| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> |
| 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Rob Buis <buis@kde.org> |
| 4 * Copyright (C) 2007 Apple Inc. All rights reserved. | 4 * Copyright (C) 2007 Apple Inc. All rights reserved. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 { | 98 { |
| 99 return adoptRef(new SVGSVGElement(tagName, document)); | 99 return adoptRef(new SVGSVGElement(tagName, document)); |
| 100 } | 100 } |
| 101 | 101 |
| 102 SVGSVGElement::~SVGSVGElement() | 102 SVGSVGElement::~SVGSVGElement() |
| 103 { | 103 { |
| 104 if (m_viewSpec) | 104 if (m_viewSpec) |
| 105 m_viewSpec->resetContextElement(); | 105 m_viewSpec->resetContextElement(); |
| 106 // There are cases where removedFromDocument() is not called. | 106 // There are cases where removedFromDocument() is not called. |
| 107 // see ContainerNode::removeAllChildren, called by its destructor. | 107 // see ContainerNode::removeAllChildren, called by its destructor. |
| 108 document()->accessSVGExtensions()->removeTimeContainer(this); | 108 document().accessSVGExtensions()->removeTimeContainer(this); |
| 109 } | 109 } |
| 110 | 110 |
| 111 const AtomicString& SVGSVGElement::contentScriptType() const | 111 const AtomicString& SVGSVGElement::contentScriptType() const |
| 112 { | 112 { |
| 113 DEFINE_STATIC_LOCAL(const AtomicString, defaultValue, ("text/ecmascript", At
omicString::ConstructFromLiteral)); | 113 DEFINE_STATIC_LOCAL(const AtomicString, defaultValue, ("text/ecmascript", At
omicString::ConstructFromLiteral)); |
| 114 const AtomicString& n = fastGetAttribute(SVGNames::contentScriptTypeAttr); | 114 const AtomicString& n = fastGetAttribute(SVGNames::contentScriptTypeAttr); |
| 115 return n.isNull() ? defaultValue : n; | 115 return n.isNull() ? defaultValue : n; |
| 116 } | 116 } |
| 117 | 117 |
| 118 void SVGSVGElement::setContentScriptType(const AtomicString& type) | 118 void SVGSVGElement::setContentScriptType(const AtomicString& type) |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 if (!m_viewSpec) | 166 if (!m_viewSpec) |
| 167 m_viewSpec = SVGViewSpec::create(this); | 167 m_viewSpec = SVGViewSpec::create(this); |
| 168 return m_viewSpec.get(); | 168 return m_viewSpec.get(); |
| 169 } | 169 } |
| 170 | 170 |
| 171 float SVGSVGElement::currentScale() const | 171 float SVGSVGElement::currentScale() const |
| 172 { | 172 { |
| 173 if (!inDocument() || !isOutermostSVGSVGElement()) | 173 if (!inDocument() || !isOutermostSVGSVGElement()) |
| 174 return 1; | 174 return 1; |
| 175 | 175 |
| 176 Frame* frame = document()->frame(); | 176 Frame* frame = document().frame(); |
| 177 if (!frame) | 177 if (!frame) |
| 178 return 1; | 178 return 1; |
| 179 | 179 |
| 180 FrameTree* frameTree = frame->tree(); | 180 FrameTree* frameTree = frame->tree(); |
| 181 ASSERT(frameTree); | 181 ASSERT(frameTree); |
| 182 | 182 |
| 183 // The behaviour of currentScale() is undefined, when we're dealing with non
-standalone SVG documents. | 183 // The behaviour of currentScale() is undefined, when we're dealing with non
-standalone SVG documents. |
| 184 // If the svg is embedded, the scaling is handled by the host renderer, so w
hen asking from inside | 184 // If the svg is embedded, the scaling is handled by the host renderer, so w
hen asking from inside |
| 185 // the SVG document, a scale value of 1 seems reasonable, as it doesn't know
anything about the parent scale. | 185 // the SVG document, a scale value of 1 seems reasonable, as it doesn't know
anything about the parent scale. |
| 186 return frameTree->parent() ? 1 : frame->pageZoomFactor(); | 186 return frameTree->parent() ? 1 : frame->pageZoomFactor(); |
| 187 } | 187 } |
| 188 | 188 |
| 189 void SVGSVGElement::setCurrentScale(float scale) | 189 void SVGSVGElement::setCurrentScale(float scale) |
| 190 { | 190 { |
| 191 if (!inDocument() || !isOutermostSVGSVGElement()) | 191 if (!inDocument() || !isOutermostSVGSVGElement()) |
| 192 return; | 192 return; |
| 193 | 193 |
| 194 Frame* frame = document()->frame(); | 194 Frame* frame = document().frame(); |
| 195 if (!frame) | 195 if (!frame) |
| 196 return; | 196 return; |
| 197 | 197 |
| 198 FrameTree* frameTree = frame->tree(); | 198 FrameTree* frameTree = frame->tree(); |
| 199 ASSERT(frameTree); | 199 ASSERT(frameTree); |
| 200 | 200 |
| 201 // The behaviour of setCurrentScale() is undefined, when we're dealing with
non-standalone SVG documents. | 201 // The behaviour of setCurrentScale() is undefined, when we're dealing with
non-standalone SVG documents. |
| 202 // We choose the ignore this call, it's pretty useless to support calling se
tCurrentScale() from within | 202 // We choose the ignore this call, it's pretty useless to support calling se
tCurrentScale() from within |
| 203 // an embedded SVG document, for the same reasons as in currentScale() - nee
ds resolution by SVG WG. | 203 // an embedded SVG document, for the same reasons as in currentScale() - nee
ds resolution by SVG WG. |
| 204 if (frameTree->parent()) | 204 if (frameTree->parent()) |
| 205 return; | 205 return; |
| 206 | 206 |
| 207 frame->setPageZoomFactor(scale); | 207 frame->setPageZoomFactor(scale); |
| 208 } | 208 } |
| 209 | 209 |
| 210 void SVGSVGElement::setCurrentTranslate(const FloatPoint& translation) | 210 void SVGSVGElement::setCurrentTranslate(const FloatPoint& translation) |
| 211 { | 211 { |
| 212 m_translation = translation; | 212 m_translation = translation; |
| 213 updateCurrentTranslate(); | 213 updateCurrentTranslate(); |
| 214 } | 214 } |
| 215 | 215 |
| 216 void SVGSVGElement::updateCurrentTranslate() | 216 void SVGSVGElement::updateCurrentTranslate() |
| 217 { | 217 { |
| 218 if (RenderObject* object = renderer()) | 218 if (RenderObject* object = renderer()) |
| 219 object->setNeedsLayout(); | 219 object->setNeedsLayout(); |
| 220 | 220 |
| 221 if (parentNode() == document() && document()->renderer()) | 221 if (parentNode() == &document() && document().renderer()) |
| 222 document()->renderer()->repaint(); | 222 document().renderer()->repaint(); |
| 223 } | 223 } |
| 224 | 224 |
| 225 void SVGSVGElement::parseAttribute(const QualifiedName& name, const AtomicString
& value) | 225 void SVGSVGElement::parseAttribute(const QualifiedName& name, const AtomicString
& value) |
| 226 { | 226 { |
| 227 SVGParsingError parseError = NoError; | 227 SVGParsingError parseError = NoError; |
| 228 | 228 |
| 229 if (!nearestViewportElement()) { | 229 if (!nearestViewportElement()) { |
| 230 bool setListener = true; | 230 bool setListener = true; |
| 231 | 231 |
| 232 // Only handle events if we're the outermost <svg> element | 232 // Only handle events if we're the outermost <svg> element |
| 233 if (name == HTMLNames::onunloadAttr) | 233 if (name == HTMLNames::onunloadAttr) |
| 234 document()->setWindowAttributeEventListener(eventNames().unloadEvent
, createAttributeEventListener(document()->frame(), name, value)); | 234 document().setWindowAttributeEventListener(eventNames().unloadEvent,
createAttributeEventListener(document().frame(), name, value)); |
| 235 else if (name == HTMLNames::onresizeAttr) | 235 else if (name == HTMLNames::onresizeAttr) |
| 236 document()->setWindowAttributeEventListener(eventNames().resizeEvent
, createAttributeEventListener(document()->frame(), name, value)); | 236 document().setWindowAttributeEventListener(eventNames().resizeEvent,
createAttributeEventListener(document().frame(), name, value)); |
| 237 else if (name == HTMLNames::onscrollAttr) | 237 else if (name == HTMLNames::onscrollAttr) |
| 238 document()->setWindowAttributeEventListener(eventNames().scrollEvent
, createAttributeEventListener(document()->frame(), name, value)); | 238 document().setWindowAttributeEventListener(eventNames().scrollEvent,
createAttributeEventListener(document().frame(), name, value)); |
| 239 else if (name == SVGNames::onzoomAttr) | 239 else if (name == SVGNames::onzoomAttr) |
| 240 document()->setWindowAttributeEventListener(eventNames().zoomEvent,
createAttributeEventListener(document()->frame(), name, value)); | 240 document().setWindowAttributeEventListener(eventNames().zoomEvent, c
reateAttributeEventListener(document().frame(), name, value)); |
| 241 else | 241 else |
| 242 setListener = false; | 242 setListener = false; |
| 243 | 243 |
| 244 if (setListener) | 244 if (setListener) |
| 245 return; | 245 return; |
| 246 } | 246 } |
| 247 | 247 |
| 248 if (name == HTMLNames::onabortAttr) | 248 if (name == HTMLNames::onabortAttr) |
| 249 document()->setWindowAttributeEventListener(eventNames().abortEvent, cre
ateAttributeEventListener(document()->frame(), name, value)); | 249 document().setWindowAttributeEventListener(eventNames().abortEvent, crea
teAttributeEventListener(document().frame(), name, value)); |
| 250 else if (name == HTMLNames::onerrorAttr) | 250 else if (name == HTMLNames::onerrorAttr) |
| 251 document()->setWindowAttributeEventListener(eventNames().errorEvent, cre
ateAttributeEventListener(document()->frame(), name, value)); | 251 document().setWindowAttributeEventListener(eventNames().errorEvent, crea
teAttributeEventListener(document().frame(), name, value)); |
| 252 else if (name == SVGNames::xAttr) | 252 else if (name == SVGNames::xAttr) |
| 253 setXBaseValue(SVGLength::construct(LengthModeWidth, value, parseError)); | 253 setXBaseValue(SVGLength::construct(LengthModeWidth, value, parseError)); |
| 254 else if (name == SVGNames::yAttr) | 254 else if (name == SVGNames::yAttr) |
| 255 setYBaseValue(SVGLength::construct(LengthModeHeight, value, parseError))
; | 255 setYBaseValue(SVGLength::construct(LengthModeHeight, value, parseError))
; |
| 256 else if (name == SVGNames::widthAttr) | 256 else if (name == SVGNames::widthAttr) |
| 257 setWidthBaseValue(SVGLength::construct(LengthModeWidth, value, parseErro
r, ForbidNegativeLengths)); | 257 setWidthBaseValue(SVGLength::construct(LengthModeWidth, value, parseErro
r, ForbidNegativeLengths)); |
| 258 else if (name == SVGNames::heightAttr) | 258 else if (name == SVGNames::heightAttr) |
| 259 setHeightBaseValue(SVGLength::construct(LengthModeHeight, value, parseEr
ror, ForbidNegativeLengths)); | 259 setHeightBaseValue(SVGLength::construct(LengthModeHeight, value, parseEr
ror, ForbidNegativeLengths)); |
| 260 else if (SVGLangSpace::parseAttribute(name, value) | 260 else if (SVGLangSpace::parseAttribute(name, value) |
| 261 || SVGExternalResourcesRequired::parseAttribute(name, value) | 261 || SVGExternalResourcesRequired::parseAttribute(name, value) |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 | 368 |
| 369 bool SVGSVGElement::checkEnclosure(SVGElement* element, const SVGRect& rect) con
st | 369 bool SVGSVGElement::checkEnclosure(SVGElement* element, const SVGRect& rect) con
st |
| 370 { | 370 { |
| 371 if (!element) | 371 if (!element) |
| 372 return false; | 372 return false; |
| 373 return RenderSVGModelObject::checkEnclosure(element->renderer(), rect); | 373 return RenderSVGModelObject::checkEnclosure(element->renderer(), rect); |
| 374 } | 374 } |
| 375 | 375 |
| 376 void SVGSVGElement::deselectAll() | 376 void SVGSVGElement::deselectAll() |
| 377 { | 377 { |
| 378 if (Frame* frame = document()->frame()) | 378 if (Frame* frame = document().frame()) |
| 379 frame->selection()->clear(); | 379 frame->selection()->clear(); |
| 380 } | 380 } |
| 381 | 381 |
| 382 float SVGSVGElement::createSVGNumber() | 382 float SVGSVGElement::createSVGNumber() |
| 383 { | 383 { |
| 384 return 0.0f; | 384 return 0.0f; |
| 385 } | 385 } |
| 386 | 386 |
| 387 SVGLength SVGSVGElement::createSVGLength() | 387 SVGLength SVGSVGElement::createSVGLength() |
| 388 { | 388 { |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 // Translate in our CSS parent coordinate space | 448 // Translate in our CSS parent coordinate space |
| 449 // FIXME: This doesn't work correctly with CSS transforms. | 449 // FIXME: This doesn't work correctly with CSS transforms. |
| 450 location = renderer->localToAbsolute(location, UseTransforms); | 450 location = renderer->localToAbsolute(location, UseTransforms); |
| 451 location.scale(zoomFactor, zoomFactor); | 451 location.scale(zoomFactor, zoomFactor); |
| 452 | 452 |
| 453 // Be careful here! localToBorderBoxTransform() included the x/y off
set coming from the viewBoxToViewTransform(), | 453 // Be careful here! localToBorderBoxTransform() included the x/y off
set coming from the viewBoxToViewTransform(), |
| 454 // so we have to subtract it here (original cause of bug #27183) | 454 // so we have to subtract it here (original cause of bug #27183) |
| 455 transform.translate(location.x() - viewBoxTransform.e(), location.y(
) - viewBoxTransform.f()); | 455 transform.translate(location.x() - viewBoxTransform.e(), location.y(
) - viewBoxTransform.f()); |
| 456 | 456 |
| 457 // Respect scroll offset. | 457 // Respect scroll offset. |
| 458 if (FrameView* view = document()->view()) { | 458 if (FrameView* view = document().view()) { |
| 459 LayoutSize scrollOffset = view->scrollOffset(); | 459 LayoutSize scrollOffset = view->scrollOffset(); |
| 460 scrollOffset.scale(zoomFactor); | 460 scrollOffset.scale(zoomFactor); |
| 461 transform.translate(-scrollOffset.width(), -scrollOffset.height(
)); | 461 transform.translate(-scrollOffset.width(), -scrollOffset.height(
)); |
| 462 } | 462 } |
| 463 } | 463 } |
| 464 } | 464 } |
| 465 | 465 |
| 466 return transform.multiply(viewBoxTransform); | 466 return transform.multiply(viewBoxTransform); |
| 467 } | 467 } |
| 468 | 468 |
| 469 bool SVGSVGElement::rendererIsNeeded(const NodeRenderingContext& context) | 469 bool SVGSVGElement::rendererIsNeeded(const NodeRenderingContext& context) |
| 470 { | 470 { |
| 471 // FIXME: We should respect display: none on the documentElement svg element | 471 // FIXME: We should respect display: none on the documentElement svg element |
| 472 // but many things in FrameView and SVGImage depend on the RenderSVGRoot whe
n | 472 // but many things in FrameView and SVGImage depend on the RenderSVGRoot whe
n |
| 473 // they should instead depend on the RenderView. | 473 // they should instead depend on the RenderView. |
| 474 // https://bugs.webkit.org/show_bug.cgi?id=103493 | 474 // https://bugs.webkit.org/show_bug.cgi?id=103493 |
| 475 if (document()->documentElement() == this) | 475 if (document().documentElement() == this) |
| 476 return true; | 476 return true; |
| 477 return Element::rendererIsNeeded(context); | 477 return Element::rendererIsNeeded(context); |
| 478 } | 478 } |
| 479 | 479 |
| 480 RenderObject* SVGSVGElement::createRenderer(RenderStyle*) | 480 RenderObject* SVGSVGElement::createRenderer(RenderStyle*) |
| 481 { | 481 { |
| 482 if (isOutermostSVGSVGElement()) | 482 if (isOutermostSVGSVGElement()) |
| 483 return new RenderSVGRoot(this); | 483 return new RenderSVGRoot(this); |
| 484 | 484 |
| 485 return new RenderSVGViewportContainer(this); | 485 return new RenderSVGViewportContainer(this); |
| 486 } | 486 } |
| 487 | 487 |
| 488 Node::InsertionNotificationRequest SVGSVGElement::insertedInto(ContainerNode* ro
otParent) | 488 Node::InsertionNotificationRequest SVGSVGElement::insertedInto(ContainerNode* ro
otParent) |
| 489 { | 489 { |
| 490 if (rootParent->inDocument()) { | 490 if (rootParent->inDocument()) { |
| 491 document()->accessSVGExtensions()->addTimeContainer(this); | 491 document().accessSVGExtensions()->addTimeContainer(this); |
| 492 | 492 |
| 493 // Animations are started at the end of document parsing and after firin
g the load event, | 493 // Animations are started at the end of document parsing and after firin
g the load event, |
| 494 // but if we miss that train (deferred programmatic element insertion fo
r example) we need | 494 // but if we miss that train (deferred programmatic element insertion fo
r example) we need |
| 495 // to initialize the time container here. | 495 // to initialize the time container here. |
| 496 if (!document()->parsing() && !document()->processingLoadEvent() && docu
ment()->loadEventFinished() && !timeContainer()->isStarted()) | 496 if (!document().parsing() && !document().processingLoadEvent() && docume
nt().loadEventFinished() && !timeContainer()->isStarted()) |
| 497 timeContainer()->begin(); | 497 timeContainer()->begin(); |
| 498 } | 498 } |
| 499 return SVGGraphicsElement::insertedInto(rootParent); | 499 return SVGGraphicsElement::insertedInto(rootParent); |
| 500 } | 500 } |
| 501 | 501 |
| 502 void SVGSVGElement::removedFrom(ContainerNode* rootParent) | 502 void SVGSVGElement::removedFrom(ContainerNode* rootParent) |
| 503 { | 503 { |
| 504 if (rootParent->inDocument()) | 504 if (rootParent->inDocument()) |
| 505 document()->accessSVGExtensions()->removeTimeContainer(this); | 505 document().accessSVGExtensions()->removeTimeContainer(this); |
| 506 SVGGraphicsElement::removedFrom(rootParent); | 506 SVGGraphicsElement::removedFrom(rootParent); |
| 507 } | 507 } |
| 508 | 508 |
| 509 void SVGSVGElement::pauseAnimations() | 509 void SVGSVGElement::pauseAnimations() |
| 510 { | 510 { |
| 511 if (!m_timeContainer->isPaused()) | 511 if (!m_timeContainer->isPaused()) |
| 512 m_timeContainer->pause(); | 512 m_timeContainer->pause(); |
| 513 } | 513 } |
| 514 | 514 |
| 515 void SVGSVGElement::unpauseAnimations() | 515 void SVGSVGElement::unpauseAnimations() |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 597 // - the SVG content is a separately stored resource that is embedded by ref
erence (such as the ‘object’ element in XHTML [XHTML]), or | 597 // - the SVG content is a separately stored resource that is embedded by ref
erence (such as the ‘object’ element in XHTML [XHTML]), or |
| 598 // the SVG content is embedded inline within a containing document; | 598 // the SVG content is embedded inline within a containing document; |
| 599 // - and the referencing element or containing document is styled using CSS
[CSS2] or XSL [XSL]; | 599 // - and the referencing element or containing document is styled using CSS
[CSS2] or XSL [XSL]; |
| 600 // - and there are CSS-compatible positioning properties ([CSS2], section 9.
3) specified on the referencing element (e.g., the ‘object’ element) | 600 // - and there are CSS-compatible positioning properties ([CSS2], section 9.
3) specified on the referencing element (e.g., the ‘object’ element) |
| 601 // or on the containing document's outermost svg element that are sufficie
nt to establish the width of the viewport. Under these conditions, | 601 // or on the containing document's outermost svg element that are sufficie
nt to establish the width of the viewport. Under these conditions, |
| 602 // the positioning properties establish the viewport's width. | 602 // the positioning properties establish the viewport's width. |
| 603 RenderSVGRoot* root = toRenderSVGRoot(renderer()); | 603 RenderSVGRoot* root = toRenderSVGRoot(renderer()); |
| 604 | 604 |
| 605 // SVG embedded through object/embed/iframe. | 605 // SVG embedded through object/embed/iframe. |
| 606 if (root->isEmbeddedThroughFrameContainingSVGDocument()) | 606 if (root->isEmbeddedThroughFrameContainingSVGDocument()) |
| 607 return !root->hasReplacedLogicalWidth() && !document()->frame()->ownerRe
nderer()->hasReplacedLogicalWidth(); | 607 return !root->hasReplacedLogicalWidth() && !document().frame()->ownerRen
derer()->hasReplacedLogicalWidth(); |
| 608 | 608 |
| 609 // SVG embedded via SVGImage (background-image/border-image/etc) / Inline SV
G. | 609 // SVG embedded via SVGImage (background-image/border-image/etc) / Inline SV
G. |
| 610 if (root->isEmbeddedThroughSVGImage() || document()->documentElement() != th
is) | 610 if (root->isEmbeddedThroughSVGImage() || document().documentElement() != thi
s) |
| 611 return !root->hasReplacedLogicalWidth(); | 611 return !root->hasReplacedLogicalWidth(); |
| 612 | 612 |
| 613 return true; | 613 return true; |
| 614 } | 614 } |
| 615 | 615 |
| 616 bool SVGSVGElement::heightAttributeEstablishesViewport() const | 616 bool SVGSVGElement::heightAttributeEstablishesViewport() const |
| 617 { | 617 { |
| 618 if (!renderer() || renderer()->isSVGViewportContainer()) | 618 if (!renderer() || renderer()->isSVGViewportContainer()) |
| 619 return true; | 619 return true; |
| 620 | 620 |
| 621 // Spec: http://www.w3.org/TR/SVG/coords.html#IntrinsicSizing | 621 // Spec: http://www.w3.org/TR/SVG/coords.html#IntrinsicSizing |
| 622 // Similarly, if there are positioning properties specified on the referenci
ng element or on the outermost svg element | 622 // Similarly, if there are positioning properties specified on the referenci
ng element or on the outermost svg element |
| 623 // that are sufficient to establish the height of the viewport, then these p
ositioning properties establish the viewport's | 623 // that are sufficient to establish the height of the viewport, then these p
ositioning properties establish the viewport's |
| 624 // height; otherwise, the ‘height’ attribute on the outermost svg element es
tablishes the viewport's height. | 624 // height; otherwise, the ‘height’ attribute on the outermost svg element es
tablishes the viewport's height. |
| 625 RenderSVGRoot* root = toRenderSVGRoot(renderer()); | 625 RenderSVGRoot* root = toRenderSVGRoot(renderer()); |
| 626 | 626 |
| 627 // SVG embedded through object/embed/iframe. | 627 // SVG embedded through object/embed/iframe. |
| 628 if (root->isEmbeddedThroughFrameContainingSVGDocument()) | 628 if (root->isEmbeddedThroughFrameContainingSVGDocument()) |
| 629 return !root->hasReplacedLogicalHeight() && !document()->frame()->ownerR
enderer()->hasReplacedLogicalHeight(); | 629 return !root->hasReplacedLogicalHeight() && !document().frame()->ownerRe
nderer()->hasReplacedLogicalHeight(); |
| 630 | 630 |
| 631 // SVG embedded via SVGImage (background-image/border-image/etc) / Inline SV
G. | 631 // SVG embedded via SVGImage (background-image/border-image/etc) / Inline SV
G. |
| 632 if (root->isEmbeddedThroughSVGImage() || document()->documentElement() != th
is) | 632 if (root->isEmbeddedThroughSVGImage() || document().documentElement() != thi
s) |
| 633 return !root->hasReplacedLogicalHeight(); | 633 return !root->hasReplacedLogicalHeight(); |
| 634 | 634 |
| 635 return true; | 635 return true; |
| 636 } | 636 } |
| 637 | 637 |
| 638 Length SVGSVGElement::intrinsicWidth(ConsiderCSSMode mode) const | 638 Length SVGSVGElement::intrinsicWidth(ConsiderCSSMode mode) const |
| 639 { | 639 { |
| 640 if (widthAttributeEstablishesViewport() || mode == IgnoreCSSProperties) { | 640 if (widthAttributeEstablishesViewport() || mode == IgnoreCSSProperties) { |
| 641 if (widthCurrentValue().unitType() == LengthTypePercentage) | 641 if (widthCurrentValue().unitType() == LengthTypePercentage) |
| 642 return Length(widthCurrentValue().valueAsPercentage() * 100, Percent
); | 642 return Length(widthCurrentValue().valueAsPercentage() * 100, Percent
); |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 769 continue; | 769 continue; |
| 770 | 770 |
| 771 Element* element = toElement(node); | 771 Element* element = toElement(node); |
| 772 if (element->getIdAttribute() == id) | 772 if (element->getIdAttribute() == id) |
| 773 return element; | 773 return element; |
| 774 } | 774 } |
| 775 return 0; | 775 return 0; |
| 776 } | 776 } |
| 777 | 777 |
| 778 } | 778 } |
| OLD | NEW |