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

Unified Diff: sky/engine/core/editing/ReplaceSelectionCommand.cpp

Issue 1215103007: Remove remaining HTML elements (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/engine/core/editing/EditorCommand.cpp ('k') | sky/engine/core/fetch/FontResource.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/editing/ReplaceSelectionCommand.cpp
diff --git a/sky/engine/core/editing/ReplaceSelectionCommand.cpp b/sky/engine/core/editing/ReplaceSelectionCommand.cpp
index afbd39aad8700f172453dab30fe0a21145514738..bfd1a6d7b580ca6e3175e8ef7096fd265daff1a3 100644
--- a/sky/engine/core/editing/ReplaceSelectionCommand.cpp
+++ b/sky/engine/core/editing/ReplaceSelectionCommand.cpp
@@ -411,29 +411,8 @@ void ReplaceSelectionCommand::moveElementOutOfAncestor(PassRefPtr<Element> prpEl
removeNode(ancestor.release());
}
-static inline bool nodeHasVisibleRenderText(Text& text)
-{
- return text.renderer() && text.renderer()->renderedTextLength() > 0;
-}
-
void ReplaceSelectionCommand::removeUnrenderedTextNodesAtEnds(InsertedNodes& insertedNodes)
{
- document().updateLayout();
-
- Node* lastLeafInserted = insertedNodes.lastLeafInserted();
- if (lastLeafInserted && lastLeafInserted->isTextNode() && !nodeHasVisibleRenderText(toText(*lastLeafInserted))
- && !enclosingElementWithTag(firstPositionInOrBeforeNode(lastLeafInserted), HTMLNames::scriptTag)) {
- insertedNodes.willRemoveNode(*lastLeafInserted);
- removeNode(lastLeafInserted);
- }
-
- // We don't have to make sure that firstNodeInserted isn't inside a select or script element, because
- // it is a top level node in the fragment and the user can't insert into those elements.
- Node* firstNodeInserted = insertedNodes.firstNodeInserted();
- if (firstNodeInserted && firstNodeInserted->isTextNode() && !nodeHasVisibleRenderText(toText(*firstNodeInserted))) {
- insertedNodes.willRemoveNode(*firstNodeInserted);
- removeNode(firstNodeInserted);
- }
}
VisiblePosition ReplaceSelectionCommand::positionAtEndOfInsertedContent() const
« no previous file with comments | « sky/engine/core/editing/EditorCommand.cpp ('k') | sky/engine/core/fetch/FontResource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698