Chromium Code Reviews| Index: third_party/WebKit/Source/core/editing/commands/DeleteSelectionCommand.cpp |
| diff --git a/third_party/WebKit/Source/core/editing/commands/DeleteSelectionCommand.cpp b/third_party/WebKit/Source/core/editing/commands/DeleteSelectionCommand.cpp |
| index 82b47623c7882840fcfe3b2d2da153ca23e61687..8b78769158cd994842230b5fdcbe0dd7e2b8621f 100644 |
| --- a/third_party/WebKit/Source/core/editing/commands/DeleteSelectionCommand.cpp |
| +++ b/third_party/WebKit/Source/core/editing/commands/DeleteSelectionCommand.cpp |
| @@ -56,6 +56,7 @@ static bool isTableRowEmpty(Node* row) { |
| if (!isHTMLTableRowElement(row)) |
| return false; |
| + row->document().updateStyleAndLayoutIgnorePendingStylesheets(); |
| for (Node* child = row->firstChild(); child; child = child->nextSibling()) { |
| if (isTableCell(child) && !isTableCellEmpty(child)) |
| return false; |
| @@ -414,11 +415,13 @@ bool DeleteSelectionCommand::handleSpecialCaseBRDelete( |
| // FIXME: This code doesn't belong in here. |
| // We detect the case where the start is an empty line consisting of BR not |
| // wrapped in a block element. |
| - if (upstreamStartIsBR && downstreamStartIsBR && |
| - !(isStartOfBlock(VisiblePosition::beforeNode(nodeAfterUpstreamStart)) && |
| - isEndOfBlock(VisiblePosition::afterNode(nodeAfterUpstreamStart)))) { |
| - m_startsAtEmptyLine = true; |
| - m_endingPosition = m_downstreamEnd; |
| + if (upstreamStartIsBR && downstreamStartIsBR) { |
| + document().updateStyleAndLayoutIgnorePendingStylesheets(); |
|
yosin_UTC9
2016/10/13 06:26:46
Wow, we has been updating layout in if-condition!
|
| + if (!(isStartOfBlock(VisiblePosition::beforeNode(nodeAfterUpstreamStart)) && |
| + isEndOfBlock(VisiblePosition::afterNode(nodeAfterUpstreamStart)))) { |
| + m_startsAtEmptyLine = true; |
| + m_endingPosition = m_downstreamEnd; |
| + } |
| } |
| return false; |
| @@ -490,6 +493,7 @@ void DeleteSelectionCommand::removeNode( |
| return; |
| } |
| + document().updateStyleAndLayoutIgnorePendingStylesheets(); |
| if (node == m_startBlock) { |
| VisiblePosition previous = previousPositionOf( |
| VisiblePosition::firstPositionInNode(m_startBlock.get())); |