Make ApplyStyleCommand not to use Position::deprecatedEditingOffset() (issue 1259283003 by yosin@chromium.org)

0 katselukertaa
Siirry ensimmäiseen lukemattomaan viestiin

yo...@chromium.org

lukematon,
3.8.2015 klo 4.19.363.8.2015
vastaanottaja tk...@chromium.org, yoi...@chromium.org, hajim...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org
Reviewers: tkent, yoichio, hajimehoshi,

Message:
PTAL

mac_blink_bot failures,
http/tests/serviceworker/fetch-request-fallback.html and
trace test on NVIDIA GPU aren't related to this patch.

Description:
Make ApplyStyleCommand not to use Position::deprecatedEditingOffset()

This patch replaces |Position::deprecatedEditingOffset()| call in
|ApplyStyleCommand| class by |Position::computeEditingOffset()|, since it
is used for computing offset for positions which can not be
middle of editing ignore content, for improving code health.

This patch is a preparation of getting rid of legacy editing position.

BUG=513114
TEST=n/a; no behavior changes


Please review this at https://codereview.chromium.org/1259283003/

Base URL: https://chromium.googlesource.com/chromium/blink.git@master

Affected files (+3, -3 lines):
M Source/core/editing/ApplyStyleCommand.cpp


Index: Source/core/editing/ApplyStyleCommand.cpp
diff --git a/Source/core/editing/ApplyStyleCommand.cpp
b/Source/core/editing/ApplyStyleCommand.cpp
index
f2e91065132baa77f82c5e6d4da1d6cc85d6c09e..efd732d1b76391042b04bbacd2d2156d118b867e
100644
--- a/Source/core/editing/ApplyStyleCommand.cpp
+++ b/Source/core/editing/ApplyStyleCommand.cpp
@@ -699,14 +699,14 @@ void
ApplyStyleCommand::fixRangeAndApplyInlineStyle(EditingStyle* style, const P
Node* startNode = start.anchorNode();
ASSERT(startNode);

- if (start.deprecatedEditingOffset() >=
caretMaxOffset(start.anchorNode())) {
+ if (start.computeEditingOffset() >=
caretMaxOffset(start.anchorNode())) {
startNode = NodeTraversal::next(*startNode);
if (!startNode || comparePositions(end,
firstPositionInOrBeforeNode(startNode)) < 0)
return;
}

Node* pastEndNode = end.anchorNode();
- if (end.deprecatedEditingOffset() >= caretMaxOffset(end.anchorNode()))
+ if (end.computeEditingOffset() >= caretMaxOffset(end.anchorNode()))
pastEndNode =
NodeTraversal::nextSkippingChildren(*end.anchorNode());

// FIXME: Callers should perform this operation on a Range that
includes the br
@@ -1324,7 +1324,7 @@ bool
ApplyStyleCommand::mergeStartWithPreviousIfIdentical(const Position& start,
int startOffsetAdjustment = startChild->nodeIndex();
int endOffsetAdjustment = startNode == end.anchorNode() ?
startOffsetAdjustment : 0;
updateStartEnd(Position(startNode, startOffsetAdjustment),
- Position(end.anchorNode(), end.deprecatedEditingOffset() +
endOffsetAdjustment));
+ Position(end.anchorNode(), end.computeEditingOffset() +
endOffsetAdjustment));
return true;
}



tk...@chromium.org

lukematon,
3.8.2015 klo 4.30.273.8.2015
vastaanottaja yo...@chromium.org, yoi...@chromium.org, hajim...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org

commit-bot@chromium.org via codereview.chromium.org

lukematon,
3.8.2015 klo 4.30.423.8.2015
vastaanottaja yo...@chromium.org, tk...@chromium.org, yoi...@chromium.org, hajim...@chromium.org, commi...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org

commit-bot@chromium.org via codereview.chromium.org

lukematon,
3.8.2015 klo 6.39.003.8.2015
vastaanottaja yo...@chromium.org, tk...@chromium.org, yoi...@chromium.org, hajim...@chromium.org, commi...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org
Vastaa kaikille
Vastaa kirjoittajalle
Välitä
0 uutta viestiä