| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde
.org> | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde
.org> |
| 3 * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org> |
| 4 * Copyright (C) 2008 Apple Inc. All rights reserved. | 4 * Copyright (C) 2008 Apple Inc. All rights reserved. |
| 5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> | 5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> |
| 6 * Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> | 6 * Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> |
| 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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 void SVGElement::invalidateRelativeLengthClients(SubtreeLayoutScope* layoutScope
) | 411 void SVGElement::invalidateRelativeLengthClients(SubtreeLayoutScope* layoutScope
) |
| 412 { | 412 { |
| 413 if (!inDocument()) | 413 if (!inDocument()) |
| 414 return; | 414 return; |
| 415 | 415 |
| 416 ASSERT(!m_inRelativeLengthClientsInvalidation); | 416 ASSERT(!m_inRelativeLengthClientsInvalidation); |
| 417 #if ENABLE(ASSERT) | 417 #if ENABLE(ASSERT) |
| 418 TemporaryChange<bool> inRelativeLengthClientsInvalidationChange(m_inRelative
LengthClientsInvalidation, true); | 418 TemporaryChange<bool> inRelativeLengthClientsInvalidationChange(m_inRelative
LengthClientsInvalidation, true); |
| 419 #endif | 419 #endif |
| 420 | 420 |
| 421 LayoutObject* renderer = this->layoutObject(); | 421 LayoutObject* layoutObject = this->layoutObject(); |
| 422 if (renderer && selfHasRelativeLengths()) { | 422 if (layoutObject && selfHasRelativeLengths()) { |
| 423 if (renderer->isSVGResourceContainer()) | 423 if (layoutObject->isSVGResourceContainer()) |
| 424 toLayoutSVGResourceContainer(renderer)->invalidateCacheAndMarkForLay
out(layoutScope); | 424 toLayoutSVGResourceContainer(layoutObject)->invalidateCacheAndMarkFo
rLayout(layoutScope); |
| 425 else | 425 else |
| 426 renderer->setNeedsLayoutAndFullPaintInvalidation(LayoutInvalidationR
eason::Unknown, MarkContainerChain, layoutScope); | 426 layoutObject->setNeedsLayoutAndFullPaintInvalidation(LayoutInvalidat
ionReason::Unknown, MarkContainerChain, layoutScope); |
| 427 } | 427 } |
| 428 | 428 |
| 429 for (SVGElement* element : m_elementsWithRelativeLengths) { | 429 for (SVGElement* element : m_elementsWithRelativeLengths) { |
| 430 if (element != this) | 430 if (element != this) |
| 431 element->invalidateRelativeLengthClients(layoutScope); | 431 element->invalidateRelativeLengthClients(layoutScope); |
| 432 } | 432 } |
| 433 } | 433 } |
| 434 | 434 |
| 435 SVGSVGElement* SVGElement::ownerSVGElement() const | 435 SVGSVGElement* SVGElement::ownerSVGElement() const |
| 436 { | 436 { |
| (...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 906 } | 906 } |
| 907 } | 907 } |
| 908 | 908 |
| 909 PassRefPtr<ComputedStyle> SVGElement::customStyleForLayoutObject() | 909 PassRefPtr<ComputedStyle> SVGElement::customStyleForLayoutObject() |
| 910 { | 910 { |
| 911 if (!correspondingElement()) | 911 if (!correspondingElement()) |
| 912 return document().ensureStyleResolver().styleForElement(this); | 912 return document().ensureStyleResolver().styleForElement(this); |
| 913 | 913 |
| 914 const ComputedStyle* style = nullptr; | 914 const ComputedStyle* style = nullptr; |
| 915 if (Element* parent = parentOrShadowHostElement()) { | 915 if (Element* parent = parentOrShadowHostElement()) { |
| 916 if (LayoutObject* renderer = parent->layoutObject()) | 916 if (LayoutObject* layoutObject = parent->layoutObject()) |
| 917 style = renderer->style(); | 917 style = layoutObject->style(); |
| 918 } | 918 } |
| 919 | 919 |
| 920 return document().ensureStyleResolver().styleForElement(correspondingElement
(), style, DisallowStyleSharing); | 920 return document().ensureStyleResolver().styleForElement(correspondingElement
(), style, DisallowStyleSharing); |
| 921 } | 921 } |
| 922 | 922 |
| 923 MutableStylePropertySet* SVGElement::animatedSMILStyleProperties() const | 923 MutableStylePropertySet* SVGElement::animatedSMILStyleProperties() const |
| 924 { | 924 { |
| 925 if (hasSVGRareData()) | 925 if (hasSVGRareData()) |
| 926 return svgRareData()->animatedSMILStyleProperties(); | 926 return svgRareData()->animatedSMILStyleProperties(); |
| 927 return 0; | 927 return 0; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 938 svgRareData()->setUseOverrideComputedStyle(value); | 938 svgRareData()->setUseOverrideComputedStyle(value); |
| 939 } | 939 } |
| 940 | 940 |
| 941 const ComputedStyle* SVGElement::ensureComputedStyle(PseudoId pseudoElementSpeci
fier) | 941 const ComputedStyle* SVGElement::ensureComputedStyle(PseudoId pseudoElementSpeci
fier) |
| 942 { | 942 { |
| 943 if (!hasSVGRareData() || !svgRareData()->useOverrideComputedStyle()) | 943 if (!hasSVGRareData() || !svgRareData()->useOverrideComputedStyle()) |
| 944 return Element::ensureComputedStyle(pseudoElementSpecifier); | 944 return Element::ensureComputedStyle(pseudoElementSpecifier); |
| 945 | 945 |
| 946 const ComputedStyle* parentStyle = nullptr; | 946 const ComputedStyle* parentStyle = nullptr; |
| 947 if (Element* parent = parentOrShadowHostElement()) { | 947 if (Element* parent = parentOrShadowHostElement()) { |
| 948 if (LayoutObject* renderer = parent->layoutObject()) | 948 if (LayoutObject* layoutObject = parent->layoutObject()) |
| 949 parentStyle = renderer->style(); | 949 parentStyle = layoutObject->style(); |
| 950 } | 950 } |
| 951 | 951 |
| 952 return svgRareData()->overrideComputedStyle(this, parentStyle); | 952 return svgRareData()->overrideComputedStyle(this, parentStyle); |
| 953 } | 953 } |
| 954 | 954 |
| 955 bool SVGElement::hasFocusEventListeners() const | 955 bool SVGElement::hasFocusEventListeners() const |
| 956 { | 956 { |
| 957 return hasEventListeners(EventTypeNames::focusin) || hasEventListeners(Event
TypeNames::focusout) | 957 return hasEventListeners(EventTypeNames::focusin) || hasEventListeners(Event
TypeNames::focusout) |
| 958 || hasEventListeners(EventTypeNames::focus) || hasEventListeners(EventTy
peNames::blur); | 958 || hasEventListeners(EventTypeNames::focus) || hasEventListeners(EventTy
peNames::blur); |
| 959 } | 959 } |
| 960 | 960 |
| 961 void SVGElement::markForLayoutAndParentResourceInvalidation(LayoutObject* render
er) | 961 void SVGElement::markForLayoutAndParentResourceInvalidation(LayoutObject* layout
Object) |
| 962 { | 962 { |
| 963 ASSERT(renderer); | 963 ASSERT(layoutObject); |
| 964 LayoutSVGResourceContainer::markForLayoutAndParentResourceInvalidation(rende
rer, true); | 964 LayoutSVGResourceContainer::markForLayoutAndParentResourceInvalidation(layou
tObject, true); |
| 965 } | 965 } |
| 966 | 966 |
| 967 void SVGElement::invalidateInstances() | 967 void SVGElement::invalidateInstances() |
| 968 { | 968 { |
| 969 if (instanceUpdatesBlocked()) | 969 if (instanceUpdatesBlocked()) |
| 970 return; | 970 return; |
| 971 | 971 |
| 972 const WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement>>& set = instances
ForElement(); | 972 const WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement>>& set = instances
ForElement(); |
| 973 if (set.isEmpty()) | 973 if (set.isEmpty()) |
| 974 return; | 974 return; |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1184 Element::trace(visitor); | 1184 Element::trace(visitor); |
| 1185 } | 1185 } |
| 1186 | 1186 |
| 1187 const AtomicString& SVGElement::eventParameterName() | 1187 const AtomicString& SVGElement::eventParameterName() |
| 1188 { | 1188 { |
| 1189 DEFINE_STATIC_LOCAL(const AtomicString, evtString, ("evt", AtomicString::Con
structFromLiteral)); | 1189 DEFINE_STATIC_LOCAL(const AtomicString, evtString, ("evt", AtomicString::Con
structFromLiteral)); |
| 1190 return evtString; | 1190 return evtString; |
| 1191 } | 1191 } |
| 1192 | 1192 |
| 1193 } // namespace blink | 1193 } // namespace blink |
| OLD | NEW |