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

Issue 485313002: Simplify TypingCommand::makeEditableRootEmpty() a bit (Closed)

Created:
6 years, 4 months ago by Inactive
Modified:
6 years, 4 months ago
CC:
blink-reviews
Project:
blink
Visibility:
Public.

Description

Simplify TypingCommand::makeEditableRootEmpty() a bit Simplify TypingCommand::makeEditableRootEmpty() a bit by avoiding an unnecessary call to ElementTraversal::firstWithin(). In this if scope, we already know that the root node has a single child. Therefore, there is no reason to do a tree traversal, we can directly call ContainerNode::firstChild(). ElementTraversal::firstWithin() never explores descendants and only looks for the first direct child that is an Element. In this case, we don't need to check if the child is an Element as we can pass a Node to isHTMLBRElement(). R=leviw@chromium.org, yosin@chromium.org Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=180673

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1 line, -2 lines) Patch
M Source/core/editing/TypingCommand.cpp View 1 chunk +1 line, -2 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
Inactive
6 years, 4 months ago (2014-08-19 21:10:41 UTC) #1
yosin_UTC9
LGTM Make sense. Thanks for clean up. root->firstChild() == nullptr case is handle by L389.
6 years, 4 months ago (2014-08-20 00:50:36 UTC) #2
Inactive
Thanks. Levi, can you please give OWNER review?
6 years, 4 months ago (2014-08-20 15:12:17 UTC) #3
leviw_travelin_and_unemployed
The CQ bit was checked by leviw@chromium.org
6 years, 4 months ago (2014-08-20 18:24:18 UTC) #4
leviw_travelin_and_unemployed
lgtm
6 years, 4 months ago (2014-08-20 18:24:18 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ch.dumez@samsung.com/485313002/1
6 years, 4 months ago (2014-08-20 18:24:37 UTC) #6
commit-bot: I haz the power
6 years, 4 months ago (2014-08-20 18:29:13 UTC) #7
Message was sent while issue was closed.
Committed patchset #1 (1) as 180673

Powered by Google App Engine
This is Rietveld 408576698