Commit 56420394 authored by Daniel Cheng's avatar Daniel Cheng Committed by Commit Bot

Use web-style naming for TreeScope::getElementById

This is web-exposed via Document and other interfaces.

CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Bug: 713843
Change-Id: Idff897e4f3177a0ff67ecfda413b8fae9d51f556
Reviewed-on: https://chromium-review.googlesource.com/487882
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: 's avatarKentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#467295}
parent 7df710ad
......@@ -378,7 +378,7 @@ void V8Window::namedPropertyGetterCustom(
if (!has_named_item && has_id_item &&
!doc->ContainsMultipleElementsWithId(name)) {
UseCounter::Count(doc, UseCounter::kDOMClobberedVariableAccessed);
V8SetReturnValueFast(info, doc->GetElementById(name), window);
V8SetReturnValueFast(info, doc->getElementById(name), window);
return;
}
......
......@@ -456,7 +456,7 @@ TEST_F(ApplyRulesetsTest, AddUniversalRuleToDocument) {
TEST_F(ApplyRulesetsTest, AddUniversalRuleToShadowTree) {
GetDocument().body()->setInnerHTML("<div id=host></div>");
Element* host = GetDocument().GetElementById("host");
Element* host = GetDocument().getElementById("host");
ASSERT_TRUE(host);
ShadowRoot& shadow_root = AttachShadow(*host);
......@@ -493,7 +493,7 @@ TEST_F(ApplyRulesetsTest, AddFontFaceRuleToDocument) {
TEST_F(ApplyRulesetsTest, AddFontFaceRuleToShadowTree) {
GetDocument().body()->setInnerHTML("<div id=host></div>");
Element* host = GetDocument().GetElementById("host");
Element* host = GetDocument().getElementById("host");
ASSERT_TRUE(host);
ShadowRoot& shadow_root = AttachShadow(*host);
......@@ -517,7 +517,7 @@ TEST_F(ApplyRulesetsTest, AddFontFaceRuleToShadowTree) {
TEST_F(ApplyRulesetsTest, RemoveSheetFromShadowTree) {
GetDocument().body()->setInnerHTML("<div id=host></div>");
Element* host = GetDocument().GetElementById("host");
Element* host = GetDocument().getElementById("host");
ASSERT_TRUE(host);
ShadowRoot& shadow_root = AttachShadow(*host);
......
......@@ -205,7 +205,7 @@ TEST_F(AffectedByFocusTest, AffectedByFocusUpdate) {
unsigned start_count = GetDocument().GetStyleEngine().StyleForElementCount();
GetDocument().GetElementById("d")->focus();
GetDocument().getElementById("d")->focus();
GetDocument().View()->UpdateAllLifecyclePhases();
unsigned element_count =
......@@ -237,7 +237,7 @@ TEST_F(AffectedByFocusTest, ChildrenOrSiblingsAffectedByFocusUpdate) {
unsigned start_count = GetDocument().GetStyleEngine().StyleForElementCount();
GetDocument().GetElementById("d")->focus();
GetDocument().getElementById("d")->focus();
GetDocument().View()->UpdateAllLifecyclePhases();
unsigned element_count =
......@@ -269,7 +269,7 @@ TEST_F(AffectedByFocusTest, InvalidationSetFocusUpdate) {
unsigned start_count = GetDocument().GetStyleEngine().StyleForElementCount();
GetDocument().GetElementById("d")->focus();
GetDocument().getElementById("d")->focus();
GetDocument().View()->UpdateAllLifecyclePhases();
unsigned element_count =
......@@ -303,7 +303,7 @@ TEST_F(AffectedByFocusTest, NoInvalidationSetFocusUpdate) {
unsigned start_count = GetDocument().GetStyleEngine().StyleForElementCount();
GetDocument().GetElementById("d")->focus();
GetDocument().getElementById("d")->focus();
GetDocument().View()->UpdateAllLifecyclePhases();
unsigned element_count =
......@@ -329,7 +329,7 @@ TEST_F(AffectedByFocusTest, FocusWithinCommonAncestor) {
unsigned start_count = GetDocument().GetStyleEngine().StyleForElementCount();
GetDocument().GetElementById("focusme1")->focus();
GetDocument().getElementById("focusme1")->focus();
GetDocument().View()->UpdateAllLifecyclePhases();
unsigned element_count =
......@@ -339,7 +339,7 @@ TEST_F(AffectedByFocusTest, FocusWithinCommonAncestor) {
start_count += element_count;
GetDocument().GetElementById("focusme2")->focus();
GetDocument().getElementById("focusme2")->focus();
GetDocument().View()->UpdateAllLifecyclePhases();
element_count =
......
......@@ -32,7 +32,7 @@ TEST(DragUpdateTest, AffectedByDragUpdate) {
document.View()->UpdateAllLifecyclePhases();
unsigned start_count = document.GetStyleEngine().StyleForElementCount();
document.GetElementById("div")->SetDragged(true);
document.getElementById("div")->SetDragged(true);
document.View()->UpdateAllLifecyclePhases();
unsigned element_count =
......@@ -61,7 +61,7 @@ TEST(DragUpdateTest, ChildAffectedByDragUpdate) {
document.UpdateStyleAndLayout();
unsigned start_count = document.GetStyleEngine().StyleForElementCount();
document.GetElementById("div")->SetDragged(true);
document.getElementById("div")->SetDragged(true);
document.UpdateStyleAndLayout();
unsigned element_count =
......@@ -91,7 +91,7 @@ TEST(DragUpdateTest, SiblingAffectedByDragUpdate) {
document.UpdateStyleAndLayout();
unsigned start_count = document.GetStyleEngine().StyleForElementCount();
document.GetElementById("div")->SetDragged(true);
document.getElementById("div")->SetDragged(true);
document.UpdateStyleAndLayout();
unsigned element_count =
......
......@@ -56,7 +56,7 @@ HTMLStyleElement* StyleSheetList::GetNamedItem(const AtomicString& name) const {
// and doesn't look for name attribute. But unicity of stylesheet ids is good
// practice anyway ;)
// FIXME: We should figure out if we should change this or fix the spec.
Element* element = tree_scope_->GetElementById(name);
Element* element = tree_scope_->getElementById(name);
return isHTMLStyleElement(element) ? toHTMLStyleElement(element) : nullptr;
}
......
......@@ -56,8 +56,8 @@ TEST_F(ScopedStyleResolverTest, HasSameStylesEmptyEmpty) {
TEST_F(ScopedStyleResolverTest, HasSameStylesNonEmpty) {
GetDocument().body()->setInnerHTML(
"<div id=host1></div><div id=host2></div>");
Element* host1 = GetDocument().GetElementById("host1");
Element* host2 = GetDocument().GetElementById("host2");
Element* host1 = GetDocument().getElementById("host1");
Element* host2 = GetDocument().getElementById("host2");
ASSERT_TRUE(host1);
ASSERT_TRUE(host2);
ShadowRoot& root1 = AttachShadow(*host1);
......@@ -72,8 +72,8 @@ TEST_F(ScopedStyleResolverTest, HasSameStylesNonEmpty) {
TEST_F(ScopedStyleResolverTest, HasSameStylesDifferentSheetCount) {
GetDocument().body()->setInnerHTML(
"<div id=host1></div><div id=host2></div>");
Element* host1 = GetDocument().GetElementById("host1");
Element* host2 = GetDocument().GetElementById("host2");
Element* host1 = GetDocument().getElementById("host1");
Element* host2 = GetDocument().getElementById("host2");
ASSERT_TRUE(host1);
ASSERT_TRUE(host2);
ShadowRoot& root1 = AttachShadow(*host1);
......@@ -89,8 +89,8 @@ TEST_F(ScopedStyleResolverTest, HasSameStylesDifferentSheetCount) {
TEST_F(ScopedStyleResolverTest, HasSameStylesCacheMiss) {
GetDocument().body()->setInnerHTML(
"<div id=host1></div><div id=host2></div>");
Element* host1 = GetDocument().GetElementById("host1");
Element* host2 = GetDocument().GetElementById("host2");
Element* host1 = GetDocument().getElementById("host1");
Element* host2 = GetDocument().getElementById("host2");
ASSERT_TRUE(host1);
ASSERT_TRUE(host2);
ShadowRoot& root1 = AttachShadow(*host1);
......
......@@ -106,8 +106,8 @@ TEST_F(SharedStyleFinderTest, AttributeAffectedByHover) {
AddSelector("[attr]:hover");
FinishAddingSelectors();
Element* a = GetDocument().GetElementById("a");
Element* b = GetDocument().GetElementById("b");
Element* a = GetDocument().getElementById("a");
Element* b = GetDocument().getElementById("b");
ASSERT_TRUE(a);
ASSERT_TRUE(b);
......@@ -125,8 +125,8 @@ TEST_F(SharedStyleFinderTest, AttributeAffectedByHoverNegated) {
AddSelector("[attr]:not(:hover)");
FinishAddingSelectors();
Element* a = GetDocument().GetElementById("a");
Element* b = GetDocument().GetElementById("b");
Element* a = GetDocument().getElementById("a");
Element* b = GetDocument().getElementById("b");
ASSERT_TRUE(a);
ASSERT_TRUE(b);
......@@ -144,8 +144,8 @@ TEST_F(SharedStyleFinderTest, AttributeAffectedByFocus) {
AddSelector("[attr]:focus");
FinishAddingSelectors();
Element* a = GetDocument().GetElementById("a");
Element* b = GetDocument().GetElementById("b");
Element* a = GetDocument().getElementById("a");
Element* b = GetDocument().getElementById("b");
ASSERT_TRUE(a);
ASSERT_TRUE(b);
......@@ -163,8 +163,8 @@ TEST_F(SharedStyleFinderTest, AttributeAffectedByFocusWithin) {
AddSelector("[attr]:focus-within");
FinishAddingSelectors();
Element* a = GetDocument().GetElementById("a");
Element* b = GetDocument().GetElementById("b");
Element* a = GetDocument().getElementById("a");
Element* b = GetDocument().getElementById("b");
ASSERT_TRUE(a);
ASSERT_TRUE(b);
......@@ -182,8 +182,8 @@ TEST_F(SharedStyleFinderTest, AttributeAffectedByActive) {
AddSelector("[attr]:active");
FinishAddingSelectors();
Element* a = GetDocument().GetElementById("a");
Element* b = GetDocument().GetElementById("b");
Element* a = GetDocument().getElementById("a");
Element* b = GetDocument().getElementById("b");
ASSERT_TRUE(a);
ASSERT_TRUE(b);
......@@ -201,8 +201,8 @@ TEST_F(SharedStyleFinderTest, AttributeAffectedByDrag) {
AddSelector("[attr]:-webkit-drag");
FinishAddingSelectors();
Element* a = GetDocument().GetElementById("a");
Element* b = GetDocument().GetElementById("b");
Element* a = GetDocument().getElementById("a");
Element* b = GetDocument().getElementById("b");
ASSERT_TRUE(a);
ASSERT_TRUE(b);
......@@ -216,7 +216,7 @@ TEST_F(SharedStyleFinderTest, AttributeAffectedByDrag) {
TEST_F(SharedStyleFinderTest, SlottedPseudoWithAttribute) {
SetBodyContent("<div id=host><div id=a></div><div id=b attr></div></div>");
Element* host = GetDocument().GetElementById("host");
Element* host = GetDocument().getElementById("host");
ShadowRoot& root = AttachShadow(*host);
root.setInnerHTML("<slot></slot>");
GetDocument().UpdateDistribution();
......@@ -224,8 +224,8 @@ TEST_F(SharedStyleFinderTest, SlottedPseudoWithAttribute) {
AddSelector("::slotted([attr])");
FinishAddingSelectors();
Element* a = GetDocument().GetElementById("a");
Element* b = GetDocument().GetElementById("b");
Element* a = GetDocument().getElementById("a");
Element* b = GetDocument().getElementById("b");
EXPECT_TRUE(a->AssignedSlot());
EXPECT_TRUE(b->AssignedSlot());
......@@ -236,7 +236,7 @@ TEST_F(SharedStyleFinderTest, SlottedPseudoWithAttribute) {
TEST_F(SharedStyleFinderTest, HostWithAttribute) {
SetBodyContent("<div id=host attr></div>");
Element* host = GetDocument().GetElementById("host");
Element* host = GetDocument().getElementById("host");
ShadowRoot& root = AttachShadow(*host);
root.setInnerHTML("<slot></slot>");
GetDocument().UpdateDistribution();
......@@ -249,7 +249,7 @@ TEST_F(SharedStyleFinderTest, HostWithAttribute) {
TEST_F(SharedStyleFinderTest, HostAncestorWithAttribute) {
SetBodyContent("<div id=host attr></div>");
Element* host = GetDocument().GetElementById("host");
Element* host = GetDocument().getElementById("host");
ShadowRoot& root = AttachShadow(*host);
root.setInnerHTML("<div id=inner></div>");
Element* inner = root.getElementById("inner");
......@@ -263,7 +263,7 @@ TEST_F(SharedStyleFinderTest, HostAncestorWithAttribute) {
TEST_F(SharedStyleFinderTest, HostContextAncestorWithAttribute) {
SetBodyContent("<div id=host attr></div>");
Element* host = GetDocument().GetElementById("host");
Element* host = GetDocument().getElementById("host");
ShadowRoot& root = AttachShadow(*host);
root.setInnerHTML("<div id=inner></div>");
Element* inner = root.getElementById("inner");
......@@ -277,7 +277,7 @@ TEST_F(SharedStyleFinderTest, HostContextAncestorWithAttribute) {
TEST_F(SharedStyleFinderTest, HostParentWithAttribute) {
SetBodyContent("<div id=host attr></div>");
Element* host = GetDocument().GetElementById("host");
Element* host = GetDocument().getElementById("host");
ShadowRoot& root = AttachShadow(*host);
root.setInnerHTML("<div id=inner></div>");
Element* inner = root.getElementById("inner");
......@@ -291,7 +291,7 @@ TEST_F(SharedStyleFinderTest, HostParentWithAttribute) {
TEST_F(SharedStyleFinderTest, HostContextParentWithAttribute) {
SetBodyContent("<div id=host attr></div>");
Element* host = GetDocument().GetElementById("host");
Element* host = GetDocument().getElementById("host");
ShadowRoot& root = AttachShadow(*host);
root.setInnerHTML("<div id=inner></div>");
Element* inner = root.getElementById("inner");
......@@ -305,7 +305,7 @@ TEST_F(SharedStyleFinderTest, HostContextParentWithAttribute) {
TEST_F(SharedStyleFinderTest, AncestorWithAttributeInParentScope) {
SetBodyContent("<div id=host attr></div>");
Element* host = GetDocument().GetElementById("host");
Element* host = GetDocument().getElementById("host");
ShadowRoot& root = AttachShadow(*host);
root.setInnerHTML("<div id=inner></div>");
Element* inner = root.getElementById("inner");
......
......@@ -66,9 +66,9 @@ TEST_F(CSSSelectorWatchTest, RecalcOnDocumentChange) {
GetDocument().View()->UpdateAllLifecyclePhases();
Element* x = GetDocument().GetElementById("x");
Element* y = GetDocument().GetElementById("y");
Element* z = GetDocument().GetElementById("z");
Element* x = GetDocument().getElementById("x");
Element* y = GetDocument().getElementById("y");
Element* z = GetDocument().getElementById("z");
ASSERT_TRUE(x);
ASSERT_TRUE(y);
ASSERT_TRUE(z);
......
......@@ -1488,7 +1488,7 @@ Element* ContainerNode::getElementById(const AtomicString& id) const {
if (IsInTreeScope()) {
// Fast path if we are in a tree scope: call getElementById() on tree scope
// and check if the matching element is in our subtree.
Element* element = ContainingTreeScope().GetElementById(id);
Element* element = ContainingTreeScope().getElementById(id);
if (!element)
return nullptr;
if (element->IsDescendantOf(this))
......
......@@ -269,7 +269,7 @@ class CORE_EXPORT Document : public ContainerNode,
using SecurityContext::GetSecurityOrigin;
using SecurityContext::GetContentSecurityPolicy;
using TreeScope::GetElementById;
using TreeScope::getElementById;
bool CanContainRangeEndPoint() const override { return true; }
......
......@@ -479,7 +479,7 @@ TEST_F(DocumentTest, StyleVersion) {
"</style>"
"<div id='x'><span class='c'></span></div>");
Element* element = GetDocument().GetElementById("x");
Element* element = GetDocument().getElementById("x");
EXPECT_TRUE(element);
uint64_t previous_style_version = GetDocument().StyleVersion();
......
......@@ -14,8 +14,8 @@ TEST_F(NodeTest, canStartSelection) {
const char* body_content =
"<a id=one href='http://www.msn.com'>one</a><b id=two>two</b>";
SetBodyContent(body_content);
Node* one = GetDocument().GetElementById("one");
Node* two = GetDocument().GetElementById("two");
Node* one = GetDocument().getElementById("one");
Node* two = GetDocument().getElementById("two");
EXPECT_FALSE(one->CanStartSelection());
EXPECT_FALSE(one->firstChild()->CanStartSelection());
......@@ -29,7 +29,7 @@ TEST_F(NodeTest, canStartSelectionWithShadowDOM) {
"<a href='http://www.msn.com'><content></content></a>";
SetBodyContent(body_content);
SetShadowContent(shadow_content, "host");
Node* one = GetDocument().GetElementById("one");
Node* one = GetDocument().getElementById("one");
EXPECT_FALSE(one->CanStartSelection());
EXPECT_FALSE(one->firstChild()->CanStartSelection());
......@@ -38,7 +38,7 @@ TEST_F(NodeTest, canStartSelectionWithShadowDOM) {
TEST_F(NodeTest, customElementState) {
const char* body_content = "<div id=div></div>";
SetBodyContent(body_content);
Element* div = GetDocument().GetElementById("div");
Element* div = GetDocument().getElementById("div");
EXPECT_EQ(CustomElementState::kUncustomized, div->GetCustomElementState());
EXPECT_TRUE(div->IsDefined());
EXPECT_EQ(Node::kV0NotCustomElement, div->GetV0CustomElementState());
......
......@@ -13,7 +13,7 @@ namespace blink {
class NonElementParentNode {
public:
static Element* getElementById(Document& document, const AtomicString& id) {
return document.GetElementById(id);
return document.getElementById(id);
}
static Element* getElementById(DocumentFragment& fragment,
......
......@@ -44,10 +44,10 @@ TEST_F(NthIndexCacheTest, NthIndex) {
NthIndexCache nth_index_cache(GetDocument());
EXPECT_EQ(
nth_index_cache.NthChildIndex(*GetDocument().GetElementById("nth-child")),
nth_index_cache.NthChildIndex(*GetDocument().getElementById("nth-child")),
12U);
EXPECT_EQ(nth_index_cache.NthLastChildIndex(
*GetDocument().GetElementById("nth-last-child")),
*GetDocument().getElementById("nth-last-child")),
12U);
}
......
......@@ -115,11 +115,11 @@ TEST_F(RangeTest, SplitTextNodeRangeOutsideText) {
"id=\"inner-right\">2</span>3</span>");
Element* outer =
GetDocument().GetElementById(AtomicString::FromUTF8("outer"));
GetDocument().getElementById(AtomicString::FromUTF8("outer"));
Element* inner_left =
GetDocument().GetElementById(AtomicString::FromUTF8("inner-left"));
GetDocument().getElementById(AtomicString::FromUTF8("inner-left"));
Element* inner_right =
GetDocument().GetElementById(AtomicString::FromUTF8("inner-right"));
GetDocument().getElementById(AtomicString::FromUTF8("inner-right"));
Text* old_text = ToText(outer->childNodes()->item(2));
Range* range_outer_outside = Range::Create(GetDocument(), outer, 0, outer, 5);
......@@ -198,8 +198,8 @@ TEST_F(RangeTest, NotMarkedValidByIrrelevantTextInsert) {
"<div><span id=span1>foo</span>bar<span id=span2>baz</span></div>");
Element* div = GetDocument().QuerySelector("div");
Element* span1 = GetDocument().GetElementById("span1");
Element* span2 = GetDocument().GetElementById("span2");
Element* span1 = GetDocument().getElementById("span1");
Element* span2 = GetDocument().getElementById("span2");
Text* text = ToText(div->childNodes()->item(1));
Range* range = Range::Create(GetDocument(), span2, 0, div, 3);
......@@ -220,8 +220,8 @@ TEST_F(RangeTest, NotMarkedValidByIrrelevantTextRemove) {
"<div><span id=span1>foofoo</span>bar<span id=span2>baz</span></div>");
Element* div = GetDocument().QuerySelector("div");
Element* span1 = GetDocument().GetElementById("span1");
Element* span2 = GetDocument().GetElementById("span2");
Element* span1 = GetDocument().getElementById("span1");
Element* span2 = GetDocument().getElementById("span2");
Text* text = ToText(div->childNodes()->item(1));
Range* range = Range::Create(GetDocument(), span2, 0, div, 3);
......@@ -246,8 +246,8 @@ TEST_F(RangeTest, ExpandNotCrash) {
TEST_F(RangeTest, MultipleTextQuads) {
SetBodyContent("<div><p id='one'>one</p><p id='two'>two</p></div>");
Position start(GetDocument().GetElementById("one")->firstChild(), 0);
Position end(GetDocument().GetElementById("two")->firstChild(), 3);
Position start(GetDocument().getElementById("one")->firstChild(), 0);
Position end(GetDocument().getElementById("two")->firstChild(), 3);
Range* range = Range::Create(GetDocument(), start, end);
Vector<FloatQuad> quads;
range->TextQuads(quads);
......
......@@ -411,7 +411,7 @@ void SelectorQuery::ExecuteWithId(
return;
}
Element* element = scope.GetElementById(selector_id_);
Element* element = scope.getElementById(selector_id_);
if (!element)
return;
if (selector_id_is_rightmost_) {
......
......@@ -121,11 +121,11 @@ TEST_F(StaticRangeTest, SplitTextNodeRangeOutsideText) {
"id=\"inner-right\">2</span>3</span>");
Element* outer =
GetDocument().GetElementById(AtomicString::FromUTF8("outer"));
GetDocument().getElementById(AtomicString::FromUTF8("outer"));
Element* inner_left =
GetDocument().GetElementById(AtomicString::FromUTF8("inner-left"));
GetDocument().getElementById(AtomicString::FromUTF8("inner-left"));
Element* inner_right =
GetDocument().GetElementById(AtomicString::FromUTF8("inner-right"));
GetDocument().getElementById(AtomicString::FromUTF8("inner-right"));
Text* old_text = ToText(outer->childNodes()->item(2));
StaticRange* static_range_outer_outside =
......
......@@ -22,7 +22,7 @@ TEST(StyleElementTest, CreateSheetUsesCache) {
"<style id=style>a { top: 0; }</style>");
HTMLStyleElement& style_element =
toHTMLStyleElement(*document.GetElementById("style"));
toHTMLStyleElement(*document.getElementById("style"));
StyleSheetContents* sheet = style_element.sheet()->Contents();
Comment* comment = document.createComment("hello!");
......
......@@ -81,7 +81,7 @@ TEST_F(StyleEngineTest, AnalyzedInject) {
"<style>div { color: red }</style><div id='t1'>Green</div><div></div>");
GetDocument().View()->UpdateAllLifecyclePhases();
Element* t1 = GetDocument().GetElementById("t1");
Element* t1 = GetDocument().getElementById("t1");
ASSERT_TRUE(t1);
ASSERT_TRUE(t1->GetComputedStyle());
EXPECT_EQ(MakeRGB(255, 0, 0),
......@@ -205,7 +205,7 @@ TEST_F(StyleEngineTest, RuleSetInvalidationCustomPseudo) {
TEST_F(StyleEngineTest, RuleSetInvalidationHost) {
GetDocument().body()->setInnerHTML(
"<div id=nohost></div><div id=host></div>");
Element* host = GetDocument().GetElementById("host");
Element* host = GetDocument().getElementById("host");
ASSERT_TRUE(host);
ShadowRootInit init;
......@@ -251,7 +251,7 @@ TEST_F(StyleEngineTest, RuleSetInvalidationSlotted) {
" <span></span>"
"</div>");
Element* host = GetDocument().GetElementById("host");
Element* host = GetDocument().getElementById("host");
ASSERT_TRUE(host);
ShadowRootInit init;
......@@ -283,7 +283,7 @@ TEST_F(StyleEngineTest, RuleSetInvalidationSlotted) {
TEST_F(StyleEngineTest, RuleSetInvalidationHostContext) {
GetDocument().body()->setInnerHTML("<div id=host></div>");
Element* host = GetDocument().GetElementById("host");
Element* host = GetDocument().getElementById("host");
ASSERT_TRUE(host);
ShadowRootInit init;
......@@ -315,7 +315,7 @@ TEST_F(StyleEngineTest, RuleSetInvalidationHostContext) {
TEST_F(StyleEngineTest, RuleSetInvalidationV0BoundaryCrossing) {
GetDocument().body()->setInnerHTML("<div id=host></div>");
Element* host = GetDocument().GetElementById("host");
Element* host = GetDocument().getElementById("host");
ASSERT_TRUE(host);
ShadowRootInit init;
......@@ -346,7 +346,7 @@ TEST_F(StyleEngineTest, HasViewportDependentMediaQueries) {
" div {}"
"</style>");
Element* style_element = GetDocument().GetElementById("sheet");
Element* style_element = GetDocument().getElementById("sheet");
for (unsigned i = 0; i < 10; i++) {
GetDocument().body()->RemoveChild(style_element);
......@@ -371,7 +371,7 @@ TEST_F(StyleEngineTest, StyleMediaAttributeStyleChange) {
"<div id='t1'>Green</div><div></div>");
GetDocument().View()->UpdateAllLifecyclePhases();
Element* t1 = GetDocument().GetElementById("t1");
Element* t1 = GetDocument().getElementById("t1");
ASSERT_TRUE(t1);
ASSERT_TRUE(t1->GetComputedStyle());
EXPECT_EQ(MakeRGB(0, 0, 0),
......@@ -379,7 +379,7 @@ TEST_F(StyleEngineTest, StyleMediaAttributeStyleChange) {
unsigned before_count = GetStyleEngine().StyleForElementCount();
Element* s1 = GetDocument().GetElementById("s1");
Element* s1 = GetDocument().getElementById("s1");
s1->setAttribute(blink::HTMLNames::mediaAttr, "(max-width: 2000px)");
GetDocument().View()->UpdateAllLifecyclePhases();
......@@ -397,7 +397,7 @@ TEST_F(StyleEngineTest, StyleMediaAttributeNoStyleChange) {
"<div id='t1'>Green</div><div></div>");
GetDocument().View()->UpdateAllLifecyclePhases();
Element* t1 = GetDocument().GetElementById("t1");
Element* t1 = GetDocument().getElementById("t1");
ASSERT_TRUE(t1);
ASSERT_TRUE(t1->GetComputedStyle());
EXPECT_EQ(MakeRGB(0, 128, 0),
......@@ -405,7 +405,7 @@ TEST_F(StyleEngineTest, StyleMediaAttributeNoStyleChange) {
unsigned before_count = GetStyleEngine().StyleForElementCount();
Element* s1 = GetDocument().GetElementById("s1");
Element* s1 = GetDocument().getElementById("s1");
s1->setAttribute(blink::HTMLNames::mediaAttr, "(max-width: 2000px)");
GetDocument().View()->UpdateAllLifecyclePhases();
......@@ -428,7 +428,7 @@ TEST_F(StyleEngineTest, ModifyStyleRuleMatchedPropertiesCache) {
"<div id='t1'>Green</div>");
GetDocument().View()->UpdateAllLifecyclePhases();
Element* t1 = GetDocument().GetElementById("t1");
Element* t1 = GetDocument().getElementById("t1");
ASSERT_TRUE(t1);
ASSERT_TRUE(t1->GetComputedStyle());
EXPECT_EQ(MakeRGB(0, 0, 255),
......@@ -470,8 +470,8 @@ TEST_F(StyleEngineTest, ScheduleInvalidationAfterSubtreeRecalc) {
"<div id='t2'></div>");
GetDocument().View()->UpdateAllLifecyclePhases();
Element* t1 = GetDocument().GetElementById("t1");
Element* t2 = GetDocument().GetElementById("t2");
Element* t1 = GetDocument().getElementById("t1");
Element* t2 = GetDocument().getElementById("t2");
ASSERT_TRUE(t1);
ASSERT_TRUE(t2);
......@@ -497,7 +497,7 @@ TEST_F(StyleEngineTest, ScheduleInvalidationAfterSubtreeRecalc) {
EXPECT_FALSE(GetDocument().ChildNeedsStyleInvalidation());
GetDocument().View()->UpdateAllLifecyclePhases();
HTMLStyleElement* s2 = toHTMLStyleElement(GetDocument().GetElementById("s2"));
HTMLStyleElement* s2 = toHTMLStyleElement(GetDocument().getElementById("s2"));
ASSERT_TRUE(s2);
s2->setDisabled(true);
GetStyleEngine().UpdateActiveStyle();
......@@ -512,7 +512,7 @@ TEST_F(StyleEngineTest, ScheduleInvalidationAfterSubtreeRecalc) {
EXPECT_FALSE(GetDocument().NeedsStyleInvalidation());
GetDocument().View()->UpdateAllLifecyclePhases();
HTMLStyleElement* s1 = toHTMLStyleElement(GetDocument().GetElementById("s1"));
HTMLStyleElement* s1 = toHTMLStyleElement(GetDocument().getElementById("s1"));
ASSERT_TRUE(s1);
s1->setDisabled(true);
GetStyleEngine().UpdateActiveStyle();
......@@ -533,7 +533,7 @@ TEST_F(StyleEngineTest, ScheduleInvalidationAfterSubtreeRecalc) {
TEST_F(StyleEngineTest, NoScheduledRuleSetInvalidationsOnNewShadow) {
GetDocument().body()->setInnerHTML("<div id='host'></div>");
Element* host = GetDocument().GetElementById("host");
Element* host = GetDocument().getElementById("host");
ASSERT_TRUE(host);
GetDocument().View()->UpdateAllLifecyclePhases();
......
......@@ -19,7 +19,7 @@ TEST_F(TextTest, SetDataToChangeFirstLetterTextNode) {
"<style>pre::first-letter {color:red;}</style><pre "
"id=sample>a<span>b</span></pre>");
Node* sample = GetDocument().GetElementById("sample");
Node* sample = GetDocument().getElementById("sample");
Text* text = ToText(sample->firstChild());
text->setData(" ");
UpdateAllLifecyclePhases();
......
......@@ -118,7 +118,7 @@ void TreeScope::ClearScopedStyleResolver() {
scoped_style_resolver_.Clear();
}
Element* TreeScope::GetElementById(const AtomicString& element_id) const {
Element* TreeScope::getElementById(const AtomicString& element_id) const {
if (element_id.IsEmpty())
return nullptr;
if (!elements_by_id_)
......@@ -327,7 +327,7 @@ DOMSelection* TreeScope::GetSelection() const {
Element* TreeScope::FindAnchor(const String& name) {
if (name.IsEmpty())
return nullptr;
if (Element* element = GetElementById(AtomicString(name)))