[Webkit-unassigned] [Bug 54373] CSS '+' combinator with more than 2 combinations doesn't work

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Mar 8 13:33:44 PST 2011


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


Dave Hyatt <hyatt at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #82601|review?, commit-queue?      |review-, commit-queue-
               Flag|                            |




--- Comment #3 from Dave Hyatt <hyatt at apple.com>  2011-03-08 13:33:44 PST ---
(From update of attachment 82601)
View in context: https://bugs.webkit.org/attachment.cgi?id=82601&action=review

Good first start.  Don't forget you need to patch checkForSiblingStyleChanges as well.  Will need a dynamic test to cover that code also.

> Source/WebCore/css/CSSStyleSelector.cpp:2243
> +                if (e->parentNode() && e->parentNode()->isElementNode()) {
> +                    RenderStyle* parentStyle = elementStyle ? elementParentStyle : e->parentNode()->renderStyle();
> +                    if (parentStyle)
> +                        parentStyle->setChildrenAffectedByDirectAdjacentRules();

If you're going to put a bit on the children, then you don't need to set a bit on the parent any longer.  Just remove this code.

> Source/WebCore/dom/Element.cpp:1101
> +        if (hasDirectAdjacentRules && n->isElementNode() && n->renderStyle() && n->renderStyle()->affectedByDirectAdjacentRules())

You need to be smarter about this.  You're looking for runs of nodes that have the affected bit set.  For example if a node n has changed, then you want to recalc all the elements that follow n that are affected by direct adjacent rules.  You don't need to do this if n hasn't actually changed.  You're doing too much recalc as a result.

> Source/WebCore/rendering/style/RenderStyle.h:136
> -    unsigned m_childIndex : 21; // Plenty of bits to cache an index.
> +    bool m_affectedByDirectAdjacentRules: 1;
> +    unsigned m_childIndex : 20; // Plenty of bits to cache an index.

Should be able to leave this alone if you just remove the childrenaffected bit.

-- 
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