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

Side by Side Diff: Source/core/svg/SVGElement.cpp

Issue 899163003: Move rendering/RenderObject to layout/LayoutObject. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/svg/SVGElement.h ('k') | Source/core/svg/SVGEllipseElement.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 21 matching lines...) Expand all
32 #include "core/XMLNames.h" 32 #include "core/XMLNames.h"
33 #include "core/css/CSSCursorImageValue.h" 33 #include "core/css/CSSCursorImageValue.h"
34 #include "core/css/parser/CSSParser.h" 34 #include "core/css/parser/CSSParser.h"
35 #include "core/css/resolver/StyleResolver.h" 35 #include "core/css/resolver/StyleResolver.h"
36 #include "core/dom/Document.h" 36 #include "core/dom/Document.h"
37 #include "core/dom/ElementTraversal.h" 37 #include "core/dom/ElementTraversal.h"
38 #include "core/dom/shadow/ShadowRoot.h" 38 #include "core/dom/shadow/ShadowRoot.h"
39 #include "core/events/Event.h" 39 #include "core/events/Event.h"
40 #include "core/frame/Settings.h" 40 #include "core/frame/Settings.h"
41 #include "core/html/HTMLElement.h" 41 #include "core/html/HTMLElement.h"
42 #include "core/rendering/RenderObject.h" 42 #include "core/layout/LayoutObject.h"
43 #include "core/rendering/svg/RenderSVGResourceContainer.h" 43 #include "core/rendering/svg/RenderSVGResourceContainer.h"
44 #include "core/svg/SVGCursorElement.h" 44 #include "core/svg/SVGCursorElement.h"
45 #include "core/svg/SVGDocumentExtensions.h" 45 #include "core/svg/SVGDocumentExtensions.h"
46 #include "core/svg/SVGElementRareData.h" 46 #include "core/svg/SVGElementRareData.h"
47 #include "core/svg/SVGGraphicsElement.h" 47 #include "core/svg/SVGGraphicsElement.h"
48 #include "core/svg/SVGSVGElement.h" 48 #include "core/svg/SVGSVGElement.h"
49 #include "core/svg/SVGTitleElement.h" 49 #include "core/svg/SVGTitleElement.h"
50 #include "core/svg/SVGUseElement.h" 50 #include "core/svg/SVGUseElement.h"
51 51
52 #include "wtf/TemporaryChange.h" 52 #include "wtf/TemporaryChange.h"
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 RenderObject* renderer = this->renderer(); 421 LayoutObject* renderer = this->renderer();
422 if (renderer && selfHasRelativeLengths()) { 422 if (renderer && selfHasRelativeLengths()) {
423 if (renderer->isSVGResourceContainer()) 423 if (renderer->isSVGResourceContainer())
424 toRenderSVGResourceContainer(renderer)->invalidateCacheAndMarkForLay out(layoutScope); 424 toRenderSVGResourceContainer(renderer)->invalidateCacheAndMarkForLay out(layoutScope);
425 else 425 else
426 renderer->setNeedsLayoutAndFullPaintInvalidation(MarkContainingBlock Chain, layoutScope); 426 renderer->setNeedsLayoutAndFullPaintInvalidation(MarkContainingBlock Chain, 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);
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
865 return; 865 return;
866 } 866 }
867 867
868 if (attrName == HTMLNames::classAttr) { 868 if (attrName == HTMLNames::classAttr) {
869 classAttributeChanged(AtomicString(m_className->currentValue()->value()) ); 869 classAttributeChanged(AtomicString(m_className->currentValue()->value()) );
870 invalidateInstances(); 870 invalidateInstances();
871 return; 871 return;
872 } 872 }
873 873
874 if (isIdAttributeName(attrName)) { 874 if (isIdAttributeName(attrName)) {
875 RenderObject* object = renderer(); 875 LayoutObject* object = renderer();
876 // Notify resources about id changes, this is important as we cache reso urces by id in SVGDocumentExtensions 876 // Notify resources about id changes, this is important as we cache reso urces by id in SVGDocumentExtensions
877 if (object && object->isSVGResourceContainer()) 877 if (object && object->isSVGResourceContainer())
878 toRenderSVGResourceContainer(object)->idChanged(); 878 toRenderSVGResourceContainer(object)->idChanged();
879 if (inDocument()) 879 if (inDocument())
880 buildPendingResourcesIfNeeded(); 880 buildPendingResourcesIfNeeded();
881 invalidateInstances(); 881 invalidateInstances();
882 return; 882 return;
883 } 883 }
884 } 884 }
885 885
(...skipping 18 matching lines...) Expand all
904 } 904 }
905 } 905 }
906 906
907 PassRefPtr<RenderStyle> SVGElement::customStyleForRenderer() 907 PassRefPtr<RenderStyle> SVGElement::customStyleForRenderer()
908 { 908 {
909 if (!correspondingElement()) 909 if (!correspondingElement())
910 return document().ensureStyleResolver().styleForElement(this); 910 return document().ensureStyleResolver().styleForElement(this);
911 911
912 RenderStyle* style = 0; 912 RenderStyle* style = 0;
913 if (Element* parent = parentOrShadowHostElement()) { 913 if (Element* parent = parentOrShadowHostElement()) {
914 if (RenderObject* renderer = parent->renderer()) 914 if (LayoutObject* renderer = parent->renderer())
915 style = renderer->style(); 915 style = renderer->style();
916 } 916 }
917 917
918 return document().ensureStyleResolver().styleForElement(correspondingElement (), style, DisallowStyleSharing); 918 return document().ensureStyleResolver().styleForElement(correspondingElement (), style, DisallowStyleSharing);
919 } 919 }
920 920
921 MutableStylePropertySet* SVGElement::animatedSMILStyleProperties() const 921 MutableStylePropertySet* SVGElement::animatedSMILStyleProperties() const
922 { 922 {
923 if (hasSVGRareData()) 923 if (hasSVGRareData())
924 return svgRareData()->animatedSMILStyleProperties(); 924 return svgRareData()->animatedSMILStyleProperties();
(...skipping 11 matching lines...) Expand all
936 svgRareData()->setUseOverrideComputedStyle(value); 936 svgRareData()->setUseOverrideComputedStyle(value);
937 } 937 }
938 938
939 RenderStyle* SVGElement::computedStyle(PseudoId pseudoElementSpecifier) 939 RenderStyle* SVGElement::computedStyle(PseudoId pseudoElementSpecifier)
940 { 940 {
941 if (!hasSVGRareData() || !svgRareData()->useOverrideComputedStyle()) 941 if (!hasSVGRareData() || !svgRareData()->useOverrideComputedStyle())
942 return Element::computedStyle(pseudoElementSpecifier); 942 return Element::computedStyle(pseudoElementSpecifier);
943 943
944 RenderStyle* parentStyle = 0; 944 RenderStyle* parentStyle = 0;
945 if (Element* parent = parentOrShadowHostElement()) { 945 if (Element* parent = parentOrShadowHostElement()) {
946 if (RenderObject* renderer = parent->renderer()) 946 if (LayoutObject* renderer = parent->renderer())
947 parentStyle = renderer->style(); 947 parentStyle = renderer->style();
948 } 948 }
949 949
950 return svgRareData()->overrideComputedStyle(this, parentStyle); 950 return svgRareData()->overrideComputedStyle(this, parentStyle);
951 } 951 }
952 952
953 bool SVGElement::hasFocusEventListeners() const 953 bool SVGElement::hasFocusEventListeners() const
954 { 954 {
955 return hasEventListeners(EventTypeNames::focusin) || hasEventListeners(Event TypeNames::focusout) 955 return hasEventListeners(EventTypeNames::focusin) || hasEventListeners(Event TypeNames::focusout)
956 || hasEventListeners(EventTypeNames::focus) || hasEventListeners(EventTy peNames::blur); 956 || hasEventListeners(EventTypeNames::focus) || hasEventListeners(EventTy peNames::blur);
957 } 957 }
958 958
959 void SVGElement::markForLayoutAndParentResourceInvalidation(RenderObject* render er) 959 void SVGElement::markForLayoutAndParentResourceInvalidation(LayoutObject* render er)
960 { 960 {
961 ASSERT(renderer); 961 ASSERT(renderer);
962 RenderSVGResourceContainer::markForLayoutAndParentResourceInvalidation(rende rer, true); 962 RenderSVGResourceContainer::markForLayoutAndParentResourceInvalidation(rende rer, true);
963 } 963 }
964 964
965 void SVGElement::invalidateInstances() 965 void SVGElement::invalidateInstances()
966 { 966 {
967 if (!inDocument()) 967 if (!inDocument())
968 return; 968 return;
969 969
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « Source/core/svg/SVGElement.h ('k') | Source/core/svg/SVGEllipseElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698