-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider removing explicit mo@maxsize = "infinity" attribute? #107
Comments
I can't see how this is useful at all, I'd remove it from core. Seems to have been added in mathml 2.0 but I don't recall why, I'll see if the mail from that time is still available (but only to see if it should stay in full, I think with the general movement to remove named lengths from core it does not belong there at all) |
So I think there is nothing to do here. Except that we should probably write tests for minsize/maxsize for other lengths. |
consensus was to remove "infinity" from core, consistently with other named lengths. |
https://bugs.webkit.org/show_bug.cgi?id=202720 Patch by Delan Azabani <dazabani@igalia.com> on 2020-04-09 Reviewed by Frédéric Wang. In MathML 2, the default mo@maxsize was infinity [1], unless some other default was given by mstyle@maxsize [2]. The sole purpose of "infinity" was to give authors a way to set mo@maxsize to infinity when some other mstyle@maxsize was set. MathML Core removes mstyle@maxsize [3][4], such that "infinity" has the same semantics as any other missing or invalid mo@maxsize, so the spec has been simplified to make infinity an anonymous value [5][6]. No functional change, because WebKit has never supported mstyle@maxsize anyway. To verify that there's no functional change: 1. Search for references to LengthType::Infinity, and observe that the mo@maxsize parser in MathMLOperatorElement::maxSize is the only place where a Length of ::type infinity is created 2. Search for references to that method, and observe that the only caller (RenderMathMLOperator::maxSize) passes intMaxForLayoutUnit (infinity) to toUserUnits as the referenceValue 3. Go to the definition of toUserUnits, and observe that the refer- enceValue is used as the ParsingFailed default 4. Step 1 shows that no other attributes would be affected by removing LengthType::Infinity, and steps 2 and 3 show that mo@maxsize treats invalid values as infinity, therefore it's safe to remove both the "infinity" parsing code and the underlying LengthType variant [1] https://www.w3.org/TR/MathML2/chapter3.html#id.3.2.5.2 [2] https://www.w3.org/TR/MathML2/chapter3.html#presm.mstyle [3] https://mathml-refresh.github.io/mathml-core/#style-change-mstyle [4] w3c/mathml#1 [5] https://mathml-refresh.github.io/mathml-core/#dictionary-based-attributes [6] w3c/mathml#107 No new tests, because no functional change. * mathml/MathMLElement.h: Remove LengthType::Infinity. * mathml/MathMLOperatorElement.cpp: (WebCore::MathMLOperatorElement::maxSize): Remove explicit branch on "infinity". Replace what remains with an equivalent cachedMathMLLength call. * rendering/mathml/RenderMathMLBlock.cpp: (WebCore::toUserUnits): Remove explicit branch on LengthType::Infinity. * rendering/mathml/RenderMathMLOperator.cpp: (WebCore::RenderMathMLOperator::maxSize): Update comment to refer to the default value in the same way as the spec. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@259785 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=202720 Patch by Delan Azabani <dazabani@igalia.com> on 2020-04-09 Reviewed by Frédéric Wang. In MathML 2, the default mo@maxsize was infinity [1], unless some other default was given by mstyle@maxsize [2]. The sole purpose of "infinity" was to give authors a way to set mo@maxsize to infinity when some other mstyle@maxsize was set. MathML Core removes mstyle@maxsize [3][4], such that "infinity" has the same semantics as any other missing or invalid mo@maxsize, so the spec has been simplified to make infinity an anonymous value [5][6]. No functional change, because WebKit has never supported mstyle@maxsize anyway. To verify that there's no functional change: 1. Search for references to LengthType::Infinity, and observe that the mo@maxsize parser in MathMLOperatorElement::maxSize is the only place where a Length of ::type infinity is created 2. Search for references to that method, and observe that the only caller (RenderMathMLOperator::maxSize) passes intMaxForLayoutUnit (infinity) to toUserUnits as the referenceValue 3. Go to the definition of toUserUnits, and observe that the refer- enceValue is used as the ParsingFailed default 4. Step 1 shows that no other attributes would be affected by removing LengthType::Infinity, and steps 2 and 3 show that mo@maxsize treats invalid values as infinity, therefore it's safe to remove both the "infinity" parsing code and the underlying LengthType variant [1] https://www.w3.org/TR/MathML2/chapter3.html#id.3.2.5.2 [2] https://www.w3.org/TR/MathML2/chapter3.html#presm.mstyle [3] https://mathml-refresh.github.io/mathml-core/#style-change-mstyle [4] w3c/mathml#1 [5] https://mathml-refresh.github.io/mathml-core/#dictionary-based-attributes [6] w3c/mathml#107 No new tests, because no functional change. * mathml/MathMLElement.h: Remove LengthType::Infinity. * mathml/MathMLOperatorElement.cpp: (WebCore::MathMLOperatorElement::maxSize): Remove explicit branch on "infinity". Replace what remains with an equivalent cachedMathMLLength call. * rendering/mathml/RenderMathMLBlock.cpp: (WebCore::toUserUnits): Remove explicit branch on LengthType::Infinity. * rendering/mathml/RenderMathMLOperator.cpp: (WebCore::RenderMathMLOperator::maxSize): Update comment to refer to the default value in the same way as the spec. Canonical link: https://commits.webkit.org/223145@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@259785 268f45cc-cd09-0410-ab3c-d52691b4dbfc
This is the same as not specifying the attribute at all, so I'm not sure it's really useful now that mstyle@maxsize is disallowed per #1
That way the attribute can just be defined as a length-percentage like lspace/rspace/minsize
The text was updated successfully, but these errors were encountered: