Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 222e3c7feef0cd1227e2afdad6234208528815eb
      
https://github.com/WebKit/WebKit/commit/222e3c7feef0cd1227e2afdad6234208528815eb
  Author: Aditya Keerthi <[email protected]>
  Date:   2023-01-11 (Wed, 11 Jan 2023)

  Changed paths:
    A 
LayoutTests/fast/dom/HTMLElement/attr-dir-value-change-auto-parent-expected.txt
    A LayoutTests/fast/dom/HTMLElement/attr-dir-value-change-auto-parent.html
    M Source/WebCore/html/HTMLElement.cpp

  Log Message:
  -----------
  REGRESSION (254017@main): Arabic default signature in Mail.app is not 
right-to-left
https://bugs.webkit.org/show_bug.cgi?id=250443
rdar://102207392

Reviewed by Darin Adler and Ryosuke Niwa.

Mail.app controls the directionality of the signature by adding `dir="auto"` to
the signature element, getting the element's computed style, and then updating
the attribute to reflect the computed value. The `<body>` of the email has
`dir="auto"` specified.

Following 254017@main, adding the `dir` attribute to an element with a
`dir="auto"` parent, results in an unconditional call to unset the
`SelfOrPrecedingNodesAffectDirAuto` node flag. This flag is read in
`HTMLElement::directionalityIfDirIsAuto`, which returns `std::nullopt` if the
flag is unset, rather than computing the directionality from the text.
Consequently, a fallback left-to-right value is used when resolving style.

To fix, only unset the `SelfOrPrecedingNodesAffectDirAuto` node flag if the
specified direction is valid, and not `auto`.

* 
LayoutTests/fast/dom/HTMLElement/attr-dir-value-change-auto-parent-expected.txt:
 Added.
* LayoutTests/fast/dom/HTMLElement/attr-dir-value-change-auto-parent.html: 
Added.
* Source/WebCore/html/HTMLElement.cpp:
(WebCore::HTMLElement::dirAttributeChanged):

Canonical link: https://commits.webkit.org/258799@main


_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to