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

Unified Diff: Source/core/html/HTMLOptionElement.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/HTMLOptGroupElement.cpp ('k') | Source/core/html/HTMLParamElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLOptionElement.cpp
diff --git a/Source/core/html/HTMLOptionElement.cpp b/Source/core/html/HTMLOptionElement.cpp
index 9bb225084da2676f87c898eeb223bb95c55bdd0b..caf204ff1409bff21f9452efaa2cf89b6b19ec7a 100644
--- a/Source/core/html/HTMLOptionElement.cpp
+++ b/Source/core/html/HTMLOptionElement.cpp
@@ -110,11 +110,11 @@ bool HTMLOptionElement::rendererIsFocusable() const
String HTMLOptionElement::text() const
{
- Document* document = this->document();
+ Document& document = this->document();
String text;
// WinIE does not use the label attribute, so as a quirk, we ignore it.
- if (!document->inQuirksMode())
+ if (!document.inQuirksMode())
text = fastGetAttribute(labelAttr);
// FIXME: The following treats an element with the label attribute set to
@@ -125,7 +125,7 @@ String HTMLOptionElement::text() const
// FIXME: Is displayStringModifiedByEncoding helpful here?
// If it's correct here, then isn't it needed in the value and label functions too?
- return document->displayStringModifiedByEncoding(text).stripWhiteSpace(isHTMLSpace).simplifyWhiteSpace(isHTMLSpace);
+ return document.displayStringModifiedByEncoding(text).stripWhiteSpace(isHTMLSpace).simplifyWhiteSpace(isHTMLSpace);
}
void HTMLOptionElement::setText(const String &text, ExceptionState& es)
@@ -145,7 +145,7 @@ void HTMLOptionElement::setText(const String &text, ExceptionState& es)
toText(child)->setData(text);
else {
removeChildren();
- appendChild(Text::create(document(), text), es);
+ appendChild(Text::create(&document(), text), es);
}
if (selectIsMenuList && select->selectedIndex() != oldSelectedIndex)
« no previous file with comments | « Source/core/html/HTMLOptGroupElement.cpp ('k') | Source/core/html/HTMLParamElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698