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

Changeset 202962 in webkit


Ignore:
Timestamp:
Jul 7, 2016, 11:16:32 PM (10 years ago)
Author:
fred.wang@free.fr
Message:

Bug 155792 - Basic implementation of mpadded
https://bugs.webkit.org/show_bug.cgi?id=155792

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

Source/WebCore:

We implement a basic support for the mpadded element.
We support most of the attribute values except pseudo-units or negative values.

Tests: mathml/presentation/mpadded-1-2.html

mathml/presentation/mpadded-1.html
mathml/presentation/mpadded-2.html
mathml/presentation/mpadded-3.html
mathml/presentation/mpadded-unsupported-values.html
mathml/presentation/mpadded-dynamic.html

  • CMakeLists.txt: Add RenderMathMLPadded to the build system.
  • WebCore.xcodeproj/project.pbxproj: Ditto.
  • mathml/MathMLInlineContainerElement.cpp:

(WebCore::MathMLInlineContainerElement::createElementRenderer): Create the renderer
for mpadded.

  • mathml/mathattrs.in: Add voffset attribute.
  • mathml/mathtags.in: Make mpadded use MathMLInlineContainerElement.
  • rendering/RenderObject.h:

(WebCore::RenderObject::isRenderMathMLPadded): Define isRenderMathMLPadded.

  • rendering/mathml/RenderMathMLPadded.cpp: Added.

We do a simple implementation by overriding the behavior of RenderMathMLRow and forcing
relayout after attribute or style change.
(WebCore::RenderMathMLPadded::RenderMathMLPadded):
(WebCore::RenderMathMLPadded::computePreferredLogicalWidths):
(WebCore::RenderMathMLPadded::layoutBlock):
(WebCore::RenderMathMLPadded::updateFromElement):
(WebCore::RenderMathMLPadded::styleDidChange):
(WebCore::RenderMathMLPadded::firstLineBaseline):

  • rendering/mathml/RenderMathMLPadded.h: Added.

LayoutTests:

We import mpadded tests from Mozilla test suite.
We also add some tests for dynamic changes of mpadded attributes and to verify
that the mpadded element behaves as if it had an inferred <mrow>.
Finally, we check that fallback properly for negative and pseudo-unit values that
we do not support yet.

  • mathml/presentation/inferred-mrow-baseline.html: Check baseline for mpadded.
  • mathml/presentation/inferred-mrow-baseline-expected.txt: Ditto.
  • mathml/presentation/inferred-mrow-stretchy.html: Check stretching of operators for mpadded.
  • mathml/presentation/inferred-mrow-stretchy-expected.txt: Ditto.
  • mathml/presentation/mpadded-dynamic.html: Added. Verify dynamic change of mpadded attributes.
  • mathml/presentation/mpadded-dynamic-expected.html: Added. Ditto.
  • mathml/presentation/mpadded-unsupported-values.html: Added. Check negative and pseudo-unit values.
  • mathml/presentation/mpadded-unsupported-values-expected.html: Added.
  • mathml/presentation/mpadded-1-2-expected.html: Added.
  • mathml/presentation/mpadded-1-2.html: Added.
  • mathml/presentation/mpadded-1-expected.html: Added.
  • mathml/presentation/mpadded-1.html: Added.
  • mathml/presentation/mpadded-2-expected.html: Added.
  • mathml/presentation/mpadded-2.html: Added.
  • mathml/presentation/mpadded-3-expected.html: Added.
  • mathml/presentation/mpadded-3.html: Added.
Location:
trunk
Files:
16 added
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r202960 r202962  
     12016-07-07  Frederic Wang  <fwang@igalia.com>
     2
     3        Bug 155792 - Basic implementation of mpadded
     4        https://bugs.webkit.org/show_bug.cgi?id=155792
     5
     6        Reviewed by Brent Fulgham.
     7
     8        We import mpadded tests from Mozilla test suite.
     9        We also add some tests for dynamic changes of mpadded attributes and to verify
     10        that the mpadded element behaves as if it had an inferred <mrow>.
     11        Finally, we check that fallback properly for negative and pseudo-unit values that
     12        we do not support yet.
     13
     14        * mathml/presentation/inferred-mrow-baseline.html: Check baseline for mpadded.
     15        * mathml/presentation/inferred-mrow-baseline-expected.txt: Ditto.
     16        * mathml/presentation/inferred-mrow-stretchy.html: Check stretching of operators for mpadded.
     17        * mathml/presentation/inferred-mrow-stretchy-expected.txt: Ditto.
     18        * mathml/presentation/mpadded-dynamic.html: Added. Verify dynamic change of mpadded attributes.
     19        * mathml/presentation/mpadded-dynamic-expected.html: Added. Ditto.
     20        * mathml/presentation/mpadded-unsupported-values.html: Added. Check negative and pseudo-unit values.
     21        * mathml/presentation/mpadded-unsupported-values-expected.html: Added.
     22        * mathml/presentation/mpadded-1-2-expected.html: Added.
     23        * mathml/presentation/mpadded-1-2.html: Added.
     24        * mathml/presentation/mpadded-1-expected.html: Added.
     25        * mathml/presentation/mpadded-1.html: Added.
     26        * mathml/presentation/mpadded-2-expected.html: Added.
     27        * mathml/presentation/mpadded-2.html: Added.
     28        * mathml/presentation/mpadded-3-expected.html: Added.
     29        * mathml/presentation/mpadded-3.html: Added.
     30
    1312016-07-07  Frederic Wang  <fwang@igalia.com>
    232
  • trunk/LayoutTests/mathml/presentation/inferred-mrow-baseline-expected.txt

    r196417 r202962  
    11This test passes if rectangles are correctly aligned with respect to the baseline.
    22
     3 
    34 
    45 
     
    1617PASS baseline alignment inside Math
    1718PASS baseline alignment inside Menclose
     19PASS baseline alignment inside Mpadded
    1820
  • trunk/LayoutTests/mathml/presentation/inferred-mrow-baseline.html

    r196417 r202962  
    99      function run()
    1010      {
    11         var tags = ["Mrow", "Sqrt", "Style", "Error", "Phantom", "Math", "Menclose"];
     11        var tags = ["Mrow", "Sqrt", "Style", "Error", "Phantom", "Math", "Menclose", "Mpadded"];
    1212        for (var i in tags) {
    1313          var tag = tags[i];
     
    4040         
    4141      <math><menclose notation="box"><mspace id="aboveMenclose" width="10px" height="30px" mathbackground="red"></mspace><mspace id="belowMenclose" width="10px" depth="30px" mathbackground="blue"></mspace></menclose></math>
     42
     43      <math><mpadded notation="box"><mspace id="aboveMpadded" width="10px" height="30px" mathbackground="red"></mspace><mspace id="belowMpadded" width="10px" depth="30px" mathbackground="blue"></mspace></mpadded></math>
    4244    </p>
    4345
  • trunk/LayoutTests/mathml/presentation/inferred-mrow-stretchy-expected.txt

    r202420 r202962  
    1313 
    1414|
     15 
     16|
    1517
    1618
     
    2224PASS operator stretching inside Math
    2325PASS operator stretching inside Menclose
     26PASS operator stretching inside Mpadded
    2427
  • trunk/LayoutTests/mathml/presentation/inferred-mrow-stretchy.html

    r196417 r202962  
    99      function run()
    1010      {
    11         var tags = ["Mrow", "Sqrt", "Style", "Error", "Phantom", "Math", "Menclose"];
     11        var tags = ["Mrow", "Sqrt", "Style", "Error", "Phantom", "Math", "Menclose", "Mpadded"];
    1212        for (var i in tags) {
    1313          var tag = tags[i];
     
    3333      <math><mo id="moMath">|</mo><mspace width="1px" height="30px" depth="30px" mathbackground="red"></mspace></math>
    3434      <math><menclose notation="box"><mo id="moMenclose">|</mo><mspace width="1px" height="30px" depth="30px" mathbackground="red"></mspace></menclose></math>
     35      <math><mpadded notation="box"><mo id="moMpadded">|</mo><mspace width="1px" height="30px" depth="30px" mathbackground="red"></mspace></mpadded></math>
    3536    </p>
    3637
  • trunk/Source/WebCore/CMakeLists.txt

    r202961 r202962  
    25332533    rendering/mathml/RenderMathMLMenclose.cpp
    25342534    rendering/mathml/RenderMathMLOperator.cpp
     2535    rendering/mathml/RenderMathMLPadded.cpp
    25352536    rendering/mathml/RenderMathMLRoot.cpp
    25362537    rendering/mathml/RenderMathMLRow.cpp
  • trunk/Source/WebCore/ChangeLog

    r202961 r202962  
     12016-07-07  Frederic Wang  <fwang@igalia.com>
     2
     3        Bug 155792 - Basic implementation of mpadded
     4        https://bugs.webkit.org/show_bug.cgi?id=155792
     5
     6        Reviewed by Brent Fulgham.
     7
     8        We implement a basic support for the mpadded element.
     9        We support most of the attribute values except pseudo-units or negative values.
     10
     11        Tests: mathml/presentation/mpadded-1-2.html
     12               mathml/presentation/mpadded-1.html
     13               mathml/presentation/mpadded-2.html
     14               mathml/presentation/mpadded-3.html
     15               mathml/presentation/mpadded-unsupported-values.html
     16               mathml/presentation/mpadded-dynamic.html
     17
     18        * CMakeLists.txt: Add RenderMathMLPadded to the build system.
     19        * WebCore.xcodeproj/project.pbxproj: Ditto.
     20        * mathml/MathMLInlineContainerElement.cpp:
     21        (WebCore::MathMLInlineContainerElement::createElementRenderer): Create the renderer
     22        for mpadded.
     23        * mathml/mathattrs.in: Add voffset attribute.
     24        * mathml/mathtags.in: Make mpadded use MathMLInlineContainerElement.
     25        * rendering/RenderObject.h:
     26        (WebCore::RenderObject::isRenderMathMLPadded): Define isRenderMathMLPadded.
     27        * rendering/mathml/RenderMathMLPadded.cpp: Added.
     28        We do a simple implementation by overriding the behavior of RenderMathMLRow and forcing
     29        relayout after attribute or style change.
     30        (WebCore::RenderMathMLPadded::RenderMathMLPadded):
     31        (WebCore::RenderMathMLPadded::computePreferredLogicalWidths):
     32        (WebCore::RenderMathMLPadded::layoutBlock):
     33        (WebCore::RenderMathMLPadded::updateFromElement):
     34        (WebCore::RenderMathMLPadded::styleDidChange):
     35        (WebCore::RenderMathMLPadded::firstLineBaseline):
     36        * rendering/mathml/RenderMathMLPadded.h: Added.
     37
    1382016-07-07  Frederic Wang  <fwang@igalia.com>
    239
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r202961 r202962  
    23902390                5B30695E18B3D3450099D5E8 /* WebGLDrawBuffers.h in Headers */ = {isa = PBXBuildFile; fileRef = 5B30695B18B3D3450099D5E8 /* WebGLDrawBuffers.h */; };
    23912391                5B7A208D2E12979B4AE19DE6 /* RenderMathMLSpace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DBFCB0EBFF5CD77EBEB35395 /* RenderMathMLSpace.cpp */; };
     2392                5B7A208D2E12979B4AE19E6F /* RenderMathMLPadded.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DBFCB0EBFF5CD77EBEB3595F /* RenderMathMLPadded.cpp */; };
    23922393                5C4304B0191AC908000E2BC0 /* EXTShaderTextureLOD.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5C4304AD191AC908000E2BC0 /* EXTShaderTextureLOD.cpp */; };
    23932394                5C4304B1191AC908000E2BC0 /* EXTShaderTextureLOD.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C4304AE191AC908000E2BC0 /* EXTShaderTextureLOD.h */; };
     
    90379038                3314ACEA10892086000F0E56 /* JSExceptionBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSExceptionBase.h; sourceTree = "<group>"; };
    90389039                331FF67DE197B57393C46AA7 /* RenderMathMLSpace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderMathMLSpace.h; sourceTree = "<group>"; };
     9040                331FF67DE197B57393C46A7F /* RenderMathMLPadded.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderMathMLPadded.h; sourceTree = "<group>"; };
    90399041                333F704E0FB49CA2008E12A6 /* Notification.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Notification.idl; sourceTree = "<group>"; };
    90409042                333F704F0FB49CA2008E12A6 /* Notification.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Notification.h; sourceTree = "<group>"; };
     
    1452314525                DB23C2CA0A508D29002489EB /* IndentOutdentCommand.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = IndentOutdentCommand.h; sourceTree = "<group>"; };
    1452414526                DBFCB0EBFF5CD77EBEB35395 /* RenderMathMLSpace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderMathMLSpace.cpp; sourceTree = "<group>"; };
     14527                DBFCB0EBFF5CD77EBEB3595F /* RenderMathMLPadded.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderMathMLPadded.cpp; sourceTree = "<group>"; };
    1452514528                DD05FE0B0B8BA3C6009ACDFE /* WebCoreObjCExtras.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebCoreObjCExtras.h; sourceTree = "<group>"; };
    1452614529                DD763BB10992C2C900740B8E /* libxml2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libxml2.dylib; path = /usr/lib/libxml2.dylib; sourceTree = "<absolute>"; };
     
    1714717150                                DBFCB0EBFF5CD77EBEB35395 /* RenderMathMLSpace.cpp */,
    1714817151                                331FF67DE197B57393C46AA7 /* RenderMathMLSpace.h */,
     17152                                DBFCB0EBFF5CD77EBEB3595F /* RenderMathMLPadded.cpp */,
     17153                                331FF67DE197B57393C46A7F /* RenderMathMLPadded.h */,
    1714917154                                439046D712DA25E800AF80A9 /* RenderMathMLToken.cpp */,
    1715017155                                439046D812DA25E800AF80A9 /* RenderMathMLToken.h */,
     
    3162631631                                439046E712DA25E800AF80A2 /* RenderMathMLScripts.cpp in Sources */,
    3162731632                                5B7A208D2E12979B4AE19DE6 /* RenderMathMLSpace.cpp in Sources */,
     31633                                5B7A208D2E12979B4AE19E6F /* RenderMathMLPadded.cpp in Sources */,
    3162831634                                439046EB12DA25E800AF80A9 /* RenderMathMLToken.cpp in Sources */,
    3162931635                                439046E912DA25E800AF80A2 /* RenderMathMLUnderOver.cpp in Sources */,
  • trunk/Source/WebCore/mathml/MathMLInlineContainerElement.cpp

    r202960 r202962  
    3636#include "RenderMathMLFraction.h"
    3737#include "RenderMathMLMenclose.h"
     38#include "RenderMathMLPadded.h"
    3839#include "RenderMathMLRoot.h"
    3940#include "RenderMathMLRow.h"
     
    8081    if (hasTagName(mtableTag))
    8182        return createRenderer<RenderMathMLTable>(*this, WTFMove(style));
     83    if (hasTagName(mpaddedTag))
     84        return createRenderer<RenderMathMLPadded>(*this, WTFMove(style));
    8285
    8386    return createRenderer<RenderMathMLBlock>(*this, WTFMove(style));
  • trunk/Source/WebCore/mathml/mathattrs.in

    r202960 r202962  
    4848subscriptshift
    4949superscriptshift
     50voffset
    5051width
  • trunk/Source/WebCore/mathml/mathtags.in

    r177025 r202962  
    1212msubsup interfaceName=MathMLInlineContainerElement
    1313merror interfaceName=MathMLInlineContainerElement
     14mpadded interfaceName=MathMLInlineContainerElement
    1415mphantom interfaceName=MathMLInlineContainerElement
    1516mrow interfaceName=MathMLInlineContainerElement
     
    4243mlabeledtr interfaceName=MathMLElement
    4344mlongdiv interfaceName=MathMLElement
    44 mpadded interfaceName=MathMLElement
    4545mscarries interfaceName=MathMLElement
    4646mscarry interfaceName=MathMLElement
  • trunk/Source/WebCore/rendering/RenderObject.h

    r202726 r202962  
    343343    virtual bool isRenderMathMLFenced() const { return false; }
    344344    virtual bool isRenderMathMLFraction() const { return false; }
     345    virtual bool isRenderMathMLPadded() const { return false; }
    345346    virtual bool isRenderMathMLRoot() const { return false; }
    346347    virtual bool isRenderMathMLSpace() const { return false; }
Note: See TracChangeset for help on using the changeset viewer.