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

Unified Diff: Source/core/html/TextFieldInputType.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/html/SearchInputType.cpp ('k') | Source/core/html/ValidationMessage.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/TextFieldInputType.cpp
diff --git a/Source/core/html/TextFieldInputType.cpp b/Source/core/html/TextFieldInputType.cpp
index 8a49a91851848b3ea0008784ea35ddba5b40de9f..329e933940e9a1c7d4b34626832127ce68097653 100644
--- a/Source/core/html/TextFieldInputType.cpp
+++ b/Source/core/html/TextFieldInputType.cpp
@@ -86,9 +86,9 @@ bool TextFieldInputType::isTextField() const
static inline bool shouldIgnoreRequiredAttribute(const HTMLInputElement& input)
{
- if (!input.document()->settings() || !input.document()->settings()->needsSiteSpecificQuirks())
+ if (!input.document().settings() || !input.document().settings()->needsSiteSpecificQuirks())
return false;
- if (!equalIgnoringCase(input.document()->url().host(), "egov.uscis.gov"))
+ if (!equalIgnoringCase(input.document().url().host(), "egov.uscis.gov"))
return false;
return input.fastGetAttribute(requiredAttr) == "no";
}
@@ -154,7 +154,7 @@ void TextFieldInputType::handleKeydownEvent(KeyboardEvent* event)
{
if (!element()->focused())
return;
- Frame* frame = element()->document()->frame();
+ Frame* frame = element()->document().frame();
if (!frame || !frame->editor().doTextFieldCommandFromEvent(element(), event))
return;
event->setDefaultHandled();
@@ -243,7 +243,7 @@ void TextFieldInputType::createShadowSubtree()
ASSERT(!m_innerText);
ASSERT(!m_innerBlock);
- Document* document = element()->document();
+ Document* document = &element()->document();
bool shouldHaveSpinButton = this->shouldHaveSpinButton();
bool createsContainer = shouldHaveSpinButton || needsContainer();
@@ -373,7 +373,7 @@ void TextFieldInputType::handleBeforeTextInsertedEvent(BeforeTextInsertedEvent*
// If the text field has no focus, we don't need to take account of the
// selection length. The selection is the source of text drag-and-drop in
// that case, and nothing in the text field will be removed.
- unsigned selectionLength = element()->focused() ? plainText(element()->document()->frame()->selection()->selection().toNormalizedRange().get()).length() : 0;
+ unsigned selectionLength = element()->focused() ? plainText(element()->document().frame()->selection()->selection().toNormalizedRange().get()).length() : 0;
ASSERT(oldLength >= selectionLength);
// Selected characters will be removed by the next text event.
@@ -412,7 +412,7 @@ void TextFieldInputType::updatePlaceholderText()
return;
}
if (!m_placeholder) {
- m_placeholder = HTMLDivElement::create(element()->document());
+ m_placeholder = HTMLDivElement::create(&element()->document());
m_placeholder->setPart(AtomicString("-webkit-input-placeholder", AtomicString::ConstructFromLiteral));
element()->userAgentShadowRoot()->insertBefore(m_placeholder, m_container ? m_container->nextSibling() : innerTextElement()->nextSibling());
}
@@ -456,7 +456,7 @@ void TextFieldInputType::didSetValueByUserEdit(ValueChangeState state)
{
if (!element()->focused())
return;
- if (Frame* frame = element()->document()->frame())
+ if (Frame* frame = element()->document().frame())
frame->editor().textDidChangeInTextField(element());
}
« no previous file with comments | « Source/core/html/SearchInputType.cpp ('k') | Source/core/html/ValidationMessage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698