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

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

Issue 1180653005: Refactoring: Remove addDisplayInline parameter of createInlineStyle (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: tkent's review 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 | « Source/core/editing/StyledMarkupAccumulator.h ('k') | Source/core/editing/StyledMarkupSerializer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/StyledMarkupAccumulator.cpp
diff --git a/Source/core/editing/StyledMarkupAccumulator.cpp b/Source/core/editing/StyledMarkupAccumulator.cpp
index 482c34195839f43be59776c2c0caa3ec906a77ea..e7cf7f5e3a294be81f1d9867e2abd9f07f6ef99b 100644
--- a/Source/core/editing/StyledMarkupAccumulator.cpp
+++ b/Source/core/editing/StyledMarkupAccumulator.cpp
@@ -67,7 +67,7 @@ void StyledMarkupAccumulator::appendStartMarkup(StringBuilder& result, Node& nod
break;
case Node::ELEMENT_NODE: {
Element& element = toElement(node);
- RefPtrWillBeRawPtr<EditingStyle> style = createInlineStyle(element, false);
+ RefPtrWillBeRawPtr<EditingStyle> style = createInlineStyle(element);
appendElement(element, style);
break;
}
@@ -140,10 +140,8 @@ void StyledMarkupAccumulator::appendElement(Element& element, PassRefPtrWillBeRa
appendElement(m_result, element, false, style);
}
-RefPtrWillBeRawPtr<EditingStyle> StyledMarkupAccumulator::createInlineStyle(Element& element, bool addDisplayInline)
+RefPtrWillBeRawPtr<EditingStyle> StyledMarkupAccumulator::createInlineStyle(Element& element)
{
- const bool shouldAnnotateOrForceInline = element.isHTMLElement() && (shouldAnnotate() || addDisplayInline);
-
RefPtrWillBeRawPtr<EditingStyle> inlineStyle = nullptr;
if (shouldApplyWrappingStyle(element)) {
@@ -157,15 +155,9 @@ RefPtrWillBeRawPtr<EditingStyle> StyledMarkupAccumulator::createInlineStyle(Elem
if (element.isStyledElement() && element.inlineStyle())
inlineStyle->overrideWithStyle(element.inlineStyle());
- if (!shouldAnnotateOrForceInline)
- return inlineStyle;
-
- if (shouldAnnotate())
+ if (element.isHTMLElement() && shouldAnnotate())
inlineStyle->mergeStyleFromRulesForSerialization(&toHTMLElement(element));
- if (addDisplayInline)
- inlineStyle->forceInline();
-
return inlineStyle;
}
« no previous file with comments | « Source/core/editing/StyledMarkupAccumulator.h ('k') | Source/core/editing/StyledMarkupSerializer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698