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

Unified Diff: Source/core/html/HTMLSelectElement.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/HTMLScriptElement.cpp ('k') | Source/core/html/HTMLStyleElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLSelectElement.cpp
diff --git a/Source/core/html/HTMLSelectElement.cpp b/Source/core/html/HTMLSelectElement.cpp
index c516473e18953ca0c9b9fb22c783b2200cb5fcd0..be63119089e4102eea56138b304ca87bdb076e03 100644
--- a/Source/core/html/HTMLSelectElement.cpp
+++ b/Source/core/html/HTMLSelectElement.cpp
@@ -378,7 +378,7 @@ void HTMLSelectElement::optionElementChildrenChanged()
setNeedsValidityCheck();
if (renderer()) {
- if (AXObjectCache* cache = renderer()->document()->existingAXObjectCache())
+ if (AXObjectCache* cache = renderer()->document().existingAXObjectCache())
cache->childrenChanged(this);
}
}
@@ -446,7 +446,7 @@ void HTMLSelectElement::setLength(unsigned newLen, ExceptionState& es)
if (diff < 0) { // Add dummy elements.
do {
- RefPtr<Element> option = document()->createElement(optionTag, false);
+ RefPtr<Element> option = document().createElement(optionTag, false);
ASSERT(option);
add(toHTMLElement(option.get()), 0, es);
if (es.hadException())
@@ -721,7 +721,7 @@ void HTMLSelectElement::setRecalcListItems()
invalidateSelectedItems();
if (renderer()) {
- if (AXObjectCache* cache = renderer()->document()->existingAXObjectCache())
+ if (AXObjectCache* cache = renderer()->document().existingAXObjectCache())
cache->childrenChanged(this);
}
}
@@ -1065,7 +1065,7 @@ bool HTMLSelectElement::platformHandleKeydownEvent(KeyboardEvent* event)
if (!RenderTheme::theme().popsMenuByArrowKeys())
return false;
- if (!isSpatialNavigationEnabled(document()->frame())) {
+ if (!isSpatialNavigationEnabled(document().frame())) {
if (event->keyIdentifier() == "Down" || event->keyIdentifier() == "Up") {
focus();
// Calling focus() may cause us to lose our renderer. Return true so
@@ -1104,7 +1104,7 @@ void HTMLSelectElement::menuListDefaultEventHandler(Event* event)
// When using spatial navigation, we want to be able to navigate away
// from the select element when the user hits any of the arrow keys,
// instead of changing the selection.
- if (isSpatialNavigationEnabled(document()->frame())) {
+ if (isSpatialNavigationEnabled(document().frame())) {
if (!m_activeSelectionState)
return;
}
@@ -1145,7 +1145,7 @@ void HTMLSelectElement::menuListDefaultEventHandler(Event* event)
int keyCode = toKeyboardEvent(event)->keyCode();
bool handled = false;
- if (keyCode == ' ' && isSpatialNavigationEnabled(document()->frame())) {
+ if (keyCode == ' ' && isSpatialNavigationEnabled(document().frame())) {
// Use space to toggle arrow key handling for selection change or spatial navigation.
m_activeSelectionState = !m_activeSelectionState;
event->setDefaultHandled();
@@ -1298,7 +1298,7 @@ void HTMLSelectElement::listBoxDefaultEventHandler(Event* event)
updateSelectedState(listIndex, mouseEvent->ctrlKey(), mouseEvent->shiftKey());
#endif
}
- if (Frame* frame = document()->frame())
+ if (Frame* frame = document().frame())
frame->eventHandler()->setMouseDownMayStartAutoscroll();
event->setDefaultHandled();
@@ -1383,7 +1383,7 @@ void HTMLSelectElement::listBoxDefaultEventHandler(Event* event)
handled = true;
}
- if (isSpatialNavigationEnabled(document()->frame()))
+ if (isSpatialNavigationEnabled(document().frame()))
// Check if the selection moves to the boundary.
if (keyIdentifier == "Left" || keyIdentifier == "Right" || ((keyIdentifier == "Down" || keyIdentifier == "Up") && endIndex == m_activeSelectionEndIndex))
return;
@@ -1397,7 +1397,7 @@ void HTMLSelectElement::listBoxDefaultEventHandler(Event* event)
ASSERT_UNUSED(listItems, !listItems.size() || static_cast<size_t>(endIndex) < listItems.size());
setActiveSelectionEndIndex(endIndex);
- bool selectNewItem = !m_multiple || toKeyboardEvent(event)->shiftKey() || !isSpatialNavigationEnabled(document()->frame());
+ bool selectNewItem = !m_multiple || toKeyboardEvent(event)->shiftKey() || !isSpatialNavigationEnabled(document().frame());
if (selectNewItem)
m_activeSelectionState = true;
// If the anchor is unitialized, or if we're going to deselect all
@@ -1427,7 +1427,7 @@ void HTMLSelectElement::listBoxDefaultEventHandler(Event* event)
if (form())
form()->submitImplicitly(event, false);
event->setDefaultHandled();
- } else if (m_multiple && keyCode == ' ' && isSpatialNavigationEnabled(document()->frame())) {
+ } else if (m_multiple && keyCode == ' ' && isSpatialNavigationEnabled(document().frame())) {
// Use space to toggle selection change.
m_activeSelectionState = !m_activeSelectionState;
updateSelectedState(listToOptionIndex(m_activeSelectionEndIndex), true /*multi*/, false /*shift*/);
« no previous file with comments | « Source/core/html/HTMLScriptElement.cpp ('k') | Source/core/html/HTMLStyleElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698