Commit 8f100f36 authored by joone.hur's avatar joone.hur Committed by Commit bot

Remove redundant isInline function

The same isInline function is defined in EditingUtilities.cpp and
IndentOutdentCommand.cpp. This CL adds isInline declaration in
EditingUtilities.h so that it can remove the same function from
IndentOutdentCommand.cpp.

In addition, it uses Node::computedStyle() rather than layout object
to reduce dependency of layout tree.

BUG=none

Review-Url: https://codereview.chromium.org/2105653004
Cr-Commit-Position: refs/heads/master@{#402689}
parent 76923ea8
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include "core/HTMLNames.h" #include "core/HTMLNames.h"
#include "core/dom/Document.h" #include "core/dom/Document.h"
#include "core/dom/ElementTraversal.h" #include "core/dom/ElementTraversal.h"
#include "core/dom/NodeComputedStyle.h"
#include "core/dom/Range.h" #include "core/dom/Range.h"
#include "core/dom/Text.h" #include "core/dom/Text.h"
#include "core/dom/shadow/ShadowRoot.h" #include "core/dom/shadow/ShadowRoot.h"
...@@ -764,7 +765,7 @@ bool isEnclosingBlock(const Node* node) ...@@ -764,7 +765,7 @@ bool isEnclosingBlock(const Node* node)
bool isInline(const Node* node) bool isInline(const Node* node)
{ {
return node && node->layoutObject() && node->layoutObject()->isInline(); return node && node->computedStyle()->display() == INLINE;
} }
// TODO(yosin) Deploy this in all of the places where |enclosingBlockFlow()| and // TODO(yosin) Deploy this in all of the places where |enclosingBlockFlow()| and
......
...@@ -150,6 +150,7 @@ bool isTabHTMLSpanElement(const Node*); ...@@ -150,6 +150,7 @@ bool isTabHTMLSpanElement(const Node*);
bool isTabHTMLSpanElementTextNode(const Node*); bool isTabHTMLSpanElementTextNode(const Node*);
bool isMailHTMLBlockquoteElement(const Node*); bool isMailHTMLBlockquoteElement(const Node*);
bool isDisplayInsideTable(const Node*); bool isDisplayInsideTable(const Node*);
bool isInline(const Node*);
bool isTableCell(const Node*); bool isTableCell(const Node*);
bool isEmptyTableCell(const Node*); bool isEmptyTableCell(const Node*);
bool isTableStructureNode(const Node*); bool isTableStructureNode(const Node*);
......
...@@ -54,12 +54,6 @@ static bool isHTMLListOrBlockquoteElement(const Node* node) ...@@ -54,12 +54,6 @@ static bool isHTMLListOrBlockquoteElement(const Node* node)
return isHTMLUListElement(element) || isHTMLOListElement(element) || element.hasTagName(blockquoteTag); return isHTMLUListElement(element) || isHTMLOListElement(element) || element.hasTagName(blockquoteTag);
} }
static bool isInline(const Node* node)
{
return node && node->layoutObject() && node->layoutObject()->isInline();
}
IndentOutdentCommand::IndentOutdentCommand(Document& document, EIndentType typeOfAction) IndentOutdentCommand::IndentOutdentCommand(Document& document, EIndentType typeOfAction)
: ApplyBlockElementCommand(document, blockquoteTag, "margin: 0 0 0 40px; border: none; padding: 0px;") : ApplyBlockElementCommand(document, blockquoteTag, "margin: 0 0 0 40px; border: none; padding: 0px;")
, m_typeOfAction(typeOfAction) , m_typeOfAction(typeOfAction)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment