Bug 126057 - Clearing 'dir' attribute does not correctly set page directionality
Summary: Clearing 'dir' attribute does not correctly set page directionality
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: BlinkMergeCandidate
Depends on:
Blocks:
 
Reported: 2013-12-20 00:25 PST by Prashant Hiremath
Modified: 2022-07-26 21:58 PDT (History)
10 users (show)

See Also:


Attachments
Patch (2.94 KB, patch)
2013-12-20 00:43 PST, Prashant Hiremath
rniwa: review-
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from webkit-ews-07 for mac-mountainlion (493.96 KB, application/zip)
2013-12-20 02:06 PST, Build Bot
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Prashant Hiremath 2013-12-20 00:25:36 PST
Merge https://chromium.googlesource.com/chromium/blink/+/2d592d1c998bec9438e421e1ce1ee6caba05a884

The dir attribute by default resolves to ltr. After its set to rtl, clearing it should cause it to once again resolve to its default,
ltr. This patch makes this change from the current behavior where the rtl persists the clear.
Comment 1 Prashant Hiremath 2013-12-20 00:43:23 PST
Created attachment 219738 [details]
Patch

proposed patch
Comment 2 Build Bot 2013-12-20 02:06:12 PST
Comment on attachment 219738 [details]
Patch

Attachment 219738 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/49338234

New failing tests:
fast/dom/HTMLElement/set-and-clear-dir-attribute.html
Comment 3 Build Bot 2013-12-20 02:06:14 PST
Created attachment 219743 [details]
Archive of layout-test-results from webkit-ews-07 for mac-mountainlion

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: webkit-ews-07  Port: mac-mountainlion  Platform: Mac OS X 10.8.5
Comment 4 Ryosuke Niwa 2013-12-20 09:06:47 PST
Comment on attachment 219738 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=219738&action=review

> Source/WebCore/html/HTMLElement.cpp:209
> +            AtomicString dirValue = isValidDirAttribute(value) ? value : "ltr";

This is incorrect. When dir="" attribute doesn't parse correctly, it needs to be treated as if it doesn't exist for the purpose of determining the directionality of text.
I've specifically added a test case for this in fast/dom/HTMLElement/set-and-clear-dir-attribute.html

i.e. the blink change is wrong.
Comment 5 Prashant Hiremath 2013-12-22 19:56:53 PST
(In reply to comment #4)
> (From update of attachment 219738 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=219738&action=review
> 
> > Source/WebCore/html/HTMLElement.cpp:209
> > +            AtomicString dirValue = isValidDirAttribute(value) ? value : "ltr";
> 
> This is incorrect. When dir="" attribute doesn't parse correctly, it needs to be treated as if it doesn't exist for the purpose of determining the directionality of text.
> I've specifically added a test case for this in fast/dom/HTMLElement/set-and-clear-dir-attribute.html
> 
> i.e. the blink change is wrong.

Ok, got it :) . will close the bug.
Comment 6 Ryosuke Niwa 2013-12-22 20:05:37 PST
I don't think we should close the bug given that the bug still exists in WebKit.

It's just that the fix is incorrect.
Comment 7 Prashant Hiremath 2013-12-22 22:39:53 PST
(In reply to comment #6)
> I don't think we should close the bug given that the bug still exists in WebKit.
> 
> It's just that the fix is incorrect.

Thanks.
I'll try to look into this issue then :).
Comment 8 Ahmad Saleem 2022-07-26 10:34:19 PDT
This patch was modifying - equalIgnoringCase and it was removed in below:

https://github.com/WebKit/WebKit/commit/507aa34586fdcf0b9a5ea433c2402f295a717da8

-> rniwa@webkit.org - I think you landed 'dir' related changes just recently, have this been addressed or is this something needed? Thanks!
Comment 9 Ryosuke Niwa 2022-07-26 21:58:03 PDT
Yeah, I'm sure I fixed this with my latest patches.