Chromium Code Reviews
Help | Chromium Project | Gerrit Changes | Sign in
(2)

Issue 1195743002: Have StyledMarkupSerializer work on the Composed tree (Closed)

Created:
4 years, 10 months ago by hajimehoshi
Modified:
4 years, 10 months ago
Reviewers:
tkent, yosin_UTC9
CC:
blink-reviews, blink-reviews-style_chromium.org
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Have StyledMarkupSerializer work on the Composed tree We are now going to have StyledMarkupSerializer work on the Composed tree. We found just templatizing StyledMarkupSerializer was not enough. As for traversing a node tree, even though you start to traverse a tree in a composed-tree strategy, you would need to 'switch' the strategy to a dom-tree strategy when you find a closed-shadow host. For example, a <select> element is now a closed shadow host, but traversing <select> element as a composed tree doesn't make sense (a <div> or something would be in your clipboard). This means we need to call the DOM version of traverseNodesForSerialization in the Composed tree version of that. This CL fixes the logic during traversing on a closed-shadow node to switch the node-tree traversing strategy. This CL also adds tests for this. This patch is result of collaboration work with yosin@chromium.org for selection of web components. We've already prepared the new node-traversal usages at crrev.com/1188063002. BUG=275851 TEST=webkit_unit_tests --gtest_filter=StyledMarkupSerializerTest.* Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=197455

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Total comments: 6

Patch Set 4 : reviews #

Unified diffs Side-by-side diffs Delta from patch set Stats (+97 lines, -20 lines) Patch
M Source/core/editing/EditingStrategy.h View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M Source/core/editing/EditingStrategy.cpp View 1 2 3 2 chunks +11 lines, -0 lines 0 comments Download
M Source/core/editing/StyledMarkupSerializer.h View 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/editing/StyledMarkupSerializer.cpp View 1 2 3 3 chunks +42 lines, -20 lines 0 comments Download
M Source/core/editing/StyledMarkupSerializerTest.cpp View 1 12 chunks +26 lines, -0 lines 0 comments Download
M Source/core/editing/VisibleSelection.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/editing/VisibleSelection.cpp View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
M Source/core/editing/markup.h View 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/editing/markup.cpp View 2 chunks +7 lines, -0 lines 0 comments Download

Messages

Total messages: 9 (2 generated)
hajimehoshi
PTAL
4 years, 10 months ago (2015-06-19 05:54:32 UTC) #2
tkent
https://codereview.chromium.org/1195743002/diff/40001/Source/core/editing/EditingStrategy.cpp File Source/core/editing/EditingStrategy.cpp (right): https://codereview.chromium.org/1195743002/diff/40001/Source/core/editing/EditingStrategy.cpp#newcode151 Source/core/editing/EditingStrategy.cpp:151: if (!node->isElementNode()) You assume |node| is non-null. So, the ...
4 years, 10 months ago (2015-06-19 06:07:49 UTC) #3
yosin_UTC9
https://codereview.chromium.org/1195743002/diff/40001/Source/core/editing/StyledMarkupSerializer.cpp File Source/core/editing/StyledMarkupSerializer.cpp (right): https://codereview.chromium.org/1195743002/diff/40001/Source/core/editing/StyledMarkupSerializer.cpp#newcode63 Source/core/editing/StyledMarkupSerializer.cpp:63: static bool handleSelectionBoundary(Node*); |const Node&| if |isSelectionBoundaryShadowHost()| takes |const ...
4 years, 10 months ago (2015-06-19 06:16:16 UTC) #4
hajimehoshi
Thank you! PTAL https://codereview.chromium.org/1195743002/diff/40001/Source/core/editing/EditingStrategy.cpp File Source/core/editing/EditingStrategy.cpp (right): https://codereview.chromium.org/1195743002/diff/40001/Source/core/editing/EditingStrategy.cpp#newcode151 Source/core/editing/EditingStrategy.cpp:151: if (!node->isElementNode()) On 2015/06/19 06:07:49, tkent ...
4 years, 10 months ago (2015-06-19 06:26:51 UTC) #5
tkent
lgtm
4 years, 10 months ago (2015-06-19 06:36:15 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1195743002/60001
4 years, 10 months ago (2015-06-19 06:39:09 UTC) #8
commit-bot: I haz the power
4 years, 10 months ago (2015-06-19 08:22:59 UTC) #9
Message was sent while issue was closed.
Committed patchset #4 (id:60001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=197455

Powered by Google App Engine
This is Rietveld 408576698