Bug 9983 - dynamically generated elements do not inherit css properties
Summary: dynamically generated elements do not inherit css properties
Status: RESOLVED DUPLICATE of bug 11384
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-18 04:12 PDT by Michiel Roding
Modified: 2008-02-21 22:19 PST (History)
1 user (show)

See Also:


Attachments
test case (444 bytes, text/html)
2006-07-18 04:13 PDT, Michiel Roding
no flags Details
Test case with <script> before <p> (445 bytes, text/html)
2006-07-18 04:42 PDT, David Kilzer (:ddkilzer)
no flags Details
Test exhibiting issue using insertBefore() (384 bytes, text/html)
2006-07-18 06:20 PDT, David Kilzer (:ddkilzer)
no flags Details
Better test case (broken results obvious) (422 bytes, text/html)
2006-07-18 07:19 PDT, David Kilzer (:ddkilzer)
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michiel Roding 2006-07-18 04:12:28 PDT
when adding an element to the DOM, some css-properties are not set.

See the example; a p + p selector is defined, but not applied. Neither using insertBefore nor appendChild.

this applies both to the 420+ nightly and 419.3
Comment 1 Michiel Roding 2006-07-18 04:13:08 PDT
Created attachment 9545 [details]
test case
Comment 2 David Kilzer (:ddkilzer) 2006-07-18 04:40:08 PDT
Looking at the DOM using the Web Inspector (right-click on page, "Inspect Element" on nightly builds), I'm seeing this on the test page:

<p id="p2">
<script>
<p>

I think the test case may be wrong since running appendChild() on the <body> tag will produce the above results.  Also, the current test case looks the same when viewed in Firefox 1.5.0.4.

Comment 3 David Kilzer (:ddkilzer) 2006-07-18 04:42:05 PDT
Created attachment 9547 [details]
Test case with <script> before <p>
Comment 4 David Kilzer (:ddkilzer) 2006-07-18 04:43:53 PDT
(In reply to comment #3)
> Created an attachment (id=9547) [edit]
> Test case with <script> before <p>

This test case works fine with a locally-built WebKit r15500 on Safari 2.0.4 (419.3) on Mac OS X 10.4.7 (8J135/PowerPC), thus I'm closing this bug as RESOLVED/WORKSFORME.

Note that if this test case does NOT work with production Safari, there's not much that can be done by the WebKit project itself since the bug is already fixed in this project.

Comment 5 David Kilzer (:ddkilzer) 2006-07-18 04:46:40 PDT
(In reply to comment #4)
> Note that if this test case does NOT work with production Safari, there's not
> much that can be done by the WebKit project itself since the bug is already
> fixed in this project.

This test case works in production Safari 2.0.4 (419.3) as well!  :)
Comment 6 Michiel Roding 2006-07-18 04:47:17 PDT
try uncommenting line 16 and commenting line 17; it will insert the element before the existing P. 

In firefox, in that case (prepending) it doesn't work unless you do:
document.body.style.display = 'none';
document.body.style.display = 'block';

which forces ff to 'rerender'; the second P does turn yellow then.
Comment 7 David Kilzer (:ddkilzer) 2006-07-18 06:14:43 PDT
Reopening per Comment #6.

Comment 8 David Kilzer (:ddkilzer) 2006-07-18 06:20:28 PDT
Created attachment 9552 [details]
Test exhibiting issue using insertBefore()

This test does exhibit the issue.
Comment 9 David Kilzer (:ddkilzer) 2006-07-18 06:20:59 PDT
Confirmed in locally-built WebKit r15500.

Comment 10 David Kilzer (:ddkilzer) 2006-07-18 07:19:48 PDT
Created attachment 9554 [details]
Better test case (broken results obvious)

Interestingly, the Web Inspector shows that the paragraph that should be yellow has the style applied to it!
Comment 11 Dave Hyatt 2006-09-12 23:47:19 PDT
We don't handle dynamic sibling updates at all right now.
Comment 12 Robert Blaut 2008-01-30 14:39:12 PST
Look also at similar bug 11384.
Comment 13 Robert Blaut 2008-02-21 22:19:21 PST

*** This bug has been marked as a duplicate of 11384 ***