[Webkit-unassigned] [Bug 50916] Add support for dir=auto

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Feb 2 14:48:44 PST 2011


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





--- Comment #14 from mitz at webkit.org  2011-02-02 14:48:43 PST ---
(From update of attachment 80968)
View in context: https://bugs.webkit.org/attachment.cgi?id=80968&action=review

> Source/JavaScriptCore/ChangeLog:14
> +        * JavaScriptCore.exp:
> +        * JavaScriptCore.order:
> +        * wtf/text/StringImpl.cpp:
> +        (WTF::StringImpl::defaultWritingDirection):
> +        * wtf/text/StringImpl.h:
> +        * wtf/text/WTFString.h:
> +        (WTF::String::defaultWritingDirection):

What happened to the change log comments?

> Source/WebCore/ChangeLog:29
> +        * css/CSSStyleSelector.cpp:
> +        (WebCore::CSSStyleSelector::canShareStyleWithElement):
> +        * dom/Element.cpp:
> +        (WebCore::Element::adjustElementDirectionalityIfNeededAfterChildrenChanged):
> +        (WebCore::Element::childrenChanged):
> +        * dom/Element.h:
> +        * dom/Node.cpp:
> +        (WebCore::Node::attach):
> +        (WebCore::Node::setHasDirAutoFlagRecursively):
> +        * dom/Node.h:
> +        (WebCore::Node::selfOrAncestorHasDirAutoAttribute):
> +        * html/HTMLElement.cpp:
> +        (WebCore::HTMLElement::mapToEntry):
> +        (WebCore::HTMLElement::parseMappedAttribute):
> +        (WebCore::HTMLElement::directionality):
> +        (WebCore::HTMLElement::adjustDirectionalityAfterChildrenChanged):
> +        * html/HTMLElement.h:

Same here.

> Source/WebCore/dom/Node.cpp:1255
> +    if (parentNode() && parentNode()->getFlag(SelfOrAncestorHasDirAutoFlag))
> +        setFlag(SelfOrAncestorHasDirAutoFlag);
> +

It’s strange that inheriting this bit from the parent happens in attach() and not when actually being added to the parent in the DOM tree. It is also not cleared when attaching under a parent that doesn’t have the flag set, so it seems as if you can move a subtree from under a dir="auto" parent to a dir="ltr" parent and the subtree will maintain the flag.

I am still fuzzy on whether this patch (a) handles all dynamic cases correctly and (b) does not scan descendants multiple times as the tree is constructed. I guess that depends on when childrenChanged() is called during parsing.

> Source/WebCore/html/HTMLElement.cpp:905
> +    setAttribute(dirAttr, textDirection == LTR ? "ltr" : " rtl");

Did you mean to set the attribute here?

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