Last Comment Bug 229915 - [SELECTORS-DYNAMIC] we don't restyle for + combinator and content tree changes
: [SELECTORS-DYNAMIC] we don't restyle for + combinator and content tree changes
Status: RESOLVED FIXED
: css3, testcase
Product: Core
Classification: Components
Component: CSS Parsing and Computation (show other bugs)
: Trunk
: All All
: -- normal with 13 votes (vote)
: mozilla1.9beta4
Assigned To: David Baron :dbaron: ⌚️UTC-7 (review requests must explain patch)
:
Mentors:
: 343652 344990 (view as bug list)
Depends on: 401291
Blocks: 371061 418463
  Show dependency treegraph
 
Reported: 2004-01-02 11:15 PST by David Baron :dbaron: ⌚️UTC-7 (review requests must explain patch)
Modified: 2008-02-20 08:37 PST (History)
19 users (show)
dbaron: in‑testsuite?
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
inserting element div with insertBefore between a and span with style a+span{background-color:green} (1.19 KB, text/html)
2004-01-16 18:09 PST, Martijn Wargers [:mwargers] (not working for Mozilla)
no flags Details
testcase (1.64 KB, text/html; charset=UTF-8)
2004-01-16 20:58 PST, David Baron :dbaron: ⌚️UTC-7 (review requests must explain patch)
no flags Details
testcase (1.86 KB, text/html; charset=UTF-8)
2004-01-16 21:02 PST, David Baron :dbaron: ⌚️UTC-7 (review requests must explain patch)
no flags Details
Additional testcase (1.71 KB, text/html)
2008-01-21 02:21 PST, Andreas Blixt
no flags Details

Description David Baron :dbaron: ⌚️UTC-7 (review requests must explain patch) 2004-01-02 11:15:10 PST
Our handling of content tree changes (removeChild, insertChild, appendChild,
replaceChild) doesn't cause the necessary restyling to handle the + combinator
in CSS selectors.

This is spun off of bug 15608 and is related to bug 73586 and bug 98997.  I'll
attach a testcase sometime...
Comment 1 David Baron :dbaron: ⌚️UTC-7 (review requests must explain patch) 2004-01-02 11:17:52 PST
Bug 73586, bug 98997, and bug 229915 would be fixed by what I described in step
3 of bug 15608 comment 28:

  When adding/removing content, just reresolve style on the parent (to handle
  empty, +, and all the new CSS3 variants).  (Perhaps there are good ways to
  optimize this, but it might just not be that bad.)
Comment 2 Martijn Wargers [:mwargers] (not working for Mozilla) 2004-01-16 18:09:01 PST
Created attachment 139246 [details]
inserting element div with insertBefore between a and span with style a+span{background-color:green}
Comment 3 David Baron :dbaron: ⌚️UTC-7 (review requests must explain patch) 2004-01-16 20:58:40 PST
Created attachment 139252 [details]
testcase
Comment 4 David Baron :dbaron: ⌚️UTC-7 (review requests must explain patch) 2004-01-16 21:02:25 PST
Created attachment 139253 [details]
testcase
Comment 5 David Baron :dbaron: ⌚️UTC-7 (review requests must explain patch) 2004-04-05 22:16:42 PDT
It's worth testing ~ as well -- some issues are similar, but some are a bit
different.
Comment 6 David Baron :dbaron: ⌚️UTC-7 (review requests must explain patch) 2006-07-06 07:38:06 PDT
*** Bug 343652 has been marked as a duplicate of this bug. ***
Comment 7 Jesse Ruderman 2006-07-17 21:40:59 PDT
*** Bug 344990 has been marked as a duplicate of this bug. ***
Comment 8 Porges 2007-08-22 17:02:09 PDT
I just ran into this bug. I have:

h1 + p { text-indent: 0 }
p { text-indent: 2em }

The bug is triggered if I remove a paragraph directly following a header, as the following paragraph that gets moved up is stuck with the old indentation.

Is there a simple workaround for this bug?
Comment 9 Dão Gottwald [:dao] 2008-01-06 14:20:19 PST
Hit upon this in bug 393718 / attachment 295517 [details] [diff] [review].
Comment 10 Andreas Blixt 2008-01-21 02:21:38 PST
Created attachment 298239 [details]
Additional testcase

Additional testcase
Comment 11 David Baron :dbaron: ⌚️UTC-7 (review requests must explain patch) 2008-02-19 12:49:14 PST
Fix by checkin of bug 401291 to trunk, 2008-02-18 22:17 -0800.

I included tests for this bug (based on attachment 139253 [details]) in that landing.  However, I think more tests are needed, as none of the tests currently in the tree test any cases where :empty and :-moz-only-whitespace differ, and those cases need to be exercised a good bit.

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