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 * (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.
All rights reserved. | 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc.
All rights reserved. |
8 * (C) 2007 Eric Seidel (eric@webkit.org) | 8 * (C) 2007 Eric Seidel (eric@webkit.org) |
9 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 #include "platform/RuntimeEnabledFeatures.h" | 132 #include "platform/RuntimeEnabledFeatures.h" |
133 #include "platform/UserGestureIndicator.h" | 133 #include "platform/UserGestureIndicator.h" |
134 #include "platform/graphics/CompositorMutableProperties.h" | 134 #include "platform/graphics/CompositorMutableProperties.h" |
135 #include "platform/graphics/CompositorMutation.h" | 135 #include "platform/graphics/CompositorMutation.h" |
136 #include "platform/scroll/ScrollableArea.h" | 136 #include "platform/scroll/ScrollableArea.h" |
137 #include "wtf/BitVector.h" | 137 #include "wtf/BitVector.h" |
138 #include "wtf/HashFunctions.h" | 138 #include "wtf/HashFunctions.h" |
139 #include "wtf/text/CString.h" | 139 #include "wtf/text/CString.h" |
140 #include "wtf/text/StringBuilder.h" | 140 #include "wtf/text/StringBuilder.h" |
141 #include "wtf/text/TextPosition.h" | 141 #include "wtf/text/TextPosition.h" |
| 142 #include <memory> |
142 | 143 |
143 namespace blink { | 144 namespace blink { |
144 | 145 |
145 namespace { | 146 namespace { |
146 | 147 |
147 // We need to retain the scroll customization callbacks until the element | 148 // We need to retain the scroll customization callbacks until the element |
148 // they're associated with is destroyed. It would be simplest if the callbacks | 149 // they're associated with is destroyed. It would be simplest if the callbacks |
149 // could be stored in ElementRareData, but we can't afford the space | 150 // could be stored in ElementRareData, but we can't afford the space |
150 // increase. Instead, keep the scroll customization callbacks here. The other | 151 // increase. Instead, keep the scroll customization callbacks here. The other |
151 // option would be to store these callbacks on the FrameHost or document, but | 152 // option would be to store these callbacks on the FrameHost or document, but |
(...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1043 result.unite(quads[i].boundingBox()); | 1044 result.unite(quads[i].boundingBox()); |
1044 | 1045 |
1045 DCHECK(elementLayoutObject); | 1046 DCHECK(elementLayoutObject); |
1046 document().adjustFloatRectForScrollAndAbsoluteZoom(result, *elementLayoutObj
ect); | 1047 document().adjustFloatRectForScrollAndAbsoluteZoom(result, *elementLayoutObj
ect); |
1047 return ClientRect::create(result); | 1048 return ClientRect::create(result); |
1048 } | 1049 } |
1049 | 1050 |
1050 const AtomicString& Element::computedRole() | 1051 const AtomicString& Element::computedRole() |
1051 { | 1052 { |
1052 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this); | 1053 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this); |
1053 OwnPtr<ScopedAXObjectCache> cache = ScopedAXObjectCache::create(document()); | 1054 std::unique_ptr<ScopedAXObjectCache> cache = ScopedAXObjectCache::create(doc
ument()); |
1054 return cache->get()->computedRoleForNode(this); | 1055 return cache->get()->computedRoleForNode(this); |
1055 } | 1056 } |
1056 | 1057 |
1057 String Element::computedName() | 1058 String Element::computedName() |
1058 { | 1059 { |
1059 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this); | 1060 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this); |
1060 OwnPtr<ScopedAXObjectCache> cache = ScopedAXObjectCache::create(document()); | 1061 std::unique_ptr<ScopedAXObjectCache> cache = ScopedAXObjectCache::create(doc
ument()); |
1061 return cache->get()->computedNameForNode(this); | 1062 return cache->get()->computedNameForNode(this); |
1062 } | 1063 } |
1063 | 1064 |
1064 const AtomicString& Element::getAttribute(const AtomicString& localName) const | 1065 const AtomicString& Element::getAttribute(const AtomicString& localName) const |
1065 { | 1066 { |
1066 if (!elementData()) | 1067 if (!elementData()) |
1067 return nullAtom; | 1068 return nullAtom; |
1068 synchronizeAttribute(localName); | 1069 synchronizeAttribute(localName); |
1069 if (const Attribute* attribute = elementData()->attributes().find(localName,
shouldIgnoreAttributeCase())) | 1070 if (const Attribute* attribute = elementData()->attributes().find(localName,
shouldIgnoreAttributeCase())) |
1070 return attribute->value(); | 1071 return attribute->value(); |
(...skipping 2650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3721 | 3722 |
3722 DEFINE_TRACE_WRAPPERS(Element) | 3723 DEFINE_TRACE_WRAPPERS(Element) |
3723 { | 3724 { |
3724 if (hasRareData()) { | 3725 if (hasRareData()) { |
3725 visitor->traceWrappers(elementRareData()); | 3726 visitor->traceWrappers(elementRareData()); |
3726 } | 3727 } |
3727 ContainerNode::traceWrappers(visitor); | 3728 ContainerNode::traceWrappers(visitor); |
3728 } | 3729 } |
3729 | 3730 |
3730 } // namespace blink | 3731 } // namespace blink |
OLD | NEW |