⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 174677 in webkit


Ignore:
Timestamp:
Oct 14, 2014, 2:53:59 AM (12 years ago)
Author:
alex
Message:

Changes in the stretchy attribute do not update rendering
https://bugs.webkit.org/show_bug.cgi?id=136883

Reviewed by Darin Adler.

Source/WebCore:

Test: mathml/presentation/mo-stretch-update.html

We need to relayout when a change in the stretchy attribute
happens.

  • mathml/MathMLTextElement.cpp:

(WebCore::MathMLTextElement::parseAttribute): Parse the
modifications of the stretchy attribute.

  • mathml/MathMLTextElement.h:
  • rendering/mathml/RenderMathMLOperator.cpp:

(WebCore::RenderMathMLOperator::setOperatorFlagAndScheduleLayoutIfNeeded):
Add function that receives the value instead of looking for it and
checks if the change should schedule a layout.
(WebCore::RenderMathMLOperator::setOperatorFlagFromAttribute):
(WebCore::RenderMathMLOperator::setOperatorFlagFromAttributeValue):
Add function that receives the value instead of looking for it.

  • rendering/mathml/RenderMathMLOperator.h:

LayoutTests:

The test updates the stretchy value in a timeout.

  • mathml/presentation/mo-stretch-update-expected.html: Added.
  • mathml/presentation/mo-stretch-update.html: Added.
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r174675 r174677  
     12014-10-14  Alejandro G. Castro  <alex@igalia.com>
     2
     3        Changes in the stretchy attribute do not update rendering
     4        https://bugs.webkit.org/show_bug.cgi?id=136883
     5
     6        Reviewed by Darin Adler.
     7
     8        The test updates the stretchy value in a timeout.
     9
     10        * mathml/presentation/mo-stretch-update-expected.html: Added.
     11        * mathml/presentation/mo-stretch-update.html: Added.
     12
    1132014-10-14  Andrzej Badowski  <a.badowski@samsung.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r174676 r174677  
     12014-10-14  Alejandro G. Castro  <alex@igalia.com>
     2
     3        Changes in the stretchy attribute do not update rendering
     4        https://bugs.webkit.org/show_bug.cgi?id=136883
     5
     6        Reviewed by Darin Adler.
     7
     8        Test: mathml/presentation/mo-stretch-update.html
     9
     10        We need to relayout when a change in the stretchy attribute
     11        happens.
     12
     13        * mathml/MathMLTextElement.cpp:
     14        (WebCore::MathMLTextElement::parseAttribute): Parse the
     15        modifications of the stretchy attribute.
     16        * mathml/MathMLTextElement.h:
     17        * rendering/mathml/RenderMathMLOperator.cpp:
     18        (WebCore::RenderMathMLOperator::setOperatorFlagAndScheduleLayoutIfNeeded):
     19        Add function that receives the value instead of looking for it and
     20        checks if the change should schedule a layout.
     21        (WebCore::RenderMathMLOperator::setOperatorFlagFromAttribute):
     22        (WebCore::RenderMathMLOperator::setOperatorFlagFromAttributeValue):
     23        Add function that receives the value instead of looking for it.
     24        * rendering/mathml/RenderMathMLOperator.h:
     25
    1262014-10-14  Chris Dumez  <cdumez@apple.com>
    227
  • trunk/Source/WebCore/mathml/MathMLTextElement.cpp

    r174375 r174677  
    6565}
    6666
     67void MathMLTextElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
     68{
     69    if (name == stretchyAttr) {
     70        if (is<RenderMathMLOperator>(renderer()))
     71            downcast<RenderMathMLOperator>(*renderer()).setOperatorFlagAndScheduleLayoutIfNeeded(MathMLOperatorDictionary::Stretchy, value);
     72        return;
     73    }
     74
     75    MathMLElement::parseAttribute(name, value);
     76}
     77
    6778RenderPtr<RenderElement> MathMLTextElement::createElementRenderer(PassRef<RenderStyle> style)
    6879{
  • trunk/Source/WebCore/mathml/MathMLTextElement.h

    r162139 r174677  
    3333namespace WebCore {
    3434   
    35 class MathMLTextElement : public MathMLElement {
     35class MathMLTextElement final : public MathMLElement {
    3636public:
    3737    static PassRefPtr<MathMLTextElement> create(const QualifiedName& tagName, Document&);
     
    4747
    4848    virtual void childrenChanged(const ChildChange&) override;
     49    virtual void parseAttribute(const QualifiedName&, const AtomicString&) override;
    4950};
    5051   
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp

    r174619 r174677  
    11581158}
    11591159
     1160void RenderMathMLOperator::setOperatorFlagAndScheduleLayoutIfNeeded(MathMLOperatorDictionary::Flag flag, const AtomicString& attributeValue)
     1161{
     1162    unsigned short oldOperatorFlags = m_operatorFlags;
     1163
     1164    setOperatorFlagFromAttributeValue(flag, attributeValue);
     1165
     1166    if (oldOperatorFlags != m_operatorFlags)
     1167        setNeedsLayoutAndPrefWidthsRecalc();
     1168}
     1169
    11601170void RenderMathMLOperator::setOperatorFlagFromAttribute(MathMLOperatorDictionary::Flag flag, const QualifiedName& name)
    11611171{
     1172    setOperatorFlagFromAttributeValue(flag, element().fastGetAttribute(name));
     1173}
     1174
     1175void RenderMathMLOperator::setOperatorFlagFromAttributeValue(MathMLOperatorDictionary::Flag flag, const AtomicString& attributeValue)
     1176{
    11621177    ASSERT(!isAnonymous());
    1163     const AtomicString& attributeValue = element().fastGetAttribute(name);
     1178
    11641179    if (attributeValue == "true")
    11651180        m_operatorFlags |= flag;
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.h

    r174540 r174677  
    8080    void updateTokenContent() override final;
    8181    void updateOperatorProperties();
     82    void setOperatorFlagAndScheduleLayoutIfNeeded(MathMLOperatorDictionary::Flag, const AtomicString& attributeValue);
    8283
    8384protected:
     
    187188
    188189    void setOperatorFlagFromAttribute(MathMLOperatorDictionary::Flag, const QualifiedName&);
     190    void setOperatorFlagFromAttributeValue(MathMLOperatorDictionary::Flag, const AtomicString& attributeValue);
    189191    void setOperatorPropertiesFromOpDictEntry(const MathMLOperatorDictionary::Entry*);
    190192    virtual void SetOperatorProperties();
Note: See TracChangeset for help on using the changeset viewer.