Changeset 203553 in webkit


Ignore:
Timestamp:
Jul 21, 2016 10:33:01 PM (8 years ago)
Author:
fred.wang@free.fr
Message:

Move parsing of accentunder and accent attributes from renderer to element classes
https://bugs.webkit.org/show_bug.cgi?id=159625

Patch by Frederic Wang <fwang@igalia.com> on 2016-07-21
Reviewed by Brent Fulgham.

We introduce a new MathMLUnderOverElement that is used for elements munder, mover and
munderover in order to create RenderMathMLUnderOver and parse and expose the values of the
accent and accentunder attributes. This is one more step toward moving MathML attribute
parsing to the DOM (bug 156536). We also do minor clean-up for this and previous renderer
classes that no longer do attribute parsing: the MathMLNames namespace is no longer necessary
and constructors can take a more accurate element type.

No new tests, already covered by existing test.

  • CMakeLists.txt: Add MathMLUnderOverElement files.
  • WebCore.xcodeproj/project.pbxproj: Ditto.
  • mathml/MathMLAllInOne.cpp: Ditto.
  • mathml/MathMLElement.cpp:

(WebCore::MathMLElement::cachedBooleanAttribute): Add parsing of boolean attributes.

  • mathml/MathMLElement.h: New type and helper functions for boolean attributes.
  • mathml/MathMLInlineContainerElement.cpp:

(WebCore::MathMLInlineContainerElement::createElementRenderer): Remove handling of
under/over/underover elements.

  • mathml/MathMLScriptsElement.cpp:

(WebCore::MathMLScriptsElement::MathMLScriptsElement): Remove inline keyword to avoid link
errors now that MathMLUnderOverElement overrides that class.

  • mathml/MathMLScriptsElement.h: Allow MathMLUnderOverElement to override this class.
  • mathml/MathMLUnderOverElement.cpp:

(WebCore::MathMLUnderOverElement::MathMLUnderOverElement):
(WebCore::MathMLUnderOverElement::create):
(WebCore::MathMLUnderOverElement::accent): Helper function to access the accent value.
(WebCore::MathMLUnderOverElement::accentUnder): Helper function to access the accentunder value.
(WebCore::MathMLUnderOverElement::parseAttribute): Make accent and accentunder dirty.
(WebCore::MathMLUnderOverElement::createElementRenderer): Create RenderMathMLUnderOver

  • mathml/MathMLUnderOverElement.h:
  • mathml/mathtags.in: Map under/over/underover to MathMLUnderOverElement.
  • rendering/mathml/RenderMathMLFraction.cpp: Remove MathMLNames and make the constructor

take a MathMLFractionElement.
(WebCore::RenderMathMLFraction::RenderMathMLFraction):

  • rendering/mathml/RenderMathMLFraction.h:
  • rendering/mathml/RenderMathMLPadded.cpp: Remove MathMLNames and make the constructor

take a MathMLPaddedElement.
(WebCore::RenderMathMLPadded::RenderMathMLPadded):

  • rendering/mathml/RenderMathMLPadded.h:
  • rendering/mathml/RenderMathMLScripts.cpp: Remove MathMLNames and make the constructor

take a MathMLScriptsElement. Also rename scriptsElement() to element().
(WebCore::RenderMathMLScripts::RenderMathMLScripts):
(WebCore::RenderMathMLScripts::element):
(WebCore::RenderMathMLScripts::getScriptMetricsAndLayoutIfNeeded):
(WebCore::RenderMathMLScripts::scriptsElement): Deleted.

  • rendering/mathml/RenderMathMLScripts.h:
  • rendering/mathml/RenderMathMLUnderOver.cpp: Remove MathMLNames and make the constructor

take a RenderMathMLUnderOver.
(WebCore::RenderMathMLUnderOver::RenderMathMLUnderOver):
(WebCore::RenderMathMLUnderOver::element):
(WebCore::RenderMathMLUnderOver::hasAccent): Use the helper functions for accent and accentunder.

  • rendering/mathml/RenderMathMLUnderOver.h:
Location:
trunk/Source/WebCore
Files:
19 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/CMakeLists.txt

    r203494 r203553  
    19961996    mathml/MathMLSpaceElement.cpp
    19971997    mathml/MathMLTextElement.cpp
     1998    mathml/MathMLUnderOverElement.cpp
    19981999
    19992000    page/AutoscrollController.cpp
  • trunk/Source/WebCore/ChangeLog

    r203552 r203553  
     12016-07-21  Frederic Wang  <fwang@igalia.com>
     2
     3        Move parsing of accentunder and accent attributes from renderer to element classes
     4        https://bugs.webkit.org/show_bug.cgi?id=159625
     5
     6        Reviewed by Brent Fulgham.
     7
     8        We introduce a new MathMLUnderOverElement that is used for elements munder, mover and
     9        munderover in order to create RenderMathMLUnderOver and parse and expose the values of the
     10        accent and accentunder attributes. This is one more step toward moving MathML attribute
     11        parsing to the DOM (bug 156536). We also do minor clean-up for this and previous renderer
     12        classes that no longer do attribute parsing: the MathMLNames namespace is no longer necessary
     13        and constructors can take a more accurate element type.
     14
     15        No new tests, already covered by existing test.
     16
     17        * CMakeLists.txt: Add MathMLUnderOverElement files.
     18        * WebCore.xcodeproj/project.pbxproj: Ditto.
     19        * mathml/MathMLAllInOne.cpp: Ditto.
     20        * mathml/MathMLElement.cpp:
     21        (WebCore::MathMLElement::cachedBooleanAttribute): Add parsing of boolean attributes.
     22        * mathml/MathMLElement.h: New type and helper functions for boolean attributes.
     23        * mathml/MathMLInlineContainerElement.cpp:
     24        (WebCore::MathMLInlineContainerElement::createElementRenderer): Remove handling of
     25        under/over/underover elements.
     26        * mathml/MathMLScriptsElement.cpp:
     27        (WebCore::MathMLScriptsElement::MathMLScriptsElement): Remove inline keyword to avoid link
     28        errors now that MathMLUnderOverElement overrides that class.
     29        * mathml/MathMLScriptsElement.h: Allow MathMLUnderOverElement to override this class.
     30        * mathml/MathMLUnderOverElement.cpp:
     31        (WebCore::MathMLUnderOverElement::MathMLUnderOverElement):
     32        (WebCore::MathMLUnderOverElement::create):
     33        (WebCore::MathMLUnderOverElement::accent): Helper function to access the accent value.
     34        (WebCore::MathMLUnderOverElement::accentUnder): Helper function to access the accentunder value.
     35        (WebCore::MathMLUnderOverElement::parseAttribute): Make accent and accentunder dirty.
     36        (WebCore::MathMLUnderOverElement::createElementRenderer): Create RenderMathMLUnderOver
     37        * mathml/MathMLUnderOverElement.h:
     38        * mathml/mathtags.in: Map under/over/underover to MathMLUnderOverElement.
     39        * rendering/mathml/RenderMathMLFraction.cpp: Remove MathMLNames and make the constructor
     40        take a MathMLFractionElement.
     41        (WebCore::RenderMathMLFraction::RenderMathMLFraction):
     42        * rendering/mathml/RenderMathMLFraction.h:
     43        * rendering/mathml/RenderMathMLPadded.cpp: Remove MathMLNames and make the constructor
     44        take a MathMLPaddedElement.
     45        (WebCore::RenderMathMLPadded::RenderMathMLPadded):
     46        * rendering/mathml/RenderMathMLPadded.h:
     47        * rendering/mathml/RenderMathMLScripts.cpp: Remove MathMLNames and make the constructor
     48        take a MathMLScriptsElement. Also rename scriptsElement() to element().
     49        (WebCore::RenderMathMLScripts::RenderMathMLScripts):
     50        (WebCore::RenderMathMLScripts::element):
     51        (WebCore::RenderMathMLScripts::getScriptMetricsAndLayoutIfNeeded):
     52        (WebCore::RenderMathMLScripts::scriptsElement): Deleted.
     53        * rendering/mathml/RenderMathMLScripts.h:
     54        * rendering/mathml/RenderMathMLUnderOver.cpp: Remove MathMLNames and make the constructor
     55        take a RenderMathMLUnderOver.
     56        (WebCore::RenderMathMLUnderOver::RenderMathMLUnderOver):
     57        (WebCore::RenderMathMLUnderOver::element):
     58        (WebCore::RenderMathMLUnderOver::hasAccent): Use the helper functions for accent and accentunder.
     59        * rendering/mathml/RenderMathMLUnderOver.h:
     60
    1612016-07-21  Chris Dumez  <cdumez@apple.com>
    262
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r203459 r203553  
    69096909                FA654A6B1108ABED002615E0 /* MathMLTextElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA654A691108ABED002615E0 /* MathMLTextElement.cpp */; };
    69106910                FA654A6C1108ABED002615E0 /* MathMLTextElement.h in Headers */ = {isa = PBXBuildFile; fileRef = FA654A6A1108ABED002615E0 /* MathMLTextElement.h */; };
     6911                FA654A6B1108ABED002626F1 /* MathMLUnderOverElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA654A691108ABED002626F1 /* MathMLUnderOverElement.cpp */; };
     6912                FA654A6C1108ABED002626F1 /* MathMLUnderOverElement.h in Headers */ = {isa = PBXBuildFile; fileRef = FA654A6A1108ABED002626F1 /* MathMLUnderOverElement.h */; };
    69116913                FABE72F41059C1EB00D999DD /* MathMLElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FABE72ED1059C1EB00D999DD /* MathMLElement.cpp */; };
    69126914                FABE72F51059C1EB00D999DD /* MathMLElement.h in Headers */ = {isa = PBXBuildFile; fileRef = FABE72EE1059C1EB00D999DD /* MathMLElement.h */; };
     
    1508815090                FA654A691108ABED002615E0 /* MathMLTextElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MathMLTextElement.cpp; sourceTree = "<group>"; };
    1508915091                FA654A6A1108ABED002615E0 /* MathMLTextElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MathMLTextElement.h; sourceTree = "<group>"; };
     15092                FA654A691108ABED002626F1 /* MathMLUnderOverElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MathMLUnderOverElement.cpp; sourceTree = "<group>"; };
     15093                FA654A6A1108ABED002626F1 /* MathMLUnderOverElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MathMLUnderOverElement.h; sourceTree = "<group>"; };
    1509015094                FA6E466FCD0418A9966A5B60 /* DNSResolveQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DNSResolveQueue.h; sourceTree = "<group>"; };
    1509115095                FABE72ED1059C1EB00D999DD /* MathMLElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MathMLElement.cpp; sourceTree = "<group>"; };
     
    2491224916                                FA654A691108ABED002615E0 /* MathMLTextElement.cpp */,
    2491324917                                FA654A6A1108ABED002615E0 /* MathMLTextElement.h */,
     24918                                FA654A691108ABED002626F1 /* MathMLUnderOverElement.cpp */,
     24919                                FA654A6A1108ABED002626F1 /* MathMLUnderOverElement.h */,
    2491424920                                FABE72F31059C1EB00D999DD /* mathtags.in */,
    2491524921                        );
     
    2745027456                                4FA65A6C1108ABED002615E0 /* MathMLSpaceElement.h in Headers */,
    2745127457                                FA654A6C1108ABED002615E0 /* MathMLTextElement.h in Headers */,
     27458                                FA654A6C1108ABED002626F1 /* MathMLUnderOverElement.h in Headers */,
    2745227459                                439046EA12DA25E812AF80AC /* MathOperator.h in Headers */,
    2745327460                                49D5DC2C0F423A73008F20FD /* Matrix3DTransformOperation.h in Headers */,
     
    3128331290                                4FA65A6B1108ABED002615E0 /* MathMLSpaceElement.cpp in Sources */,
    3128431291                                FA654A6B1108ABED002615E0 /* MathMLTextElement.cpp in Sources */,
     31292                                FA654A6B1108ABED002626F1 /* MathMLUnderOverElement.cpp in Sources */,
    3128531293                                439046E912DA25E812AF80AC /* MathOperator.cpp in Sources */,
    3128631294                                49D5DC2B0F423A73008F20FD /* Matrix3DTransformOperation.cpp in Sources */,
  • trunk/Source/WebCore/mathml/MathMLAllInOne.cpp

    r203396 r203553  
    3636#include "MathMLSelectElement.cpp"
    3737#include "MathMLTextElement.cpp"
     38#include "MathMLUnderOverElement.cpp"
    3839
  • trunk/Source/WebCore/mathml/MathMLElement.cpp

    r203324 r203553  
    526526}
    527527
     528const MathMLElement::BooleanValue& MathMLElement::cachedBooleanAttribute(const QualifiedName& name, BooleanAttribute& attribute)
     529{
     530    if (!attribute.dirty)
     531        return attribute.value;
     532
     533    // In MathML, attribute values are case-sensitive.
     534    const AtomicString& value = attributeWithoutSynchronization(name);
     535    if (value == "true")
     536        attribute.value = BooleanValue::True;
     537    else if (value == "false")
     538        attribute.value = BooleanValue::False;
     539    else
     540        attribute.value = BooleanValue::Default;
     541    attribute.dirty = false;
     542
     543    return attribute.value;
     544}
     545
    528546}
    529547
  • trunk/Source/WebCore/mathml/MathMLElement.h

    r203228 r203553  
    6767    static Length parseMathMLLength(const String&);
    6868
     69    enum class BooleanValue { True, False, Default };
     70    struct BooleanAttribute {
     71        BooleanValue value { BooleanValue::Default };
     72        bool dirty { true };
     73    };
     74
    6975protected:
    7076    MathMLElement(const QualifiedName& tagName, Document&);
     
    8490
    8591    const Length& cachedMathMLLength(const QualifiedName&, Length&);
     92    const BooleanValue& cachedBooleanAttribute(const QualifiedName&, BooleanAttribute&);
    8693
    8794private:
  • trunk/Source/WebCore/mathml/MathMLInlineContainerElement.cpp

    r203396 r203553  
    3737#include "RenderMathMLRoot.h"
    3838#include "RenderMathMLRow.h"
    39 #include "RenderMathMLUnderOver.h"
    4039
    4140namespace WebCore {
     
    6665    if (hasTagName(annotation_xmlTag) || hasTagName(merrorTag) || hasTagName(mphantomTag) || hasTagName(mrowTag) || hasTagName(mstyleTag))
    6766        return createRenderer<RenderMathMLRow>(*this, WTFMove(style));
    68     if (hasTagName(moverTag) || hasTagName(munderTag) || hasTagName(munderoverTag))
    69         return createRenderer<RenderMathMLUnderOver>(*this, WTFMove(style));
    7067    if (hasTagName(msqrtTag) || hasTagName(mrootTag))
    7168        return createRenderer<RenderMathMLRoot>(*this, WTFMove(style));
  • trunk/Source/WebCore/mathml/MathMLScriptsElement.cpp

    r203396 r203553  
    3636using namespace MathMLNames;
    3737
    38 inline MathMLScriptsElement::MathMLScriptsElement(const QualifiedName& tagName, Document& document)
     38MathMLScriptsElement::MathMLScriptsElement(const QualifiedName& tagName, Document& document)
    3939    : MathMLInlineContainerElement(tagName, document)
    4040{
  • trunk/Source/WebCore/mathml/MathMLScriptsElement.h

    r203396 r203553  
    3131namespace WebCore {
    3232
    33 class MathMLScriptsElement final : public MathMLInlineContainerElement {
     33class MathMLScriptsElement : public MathMLInlineContainerElement {
    3434public:
    3535    static Ref<MathMLScriptsElement> create(const QualifiedName& tagName, Document&);
     
    3737    const Length& superscriptShift();
    3838
     39protected:
     40    MathMLScriptsElement(const QualifiedName& tagName, Document&);
     41
    3942private:
    40     MathMLScriptsElement(const QualifiedName& tagName, Document&);
    41     RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) final;
    42     void parseAttribute(const QualifiedName&, const AtomicString&) final;
     43    RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) override;
     44    void parseAttribute(const QualifiedName&, const AtomicString&) override;
    4345
    4446    Length m_subscriptShift;
  • trunk/Source/WebCore/mathml/MathMLUnderOverElement.cpp

    r203552 r203553  
    2828
    2929#if ENABLE(MATHML)
    30 #include "MathMLScriptsElement.h"
     30#include "MathMLUnderOverElement.h"
    3131
    32 #include "RenderMathMLScripts.h"
     32#include "RenderMathMLUnderOver.h"
    3333
    3434namespace WebCore {
     
    3636using namespace MathMLNames;
    3737
    38 inline MathMLScriptsElement::MathMLScriptsElement(const QualifiedName& tagName, Document& document)
    39     : MathMLInlineContainerElement(tagName, document)
     38inline MathMLUnderOverElement::MathMLUnderOverElement(const QualifiedName& tagName, Document& document)
     39    : MathMLScriptsElement(tagName, document)
    4040{
    4141}
    4242
    43 Ref<MathMLScriptsElement> MathMLScriptsElement::create(const QualifiedName& tagName, Document& document)
     43Ref<MathMLUnderOverElement> MathMLUnderOverElement::create(const QualifiedName& tagName, Document& document)
    4444{
    45     return adoptRef(*new MathMLScriptsElement(tagName, document));
     45    return adoptRef(*new MathMLUnderOverElement(tagName, document));
    4646}
    4747
    48 const MathMLElement::Length& MathMLScriptsElement::subscriptShift()
     48const MathMLElement::BooleanValue& MathMLUnderOverElement::accent()
    4949{
    50     return cachedMathMLLength(subscriptshiftAttr, m_subscriptShift);
     50    return cachedBooleanAttribute(accentAttr, m_accent);
    5151}
    5252
    53 const MathMLElement::Length& MathMLScriptsElement::superscriptShift()
     53const MathMLElement::BooleanValue& MathMLUnderOverElement::accentUnder()
    5454{
    55     return cachedMathMLLength(superscriptshiftAttr, m_superscriptShift);
     55    return cachedBooleanAttribute(accentunderAttr, m_accentUnder);
    5656}
    5757
    58 void MathMLScriptsElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
     58void MathMLUnderOverElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
    5959{
    60     if (name == subscriptshiftAttr)
    61         m_subscriptShift.dirty = true;
    62     else if (name == superscriptshiftAttr)
    63         m_superscriptShift.dirty = true;
     60    if (name == accentAttr)
     61        m_accent.dirty = true;
     62    else if (name == accentunderAttr)
     63        m_accentUnder.dirty = true;
    6464
    6565    MathMLElement::parseAttribute(name, value);
    6666}
    6767
    68 RenderPtr<RenderElement> MathMLScriptsElement::createElementRenderer(RenderStyle&& style, const RenderTreePosition&)
     68RenderPtr<RenderElement> MathMLUnderOverElement::createElementRenderer(RenderStyle&& style, const RenderTreePosition&)
    6969{
    70     ASSERT(hasTagName(msubTag) || hasTagName(msupTag) || hasTagName(msubsupTag) || hasTagName(mmultiscriptsTag));
    71     return createRenderer<RenderMathMLScripts>(*this, WTFMove(style));
     70    ASSERT(hasTagName(munderTag) || hasTagName(moverTag) || hasTagName(munderoverTag));
     71    return createRenderer<RenderMathMLUnderOver>(*this, WTFMove(style));
    7272}
    7373
  • trunk/Source/WebCore/mathml/MathMLUnderOverElement.h

    r203552 r203553  
    2727
    2828#if ENABLE(MATHML)
    29 #include "MathMLInlineContainerElement.h"
     29#include "MathMLScriptsElement.h"
    3030
    3131namespace WebCore {
    3232
    33 class MathMLScriptsElement final : public MathMLInlineContainerElement {
     33class MathMLUnderOverElement final : public MathMLScriptsElement {
    3434public:
    35     static Ref<MathMLScriptsElement> create(const QualifiedName& tagName, Document&);
    36     const Length& subscriptShift();
    37     const Length& superscriptShift();
     35    static Ref<MathMLUnderOverElement> create(const QualifiedName& tagName, Document&);
     36    const BooleanValue& accent();
     37    const BooleanValue& accentUnder();
    3838
    3939private:
    40     MathMLScriptsElement(const QualifiedName& tagName, Document&);
     40    MathMLUnderOverElement(const QualifiedName& tagName, Document&);
    4141    RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) final;
    4242    void parseAttribute(const QualifiedName&, const AtomicString&) final;
    4343
    44     Length m_subscriptShift;
    45     Length m_superscriptShift;
     44    BooleanAttribute m_accent;
     45    BooleanAttribute m_accentUnder;
    4646};
    4747
  • trunk/Source/WebCore/mathml/mathtags.in

    r203396 r203553  
    1616mrow interfaceName=MathMLInlineContainerElement
    1717mstyle interfaceName=MathMLInlineContainerElement
    18 mover interfaceName=MathMLInlineContainerElement
    19 munder interfaceName=MathMLInlineContainerElement
    20 munderover interfaceName=MathMLInlineContainerElement
     18mover interfaceName=MathMLUnderOverElement
     19munder interfaceName=MathMLUnderOverElement
     20munderover interfaceName=MathMLUnderOverElement
    2121msqrt interfaceName=MathMLInlineContainerElement
    2222mroot interfaceName=MathMLInlineContainerElement
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp

    r203395 r203553  
    3232
    3333#include "GraphicsContext.h"
    34 #include "MathMLNames.h"
     34#include "MathMLFractionElement.h"
    3535#include "PaintInfo.h"
    3636#include <cmath>
     
    3838namespace WebCore {
    3939
    40 using namespace MathMLNames;
    41 
    42 RenderMathMLFraction::RenderMathMLFraction(MathMLInlineContainerElement& element, RenderStyle&& style)
     40RenderMathMLFraction::RenderMathMLFraction(MathMLFractionElement& element, RenderStyle&& style)
    4341    : RenderMathMLBlock(element, WTFMove(style))
    4442{
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLFraction.h

    r203395 r203553  
    3636namespace WebCore {
    3737
     38class MathMLFractionElement;
     39
    3840class RenderMathMLFraction final : public RenderMathMLBlock {
    3941public:
    40     RenderMathMLFraction(MathMLInlineContainerElement&, RenderStyle&&);
     42    RenderMathMLFraction(MathMLFractionElement&, RenderStyle&&);
    4143
    4244    float relativeLineThickness() const { return m_defaultLineThickness ? m_lineThickness / m_defaultLineThickness : LayoutUnit(0); }
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLPadded.cpp

    r203150 r203553  
    2929#if ENABLE(MATHML)
    3030
    31 #include "MathMLNames.h"
    3231#include <cmath>
    3332
    3433namespace WebCore {
    3534
    36 using namespace MathMLNames;
    37 
    38 RenderMathMLPadded::RenderMathMLPadded(Element& element, RenderStyle&& style)
     35RenderMathMLPadded::RenderMathMLPadded(MathMLPaddedElement& element, RenderStyle&& style)
    3936    : RenderMathMLRow(element, WTFMove(style))
    4037{
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLPadded.h

    r203228 r203553  
    3535class RenderMathMLPadded final : public RenderMathMLRow {
    3636public:
    37     RenderMathMLPadded(Element&, RenderStyle&&);
     37    RenderMathMLPadded(MathMLPaddedElement&, RenderStyle&&);
    3838
    3939private:
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLScripts.cpp

    r203396 r203553  
    3838namespace WebCore {
    3939
    40 using namespace MathMLNames;
    41 
    4240static bool isPrescriptDelimiter(const RenderObject& renderObject)
    4341{
     
    4543}
    4644
    47 RenderMathMLScripts::RenderMathMLScripts(Element& element, RenderStyle&& style)
     45RenderMathMLScripts::RenderMathMLScripts(MathMLScriptsElement& element, RenderStyle&& style)
    4846    : RenderMathMLBlock(element, WTFMove(style))
    4947{
     
    6765}
    6866
    69 MathMLScriptsElement& RenderMathMLScripts::scriptsElement() const
    70 {
    71     ASSERT(!isRenderMathMLUnderOver());
     67MathMLScriptsElement& RenderMathMLScripts::element() const
     68{
    7269    return static_cast<MathMLScriptsElement&>(nodeForNonAnonymous());
    7370}
     
    261258            // It is not clear how to interpret the default shift and it is not available yet anyway.
    262259            // Hence we just pass 0 as the default value used by toUserUnits.
    263             LayoutUnit specifiedMinSubShift = toUserUnits(scriptsElement().subscriptShift(), style(), 0);
     260            LayoutUnit specifiedMinSubShift = toUserUnits(element().subscriptShift(), style(), 0);
    264261            minSubScriptShift = std::max(minSubScriptShift, specifiedMinSubShift);
    265262        }
     
    270267            // It is not clear how to interpret the default shift and it is not available yet anyway.
    271268            // Hence we just pass 0 as the default value used by toUserUnits.
    272             LayoutUnit specifiedMinSupShift = toUserUnits(scriptsElement().superscriptShift(), style(), 0);
     269            LayoutUnit specifiedMinSupShift = toUserUnits(element().superscriptShift(), style(), 0);
    273270            minSupScriptShift = std::max(minSupScriptShift, specifiedMinSupShift);
    274271        }
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLScripts.h

    r203396 r203553  
    3939class RenderMathMLScripts : public RenderMathMLBlock {
    4040public:
    41     RenderMathMLScripts(Element&, RenderStyle&&);
     41    RenderMathMLScripts(MathMLScriptsElement&, RenderStyle&&);
    4242    RenderMathMLOperator* unembellishedOperator() final;
    4343
     
    5252
    5353private:
    54     MathMLScriptsElement& scriptsElement() const;
     54    MathMLScriptsElement& element() const;
    5555    Optional<int> firstLineBaseline() const final;
    5656    bool getBaseAndScripts(RenderBox*& base, RenderBox*& firstPostScript, RenderBox*& firstPreScript);
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLSpace.cpp

    r203108 r203553  
    3030
    3131#include "GraphicsContext.h"
    32 #include "MathMLNames.h"
    3332#include "PaintInfo.h"
    3433
    3534namespace WebCore {
    36 
    37 using namespace MathMLNames;
    3835
    3936RenderMathMLSpace::RenderMathMLSpace(MathMLSpaceElement& element, RenderStyle&& style)
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLUnderOver.cpp

    r203324 r203553  
    3232
    3333#include "MathMLElement.h"
    34 #include "MathMLNames.h"
    3534#include "MathMLOperatorDictionary.h"
     35#include "MathMLUnderOverElement.h"
    3636#include "RenderIterator.h"
    3737#include "RenderMathMLOperator.h"
     
    3939namespace WebCore {
    4040
    41 using namespace MathMLNames;
    42 
    43 RenderMathMLUnderOver::RenderMathMLUnderOver(Element& element, RenderStyle&& style)
     41RenderMathMLUnderOver::RenderMathMLUnderOver(MathMLUnderOverElement& element, RenderStyle&& style)
    4442    : RenderMathMLScripts(element, WTFMove(style))
    4543{
     44}
     45
     46MathMLUnderOverElement& RenderMathMLUnderOver::element() const
     47{
     48    return static_cast<MathMLUnderOverElement&>(nodeForNonAnonymous());
    4649}
    4750
     
    166169    ASSERT(m_scriptType == UnderOver || (accentUnder && m_scriptType == Under) || (!accentUnder && m_scriptType == Over));
    167170
    168     const AtomicString& attributeValue = element()->attributeWithoutSynchronization(accentUnder ? accentunderAttr : accentAttr);
    169     if (attributeValue == "true")
     171    const MathMLElement::BooleanValue& attributeValue = accentUnder ? element().accentUnder() : element().accent();
     172    if (attributeValue == MathMLElement::BooleanValue::True)
    170173        return true;
    171     if (attributeValue == "false")
     174    if (attributeValue == MathMLElement::BooleanValue::False)
    172175        return false;
    173176    RenderBox& script = accentUnder ? under() : over();
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLUnderOver.h

    r203228 r203553  
    3333namespace WebCore {
    3434
     35class MathMLUnderOverElement;
     36
    3537class RenderMathMLUnderOver final : public RenderMathMLScripts {
    3638public:
    37     RenderMathMLUnderOver(Element&, RenderStyle&&);
     39    RenderMathMLUnderOver(MathMLUnderOverElement&, RenderStyle&&);
    3840
    3941private:
     
    4143    bool isRenderMathMLUnderOver() const final { return true; }
    4244    const char* renderName() const final { return "RenderMathMLUnderOver"; }
     45    MathMLUnderOverElement& element() const;
    4346
    4447    void computePreferredLogicalWidths() final;
Note: See TracChangeset for help on using the changeset viewer.