| OLD | NEW |
| 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 1036 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1047 } | 1047 } |
| 1048 | 1048 |
| 1049 const AtomicString& HTMLElement::eventParameterName() | 1049 const AtomicString& HTMLElement::eventParameterName() |
| 1050 { | 1050 { |
| 1051 DEFINE_STATIC_LOCAL(const AtomicString, eventString, ("event")); | 1051 DEFINE_STATIC_LOCAL(const AtomicString, eventString, ("event")); |
| 1052 return eventString; | 1052 return eventString; |
| 1053 } | 1053 } |
| 1054 | 1054 |
| 1055 int HTMLElement::offsetLeftForBinding() | 1055 int HTMLElement::offsetLeftForBinding() |
| 1056 { | 1056 { |
| 1057 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this); | 1057 Element* offsetParent = unclosedOffsetParent(); |
| 1058 if (LayoutBoxModelObject* layoutObject = layoutBoxModelObject()) | 1058 if (LayoutBoxModelObject* layoutObject = layoutBoxModelObject()) |
| 1059 return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSna
ppedOffsetLeft(unclosedOffsetParent())), layoutObject->styleRef()).round(); | 1059 return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSna
ppedOffsetLeft(offsetParent)), layoutObject->styleRef()).round(); |
| 1060 return 0; | 1060 return 0; |
| 1061 } | 1061 } |
| 1062 | 1062 |
| 1063 int HTMLElement::offsetTopForBinding() | 1063 int HTMLElement::offsetTopForBinding() |
| 1064 { | 1064 { |
| 1065 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this); | 1065 Element* offsetParent = unclosedOffsetParent(); |
| 1066 if (LayoutBoxModelObject* layoutObject = layoutBoxModelObject()) | 1066 if (LayoutBoxModelObject* layoutObject = layoutBoxModelObject()) |
| 1067 return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSna
ppedOffsetTop(unclosedOffsetParent())), layoutObject->styleRef()).round(); | 1067 return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSna
ppedOffsetTop(offsetParent)), layoutObject->styleRef()).round(); |
| 1068 return 0; | 1068 return 0; |
| 1069 } | 1069 } |
| 1070 | 1070 |
| 1071 int HTMLElement::offsetWidthForBinding() | 1071 int HTMLElement::offsetWidthForBinding() |
| 1072 { | 1072 { |
| 1073 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this); | 1073 Element* offsetParent = unclosedOffsetParent(); |
| 1074 if (LayoutBoxModelObject* layoutObject = layoutBoxModelObject()) | 1074 if (LayoutBoxModelObject* layoutObject = layoutBoxModelObject()) |
| 1075 return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSna
ppedOffsetWidth(unclosedOffsetParent())), layoutObject->styleRef()).round(); | 1075 return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSna
ppedOffsetWidth(offsetParent)), layoutObject->styleRef()).round(); |
| 1076 return 0; | 1076 return 0; |
| 1077 } | 1077 } |
| 1078 | 1078 |
| 1079 int HTMLElement::offsetHeightForBinding() | 1079 int HTMLElement::offsetHeightForBinding() |
| 1080 { | 1080 { |
| 1081 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this); | 1081 Element* offsetParent = unclosedOffsetParent(); |
| 1082 if (LayoutBoxModelObject* layoutObject = layoutBoxModelObject()) | 1082 if (LayoutBoxModelObject* layoutObject = layoutBoxModelObject()) |
| 1083 return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSna
ppedOffsetHeight(unclosedOffsetParent())), layoutObject->styleRef()).round(); | 1083 return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSna
ppedOffsetHeight(offsetParent)), layoutObject->styleRef()).round(); |
| 1084 return 0; | 1084 return 0; |
| 1085 } | 1085 } |
| 1086 | 1086 |
| 1087 Element* HTMLElement::unclosedOffsetParent() | 1087 Element* HTMLElement::unclosedOffsetParent() |
| 1088 { | 1088 { |
| 1089 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this); | 1089 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this); |
| 1090 | 1090 |
| 1091 LayoutObject* layoutObject = this->layoutObject(); | 1091 LayoutObject* layoutObject = this->layoutObject(); |
| 1092 if (!layoutObject) | 1092 if (!layoutObject) |
| 1093 return nullptr; | 1093 return nullptr; |
| 1094 | 1094 |
| 1095 return layoutObject->offsetParent(this); | 1095 return layoutObject->offsetParent(this); |
| 1096 } | 1096 } |
| 1097 | 1097 |
| 1098 } // namespace blink | 1098 } // namespace blink |
| 1099 | 1099 |
| 1100 #ifndef NDEBUG | 1100 #ifndef NDEBUG |
| 1101 | 1101 |
| 1102 // For use in the debugger | 1102 // For use in the debugger |
| 1103 void dumpInnerHTML(blink::HTMLElement*); | 1103 void dumpInnerHTML(blink::HTMLElement*); |
| 1104 | 1104 |
| 1105 void dumpInnerHTML(blink::HTMLElement* element) | 1105 void dumpInnerHTML(blink::HTMLElement* element) |
| 1106 { | 1106 { |
| 1107 printf("%s\n", element->innerHTML().ascii().data()); | 1107 printf("%s\n", element->innerHTML().ascii().data()); |
| 1108 } | 1108 } |
| 1109 #endif | 1109 #endif |
| OLD | NEW |