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

Unified Diff: Source/core/editing/markup.cpp

Issue 19098002: Introduce isHTMLHtmlElement and toHTMLHtmlElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 7 years, 5 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 | « Source/core/editing/VisiblePosition.cpp ('k') | Source/core/html/HTMLHtmlElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/markup.cpp
diff --git a/Source/core/editing/markup.cpp b/Source/core/editing/markup.cpp
index 0328a3ed9de5f9657b8f58a653b6f6e52d52db30..5eeb226569eb28011671eadd70d9f5f1b972965a 100644
--- a/Source/core/editing/markup.cpp
+++ b/Source/core/editing/markup.cpp
@@ -51,6 +51,7 @@
#include "core/editing/htmlediting.h"
#include "core/html/HTMLBodyElement.h"
#include "core/html/HTMLElement.h"
+#include "core/html/HTMLHtmlElement.h"
#include "core/html/HTMLTableElement.h"
#include "core/html/HTMLTextFormControlElement.h"
#include "core/page/Frame.h"
@@ -843,7 +844,7 @@ PassRefPtr<DocumentFragment> createFragmentFromText(Range* context, const String
bool useClonesOfEnclosingBlock = blockNode
&& blockNode->isElementNode()
&& !block->hasTagName(bodyTag)
- && !block->hasTagName(htmlTag)
+ && !isHTMLHtmlElement(block)
&& block != editableRootForPosition(context->startPosition());
bool useLineBreak = enclosingTextFormControl(context->startPosition());
@@ -1022,7 +1023,7 @@ PassRefPtr<DocumentFragment> createContextualFragment(const String& markup, HTML
RefPtr<Node> nextNode;
for (RefPtr<Node> node = fragment->firstChild(); node; node = nextNode) {
nextNode = node->nextSibling();
- if (node->hasTagName(htmlTag) || node->hasTagName(headTag) || node->hasTagName(bodyTag)) {
+ if (isHTMLHtmlElement(node.get()) || node->hasTagName(headTag) || node->hasTagName(bodyTag)) {
HTMLElement* element = toHTMLElement(node.get());
if (Node* firstChild = element->firstChild())
nextNode = firstChild;
« no previous file with comments | « Source/core/editing/VisiblePosition.cpp ('k') | Source/core/html/HTMLHtmlElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698