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

Unified Diff: Source/core/html/BaseMultipleFieldsDateAndTimeInputType.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/BaseChooserOnlyDateAndTimeInputType.cpp ('k') | Source/core/html/ClassList.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/BaseMultipleFieldsDateAndTimeInputType.cpp
diff --git a/Source/core/html/BaseMultipleFieldsDateAndTimeInputType.cpp b/Source/core/html/BaseMultipleFieldsDateAndTimeInputType.cpp
index 873857dca7a5abbbf4ecd7aae194b965a56fee90..ee7a8c8183b3a256622ae38089f8ea3762542e5f 100644
--- a/Source/core/html/BaseMultipleFieldsDateAndTimeInputType.cpp
+++ b/Source/core/html/BaseMultipleFieldsDateAndTimeInputType.cpp
@@ -150,7 +150,7 @@ PickerIndicatorElement* BaseMultipleFieldsDateAndTimeInputType::pickerIndicatorE
inline bool BaseMultipleFieldsDateAndTimeInputType::containsFocusedShadowElement() const
{
- return element()->userAgentShadowRoot()->contains(element()->document()->focusedElement());
+ return element()->userAgentShadowRoot()->contains(element()->document().focusedElement());
}
void BaseMultipleFieldsDateAndTimeInputType::didBlurFromControl()
@@ -330,13 +330,13 @@ void BaseMultipleFieldsDateAndTimeInputType::createShadowSubtree()
// FIXME: This code should not depend on such craziness.
ASSERT(!element()->renderer());
- Document* document = element()->document();
+ Document& document = element()->document();
ContainerNode* container = element()->userAgentShadowRoot();
- container->appendChild(DateTimeEditElement::create(document, *this));
+ container->appendChild(DateTimeEditElement::create(&document, *this));
updateInnerTextValue();
- container->appendChild(ClearButtonElement::create(document, *this));
- container->appendChild(SpinButtonElement::create(document, *this));
+ container->appendChild(ClearButtonElement::create(&document, *this));
+ container->appendChild(SpinButtonElement::create(&document, *this));
bool shouldAddPickerIndicator = false;
if (InputType::themeSupportsDataListUI(this))
@@ -346,7 +346,7 @@ void BaseMultipleFieldsDateAndTimeInputType::createShadowSubtree()
m_pickerIndicatorIsAlwaysVisible = true;
}
if (shouldAddPickerIndicator) {
- container->appendChild(PickerIndicatorElement::create(document, *this));
+ container->appendChild(PickerIndicatorElement::create(&document, *this));
m_pickerIndicatorIsVisible = true;
updatePickerIndicatorVisibility();
}
@@ -381,8 +381,8 @@ void BaseMultipleFieldsDateAndTimeInputType::handleFocusEvent(Element* oldFocuse
if (!edit || m_isDestroyingShadowSubtree)
return;
if (direction == FocusDirectionBackward) {
- if (element()->document()->page())
- element()->document()->page()->focusController().advanceFocus(direction);
+ if (element()->document().page())
+ element()->document().page()->focusController().advanceFocus(direction);
} else if (direction == FocusDirectionNone || direction == FocusDirectionMouse || direction == FocusDirectionPage) {
edit->focusByOwner(oldFocusedElement);
} else
@@ -417,7 +417,6 @@ void BaseMultipleFieldsDateAndTimeInputType::requiredAttributeChanged()
void BaseMultipleFieldsDateAndTimeInputType::handleKeydownEvent(KeyboardEvent* event)
{
- Document* document = element()->document();
if (m_pickerIndicatorIsVisible
&& ((event->keyIdentifier() == "Down" && event->getModifierState("Alt")) || (RenderTheme::theme().shouldOpenPickerWithF4Key() && event->keyIdentifier() == "F4"))) {
if (PickerIndicatorElement* element = pickerIndicatorElement())
« no previous file with comments | « Source/core/html/BaseChooserOnlyDateAndTimeInputType.cpp ('k') | Source/core/html/ClassList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698