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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLElement.cpp

Issue 2825343003: Clean compositing inputs for location APIs for sticky-affected elements. (Closed)
Patch Set: Rebase Created 3 years, 7 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 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 * Copyright (C) 2004-2008, 2013, 2014 Apple Inc. All rights reserved. 4 * Copyright (C) 2004-2008, 2013, 2014 Apple Inc. All rights reserved.
5 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. 5 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved.
6 * (http://www.torchmobile.com/) 6 * (http://www.torchmobile.com/)
7 * Copyright (C) 2011 Motorola Mobility. All rights reserved. 7 * Copyright (C) 2011 Motorola Mobility. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 1123 matching lines...) Expand 10 before | Expand all | Expand 10 after
1134 event->SetDefaultHandled(); 1134 event->SetDefaultHandled();
1135 } 1135 }
1136 } 1136 }
1137 1137
1138 const AtomicString& HTMLElement::EventParameterName() { 1138 const AtomicString& HTMLElement::EventParameterName() {
1139 DEFINE_STATIC_LOCAL(const AtomicString, event_string, ("event")); 1139 DEFINE_STATIC_LOCAL(const AtomicString, event_string, ("event"));
1140 return event_string; 1140 return event_string;
1141 } 1141 }
1142 1142
1143 int HTMLElement::offsetLeftForBinding() { 1143 int HTMLElement::offsetLeftForBinding() {
1144 GetDocument().EnsurePaintLocationDataValidForNode(this);
1144 Element* offset_parent = unclosedOffsetParent(); 1145 Element* offset_parent = unclosedOffsetParent();
1145 if (LayoutBoxModelObject* layout_object = GetLayoutBoxModelObject()) 1146 if (LayoutBoxModelObject* layout_object = GetLayoutBoxModelObject())
1146 return AdjustLayoutUnitForAbsoluteZoom( 1147 return AdjustLayoutUnitForAbsoluteZoom(
1147 LayoutUnit(layout_object->PixelSnappedOffsetLeft(offset_parent)), 1148 LayoutUnit(layout_object->PixelSnappedOffsetLeft(offset_parent)),
1148 layout_object->StyleRef()) 1149 layout_object->StyleRef())
1149 .Round(); 1150 .Round();
1150 return 0; 1151 return 0;
1151 } 1152 }
1152 1153
1153 int HTMLElement::offsetTopForBinding() { 1154 int HTMLElement::offsetTopForBinding() {
1155 GetDocument().EnsurePaintLocationDataValidForNode(this);
1154 Element* offset_parent = unclosedOffsetParent(); 1156 Element* offset_parent = unclosedOffsetParent();
1155 if (LayoutBoxModelObject* layout_object = GetLayoutBoxModelObject()) 1157 if (LayoutBoxModelObject* layout_object = GetLayoutBoxModelObject())
1156 return AdjustLayoutUnitForAbsoluteZoom( 1158 return AdjustLayoutUnitForAbsoluteZoom(
1157 LayoutUnit(layout_object->PixelSnappedOffsetTop(offset_parent)), 1159 LayoutUnit(layout_object->PixelSnappedOffsetTop(offset_parent)),
1158 layout_object->StyleRef()) 1160 layout_object->StyleRef())
1159 .Round(); 1161 .Round();
1160 return 0; 1162 return 0;
1161 } 1163 }
1162 1164
1163 int HTMLElement::offsetWidthForBinding() { 1165 int HTMLElement::offsetWidthForBinding() {
1166 GetDocument().EnsurePaintLocationDataValidForNode(this);
1164 Element* offset_parent = unclosedOffsetParent(); 1167 Element* offset_parent = unclosedOffsetParent();
1165 if (LayoutBoxModelObject* layout_object = GetLayoutBoxModelObject()) 1168 if (LayoutBoxModelObject* layout_object = GetLayoutBoxModelObject())
1166 return AdjustLayoutUnitForAbsoluteZoom( 1169 return AdjustLayoutUnitForAbsoluteZoom(
1167 LayoutUnit( 1170 LayoutUnit(
1168 layout_object->PixelSnappedOffsetWidth(offset_parent)), 1171 layout_object->PixelSnappedOffsetWidth(offset_parent)),
1169 layout_object->StyleRef()) 1172 layout_object->StyleRef())
1170 .Round(); 1173 .Round();
1171 return 0; 1174 return 0;
1172 } 1175 }
1173 1176
1174 DISABLE_CFI_PERF 1177 DISABLE_CFI_PERF
1175 int HTMLElement::offsetHeightForBinding() { 1178 int HTMLElement::offsetHeightForBinding() {
1179 GetDocument().EnsurePaintLocationDataValidForNode(this);
1176 Element* offset_parent = unclosedOffsetParent(); 1180 Element* offset_parent = unclosedOffsetParent();
1177 if (LayoutBoxModelObject* layout_object = GetLayoutBoxModelObject()) 1181 if (LayoutBoxModelObject* layout_object = GetLayoutBoxModelObject())
1178 return AdjustLayoutUnitForAbsoluteZoom( 1182 return AdjustLayoutUnitForAbsoluteZoom(
1179 LayoutUnit( 1183 LayoutUnit(
1180 layout_object->PixelSnappedOffsetHeight(offset_parent)), 1184 layout_object->PixelSnappedOffsetHeight(offset_parent)),
1181 layout_object->StyleRef()) 1185 layout_object->StyleRef())
1182 .Round(); 1186 .Round();
1183 return 0; 1187 return 0;
1184 } 1188 }
1185 1189
(...skipping 11 matching lines...) Expand all
1197 1201
1198 #ifndef NDEBUG 1202 #ifndef NDEBUG
1199 1203
1200 // For use in the debugger 1204 // For use in the debugger
1201 void dumpInnerHTML(blink::HTMLElement*); 1205 void dumpInnerHTML(blink::HTMLElement*);
1202 1206
1203 void dumpInnerHTML(blink::HTMLElement* element) { 1207 void dumpInnerHTML(blink::HTMLElement* element) {
1204 printf("%s\n", element->innerHTML().Ascii().data()); 1208 printf("%s\n", element->innerHTML().Ascii().data());
1205 } 1209 }
1206 #endif 1210 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/ElementTest.cpp ('k') | third_party/WebKit/Source/core/style/ComputedStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698