[webkit-reviews] review requested: [Bug 51247] css attribute + child selector not updated properly when attribute change : [Attachment 77442] patch v1

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Dec 25 14:27:12 PST 2010


arno. <arno at renevier.net> has asked  for review:
Bug 51247: css attribute + child selector not updated properly when attribute
change
https://bugs.webkit.org/show_bug.cgi?id=51247

Attachment 77442: patch v1
https://bugs.webkit.org/attachment.cgi?id=77442&action=review

------- Additional Comments from arno. <arno at renevier.net>
Actually, what happen is:
when document()->styleSelector()->hasSelectorForAttribute is called in
Element::recalcStyleIfNeededAfterAttributeChanged, m_selectorAttrs does not
contain the attribute if attribute selector is followed by a relation selector.


It probably has something to do with bug #7492

I don't understand why attribute name is added to  m_selectorAttrs only if
(elementStyle && (!e->isStyledElement() ||
(!static_cast<StyledElement*>(e)->isMappedAttribute(attr) && attr != typeAttr
&& attr != readonlyAttr)))

In the case of an attribute selector followed by a relation selector,
checkOneSelector is called whith a null elementStyle argument, so attribute
name is not added to hashset.

If I, once an attribute selector is detected, I add attribute name  to
m_selectorAttrs unconditionally, the testcase works, and it looks like I don't
break anything (but I did not manage to run the full layout tests properly).

Here is a patch proposal. Feel free to comment on it, so I can work more on it
if needed.


More information about the webkit-reviews mailing list