[Webkit-unassigned] [Bug 60752] Selector matching doesn't update when DOM changes ("[data-a=x] #x")

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu May 19 10:41:52 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=60752





--- Comment #10 from Kulanthaivel Palanichamy <kulanthaivel at codeaurora.org>  2011-05-19 10:41:52 PST ---
(From update of attachment 94026)
View in context: https://bugs.webkit.org/attachment.cgi?id=94026&action=review

>> LayoutTests/fast/css/attribute-selector-dynamic-no-elementstyle-expected.txt:3
>> +This test checks whether CSS attribute selectors are re-evaluated after attribute changes in html elements which are having no style associated with them.
> 
> html elements -> elements (this isn’t HTML-specific, right?)
> 
> are having -> have

you are correct, this isn't HTML specific

>> Source/WebCore/ChangeLog:8
>> +        Currently CSSStyleSelector maintains a HashSet of attributes (m_selectorAttrs)
> 
> Is it worth beefing up the test coverage for these specific cases?

Well, all of the attribute selectors cannot be covered in one test as if any one of the attribute change triggers style recalculation, then the previously failed attribute test results will not propagate till the end of the test.
How about writing separate test cases for each one of the 7 attribute selector types?

>> Source/WebCore/ChangeLog:27
>> +        simply looked up in this pre-papulated hash set.
> 
> populated

Sorry for the spelling and grammar mistakes. I'll correct them all.

>> Source/WebCore/css/CSSStyleSelector.cpp:2379
>>          // FIXME: Handle the case were elementStyle is 0.
> 
> Is this FIXME still valid?

Yes, it is still valid. 
Consider the scenario given in the test case

span { display: none }
*[test="0"] #sp { color: green; display: block} 

<div test="1">
    <span id="sp">PASSED</span>
    </div>
- Here the <div> element has no elementStyle, but it's attribute selector triggers style change on <span> so <span>'s style shouldn't be sharable. But when <span>'s style recalculation is done, its attribute match type is 'id' and it will never hit this condition thus makes its style still sharable.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list