WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED CONFIGURATION CHANGED
14979
REGRESSION: fast/css/css-selector-text.html failing after
r25098
https://bugs.webkit.org/show_bug.cgi?id=14979
Summary
REGRESSION: fast/css/css-selector-text.html failing after r25098
mitz
Reported
2007-08-15 15:47:27 PDT
fast/css/css-selector-text.html is failing on the build bot (and on my local build) after <
http://trac.webkit.org/projects/webkit/changeset/25098
>. It was also failing after the previous incarnation of that change.
Attachments
Test case
(411 bytes, text/html)
2007-08-15 23:25 PDT
,
mitz
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Beth Dakin
Comment 1
2007-08-15 16:39:09 PDT
The problem is in this function: function parseThenSerializeRule(rule) { var styleElement = document.createElement("style"); styleElement.appendChild(document.createTextNode(rule)); return styleElement.sheet.cssRules[0].cssText; } with my patch, styleElement.sheet.cssRules[0] is null.
Beth Dakin
Comment 2
2007-08-15 17:01:19 PDT
This is failing because the style element is not in the document, so we do not create the sheet.
Beth Dakin
Comment 3
2007-08-15 21:52:43 PDT
The test may have to change. It does not pass in Firefox for what appears to be the same reason.
mitz
Comment 4
2007-08-15 23:17:30 PDT
Firefox is consistent: it always returns null for the 'sheet' property of a <style> element that is not in the document. TOT WebKit always returns a CSSStyleSheet, and the stylesheet will contain no rules if the <style> element has never been inserted into the document; but if it has been inserted at some point, the rules will persist even after it has been removed, so there is no consistent "not in document" behavior.
mitz
Comment 5
2007-08-15 23:25:22 PDT
Created
attachment 15993
[details]
Test case In this test case, the rule that's added using insertRule() is knocked out and replaced with the rule in the text node when the <style> element is removed and re-inserted into the document. I think if you are going to match Firefox, it will be better not to allow something like that to happen (e.g. by also returning null for the 'sheet' property when not in a document). I don't think the Firefox behavior makes sense (or follows the specification), though.
Beth Dakin
Comment 6
2007-08-16 12:10:16 PDT
cc-ing Hyatt. I am interested to know his thoughts on this.
Dave Hyatt
Comment 7
2007-08-16 13:25:52 PDT
I don't think this is worth fixing for Leopard, even though it is inconsistent. Both link element and style element need to null out their sheet stuff in their removedFromDocument methods. In the case of <link>, we should get rid of the process() call in removedFromDocument() because it is a no-op, and we should move the code from the destructor into removedFromDocument. We should also null out m_sheet. In the case of <style>, we should add the code that is in createSheet near the top that nulls out m_sheet and calls removePendingSheet if the sheet was loading. updateStyleSelector should still be called.
Beth Dakin
Comment 8
2007-08-16 13:56:15 PDT
I changed the test with
r25111
to get it passing.
mitz
Comment 9
2007-08-16 14:34:13 PDT
(In reply to
comment #7
)
> Both link element and style element need to null out their sheet stuff in > their removedFromDocument methods.
Why is that? Because of <
http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/stylesheets.html#StyleSheets-extensions
> ? It seems odd that if you remove and re-insert a <style> element it will be re-parsed and you will lose any dynamic changes you've made to it.
David Kilzer (:ddkilzer)
Comment 10
2008-05-09 18:43:23 PDT
<
rdar://problem/5925718
>
Ahmad Saleem
Comment 11
2022-08-11 10:09:28 PDT
I am unable to reproduce this bug in Safari 15.6 on macOS 12.5 and does not get expected result of "green" and "solid border". It is same across all browsers (Chrome Canary 106 and Firefox Nightly 105). Since all browsers are rendering this test case same, I am going to mark this as "RESOLVED CONFIGURATION CHANGED". Please reopen, if you think test case need to be tweak and my testing is not applicable. Thanks!
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug