Last Comment Bug 204401 - (del-only-inline) <del> doesn't strike all contents (text-decoration stops at inlines)
(del-only-inline)
: <del> doesn't strike all contents (text-decoration stops at inlines)
Status: RESOLVED FIXED
: testcase
Product: Core
Classification: Components
Component: Layout (show other bugs)
: Trunk
: All All
: -- normal with 3 votes (vote)
: mozilla8
Assigned To: Nobody; OK to take it and work on it
:
Mentors:
http://p3204040.webclass.csuchico.edu...
: 219194 219770 255407 (view as bug list)
Depends on: 403524
Blocks: robin's
  Show dependency treegraph
 
Reported: 2003-05-04 12:25 PDT by Fred Condo
Modified: 2014-04-26 02:25 PDT (History)
15 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
testcase (263 bytes, text/html)
2003-05-04 12:32 PDT, David Baron :dbaron: ⌚️UTC-7 (review requests must explain patch)
no flags Details
test case [background-color] (196 bytes, text/xml)
2003-09-21 06:01 PDT, Anne (:annevk)
no flags Details

Description Fred Condo 2003-05-04 12:25:09 PDT
User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.3) Gecko/20030312
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.3) Gecko/20030312

<del> and <ins> may be used as either inline or block level elements. These are
special-cased in the W3C validator, and should be in Gecko as well. Mozilla
incorrectly terminates such elements as soon as it encounters a block-level
element inside the content of <del>. DOM inspector has the same behavior.

Reproducible: Always

Steps to Reproduce:
1. View a page with <del> used as a block-level element that contains other
block-level elements.
Actual Results:  
Strike-through style is not rendered.

Expected Results:  
Decorate all text that is within a <del> element with strike-through.
Comment 1 David Baron :dbaron: ⌚️UTC-7 (review requests must explain patch) 2003-05-04 12:32:09 PDT
Created attachment 122444 [details]
testcase

I didn't look at the URL provided very closely, but this testcase seems to show
the problem you describe.

This seems to be a problem in the strict-mode text-decoration code.
Comment 2 Fred Condo 2003-05-04 12:55:11 PDT
The test code does demonstrate the problem. Note that the DOM Inspector's tree
view correctly shows the content of del as indented within it, but using the
click-search tool on the del label demonstrates that Mozilla treats the del
element as terminating at the first block element in the content of del.

I do not know the gecko internals, but this behavior suggests a problem in
parsing the HTML, not in decorating it.
Comment 3 Hixie (not reading bugmail) 2003-05-04 12:56:52 PDT
That would be because <del> is an inline box and we only walk up until we hit an
inline when trying to work out what text-decoration to apply.

The obvious fix is a no-go due to performance concerns, I imagine. (Using the
selector "del *".) The other possibility, namely making del be block-level under
certain elements, is probably a non-starter since some elements (e.g. div) can
contain mixtures.

Maybe we should revisit our logic to walk up the tree for text-decoration. We
can go either way at the moment, CSS2.1 and CSS3 disagree with each other.
Comment 4 Mats Palmgren (:mats) 2003-09-14 08:10:01 PDT
*** Bug 219194 has been marked as a duplicate of this bug. ***
Comment 5 Mats Palmgren (:mats) 2003-09-20 08:17:54 PDT
*** Bug 219770 has been marked as a duplicate of this bug. ***
Comment 6 Hixie (not reading bugmail) 2003-09-20 09:09:00 PDT
Per CSS2.1, text-decoration "is not, however, further propagated to floating and
absolutely positioned descendants, nor to the contents of 'inline-table' and
'inline-block' descendants. Nor is it propagated to block-level descendants of
inline elements."

INVALID?
Comment 7 David Baron :dbaron: ⌚️UTC-7 (review requests must explain patch) 2003-09-20 09:44:50 PDT
No, that would just imply that 'text-decoration' isn't appropriate for DEL and
we need a new property.
Comment 8 Anne (:annevk) 2003-09-20 09:57:34 PDT
http://www.w3.org/TR/html401/struct/text.html#h-9.4
Says that line-through; is acceptable, but since it is not acceptable in CSS2.1
(and 3?) I suggest display:none;, which is the recommandation for the current
XHTML2.0 (although there it is edit="deleted") and is also an option in HTML4.01:

"User agents should render inserted and deleted text in ways that make the
change obvious. For instance, inserted text may appear in a special font,
deleted text __may not be shown at all__ or be shown as struck-through or with
special markings, etc."
Comment 9 Hixie (not reading bugmail) 2003-09-21 03:06:03 PDT
We could still use text-decoration (see comment 3). Maybe we just need a special
keyword on text-decoration that means "go into blocks".
Comment 10 Hixie (not reading bugmail) 2003-09-21 03:13:54 PDT
Actually the universal selector idea wouldn't work anyway because you'd end up
with a gazillion lines everywhere.

Note that 'background' suffers from the same problem as t-d here: when the
element is inline, the background doesn't affect block children.

I think the worst case we have to deal with is:

   <block>
    <inline>
     Not deleted.
     <del>
      Deleted.
      <inline>
       Deleted.
       <block>
        <inline>
         Deleted.
        </inline>
       </block>
       Deleted.
      </inline>
      Deleted.
     </del>
     Not deleted.
    </inline>
   </block>

...where we really want a red background and line-through to render through and
behind anything marked "Deleted". I don't see a way to do this with pure CSS.
Comment 11 Anne (:annevk) 2003-09-21 06:01:04 PDT
Created attachment 131834 [details]
test case [background-color]

text-decoration is not the only thing that doesn't work, see the attachment.

Any suggestions? Perhaps bug 219770 should be reopened with a slighly different
title.
Comment 12 Fred Condo 2003-09-21 06:42:34 PDT
Ian's "worst case" seems a bit of a red herring. It's invalid in that del cannot surround such a mix of 
inline and block. The error in Gecko appears to be uniformly treating del/ins as inline. This is 
contrary to the standard, and other rendering engines get it right (see, for example, Apple's 
WebCore/KHTML). Gecko should render valid code correctly before we consider what to do about 
degenerate code.
Comment 13 David Baron :dbaron: ⌚️UTC-7 (review requests must explain patch) 2003-09-21 09:42:45 PDT
comment 12 confuses HTML's %inline and %block productions and CSS's 'display'
property.  They are entirely separate.
Comment 14 Robin Lionheart 2004-04-02 17:50:48 PST
<ins> and <del> at the block level were decorated up until version 1.3.

Adding as a blocker to #41368, since I recently updated my <ins>/<del> test to
include block level uses (http://www.robinlionheart.com/stds/html4/edit.html). 
Comment 15 Fred Condo 2004-04-03 11:43:43 PST
(In reply to comment #13)
> comment 12 confuses HTML's %inline and %block productions and CSS's 'display'
> property.  They are entirely separate.

Your comment is not cogent. It matters not whether the CSS display property is block or inline. What 
matters is that Gecko inappropriately ends the element where the standard, the W3C validator, and 
other rendering engines do not.
Comment 16 David Baron :dbaron: ⌚️UTC-7 (review requests must explain patch) 2004-04-03 12:19:37 PST
(In reply to comment #15)
> It matters not whether the CSS display property is block or inline.

It most certainly does matter.  Try adding style="display:inline" to the p
elements in attachment 122444 [details].

It's been known that this is a rendering issue and not a parsing issue since
comment 1, so please stop confusing the issue by making incorrect statements
that you should have tested before making.
Comment 17 Hixie (not reading bugmail) 2004-08-12 12:15:17 PDT
*** Bug 255407 has been marked as a duplicate of this bug. ***
Comment 18 Roger WANG 2010-10-21 00:37:52 PDT
another case is:

http://www.math.ucla.edu/~jimc/html40-test/931-paragraph.html
Comment 19 Vitor Menezes 2011-08-05 16:39:37 PDT
Landing bug 403524 makes us fully compliant with CSS 2.1 spec for text decorations, and so resolves this issue.

Note You need to log in before you can comment on or make changes to this bug.