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

Side by Side Diff: third_party/WebKit/Source/core/dom/Element.cpp

Issue 2574773002: Migrate WTF::Vector::append() to ::push_back() [part 4 of N] (Closed)
Patch Set: rebase Created 4 years 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Peter Kelly (pmk@post.com) 4 * (C) 2001 Peter Kelly (pmk@post.com)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * (C) 2007 David Smith (catfish.man@gmail.com) 6 * (C) 2007 David Smith (catfish.man@gmail.com)
7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc.
8 * All rights reserved. 8 * All rights reserved.
9 * (C) 2007 Eric Seidel (eric@webkit.org) 9 * (C) 2007 Eric Seidel (eric@webkit.org)
10 * 10 *
(...skipping 1044 matching lines...) Expand 10 before | Expand all | Expand 10 after
1055 document().updateStyleAndLayoutIgnorePendingStylesheets(); 1055 document().updateStyleAndLayoutIgnorePendingStylesheets();
1056 1056
1057 FrameView* view = document().view(); 1057 FrameView* view = document().view();
1058 if (!view) 1058 if (!view)
1059 return IntRect(); 1059 return IntRect();
1060 1060
1061 Vector<FloatQuad> quads; 1061 Vector<FloatQuad> quads;
1062 if (isSVGElement() && layoutObject()) { 1062 if (isSVGElement() && layoutObject()) {
1063 // Get the bounding rectangle from the SVG model. 1063 // Get the bounding rectangle from the SVG model.
1064 if (toSVGElement(this)->isSVGGraphicsElement()) 1064 if (toSVGElement(this)->isSVGGraphicsElement())
1065 quads.append(layoutObject()->localToAbsoluteQuad( 1065 quads.push_back(layoutObject()->localToAbsoluteQuad(
1066 layoutObject()->objectBoundingBox())); 1066 layoutObject()->objectBoundingBox()));
1067 } else { 1067 } else {
1068 // Get the bounding rectangle from the box model. 1068 // Get the bounding rectangle from the box model.
1069 if (layoutBoxModelObject()) 1069 if (layoutBoxModelObject())
1070 layoutBoxModelObject()->absoluteQuads(quads); 1070 layoutBoxModelObject()->absoluteQuads(quads);
1071 } 1071 }
1072 1072
1073 if (quads.isEmpty()) 1073 if (quads.isEmpty())
1074 return IntRect(); 1074 return IntRect();
1075 1075
(...skipping 21 matching lines...) Expand all
1097 void Element::clientQuads(Vector<FloatQuad>& quads) { 1097 void Element::clientQuads(Vector<FloatQuad>& quads) {
1098 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this); 1098 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this);
1099 1099
1100 LayoutObject* elementLayoutObject = layoutObject(); 1100 LayoutObject* elementLayoutObject = layoutObject();
1101 if (!elementLayoutObject) 1101 if (!elementLayoutObject)
1102 return; 1102 return;
1103 1103
1104 if (isSVGElement() && !elementLayoutObject->isSVGRoot()) { 1104 if (isSVGElement() && !elementLayoutObject->isSVGRoot()) {
1105 // Get the bounding rectangle from the SVG model. 1105 // Get the bounding rectangle from the SVG model.
1106 if (toSVGElement(this)->isSVGGraphicsElement()) 1106 if (toSVGElement(this)->isSVGGraphicsElement())
1107 quads.append(elementLayoutObject->localToAbsoluteQuad( 1107 quads.push_back(elementLayoutObject->localToAbsoluteQuad(
1108 elementLayoutObject->objectBoundingBox())); 1108 elementLayoutObject->objectBoundingBox()));
1109 return; 1109 return;
1110 } 1110 }
1111 1111
1112 // FIXME: Handle table/inline-table with a caption. 1112 // FIXME: Handle table/inline-table with a caption.
1113 if (elementLayoutObject->isBoxModelObject() || elementLayoutObject->isBR()) 1113 if (elementLayoutObject->isBoxModelObject() || elementLayoutObject->isBR())
1114 elementLayoutObject->absoluteQuads(quads); 1114 elementLayoutObject->absoluteQuads(quads);
1115 } 1115 }
1116 1116
1117 ClientRectList* Element::getClientRects() { 1117 ClientRectList* Element::getClientRects() {
(...skipping 2898 matching lines...) Expand 10 before | Expand all | Expand 10 after
4016 void Element::logAddElementIfIsolatedWorldAndInDocument( 4016 void Element::logAddElementIfIsolatedWorldAndInDocument(
4017 const char element[], 4017 const char element[],
4018 const QualifiedName& attr1) { 4018 const QualifiedName& attr1) {
4019 if (!isConnected()) 4019 if (!isConnected())
4020 return; 4020 return;
4021 V8DOMActivityLogger* activityLogger = 4021 V8DOMActivityLogger* activityLogger =
4022 V8DOMActivityLogger::currentActivityLoggerIfIsolatedWorld(); 4022 V8DOMActivityLogger::currentActivityLoggerIfIsolatedWorld();
4023 if (!activityLogger) 4023 if (!activityLogger)
4024 return; 4024 return;
4025 Vector<String, 2> argv; 4025 Vector<String, 2> argv;
4026 argv.append(element); 4026 argv.push_back(element);
4027 argv.append(fastGetAttribute(attr1)); 4027 argv.push_back(fastGetAttribute(attr1));
4028 activityLogger->logEvent("blinkAddElement", argv.size(), argv.data()); 4028 activityLogger->logEvent("blinkAddElement", argv.size(), argv.data());
4029 } 4029 }
4030 4030
4031 void Element::logAddElementIfIsolatedWorldAndInDocument( 4031 void Element::logAddElementIfIsolatedWorldAndInDocument(
4032 const char element[], 4032 const char element[],
4033 const QualifiedName& attr1, 4033 const QualifiedName& attr1,
4034 const QualifiedName& attr2) { 4034 const QualifiedName& attr2) {
4035 if (!isConnected()) 4035 if (!isConnected())
4036 return; 4036 return;
4037 V8DOMActivityLogger* activityLogger = 4037 V8DOMActivityLogger* activityLogger =
4038 V8DOMActivityLogger::currentActivityLoggerIfIsolatedWorld(); 4038 V8DOMActivityLogger::currentActivityLoggerIfIsolatedWorld();
4039 if (!activityLogger) 4039 if (!activityLogger)
4040 return; 4040 return;
4041 Vector<String, 3> argv; 4041 Vector<String, 3> argv;
4042 argv.append(element); 4042 argv.push_back(element);
4043 argv.append(fastGetAttribute(attr1)); 4043 argv.push_back(fastGetAttribute(attr1));
4044 argv.append(fastGetAttribute(attr2)); 4044 argv.push_back(fastGetAttribute(attr2));
4045 activityLogger->logEvent("blinkAddElement", argv.size(), argv.data()); 4045 activityLogger->logEvent("blinkAddElement", argv.size(), argv.data());
4046 } 4046 }
4047 4047
4048 void Element::logAddElementIfIsolatedWorldAndInDocument( 4048 void Element::logAddElementIfIsolatedWorldAndInDocument(
4049 const char element[], 4049 const char element[],
4050 const QualifiedName& attr1, 4050 const QualifiedName& attr1,
4051 const QualifiedName& attr2, 4051 const QualifiedName& attr2,
4052 const QualifiedName& attr3) { 4052 const QualifiedName& attr3) {
4053 if (!isConnected()) 4053 if (!isConnected())
4054 return; 4054 return;
4055 V8DOMActivityLogger* activityLogger = 4055 V8DOMActivityLogger* activityLogger =
4056 V8DOMActivityLogger::currentActivityLoggerIfIsolatedWorld(); 4056 V8DOMActivityLogger::currentActivityLoggerIfIsolatedWorld();
4057 if (!activityLogger) 4057 if (!activityLogger)
4058 return; 4058 return;
4059 Vector<String, 4> argv; 4059 Vector<String, 4> argv;
4060 argv.append(element); 4060 argv.push_back(element);
4061 argv.append(fastGetAttribute(attr1)); 4061 argv.push_back(fastGetAttribute(attr1));
4062 argv.append(fastGetAttribute(attr2)); 4062 argv.push_back(fastGetAttribute(attr2));
4063 argv.append(fastGetAttribute(attr3)); 4063 argv.push_back(fastGetAttribute(attr3));
4064 activityLogger->logEvent("blinkAddElement", argv.size(), argv.data()); 4064 activityLogger->logEvent("blinkAddElement", argv.size(), argv.data());
4065 } 4065 }
4066 4066
4067 void Element::logUpdateAttributeIfIsolatedWorldAndInDocument( 4067 void Element::logUpdateAttributeIfIsolatedWorldAndInDocument(
4068 const char element[], 4068 const char element[],
4069 const QualifiedName& attributeName, 4069 const QualifiedName& attributeName,
4070 const AtomicString& oldValue, 4070 const AtomicString& oldValue,
4071 const AtomicString& newValue) { 4071 const AtomicString& newValue) {
4072 if (!isConnected()) 4072 if (!isConnected())
4073 return; 4073 return;
4074 V8DOMActivityLogger* activityLogger = 4074 V8DOMActivityLogger* activityLogger =
4075 V8DOMActivityLogger::currentActivityLoggerIfIsolatedWorld(); 4075 V8DOMActivityLogger::currentActivityLoggerIfIsolatedWorld();
4076 if (!activityLogger) 4076 if (!activityLogger)
4077 return; 4077 return;
4078 Vector<String, 4> argv; 4078 Vector<String, 4> argv;
4079 argv.append(element); 4079 argv.push_back(element);
4080 argv.append(attributeName.toString()); 4080 argv.push_back(attributeName.toString());
4081 argv.append(oldValue); 4081 argv.push_back(oldValue);
4082 argv.append(newValue); 4082 argv.push_back(newValue);
4083 activityLogger->logEvent("blinkSetAttribute", argv.size(), argv.data()); 4083 activityLogger->logEvent("blinkSetAttribute", argv.size(), argv.data());
4084 } 4084 }
4085 4085
4086 DEFINE_TRACE(Element) { 4086 DEFINE_TRACE(Element) {
4087 if (hasRareData()) 4087 if (hasRareData())
4088 visitor->trace(elementRareData()); 4088 visitor->trace(elementRareData());
4089 visitor->trace(m_elementData); 4089 visitor->trace(m_elementData);
4090 ContainerNode::trace(visitor); 4090 ContainerNode::trace(visitor);
4091 } 4091 }
4092 4092
4093 DEFINE_TRACE_WRAPPERS(Element) { 4093 DEFINE_TRACE_WRAPPERS(Element) {
4094 if (hasRareData()) { 4094 if (hasRareData()) {
4095 visitor->traceWrappers(elementRareData()); 4095 visitor->traceWrappers(elementRareData());
4096 } 4096 }
4097 ContainerNode::traceWrappers(visitor); 4097 ContainerNode::traceWrappers(visitor);
4098 } 4098 }
4099 4099
4100 } // namespace blink 4100 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/DocumentTest.cpp ('k') | third_party/WebKit/Source/core/dom/ElementRareData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698