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

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

Issue 2197653002: CL for perf try job on android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 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. (http://www.torchmo bile.com/) 5 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
6 * Copyright (C) 2011 Motorola Mobility. All rights reserved. 6 * Copyright (C) 2011 Motorola Mobility. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 #include "core/events/KeyboardEvent.h" 49 #include "core/events/KeyboardEvent.h"
50 #include "core/frame/Settings.h" 50 #include "core/frame/Settings.h"
51 #include "core/frame/UseCounter.h" 51 #include "core/frame/UseCounter.h"
52 #include "core/html/HTMLBRElement.h" 52 #include "core/html/HTMLBRElement.h"
53 #include "core/html/HTMLFormElement.h" 53 #include "core/html/HTMLFormElement.h"
54 #include "core/html/HTMLInputElement.h" 54 #include "core/html/HTMLInputElement.h"
55 #include "core/html/HTMLMenuElement.h" 55 #include "core/html/HTMLMenuElement.h"
56 #include "core/html/HTMLTemplateElement.h" 56 #include "core/html/HTMLTemplateElement.h"
57 #include "core/html/HTMLTextFormControlElement.h" 57 #include "core/html/HTMLTextFormControlElement.h"
58 #include "core/html/parser/HTMLParserIdioms.h" 58 #include "core/html/parser/HTMLParserIdioms.h"
59 #include "core/layout/LayoutBoxModelObject.h"
60 #include "core/layout/LayoutObject.h" 59 #include "core/layout/LayoutObject.h"
61 #include "core/page/SpatialNavigation.h" 60 #include "core/page/SpatialNavigation.h"
62 #include "core/svg/SVGSVGElement.h" 61 #include "core/svg/SVGSVGElement.h"
63 #include "platform/Language.h" 62 #include "platform/Language.h"
64 #include "platform/text/BidiResolver.h" 63 #include "platform/text/BidiResolver.h"
65 #include "platform/text/BidiTextRun.h" 64 #include "platform/text/BidiTextRun.h"
66 #include "platform/text/TextRunIterator.h" 65 #include "platform/text/TextRunIterator.h"
67 #include "wtf/StdLibExtras.h" 66 #include "wtf/StdLibExtras.h"
68 #include "wtf/text/CString.h" 67 #include "wtf/text/CString.h"
69 68
(...skipping 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after
1092 event->setDefaultHandled(); 1091 event->setDefaultHandled();
1093 } 1092 }
1094 } 1093 }
1095 1094
1096 const AtomicString& HTMLElement::eventParameterName() 1095 const AtomicString& HTMLElement::eventParameterName()
1097 { 1096 {
1098 DEFINE_STATIC_LOCAL(const AtomicString, eventString, ("event")); 1097 DEFINE_STATIC_LOCAL(const AtomicString, eventString, ("event"));
1099 return eventString; 1098 return eventString;
1100 } 1099 }
1101 1100
1102 int HTMLElement::offsetLeftForBinding()
1103 {
1104 Element* offsetParent = unclosedOffsetParent();
1105 if (LayoutBoxModelObject* layoutObject = layoutBoxModelObject())
1106 return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSna ppedOffsetLeft(offsetParent)), layoutObject->styleRef()).round();
1107 return 0;
1108 }
1109
1110 int HTMLElement::offsetTopForBinding()
1111 {
1112 Element* offsetParent = unclosedOffsetParent();
1113 if (LayoutBoxModelObject* layoutObject = layoutBoxModelObject())
1114 return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSna ppedOffsetTop(offsetParent)), layoutObject->styleRef()).round();
1115 return 0;
1116 }
1117
1118 int HTMLElement::offsetWidthForBinding()
1119 {
1120 Element* offsetParent = unclosedOffsetParent();
1121 if (LayoutBoxModelObject* layoutObject = layoutBoxModelObject())
1122 return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSna ppedOffsetWidth(offsetParent)), layoutObject->styleRef()).round();
1123 return 0;
1124 }
1125
1126 int HTMLElement::offsetHeightForBinding()
1127 {
1128 Element* offsetParent = unclosedOffsetParent();
1129 if (LayoutBoxModelObject* layoutObject = layoutBoxModelObject())
1130 return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSna ppedOffsetHeight(offsetParent)), layoutObject->styleRef()).round();
1131 return 0;
1132 }
1133
1134 Element* HTMLElement::unclosedOffsetParent()
1135 {
1136 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this);
1137
1138 LayoutObject* layoutObject = this->layoutObject();
1139 if (!layoutObject)
1140 return nullptr;
1141
1142 return layoutObject->offsetParent(this);
1143 }
1144
1145 } // namespace blink 1101 } // namespace blink
1146 1102
1147 #ifndef NDEBUG 1103 #ifndef NDEBUG
1148 1104
1149 // For use in the debugger 1105 // For use in the debugger
1150 void dumpInnerHTML(blink::HTMLElement*); 1106 void dumpInnerHTML(blink::HTMLElement*);
1151 1107
1152 void dumpInnerHTML(blink::HTMLElement* element) 1108 void dumpInnerHTML(blink::HTMLElement* element)
1153 { 1109 {
1154 printf("%s\n", element->innerHTML().ascii().data()); 1110 printf("%s\n", element->innerHTML().ascii().data());
1155 } 1111 }
1156 #endif 1112 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLElement.h ('k') | third_party/WebKit/Source/core/html/HTMLElement.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698