|
|
Chromium Code Reviews|
Created:
4 years, 5 months ago by David Tseng Modified:
4 years, 5 months ago CC:
aboxhall+watch_chromium.org, arv+watch_chromium.org, chromium-reviews, dmazzoni+watch_chromium.org, dtseng+watch_chromium.org, je_julie, nektar+watch_chromium.org, oshima+watch_chromium.org, yuzo+watch_chromium.org Base URL:
https://chromium.googlesource.com/chromium/src.git@master Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionBetter work around for Blink selection issues.
In the interest of getting something that works, conform to the way selections work in the Blink accessibility tree.
For reference, the way it behaves is as follows:
- on non-static text nodes, the index is a child index (0-based).
- if the node is a static text node, the client must compute an offset as follows. Walk up to the parent of the static text, compute the length of all of the text descendants up to that static text, and finally add any remaining offsets into the static text in question.
For example, the paragraph containing:
child 1: static text name=this is a
child 2: link child rstatic text name=test
child 3: static text name=of selection
exhibits this behavior. Furthermore, the link itself which contains a static text, starts with a 0-offset (following the same rules above).
- after making a selection, the offsets behave sort of more like DOM indexes.
For example, the above snippet when selecting offsets 13/14, gives back 'o' as expected but the anchor node is set to the static text for the link's static text at offset 4. The focus object is set to 1 for the last static text.
This is surprising and probably has a lot of weird corner cases I haven't uncovered yet.
BUG=626385
TEST=chromevox_tests
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation
Committed: https://crrev.com/d14eace0f228ce66113791ad781640e311d0e549
Cr-Commit-Position: refs/heads/master@{#406413}
Patch Set 1 #Patch Set 2 : Handle line breaks. #
Messages
Total messages: 26 (18 generated)
Description was changed from ========== Better work around for Blink selection issues. ========== to ========== Better work around for Blink selection issues. CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation ==========
Description was changed from ========== Better work around for Blink selection issues. CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation ========== to ========== Better work around for Blink selection issues. In the interest of getting something that works, conform to the way selections work in the Blink accessibility tree. For reference, the way it behaves is as follows: - on non-static text nodes, the index is a child index (0-based). - if the node is a static text node, the client must compute an offset as follows. Walk up to the parent of the static text, compute the length of all of the text up to that static text, and finally add any remaining offsets into the static text in question. It doesn't appear to matter what the client passes as the anchor/focus object. The second point is surprising and should probably be fixed at some point. BUG=626385 TEST=chromevox_tests ==========
dtseng@chromium.org changed reviewers: + dmazzoni@chromium.org, nektar@chromium.org
Description was changed from ========== Better work around for Blink selection issues. In the interest of getting something that works, conform to the way selections work in the Blink accessibility tree. For reference, the way it behaves is as follows: - on non-static text nodes, the index is a child index (0-based). - if the node is a static text node, the client must compute an offset as follows. Walk up to the parent of the static text, compute the length of all of the text up to that static text, and finally add any remaining offsets into the static text in question. It doesn't appear to matter what the client passes as the anchor/focus object. The second point is surprising and should probably be fixed at some point. BUG=626385 TEST=chromevox_tests ========== to ========== Better work around for Blink selection issues. In the interest of getting something that works, conform to the way selections work in the Blink accessibility tree. For reference, the way it behaves is as follows: - on non-static text nodes, the index is a child index (0-based). - if the node is a static text node, the client must compute an offset as follows. Walk up to the parent of the static text, compute the length of all of the text up to that static text, and finally add any remaining offsets into the static text in question. It doesn't appear to matter what the client passes as the anchor/focus object. For example, the paragraph containing: child 1: static text child 2: link child 3: static text exhibits this behavior. Furthermore, the link itself which contains a static text, is starts with a 0-offset (following the same rules above). point. This is surprising and should probably be fixed or called out very clearly everywhere. BUG=626385 TEST=chromevox_tests ==========
Description was changed from ========== Better work around for Blink selection issues. In the interest of getting something that works, conform to the way selections work in the Blink accessibility tree. For reference, the way it behaves is as follows: - on non-static text nodes, the index is a child index (0-based). - if the node is a static text node, the client must compute an offset as follows. Walk up to the parent of the static text, compute the length of all of the text up to that static text, and finally add any remaining offsets into the static text in question. It doesn't appear to matter what the client passes as the anchor/focus object. For example, the paragraph containing: child 1: static text child 2: link child 3: static text exhibits this behavior. Furthermore, the link itself which contains a static text, is starts with a 0-offset (following the same rules above). point. This is surprising and should probably be fixed or called out very clearly everywhere. BUG=626385 TEST=chromevox_tests ========== to ========== Better work around for Blink selection issues. In the interest of getting something that works, conform to the way selections work in the Blink accessibility tree. For reference, the way it behaves is as follows: - on non-static text nodes, the index is a child index (0-based). - if the node is a static text node, the client must compute an offset as follows. Walk up to the parent of the static text, compute the length of all of the text descendants up to that static text, and finally add any remaining offsets into the static text in question. It doesn't appear to matter what the client passes as the anchor/focus object. For example, the paragraph containing: child 1: static text child 2: link child 3: static text exhibits this behavior. Furthermore, the link itself which contains a static text, is starts with a 0-offset (following the same rules above). point. This is surprising and should probably be fixed or called out very clearly everywhere. BUG=626385 TEST=chromevox_tests ==========
Description was changed from ========== Better work around for Blink selection issues. In the interest of getting something that works, conform to the way selections work in the Blink accessibility tree. For reference, the way it behaves is as follows: - on non-static text nodes, the index is a child index (0-based). - if the node is a static text node, the client must compute an offset as follows. Walk up to the parent of the static text, compute the length of all of the text descendants up to that static text, and finally add any remaining offsets into the static text in question. It doesn't appear to matter what the client passes as the anchor/focus object. For example, the paragraph containing: child 1: static text child 2: link child 3: static text exhibits this behavior. Furthermore, the link itself which contains a static text, is starts with a 0-offset (following the same rules above). point. This is surprising and should probably be fixed or called out very clearly everywhere. BUG=626385 TEST=chromevox_tests ========== to ========== Better work around for Blink selection issues. In the interest of getting something that works, conform to the way selections work in the Blink accessibility tree. For reference, the way it behaves is as follows: - on non-static text nodes, the index is a child index (0-based). - if the node is a static text node, the client must compute an offset as follows. Walk up to the parent of the static text, compute the length of all of the text descendants up to that static text, and finally add any remaining offsets into the static text in question. For example, the paragraph containing: child 1: static text child 2: link child 3: static text exhibits this behavior. Furthermore, the link itself which contains a static text, is starts with a 0-offset (following the same rules above). point. This is surprising and should probably be fixed or called out very clearly everywhere. BUG=626385 TEST=chromevox_tests ==========
Description was changed from ========== Better work around for Blink selection issues. In the interest of getting something that works, conform to the way selections work in the Blink accessibility tree. For reference, the way it behaves is as follows: - on non-static text nodes, the index is a child index (0-based). - if the node is a static text node, the client must compute an offset as follows. Walk up to the parent of the static text, compute the length of all of the text descendants up to that static text, and finally add any remaining offsets into the static text in question. For example, the paragraph containing: child 1: static text child 2: link child 3: static text exhibits this behavior. Furthermore, the link itself which contains a static text, is starts with a 0-offset (following the same rules above). point. This is surprising and should probably be fixed or called out very clearly everywhere. BUG=626385 TEST=chromevox_tests ========== to ========== Better work around for Blink selection issues. In the interest of getting something that works, conform to the way selections work in the Blink accessibility tree. For reference, the way it behaves is as follows: - on non-static text nodes, the index is a child index (0-based). - if the node is a static text node, the client must compute an offset as follows. Walk up to the parent of the static text, compute the length of all of the text descendants up to that static text, and finally add any remaining offsets into the static text in question. For example, the paragraph containing: child 1: static text child 2: link child 3: static text exhibits this behavior. Furthermore, the link itself which contains a static text, is starts with a 0-offset (following the same rules above). This is surprising and should probably be fixed or called out very clearly everywhere. BUG=626385 TEST=chromevox_tests ==========
Description was changed from ========== Better work around for Blink selection issues. In the interest of getting something that works, conform to the way selections work in the Blink accessibility tree. For reference, the way it behaves is as follows: - on non-static text nodes, the index is a child index (0-based). - if the node is a static text node, the client must compute an offset as follows. Walk up to the parent of the static text, compute the length of all of the text descendants up to that static text, and finally add any remaining offsets into the static text in question. For example, the paragraph containing: child 1: static text child 2: link child 3: static text exhibits this behavior. Furthermore, the link itself which contains a static text, is starts with a 0-offset (following the same rules above). This is surprising and should probably be fixed or called out very clearly everywhere. BUG=626385 TEST=chromevox_tests ========== to ========== Better work around for Blink selection issues. In the interest of getting something that works, conform to the way selections work in the Blink accessibility tree. For reference, the way it behaves is as follows: - on non-static text nodes, the index is a child index (0-based). - if the node is a static text node, the client must compute an offset as follows. Walk up to the parent of the static text, compute the length of all of the text descendants up to that static text, and finally add any remaining offsets into the static text in question. For example, the paragraph containing: child 1: static text name=this is a child 2: link child rstatic text name=test child 3: static text name=of selection exhibits this behavior. Furthermore, the link itself which contains a static text, starts with a 0-offset (following the same rules above). - after making a selection, the offsets behave sort of more like DOM indexes. For example, the above snippet when selecting offsets 13/14, gives back 'o' as expected but the anchor node is set to the static text for the link's static text at offset 4. The focus object is set to 1 for the last static text. This is surprising and probably has a lot of weird corner cases I haven't uncovered yet. BUG=626385 TEST=chromevox_tests ==========
+ var texts = parent.findAll({role: RoleType.staticText});
What about line break roles?
> + // Only allow selections inside of the same web tree.
> + if (startNode.root &&
> + startNode.root.role == RoleType.rootWebArea &&
> + startNode.root === endNode.root) {
> var startIndex = this.start.selectionIndex_;
> No selection allowed across cross-process iframes?
> +TEST_F('CursorsTest', 'InlineElementOffset', function() {
> + this.runWithLoadedTree(function() {/*!
> + <p>This is a<a href="#g">test</a>of selection</p>
> + */}, function(root) {
> + root.addEventListener('textSelectionChanged',
> this.newCallback(function(evt) {
> + // This is a little unexpected though not really incorrect; Ctrl+C
> works.
> + assertEquals(testNode, root.anchorObject);
> + assertEquals(ofSelectionNode, root.focusObject);
> + assertEquals(4, root.anchorOffset);
> + assertEquals(1, root.focusOffset);
This is certainly unexpected and I don't get why it is correct. We
haven't selected anything from inside the link.
I understand that conceptually it might make sense, but it's confusing.
What's the cause?
--
You received this message because you are subscribed to the Google Groups
"Chromium-reviews" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to chromium-reviews+unsubscribe@chromium.org.
lgtm
The CQ bit was checked by dtseng@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by dtseng@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
On Fri, Jul 15, 2016 at 12:51 PM, Nektarios Paisios <nektar@google.com> wrote: > + var texts = parent.findAll({role: RoleType.staticText}); > What about line break roles? > > Good catch; added (and tested). N > + // Only allow selections inside of the same web tree. > + if (startNode.root && > + startNode.root.role == RoleType.rootWebArea && > + startNode.root === endNode.root) { > var startIndex = this.start.selectionIndex_; > No selection allowed across cross-process iframes? > > > Nope; they'ed be separate ipc's. We could divide up the selection into each subroot and forward those requests to each renderer. Left for another cl. > > +TEST_F('CursorsTest', 'InlineElementOffset', function() { > + this.runWithLoadedTree(function() {/*! > + <p>This is a<a href="#g">test</a>of selection</p> > + */}, function(root) { > + root.addEventListener('textSelectionChanged', > this.newCallback(function(evt) { > + // This is a little unexpected though not really incorrect; Ctrl+C works. > + assertEquals(testNode, root.anchorObject); > + assertEquals(ofSelectionNode, root.focusObject); > + assertEquals(4, root.anchorOffset); > + assertEquals(1, root.focusOffset); > > This is certainly unexpected and I don't get why it is correct. We haven't > selected anything from inside the link. > I understand that conceptually it might make sense, but it's confusing. > What's the cause? > I haven't dug into it. Load balancing and leaving to dmazzoni. > -- You received this message because you are subscribed to the Google Groups "Chromium-reviews" group. To unsubscribe from this group and stop receiving emails from it, send an email to chromium-reviews+unsubscribe@chromium.org.
Description was changed from ========== Better work around for Blink selection issues. In the interest of getting something that works, conform to the way selections work in the Blink accessibility tree. For reference, the way it behaves is as follows: - on non-static text nodes, the index is a child index (0-based). - if the node is a static text node, the client must compute an offset as follows. Walk up to the parent of the static text, compute the length of all of the text descendants up to that static text, and finally add any remaining offsets into the static text in question. For example, the paragraph containing: child 1: static text name=this is a child 2: link child rstatic text name=test child 3: static text name=of selection exhibits this behavior. Furthermore, the link itself which contains a static text, starts with a 0-offset (following the same rules above). - after making a selection, the offsets behave sort of more like DOM indexes. For example, the above snippet when selecting offsets 13/14, gives back 'o' as expected but the anchor node is set to the static text for the link's static text at offset 4. The focus object is set to 1 for the last static text. This is surprising and probably has a lot of weird corner cases I haven't uncovered yet. BUG=626385 TEST=chromevox_tests ========== to ========== Better work around for Blink selection issues. In the interest of getting something that works, conform to the way selections work in the Blink accessibility tree. For reference, the way it behaves is as follows: - on non-static text nodes, the index is a child index (0-based). - if the node is a static text node, the client must compute an offset as follows. Walk up to the parent of the static text, compute the length of all of the text descendants up to that static text, and finally add any remaining offsets into the static text in question. For example, the paragraph containing: child 1: static text name=this is a child 2: link child rstatic text name=test child 3: static text name=of selection exhibits this behavior. Furthermore, the link itself which contains a static text, starts with a 0-offset (following the same rules above). - after making a selection, the offsets behave sort of more like DOM indexes. For example, the above snippet when selecting offsets 13/14, gives back 'o' as expected but the anchor node is set to the static text for the link's static text at offset 4. The focus object is set to 1 for the last static text. This is surprising and probably has a lot of weird corner cases I haven't uncovered yet. BUG=626385 TEST=chromevox_tests CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation ==========
The CQ bit was checked by dtseng@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from nektar@chromium.org Link to the patchset: https://codereview.chromium.org/2153213002/#ps20001 (title: "Handle line breaks.")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Committed patchset #2 (id:20001)
Message was sent while issue was closed.
CQ bit was unchecked.
Message was sent while issue was closed.
Description was changed from ========== Better work around for Blink selection issues. In the interest of getting something that works, conform to the way selections work in the Blink accessibility tree. For reference, the way it behaves is as follows: - on non-static text nodes, the index is a child index (0-based). - if the node is a static text node, the client must compute an offset as follows. Walk up to the parent of the static text, compute the length of all of the text descendants up to that static text, and finally add any remaining offsets into the static text in question. For example, the paragraph containing: child 1: static text name=this is a child 2: link child rstatic text name=test child 3: static text name=of selection exhibits this behavior. Furthermore, the link itself which contains a static text, starts with a 0-offset (following the same rules above). - after making a selection, the offsets behave sort of more like DOM indexes. For example, the above snippet when selecting offsets 13/14, gives back 'o' as expected but the anchor node is set to the static text for the link's static text at offset 4. The focus object is set to 1 for the last static text. This is surprising and probably has a lot of weird corner cases I haven't uncovered yet. BUG=626385 TEST=chromevox_tests CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation ========== to ========== Better work around for Blink selection issues. In the interest of getting something that works, conform to the way selections work in the Blink accessibility tree. For reference, the way it behaves is as follows: - on non-static text nodes, the index is a child index (0-based). - if the node is a static text node, the client must compute an offset as follows. Walk up to the parent of the static text, compute the length of all of the text descendants up to that static text, and finally add any remaining offsets into the static text in question. For example, the paragraph containing: child 1: static text name=this is a child 2: link child rstatic text name=test child 3: static text name=of selection exhibits this behavior. Furthermore, the link itself which contains a static text, starts with a 0-offset (following the same rules above). - after making a selection, the offsets behave sort of more like DOM indexes. For example, the above snippet when selecting offsets 13/14, gives back 'o' as expected but the anchor node is set to the static text for the link's static text at offset 4. The focus object is set to 1 for the last static text. This is surprising and probably has a lot of weird corner cases I haven't uncovered yet. BUG=626385 TEST=chromevox_tests CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation Committed: https://crrev.com/d14eace0f228ce66113791ad781640e311d0e549 Cr-Commit-Position: refs/heads/master@{#406413} ==========
Message was sent while issue was closed.
Patchset 2 (id:??) landed as https://crrev.com/d14eace0f228ce66113791ad781640e311d0e549 Cr-Commit-Position: refs/heads/master@{#406413} |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
