Closed
Bug 604505
Opened 14 years ago
Closed 6 years ago
inheriting 'content' from an element should always inherit none/normal since the computed value on elements is always 'normal'
Categories
(Core :: CSS Parsing and Computation, defect)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
INVALID
People
(Reporter: dbaron, Unassigned)
References
(Blocks 1 open bug, )
Details
(Keywords: css2)
Attachments
(1 file)
4.13 KB,
patch
|
dbaron
:
review-
|
Details | Diff | Splinter Review |
Inheriting 'content' from an element should always inherit none/normal since the computed value on elements is always 'normal'. http://test.csswg.org/suites/css2.1/20101001/html4/content-160.htm http://test.csswg.org/suites/css2.1/20101001/xhtml1/content-160.xht
Comment 1•14 years ago
|
||
Hmm. Was this a spec change at some point? But yeah, we should fix. And fix the tests we have that will fail as a result... and maybe the ones that will stop testing what they're supposed to be testing as a result. :(
Reporter | ||
Updated•14 years ago
|
Blocks: css2.1-tests
Reporter | ||
Comment 2•13 years ago
|
||
Also: http://test.csswg.org/suites/css2.1/20110111/html4/content-computed-value-001.htm (a test introduced after RC1 of the test suite)
Comment 3•11 years ago
|
||
http://test.csswg.org/suites/css2.1/latest/html4/content-160.htm http://test.csswg.org/suites/css2.1/latest/xhtml1/content-160.xht
Comment 4•10 years ago
|
||
Attachment #8525062 -
Flags: review?(dbaron)
Comment 5•10 years ago
|
||
try: https://treeherder.mozilla.org/ui/#/jobs?repo=try&revision=9c949b922918 It seems that we have a lot of tests to fix for this bug. In addition, the test for bug 569006 uses this wrong behavior. I'm not sure whether we should get rid of that test or do something different.
Reporter | ||
Comment 6•10 years ago
|
||
Comment on attachment 8525062 [details] [diff] [review] patch >diff --git a/layout/style/nsRuleNode.cpp b/layout/style/nsRuleNode.cpp >--- a/layout/style/nsRuleNode.cpp >+++ b/layout/style/nsRuleNode.cpp >@@ -7977,18 +7977,22 @@ nsRuleNode::ComputeContentData(void* aSt > const bool aCanStoreInRuleTree) > { > uint32_t count; > nsAutoString buffer; > > COMPUTE_START_RESET(Content, (), content, parentContent) > > // content: [string, url, counter, attr, enum]+, normal, none, inherit >- const nsCSSValue* contentValue = aRuleData->ValueForContent(); >- switch (contentValue->GetUnit()) { >+ nsCSSValue contentValue(*aRuleData->ValueForContent()); >+ if (!aContext->GetPseudo()) { >+ // On elements, content is always computed to normal. >+ contentValue.SetNormalValue(); >+ } >+ switch (contentValue.GetUnit()) { This isn't safe, since an element and a pseudo-element might match the same list of rules and thus share the same rule node. It's also bad because it breaks all partial computation from a start struct (i.e., when ComputeContentData has a non-null aStartStruct, aRuleData only contains the declarations that should override what is already in aStartStruct, and here you're overriding eCSSUnit_Null (which says there's nothing specified and thus you shouldn't override what's already there). Both of these could cause test failures. I need to think a little more about the best way around the first problem, though. (Fixing the second is easy.)
Attachment #8525062 -
Flags: review?(dbaron) → review-
Reporter | ||
Updated•10 years ago
|
Flags: needinfo?(dbaron)
Comment 7•6 years ago
|
||
I think this should be WONTFIX (or INVALID), given that bug 215083 needs us to have a computed value other than normal on an element. Does that sounds right Xidorn?
Flags: needinfo?(xidorn+moz)
Comment 8•6 years ago
|
||
Yeah, INVALID I guess. The spec is still very unclear about many cases, but given that values no longer need to be computed to normal for elements, the description of this bug no longer applies.
Status: NEW → RESOLVED
Closed: 6 years ago
Flags: needinfo?(xidorn+moz)
Flags: needinfo?(dbaron)
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•