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

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: Add test for sticky subtrees 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 EnsureLifecycleValidForLocationAPIs();
fs 2017/04/29 09:59:06 I think you need this in offsetWidth/Height too (b
smcgruer 2017/05/01 20:15:15 Again done, again I'm not sure how to best test th
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 EnsureLifecycleValidForLocationAPIs();
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() {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
1197 1199
1198 #ifndef NDEBUG 1200 #ifndef NDEBUG
1199 1201
1200 // For use in the debugger 1202 // For use in the debugger
1201 void dumpInnerHTML(blink::HTMLElement*); 1203 void dumpInnerHTML(blink::HTMLElement*);
1202 1204
1203 void dumpInnerHTML(blink::HTMLElement* element) { 1205 void dumpInnerHTML(blink::HTMLElement* element) {
1204 printf("%s\n", element->innerHTML().Ascii().data()); 1206 printf("%s\n", element->innerHTML().Ascii().data());
1205 } 1207 }
1206 #endif 1208 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698