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

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

Issue 23819007: Have Node::document() return a reference instead of a pointer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 4 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/AppendNodeCommand.cpp ('k') | Source/core/editing/Caret.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/ApplyStyleCommand.cpp
diff --git a/Source/core/editing/ApplyStyleCommand.cpp b/Source/core/editing/ApplyStyleCommand.cpp
index 6ea072b3bd45824bdef1e5b4c12dbb4f119bf71c..3fb7c4f69599359a3447e5584ed3557d18a0b1ed 100644
--- a/Source/core/editing/ApplyStyleCommand.cpp
+++ b/Source/core/editing/ApplyStyleCommand.cpp
@@ -145,7 +145,7 @@ ApplyStyleCommand::ApplyStyleCommand(Document* document, const EditingStyle* sty
}
ApplyStyleCommand::ApplyStyleCommand(PassRefPtr<Element> element, bool removeOnly, EditAction editingAction)
- : CompositeEditCommand(element->document())
+ : CompositeEditCommand(&element->document())
, m_style(EditingStyle::create())
, m_editingAction(editingAction)
, m_propertyLevel(PropertyDefault)
@@ -690,7 +690,7 @@ void ApplyStyleCommand::fixRangeAndApplyInlineStyle(EditingStyle* style, const P
// Start from the highest fully selected ancestor so that we can modify the fully selected node.
// e.g. When applying font-size: large on <font color="blue">hello</font>, we need to include the font element in our run
// to generate <font color="blue" size="4">hello</font> instead of <font color="blue"><font size="4">hello</font></font>
- RefPtr<Range> range = Range::create(startNode->document(), start, end);
+ RefPtr<Range> range = Range::create(&startNode->document(), start, end);
Element* editableRoot = startNode->rootEditableElement();
if (startNode != editableRoot) {
while (editableRoot && startNode->parentNode() != editableRoot && isNodeVisiblyContainedWithin(startNode->parentNode(), range.get()))
@@ -985,7 +985,7 @@ void ApplyStyleCommand::applyInlineStyleToPushDown(Node* node, EditingStyle* sty
{
ASSERT(node);
- node->document()->updateStyleIfNeeded();
+ node->document().updateStyleIfNeeded();
if (!style || style->isEmpty() || !node->renderer())
return;
@@ -1154,7 +1154,7 @@ bool ApplyStyleCommand::nodeFullySelected(Node *node, const Position &start, con
ASSERT(node->isElementNode());
// The tree may have changed and Position::upstream() relies on an up-to-date layout.
- node->document()->updateLayoutIgnorePendingStylesheets();
+ node->document().updateLayoutIgnorePendingStylesheets();
return comparePositions(firstPositionInOrBeforeNode(node), start) >= 0
&& comparePositions(lastPositionInOrAfterNode(node).upstream(), end) <= 0;
« no previous file with comments | « Source/core/editing/AppendNodeCommand.cpp ('k') | Source/core/editing/Caret.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698