Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(197)

Issue 302433015: Use correct offset when attribute auto is present (Closed)

Created:
6 years, 6 months ago by Habib Virji
Modified:
6 years, 6 months ago
CC:
blink-reviews, blink-reviews-dom_chromium.org, dglazkov+blink, eae+blinkwatch, rwlbuis, sof
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Use correct offset when attribute auto is present Depending on the inlineBox bidiLevel use the right or left offset. Do not use bidiLevel of the previous box when attribute is auto. R=eseidel, leviw BUG=296847 TEST=TextArea with strong RTL word, when on next line LTR word is entered, caret position is changed. Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=176151

Patch Set 1 #

Patch Set 2 : Updated to latest master #

Total comments: 11

Patch Set 3 : Updated as per code review comments #

Total comments: 3

Patch Set 4 : Added a check for shadow node, to check attribute direction #

Patch Set 5 : Updated to latest master #

Total comments: 4

Patch Set 6 : Rename isTextDirectionHasAutoAttribute to hasDirectionAutoAttribute #

Total comments: 4

Patch Set 7 : Position trying to look in multiple level for direction auto #

Total comments: 11

Patch Set 8 : Changed traversing of node from downwards to upwards #

Total comments: 13

Patch Set 9 : Updated code as per mario's comments #

Patch Set 10 : Updated tests to pass on mac and windows. Also a condition in HTMLElement which sets any direction … #

Total comments: 2

Patch Set 11 : Updated setHasDirAutoFlagRecursively to set shadowDOM node #

Patch Set 12 : Removes hasDirectionAutoAttribute function and sets all nodes in setHasDirAutoFlagRecursively with … #

Total comments: 2

Patch Set 13 : Updated to not just not just user agent shadow root #

Patch Set 14 : Added test for author shadow roots #

Total comments: 2

Patch Set 15 : Fix compilation issue #

Unified diffs Side-by-side diffs Delta from patch set Stats (+60 lines, -6 lines) Patch
A LayoutTests/editing/selection/caret-in-textarea-auto.html View 1 2 3 4 5 6 7 8 9 1 chunk +16 lines, -0 lines 0 comments Download
A LayoutTests/editing/selection/caret-in-textarea-auto-expected.txt View 1 2 3 4 5 6 7 8 9 1 chunk +10 lines, -0 lines 0 comments Download
A LayoutTests/fast/dom/shadow/shadow-root-direction.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +14 lines, -0 lines 0 comments Download
A LayoutTests/fast/dom/shadow/shadow-root-direction-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +11 lines, -0 lines 0 comments Download
M Source/core/dom/Position.cpp View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +4 lines, -2 lines 0 comments Download
M Source/core/html/HTMLElement.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +5 lines, -4 lines 0 comments Download

Messages

Total messages: 55 (0 generated)
Habib Virji
When attribute is auto and text entered at first has dir rtl, then entered text ...
6 years, 6 months ago (2014-05-28 16:10:57 UTC) #1
leviw_travelin_and_unemployed
https://codereview.chromium.org/302433015/diff/10001/LayoutTests/editing/selection/caret-in-textarea-auto.html File LayoutTests/editing/selection/caret-in-textarea-auto.html (right): https://codereview.chromium.org/302433015/diff/10001/LayoutTests/editing/selection/caret-in-textarea-auto.html#newcode16 LayoutTests/editing/selection/caret-in-textarea-auto.html:16: caretRect = textInputController.firstRectForCharacterRange(1, 0); Can we test this programmatically ...
6 years, 6 months ago (2014-05-28 17:42:30 UTC) #2
eseidel
Looks like leviw's review was a not l-g-t-m.
6 years, 6 months ago (2014-05-28 22:10:33 UTC) #3
Habib Virji
Thanks Levi will update the patch with suggested comments soon. https://codereview.chromium.org/302433015/diff/10001/LayoutTests/editing/selection/caret-in-textarea-auto.html File LayoutTests/editing/selection/caret-in-textarea-auto.html (right): https://codereview.chromium.org/302433015/diff/10001/LayoutTests/editing/selection/caret-in-textarea-auto.html#newcode16 ...
6 years, 6 months ago (2014-05-29 07:58:26 UTC) #4
Habib Virji
Thanks Levi, addressed most of your comments except focusedElement issue. If you are refering to ...
6 years, 6 months ago (2014-05-29 11:31:51 UTC) #5
leviw_travelin_and_unemployed
https://codereview.chromium.org/302433015/diff/30005/Source/core/dom/Position.cpp File Source/core/dom/Position.cpp (right): https://codereview.chromium.org/302433015/diff/30005/Source/core/dom/Position.cpp#newcode82 Source/core/dom/Position.cpp:82: static bool isTextDirectionAuto(Node *node) This is asking to be ...
6 years, 6 months ago (2014-05-29 16:32:18 UTC) #6
Habib Virji
https://codereview.chromium.org/302433015/diff/30005/Source/core/dom/Position.cpp File Source/core/dom/Position.cpp (right): https://codereview.chromium.org/302433015/diff/30005/Source/core/dom/Position.cpp#newcode85 Source/core/dom/Position.cpp:85: if (node->document().focusedElement()) On 2014/05/29 16:32:18, leviw wrote: @leviw: An ...
6 years, 6 months ago (2014-05-30 16:05:10 UTC) #7
leviw_travelin_and_unemployed
Looking at that code, it's possible that setHasDirAutoFlagRecursively doesn't descend into a TextArea properly (due ...
6 years, 6 months ago (2014-05-30 18:54:55 UTC) #8
Habib Virji
On 2014/05/30 18:54:55, leviw wrote: > Looking at that code, it's possible that setHasDirAutoFlagRecursively doesn't ...
6 years, 6 months ago (2014-06-02 13:28:59 UTC) #9
Inactive
https://codereview.chromium.org/302433015/diff/70001/Source/core/dom/Position.cpp File Source/core/dom/Position.cpp (right): https://codereview.chromium.org/302433015/diff/70001/Source/core/dom/Position.cpp#newcode82 Source/core/dom/Position.cpp:82: static bool isTextDirectionHasAutoAttribute(Node *node) nit: star on wrong side. ...
6 years, 6 months ago (2014-06-02 15:15:07 UTC) #10
Habib Virji
Thanks chris for reviewing. Updating code review comments. Has renamed isTextDirectionHasAutoAttribute to hasDirectionAutoAttribute. Is it ...
6 years, 6 months ago (2014-06-02 15:23:51 UTC) #11
leviw_travelin_and_unemployed
Perhaps dglazkov can comment or point this towards someone who can speak to the right ...
6 years, 6 months ago (2014-06-02 18:00:29 UTC) #12
esprehn
This doesn't seem right to me, you only look up one level. Either we should ...
6 years, 6 months ago (2014-06-02 18:06:13 UTC) #13
Habib Virji
https://codereview.chromium.org/302433015/diff/90001/Source/core/dom/Position.cpp File Source/core/dom/Position.cpp (right): https://codereview.chromium.org/302433015/diff/90001/Source/core/dom/Position.cpp#newcode86 Source/core/dom/Position.cpp:86: isAuto = equalIgnoringCase(node->shadowHost()->fastGetAttribute(dirAttr), "auto"); @levi: If I get some ...
6 years, 6 months ago (2014-06-03 16:35:56 UTC) #14
leviw_travelin_and_unemployed
https://codereview.chromium.org/302433015/diff/110001/Source/core/dom/Position.cpp File Source/core/dom/Position.cpp (right): https://codereview.chromium.org/302433015/diff/110001/Source/core/dom/Position.cpp#newcode88 Source/core/dom/Position.cpp:88: if (node->isInShadowTree()) { If you're scoping your NodeTraversal to ...
6 years, 6 months ago (2014-06-04 17:16:31 UTC) #15
esprehn
This still doesn't look right, you need to make the selfOrAncestor bits work across shadow ...
6 years, 6 months ago (2014-06-04 18:02:02 UTC) #16
esprehn
On 2014/06/04 at 18:02:02, esprehn wrote: > This still doesn't look right, you need to ...
6 years, 6 months ago (2014-06-04 18:02:27 UTC) #17
Habib Virji
On 2014/06/04 18:02:02, esprehn wrote: > This still doesn't look right, you need to make ...
6 years, 6 months ago (2014-06-05 18:57:29 UTC) #18
Habib Virji
On 2014/06/04 18:02:02, esprehn wrote: > This still doesn't look right, you need to make ...
6 years, 6 months ago (2014-06-05 18:57:31 UTC) #19
Habib Virji
https://codereview.chromium.org/302433015/diff/110001/Source/core/dom/Position.cpp File Source/core/dom/Position.cpp (right): https://codereview.chromium.org/302433015/diff/110001/Source/core/dom/Position.cpp#newcode88 Source/core/dom/Position.cpp:88: if (node->isInShadowTree()) { On 2014/06/04 17:16:32, leviw wrote: > ...
6 years, 6 months ago (2014-06-05 18:57:53 UTC) #20
leviw_travelin_and_unemployed
https://codereview.chromium.org/302433015/diff/110001/Source/core/dom/Position.cpp File Source/core/dom/Position.cpp (right): https://codereview.chromium.org/302433015/diff/110001/Source/core/dom/Position.cpp#newcode89 Source/core/dom/Position.cpp:89: if (equalIgnoringCase(node->shadowHost()->fastGetAttribute(dirAttr), "auto")) On 2014/06/05 18:57:53, Habib Virji wrote: ...
6 years, 6 months ago (2014-06-05 21:14:05 UTC) #21
Habib Virji
Thanks levi. Updated code to move upwards towards parent and look for shadowRoot. Once shadowRoot ...
6 years, 6 months ago (2014-06-06 13:52:32 UTC) #22
mario.prada
https://codereview.chromium.org/302433015/diff/130001/Source/core/dom/Position.cpp File Source/core/dom/Position.cpp (right): https://codereview.chromium.org/302433015/diff/130001/Source/core/dom/Position.cpp#newcode86 Source/core/dom/Position.cpp:86: return true; I might be entirely wrong, but I ...
6 years, 6 months ago (2014-06-06 14:34:52 UTC) #23
Habib Virji
Thanks Mario... Updated code as per your comments. https://codereview.chromium.org/302433015/diff/130001/Source/core/dom/Position.cpp File Source/core/dom/Position.cpp (right): https://codereview.chromium.org/302433015/diff/130001/Source/core/dom/Position.cpp#newcode86 Source/core/dom/Position.cpp:86: return ...
6 years, 6 months ago (2014-06-06 14:44:46 UTC) #24
Habib Virji
Patch#10, makes a small change in HTMLElement as any direction was setting auto flag. Changed ...
6 years, 6 months ago (2014-06-06 17:02:59 UTC) #25
Habib Virji
On 2014/06/06 17:02:59, Habib Virji wrote: > Patch#10, makes a small change in HTMLElement as ...
6 years, 6 months ago (2014-06-06 18:48:20 UTC) #26
esprehn
This is still not right, the issue is that setHasDirAutoFlagRecursively doesn't cross ShadowRoot boundaries. https://codereview.chromium.org/302433015/diff/170001/Source/core/dom/Position.cpp ...
6 years, 6 months ago (2014-06-11 00:58:01 UTC) #27
Habib Virji
Thanks esprehn for looking. I have updated to use containingShadowRoot. Also added a change in ...
6 years, 6 months ago (2014-06-11 08:56:02 UTC) #28
mario.prada
Hi Habib, see some comments below, but please don't take them as a proper review, ...
6 years, 6 months ago (2014-06-11 10:16:38 UTC) #29
Habib Virji
@esprehn/@mario: Thanks for the review have uploaded a new patch to set shadowRoot with dir ...
6 years, 6 months ago (2014-06-11 13:37:08 UTC) #30
Habib Virji
@esprehn/mario: Have uploaded two patches. Patch#11 and Patch#12 - Both patch sets shadowRoot with direction ...
6 years, 6 months ago (2014-06-11 17:32:10 UTC) #31
esprehn
This behavior shouldn't be specific to UA shadows. https://codereview.chromium.org/302433015/diff/230001/Source/core/html/HTMLElement.cpp File Source/core/html/HTMLElement.cpp (right): https://codereview.chromium.org/302433015/diff/230001/Source/core/html/HTMLElement.cpp#newcode757 Source/core/html/HTMLElement.cpp:757: setHasDirAutoFlagRecursively(userAgentShadowRoot(), ...
6 years, 6 months ago (2014-06-11 17:38:07 UTC) #32
Habib Virji
Thanks. Updated as suggested. https://codereview.chromium.org/302433015/diff/230001/Source/core/html/HTMLElement.cpp File Source/core/html/HTMLElement.cpp (right): https://codereview.chromium.org/302433015/diff/230001/Source/core/html/HTMLElement.cpp#newcode757 Source/core/html/HTMLElement.cpp:757: setHasDirAutoFlagRecursively(userAgentShadowRoot(), true); On 2014/06/11 17:38:07, ...
6 years, 6 months ago (2014-06-11 17:48:11 UTC) #33
esprehn
On 2014/06/11 at 17:48:11, habib.virji wrote: > Thanks. Updated as suggested. > > https://codereview.chromium.org/302433015/diff/230001/Source/core/html/HTMLElement.cpp > ...
6 years, 6 months ago (2014-06-11 18:11:50 UTC) #34
Habib Virji
On 2014/06/11 18:11:50, esprehn wrote: > On 2014/06/11 at 17:48:11, habib.virji wrote: > > Thanks. ...
6 years, 6 months ago (2014-06-11 19:27:00 UTC) #35
esprehn
This seems okay, but looking at the code the dir=auto logic is _very_ broken. For ...
6 years, 6 months ago (2014-06-11 22:56:13 UTC) #36
Habib Virji
Agreed. Will open a new CL with some possible fixes to correct dir=auto. Since this ...
6 years, 6 months ago (2014-06-12 08:38:53 UTC) #37
leviw_travelin_and_unemployed
Okay. LGTM. Please file a bug for the brokenness esprehn mentioned. esprehn: thanks for the ...
6 years, 6 months ago (2014-06-12 18:02:10 UTC) #38
Habib Virji
On 2014/06/12 18:02:10, leviw wrote: > Okay. LGTM. Please file a bug for the brokenness ...
6 years, 6 months ago (2014-06-12 18:05:37 UTC) #39
Habib Virji
The CQ bit was checked by habib.virji@samsung.com
6 years, 6 months ago (2014-06-12 18:12:05 UTC) #40
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/habib.virji@samsung.com/302433015/270001
6 years, 6 months ago (2014-06-12 18:12:32 UTC) #41
Habib Virji
The CQ bit was unchecked by habib.virji@samsung.com
6 years, 6 months ago (2014-06-12 18:35:06 UTC) #42
Habib Virji
The CQ bit was checked by habib.virji@samsung.com
6 years, 6 months ago (2014-06-13 09:20:16 UTC) #43
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/habib.virji@samsung.com/302433015/330001
6 years, 6 months ago (2014-06-13 09:21:24 UTC) #44
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: win_gpu_triggered_tests on tryserver.chromium.gpu ...
6 years, 6 months ago (2014-06-13 10:27:18 UTC) #45
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 6 months ago (2014-06-13 11:17:51 UTC) #46
commit-bot: I haz the power
Try jobs failed on following builders: win_gpu_triggered_tests on tryserver.chromium.gpu (http://build.chromium.org/p/tryserver.chromium.gpu/builders/win_gpu_triggered_tests/builds/17008)
6 years, 6 months ago (2014-06-13 11:17:52 UTC) #47
Habib Virji
The CQ bit was checked by habib.virji@samsung.com
6 years, 6 months ago (2014-06-13 12:49:20 UTC) #48
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/habib.virji@samsung.com/302433015/330001
6 years, 6 months ago (2014-06-13 12:50:35 UTC) #49
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: win_gpu_triggered_tests on tryserver.chromium.gpu ...
6 years, 6 months ago (2014-06-13 13:33:39 UTC) #50
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 6 months ago (2014-06-13 14:26:43 UTC) #51
commit-bot: I haz the power
Try jobs failed on following builders: win_gpu_triggered_tests on tryserver.chromium.gpu (http://build.chromium.org/p/tryserver.chromium.gpu/builders/win_gpu_triggered_tests/builds/17049)
6 years, 6 months ago (2014-06-13 14:26:45 UTC) #52
Habib Virji
The CQ bit was checked by habib.virji@samsung.com
6 years, 6 months ago (2014-06-14 03:56:03 UTC) #53
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/habib.virji@samsung.com/302433015/330001
6 years, 6 months ago (2014-06-14 03:56:57 UTC) #54
commit-bot: I haz the power
6 years, 6 months ago (2014-06-14 04:37:44 UTC) #55
Message was sent while issue was closed.
Change committed as 176151

Powered by Google App Engine
This is Rietveld 408576698