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

Unified Diff: Source/core/rendering/RenderListBox.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/rendering/RenderLayerFilterInfo.cpp ('k') | Source/core/rendering/RenderListItem.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderListBox.cpp
diff --git a/Source/core/rendering/RenderListBox.cpp b/Source/core/rendering/RenderListBox.cpp
index 2593e3c91e38e224d7ff266ae4db6dcd5b47e21a..5ca1e38b57f9a8ae22ac903cdb8a1b7d64331bb8 100644
--- a/Source/core/rendering/RenderListBox.cpp
+++ b/Source/core/rendering/RenderListBox.cpp
@@ -128,7 +128,7 @@ void RenderListBox::updateFromElement()
FontDescription d = itemFont.fontDescription();
d.setWeight(d.bolderWeight());
itemFont = Font(d, itemFont.letterSpacing(), itemFont.wordSpacing());
- itemFont.update(document()->styleResolver()->fontSelector());
+ itemFont.update(document().styleResolver()->fontSelector());
}
if (!text.isEmpty()) {
@@ -164,7 +164,7 @@ void RenderListBox::selectionChanged()
scrollToRevealSelection();
}
- if (AXObjectCache* cache = document()->existingAXObjectCache())
+ if (AXObjectCache* cache = document().existingAXObjectCache())
cache->selectedChildrenChanged(this);
}
@@ -407,7 +407,7 @@ void RenderListBox::paintItemForeground(PaintInfo& paintInfo, const LayoutPoint&
Color textColor = element->renderStyle() ? resolveColor(element->renderStyle(), CSSPropertyColor) : resolveColor(CSSPropertyColor);
if (isOptionElement && toHTMLOptionElement(element)->selected()) {
- if (frame()->selection()->isFocusedAndActive() && document()->focusedElement() == node())
+ if (frame()->selection()->isFocusedAndActive() && document().focusedElement() == node())
textColor = RenderTheme::theme().activeListBoxSelectionForegroundColor();
// Honor the foreground color for disabled items
else if (!element->isDisabledFormControl() && !select->isDisabledFormControl())
@@ -425,7 +425,7 @@ void RenderListBox::paintItemForeground(PaintInfo& paintInfo, const LayoutPoint&
FontDescription d = itemFont.fontDescription();
d.setWeight(d.bolderWeight());
itemFont = Font(d, itemFont.letterSpacing(), itemFont.wordSpacing());
- itemFont.update(document()->styleResolver()->fontSelector());
+ itemFont.update(document().styleResolver()->fontSelector());
}
// Draw the item text
@@ -441,7 +441,7 @@ void RenderListBox::paintItemBackground(PaintInfo& paintInfo, const LayoutPoint&
Color backColor;
if (element->hasTagName(optionTag) && toHTMLOptionElement(element)->selected()) {
- if (frame()->selection()->isFocusedAndActive() && document()->focusedElement() == node())
+ if (frame()->selection()->isFocusedAndActive() && document().focusedElement() == node())
backColor = RenderTheme::theme().activeListBoxSelectionBackgroundColor();
else
backColor = RenderTheme::theme().inactiveListBoxSelectionBackgroundColor();
@@ -638,7 +638,7 @@ void RenderListBox::scrollTo(int newOffset)
m_indexOffset = newOffset;
repaint();
- node()->document()->eventQueue()->enqueueOrDispatchScrollEvent(node(), DocumentEventQueue::ScrollEventElementTarget);
+ node()->document().eventQueue()->enqueueOrDispatchScrollEvent(node(), DocumentEventQueue::ScrollEventElementTarget);
}
LayoutUnit RenderListBox::itemHeight() const
@@ -879,7 +879,7 @@ PassRefPtr<Scrollbar> RenderListBox::createScrollbar()
widget = Scrollbar::createNativeScrollbar(this, VerticalScrollbar, RenderTheme::theme().scrollbarControlSizeForPart(ListboxPart));
didAddVerticalScrollbar(widget.get());
}
- document()->view()->addChild(widget.get());
+ document().view()->addChild(widget.get());
return widget.release();
}
@@ -909,8 +909,8 @@ void RenderListBox::setHasVerticalScrollbar(bool hasScrollbar)
m_vBar->styleChanged();
// Force an update since we know the scrollbars have changed things.
- if (document()->hasAnnotatedRegions())
- document()->setAnnotatedRegionsDirty(true);
+ if (document().hasAnnotatedRegions())
+ document().setAnnotatedRegionsDirty(true);
}
} // namespace WebCore
« no previous file with comments | « Source/core/rendering/RenderLayerFilterInfo.cpp ('k') | Source/core/rendering/RenderListItem.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698