Changeset 86771 in webkit
- Timestamp:
- May 18, 2011 9:08:39 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 8 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r86770 r86771 1 2011-05-18 Rob Buis <rbuis@rim.com> 2 3 Reviewed by Nikolas Zimmermann. 4 5 NULL deref when SVG elements have table styles 6 https://bugs.webkit.org/show_bug.cgi?id=45561 7 8 * svg/custom/display-table-caption-foreignObject-expected.txt: Added. 9 * svg/custom/display-table-caption-foreignObject.svg: Added. 10 * svg/custom/display-table-caption-inherit-foreignObject-expected.txt: Added. 11 * svg/custom/display-table-caption-inherit-foreignObject.xhtml: Added. 12 * svg/custom/display-table-caption-inherit-text-expected.txt: Added. 13 * svg/custom/display-table-caption-inherit-text.xhtml: Added. 14 * svg/custom/display-table-caption-text-expected.txt: Added. 15 * svg/custom/display-table-caption-text.svg: Added. 16 1 17 2011-05-18 Adam Roben <aroben@apple.com> 2 18 -
trunk/Source/WebCore/ChangeLog
r86768 r86771 1 2011-05-18 Rob Buis <rbuis@rim.com> 2 3 Reviewed by Nikolas Zimmermann. 4 5 NULL deref when SVG elements have table styles 6 https://bugs.webkit.org/show_bug.cgi?id=45561 7 8 Restrict computed CSS values for SVG display property to block, inline or none. 9 10 Tests: svg/custom/display-table-caption-foreignObject.svg 11 svg/custom/display-table-caption-inherit-foreignObject.xhtml 12 svg/custom/display-table-caption-inherit-text.xhtml 13 svg/custom/display-table-caption-text.svg 14 15 * css/CSSStyleSelector.cpp: 16 (WebCore::SVGDisplayPropertyGuard::SVGDisplayPropertyGuard): 17 (WebCore::SVGDisplayPropertyGuard::~SVGDisplayPropertyGuard): 18 (WebCore::isAcceptableForSVGElement): 19 (WebCore::CSSStyleSelector::applyProperty): 20 1 21 2011-05-18 Pavel Feldman <pfeldman@google.com> 2 22 -
trunk/Source/WebCore/css/CSSStyleSelector.cpp
r86635 r86771 8 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/) 9 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 10 11 * 11 12 * This library is free software; you can redistribute it and/or … … 3541 3542 } 3542 3543 3544 class SVGDisplayPropertyGuard { 3545 WTF_MAKE_NONCOPYABLE(SVGDisplayPropertyGuard); 3546 public: 3547 SVGDisplayPropertyGuard(Element*, RenderStyle*); 3548 ~SVGDisplayPropertyGuard(); 3549 private: 3550 #if ENABLE(SVG) 3551 RenderStyle* m_style; 3552 EDisplay m_originalDisplayPropertyValue; 3553 #endif 3554 }; 3555 3556 #if !ENABLE(SVG) 3557 inline SVGDisplayPropertyGuard::SVGDisplayPropertyGuard(Element*, RenderStyle*) 3558 { 3559 } 3560 3561 inline SVGDisplayPropertyGuard::~SVGDisplayPropertyGuard() 3562 { 3563 } 3564 #else 3565 static inline bool isAcceptableForSVGElement(EDisplay displayPropertyValue) 3566 { 3567 return displayPropertyValue == INLINE || displayPropertyValue == BLOCK || displayPropertyValue == NONE; 3568 } 3569 3570 inline SVGDisplayPropertyGuard::SVGDisplayPropertyGuard(Element* element, RenderStyle* style) 3571 { 3572 if (!(element && element->isSVGElement() && style->styleType() == NOPSEUDO)) { 3573 m_originalDisplayPropertyValue = NONE; 3574 m_style = 0; 3575 return; 3576 } 3577 m_style = style; 3578 m_originalDisplayPropertyValue = style->display(); 3579 ASSERT(isAcceptableForSVGElement(m_originalDisplayPropertyValue)); 3580 } 3581 3582 inline SVGDisplayPropertyGuard::~SVGDisplayPropertyGuard() 3583 { 3584 if (!m_style || isAcceptableForSVGElement(m_style->display())) 3585 return; 3586 m_style->setDisplay(m_originalDisplayPropertyValue); 3587 } 3588 #endif 3589 3590 3543 3591 // SVG handles zooming in a different way compared to CSS. The whole document is scaled instead 3544 3592 // of each individual length value in the render style / tree. CSSPrimitiveValue::computeLength*() … … 3612 3660 HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(clear, Clear) 3613 3661 return; 3614 case CSSPropertyDisplay: 3662 case CSSPropertyDisplay: { 3663 SVGDisplayPropertyGuard guard(m_element, m_style.get()); 3615 3664 HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(display, Display) 3616 3665 #if ENABLE(WCSS) … … 3630 3679 #endif 3631 3680 return; 3681 } 3632 3682 case CSSPropertyEmptyCells: 3633 3683 HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(emptyCells, EmptyCells)
Note: See TracChangeset
for help on using the changeset viewer.