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

Issue 2856933006: DevTools: fix text offset when selection ends on expand triangle (Closed)

Created:
3 years, 7 months ago by luoe
Modified:
3 years, 7 months ago
Reviewers:
einbinder, lushnikov
CC:
apavlov+blink_chromium.org, blink-reviews, caseq+blink_chromium.org, chromium-reviews, devtools-reviews_chromium.org, kozyatinskiy+blink_chromium.org, lushnikov+blink_chromium.org, pfeldman+blink_chromium.org, pfeldman
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

DevTools: fix text offset when selection ends on expand triangle A user's text selection may start/end on a non-TextNode with no text content, for example the expand triangle icon. In these cases, getSelection()'s anchor/focus node may be located before the first TextNode in a console message. These cases break ConsoleViewport._textOffsetInNode(), which traverses starting from the first TextNode. This CL addresses it by moving the target node to the next TextNode. BUG=717286 Review-Url: https://codereview.chromium.org/2856933006 Cr-Commit-Position: refs/heads/master@{#470442} Committed: https://chromium.googlesource.com/chromium/src/+/56d8d770469ff02ac1521f49addaae48863a05f8

Patch Set 1 #

Total comments: 10

Patch Set 2 : ac #

Total comments: 2

Patch Set 3 : ac #

Total comments: 2

Patch Set 4 : ac #

Unified diffs Side-by-side diffs Delta from patch set Stats (+160 lines, -128 lines) Patch
M third_party/WebKit/LayoutTests/inspector/console/console-copy-truncated-text.html View 1 7 chunks +78 lines, -57 lines 0 comments Download
M third_party/WebKit/LayoutTests/inspector/console/console-copy-truncated-text-expected.txt View 1 2 chunks +69 lines, -63 lines 0 comments Download
M third_party/WebKit/Source/devtools/front_end/console/ConsoleViewport.js View 1 2 3 1 chunk +13 lines, -8 lines 0 comments Download

Messages

Total messages: 22 (9 generated)
luoe
Please take a look. The repro case is a little tricky because it requires letting ...
3 years, 7 months ago (2017-05-03 00:38:15 UTC) #3
einbinder
https://codereview.chromium.org/2856933006/diff/1/third_party/WebKit/LayoutTests/inspector/console/console-copy-truncated-text-expected.txt File third_party/WebKit/LayoutTests/inspector/console/console-copy-truncated-text-expected.txt (right): https://codereview.chromium.org/2856933006/diff/1/third_party/WebKit/LayoutTests/inspector/console/console-copy-truncated-text-expected.txt#newcode163 third_party/WebKit/LayoutTests/inspector/console/console-copy-truncated-text-expected.txt:163: Highlighted 20 matches Why did this go up by ...
3 years, 7 months ago (2017-05-03 01:07:48 UTC) #4
einbinder
3 years, 7 months ago (2017-05-03 01:07:49 UTC) #5
luoe
https://codereview.chromium.org/2856933006/diff/1/third_party/WebKit/LayoutTests/inspector/console/console-copy-truncated-text-expected.txt File third_party/WebKit/LayoutTests/inspector/console/console-copy-truncated-text-expected.txt (right): https://codereview.chromium.org/2856933006/diff/1/third_party/WebKit/LayoutTests/inspector/console/console-copy-truncated-text-expected.txt#newcode163 third_party/WebKit/LayoutTests/inspector/console/console-copy-truncated-text-expected.txt:163: Highlighted 20 matches On 2017/05/03 01:07:48, einbinder wrote: > ...
3 years, 7 months ago (2017-05-03 02:58:40 UTC) #7
einbinder
lgtm https://codereview.chromium.org/2856933006/diff/1/third_party/WebKit/LayoutTests/inspector/console/console-copy-truncated-text-expected.txt File third_party/WebKit/LayoutTests/inspector/console/console-copy-truncated-text-expected.txt (right): https://codereview.chromium.org/2856933006/diff/1/third_party/WebKit/LayoutTests/inspector/console/console-copy-truncated-text-expected.txt#newcode163 third_party/WebKit/LayoutTests/inspector/console/console-copy-truncated-text-expected.txt:163: Highlighted 20 matches On 2017/05/03 at 02:58:39, luoe ...
3 years, 7 months ago (2017-05-03 05:15:23 UTC) #8
lushnikov
https://codereview.chromium.org/2856933006/diff/40001/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewport.js File third_party/WebKit/Source/devtools/front_end/console/ConsoleViewport.js (right): https://codereview.chromium.org/2856933006/diff/40001/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewport.js#newcode468 third_party/WebKit/Source/devtools/front_end/console/ConsoleViewport.js:468: while ((node = node.traverseNextTextNode(itemElement)) && !node.isSelfOrDescendant(selectionNode)) let's use node.traverseNextNode(itemElement) ...
3 years, 7 months ago (2017-05-05 23:31:58 UTC) #9
luoe
ptal https://codereview.chromium.org/2856933006/diff/40001/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewport.js File third_party/WebKit/Source/devtools/front_end/console/ConsoleViewport.js (right): https://codereview.chromium.org/2856933006/diff/40001/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewport.js#newcode468 third_party/WebKit/Source/devtools/front_end/console/ConsoleViewport.js:468: while ((node = node.traverseNextTextNode(itemElement)) && !node.isSelfOrDescendant(selectionNode)) On 2017/05/05 ...
3 years, 7 months ago (2017-05-05 23:48:51 UTC) #10
lushnikov
lgtm https://codereview.chromium.org/2856933006/diff/60001/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewport.js File third_party/WebKit/Source/devtools/front_end/console/ConsoleViewport.js (right): https://codereview.chromium.org/2856933006/diff/60001/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewport.js#newcode465 third_party/WebKit/Source/devtools/front_end/console/ConsoleViewport.js:465: var isValidTextNode = node.nodeType === Node.TEXT_NODE && !nonTextTags[node.parentElement.nodeName]; ...
3 years, 7 months ago (2017-05-09 00:39:40 UTC) #11
luoe
Thanks! https://codereview.chromium.org/2856933006/diff/60001/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewport.js File third_party/WebKit/Source/devtools/front_end/console/ConsoleViewport.js (right): https://codereview.chromium.org/2856933006/diff/60001/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewport.js#newcode465 third_party/WebKit/Source/devtools/front_end/console/ConsoleViewport.js:465: var isValidTextNode = node.nodeType === Node.TEXT_NODE && !nonTextTags[node.parentElement.nodeName]; ...
3 years, 7 months ago (2017-05-09 00:44:46 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2856933006/80001
3 years, 7 months ago (2017-05-09 00:49:53 UTC) #15
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/438965) win_chromium_x64_rel_ng on master.tryserver.chromium.win (JOB_FAILED, ...
3 years, 7 months ago (2017-05-09 01:21:08 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2856933006/80001
3 years, 7 months ago (2017-05-09 20:23:52 UTC) #19
commit-bot: I haz the power
3 years, 7 months ago (2017-05-10 00:07:07 UTC) #22
Message was sent while issue was closed.
Committed patchset #4 (id:80001) as
https://chromium.googlesource.com/chromium/src/+/56d8d770469ff02ac1521f49adda...

Powered by Google App Engine
This is Rietveld 408576698