WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-160239-20160801104612.patch (text/plain), 23.94 KB, created by
Frédéric Wang Nélar
on 2016-08-01 01:47:32 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Frédéric Wang Nélar
Created:
2016-08-01 01:47:32 PDT
Size:
23.94 KB
patch
obsolete
>Subversion Revision: 203973 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 48e33eee5daf5ee76a12363b2e34189f0cd3df73..2c1909ebe9851ff1d83e69aa17101bed041353bd 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,49 @@ >+2016-07-28 Frederic Wang <fwang@igalia.com> >+ >+ Move parsing of the form attribute to MathMLOperatorElement >+ https://bugs.webkit.org/show_bug.cgi?id=160239 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ We move the parsing of the mo@form attribute to the MathMLOperatorElement class. Note that >+ when the attribute is not explicit, the form may also be guessed by searching into the >+ operator dictionary. Hence we also start moving the determination of the default dictionary >+ properties. Moving the actual parsing of the corresponding attributes will be done in >+ follow-up commits. >+ >+ No new tests, already covered by existing tests. >+ >+ * mathml/MathMLInlineContainerElement.cpp: >+ (WebCore::MathMLInlineContainerElement::childrenChanged): Make the form of operators dirty >+ if its siblings have changed. >+ * mathml/MathMLOperatorDictionary.cpp: >+ (WebCore::MathMLOperatorDictionary::search): Merge old getEntry functions into one helper >+ function that returns an Optional<Entry>. >+ (WebCore::MathMLOperatorDictionary::getEntry): Deleted >+ * mathml/MathMLOperatorDictionary.h: Declare MathMLOperatorDictionary::find. >+ * mathml/MathMLOperatorElement.cpp: >+ (WebCore::MathMLOperatorElement::dictionaryProperty): We determine the operator form by >+ parsing the corresponding attribute or by using heuristics if that attribute is not >+ specified. We also read dictionary the corresponding dictionary properties. >+ (WebCore::MathMLOperatorElement::flags): Return the flags read from the dictionary. >+ (WebCore::MathMLOperatorElement::defaultLeadingSpace): Return the space read from the dictionary. >+ (WebCore::MathMLOperatorElement::defaultTrailingSpace): Return the space read from the dictionary. >+ (WebCore::MathMLOperatorElement::childrenChanged): Make the dictionary properties dirty. >+ (WebCore::MathMLOperatorElement::parseAttribute): Make the dictionary properties dirty when >+ the form changes. >+ * mathml/MathMLOperatorElement.h: New member to store dictionary properties and expose them. >+ * rendering/mathml/RenderMathMLFencedOperator.cpp: >+ (WebCore::RenderMathMLFencedOperator::setOperatorProperties): We implement the case specific >+ to anonymous mfenced operators here. >+ * rendering/mathml/RenderMathMLFencedOperator.h: Move the m_operatorForm member here and >+ declare the overriden function setOperatorProperties. >+ * rendering/mathml/RenderMathMLOperator.cpp: >+ (WebCore::RenderMathMLOperator::setOperatorProperties): Simplify this code since the logic >+ has been moved to the element classes. >+ (WebCore::RenderMathMLOperator::setOperatorPropertiesFromOpDictEntry): Deleted. >+ * rendering/mathml/RenderMathMLOperator.h: Remove setOperatorPropertiesFromOpDictEntry, make >+ members accessible to RenderMathMLFencedOperator and remove m_operatorForm. >+ > 2016-08-01 Frederic Wang <fwang@igalia.com> > > Introduce a RenderMathMLFencedOperator class >diff --git a/Source/WebCore/mathml/MathMLInlineContainerElement.cpp b/Source/WebCore/mathml/MathMLInlineContainerElement.cpp >index 7b42c88997e818c261fc9104fc32c1d4d321a3ea..4e834dba4a46197eff7f4a0143119f965c1889d6 100644 >--- a/Source/WebCore/mathml/MathMLInlineContainerElement.cpp >+++ b/Source/WebCore/mathml/MathMLInlineContainerElement.cpp >@@ -32,6 +32,7 @@ > #include "MathMLInlineContainerElement.h" > > #include "MathMLNames.h" >+#include "MathMLOperatorElement.h" > #include "RenderMathMLBlock.h" > #include "RenderMathMLFenced.h" > #include "RenderMathMLMenclose.h" >@@ -54,6 +55,11 @@ Ref<MathMLInlineContainerElement> MathMLInlineContainerElement::create(const Qua > > void MathMLInlineContainerElement::childrenChanged(const ChildChange& change) > { >+ for (auto child = firstChild(); child; child = child->nextSibling()) { >+ if (child->hasTagName(MathMLNames::moTag)) >+ static_cast<MathMLOperatorElement*>(child)->setOperatorFormDirty(); >+ } >+ > // FIXME: Parsing of operator properties should be done in the element classes rather than in the renderer classes. > // See https://webkit.org/b/156537 > if (renderer() && is<RenderMathMLRow>(*renderer())) >diff --git a/Source/WebCore/mathml/MathMLOperatorDictionary.cpp b/Source/WebCore/mathml/MathMLOperatorDictionary.cpp >index 98f24a3924eb113bd4019a7e1f01e274a68db7a4..9fe78fabebced5247ff86500fe4842ebfe1883de 100644 >--- a/Source/WebCore/mathml/MathMLOperatorDictionary.cpp >+++ b/Source/WebCore/mathml/MathMLOperatorDictionary.cpp >@@ -1089,23 +1089,30 @@ static const UChar horizontalOperators[] = { > 0x003D, 0x005E, 0x005F, 0x007E, 0x00AF, 0x02C6, 0x02C7, 0x02C9, 0x02CD, 0x02DC, 0x02F7, 0x0302, 0x0332, 0x203E, 0x20D0, 0x20D1, 0x20D6, 0x20D7, 0x20E1, 0x2190, 0x2192, 0x2194, 0x2198, 0x2199, 0x219C, 0x219D, 0x219E, 0x21A0, 0x21A2, 0x21A3, 0x21A4, 0x21A6, 0x21A9, 0x21AA, 0x21AB, 0x21AC, 0x21AD, 0x21B4, 0x21B9, 0x21BC, 0x21BD, 0x21C0, 0x21C1, 0x21C4, 0x21C6, 0x21C7, 0x21C9, 0x21CB, 0x21CC, 0x21D0, 0x21D2, 0x21D4, 0x21DA, 0x21DB, 0x21DC, 0x21DD, 0x21E0, 0x21E2, 0x21E4, 0x21E5, 0x21E6, 0x21E8, 0x21F0, 0x21F6, 0x21FD, 0x21FE, 0x21FF, 0x23B4, 0x23B5, 0x23DC, 0x23DD, 0x23DE, 0x23DF, 0x23E0, 0x23E1, 0x2500, 0x27F5, 0x27F6, 0x27F7, 0x27F8, 0x27F9, 0x27FA, 0x27FB, 0x27FC, 0x27FD, 0x27FE, 0x27FF, 0x290C, 0x290D, 0x290E, 0x290F, 0x2910, 0x294E, 0x2950, 0x2952, 0x2953, 0x2956, 0x2957, 0x295A, 0x295B, 0x295E, 0x295F, 0x2B45, 0x2B46, 0xFE35, 0xFE36, 0xFE37, 0xFE38 > }; > >-const Entry* MathMLOperatorDictionary::getEntry(UChar textContent, Form form) >+Optional<Entry> MathMLOperatorDictionary::search(UChar character, Form form, bool explicitForm) > { >- return tryBinarySearch<const Entry, Key>(dictionary, dictionarySize, Key(textContent, form), ExtractKey); >-} >+ if (!character) >+ return Optional<Entry>(); > >-const Entry* MathMLOperatorDictionary::getEntry(UChar textContent) >-{ >- // For each operator, the dictionary has at most three form in the following order: Infix, Prefix, Postfix. >- if (const Entry* entry = tryBinarySearch<const Entry, UChar>(dictionary, dictionarySize, textContent, ExtractChar)) { >+ // We try and find the default values from the operator dictionary. >+ if (auto* entry = tryBinarySearch<const Entry, Key>(dictionary, dictionarySize, Key(character, form), ExtractKey)) >+ return Optional<Entry>(*entry); >+ >+ if (explicitForm) >+ return Optional<Entry>(); >+ >+ // If we did not find the desired operator form and if it was not set explicitely, we use the first one in the following order: Infix, Prefix, Postfix. >+ // This is to handle bad MathML markup without explicit <mrow> delimiters like "<mo>(</mo><mi>a</mi><mo>)</mo><mo>(</mo><mi>b</mi><mo>)</mo>" where innerfences should not be considered infix. >+ if (auto* entry = tryBinarySearch<const Entry, UChar>(dictionary, dictionarySize, character, ExtractChar)) { > // There are at most two other entries before the one found. >- if (entry != dictionary && (entry - 1)->character == textContent) >+ if (entry != dictionary && (entry - 1)->character == character) > entry--; >- if (entry != dictionary && (entry - 1)->character == textContent) >+ if (entry != dictionary && (entry - 1)->character == character) > entry--; >- return entry; >+ return Optional<Entry>(*entry); > } >- return nullptr; >+ >+ return Optional<Entry>(); > } > > bool MathMLOperatorDictionary::isVertical(UChar textContent) >diff --git a/Source/WebCore/mathml/MathMLOperatorDictionary.h b/Source/WebCore/mathml/MathMLOperatorDictionary.h >index 03387f2725a2d5dd1b2110d60e9096dfc1d2065f..93e0082fc70e2bc37616aa06c6330db35168e4e0 100644 >--- a/Source/WebCore/mathml/MathMLOperatorDictionary.h >+++ b/Source/WebCore/mathml/MathMLOperatorDictionary.h >@@ -28,6 +28,7 @@ > #if ENABLE(MATHML) > > #include <unicode/utypes.h> >+#include <wtf/Optional.h> > > namespace WebCore { > >@@ -49,8 +50,7 @@ struct Entry { > unsigned rspace : 3; > unsigned flags : 8; > }; >-const Entry* getEntry(UChar, Form); >-const Entry* getEntry(UChar); >+Optional<Entry> search(UChar, Form, bool explicitForm); > bool isVertical(UChar); > } > >diff --git a/Source/WebCore/mathml/MathMLOperatorElement.cpp b/Source/WebCore/mathml/MathMLOperatorElement.cpp >index 760c53b6491c7f120b77e976e412a893b89165cf..1934443e36ce0d327fb9d8c7acdde61741cbc0b6 100644 >--- a/Source/WebCore/mathml/MathMLOperatorElement.cpp >+++ b/Source/WebCore/mathml/MathMLOperatorElement.cpp >@@ -35,6 +35,7 @@ > namespace WebCore { > > using namespace MathMLNames; >+using namespace MathMLOperatorDictionary; > > MathMLOperatorElement::MathMLOperatorElement(const QualifiedName& tagName, Document& document) > : MathMLTextElement(tagName, document) >@@ -67,14 +68,77 @@ UChar MathMLOperatorElement::operatorText() > return m_operatorText.value(); > } > >+const MathMLOperatorElement::DictionaryProperty& MathMLOperatorElement::dictionaryProperty() >+{ >+ if (!m_dictionaryProperty.dirty) >+ return m_dictionaryProperty; >+ >+ const auto& value = attributeWithoutSynchronization(formAttr); >+ bool explicitForm = true; >+ if (value == "prefix") >+ m_dictionaryProperty.form = Prefix; >+ else if (value == "infix") >+ m_dictionaryProperty.form = Infix; >+ else if (value == "postfix") >+ m_dictionaryProperty.form = Postfix; >+ else { >+ // FIXME: We should use more advanced heuristics indicated in the specification to determine the operator form (https://bugs.webkit.org/show_bug.cgi?id=124829). >+ explicitForm = false; >+ if (!previousSibling() && nextSibling()) >+ m_dictionaryProperty.form = Prefix; >+ else if (previousSibling() && !nextSibling()) >+ m_dictionaryProperty.form = Postfix; >+ else >+ m_dictionaryProperty.form = Infix; >+ } >+ >+ if (Optional<Entry> entry = search(operatorText(), m_dictionaryProperty.form, explicitForm)) { >+ m_dictionaryProperty.form = static_cast<MathMLOperatorDictionary::Form>(entry.value().form); >+ m_dictionaryProperty.leadingSpaceInMathUnit = entry.value().lspace; >+ m_dictionaryProperty.trailingSpaceInMathUnit = entry.value().rspace; >+ m_dictionaryProperty.flags = entry.value().flags; >+ } else { >+ // Default leading and trailing spaces are "thickmathspace". >+ m_dictionaryProperty.leadingSpaceInMathUnit = 5; >+ m_dictionaryProperty.trailingSpaceInMathUnit = 5; >+ >+ // Default operator properties are all set to "false". >+ m_dictionaryProperty.flags = 0; >+ } >+ >+ m_dictionaryProperty.dirty = false; >+ return m_dictionaryProperty; >+} >+ >+ >+unsigned short MathMLOperatorElement::flags() >+{ >+ // FIXME: We should also handle boolean attributes here (https://webkit.org/b/160190). >+ return dictionaryProperty().flags; >+} >+ >+MathMLElement::Length MathMLOperatorElement::defaultLeadingSpace() >+{ >+ return { LengthType::MathUnit, static_cast<float>(dictionaryProperty().leadingSpaceInMathUnit) }; >+} >+ >+MathMLElement::Length MathMLOperatorElement::defaultTrailingSpace() >+{ >+ return { LengthType::MathUnit, static_cast<float>(dictionaryProperty().trailingSpaceInMathUnit) }; >+} >+ > void MathMLOperatorElement::childrenChanged(const ChildChange& change) > { > m_operatorText = Optional<UChar>(); >+ m_dictionaryProperty.dirty = true; > MathMLTextElement::childrenChanged(change); > } > > void MathMLOperatorElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { >+ if (name == formAttr) >+ m_dictionaryProperty.dirty = true; >+ > if ((name == stretchyAttr || name == lspaceAttr || name == rspaceAttr || name == movablelimitsAttr) && renderer()) { > downcast<RenderMathMLOperator>(*renderer()).updateFromElement(); > return; >diff --git a/Source/WebCore/mathml/MathMLOperatorElement.h b/Source/WebCore/mathml/MathMLOperatorElement.h >index 948893c810c7b7611a58bc9fd475baef51ef8737..8ca5869a578c1638fec72e070d661c8aa4ef6276 100644 >--- a/Source/WebCore/mathml/MathMLOperatorElement.h >+++ b/Source/WebCore/mathml/MathMLOperatorElement.h >@@ -26,6 +26,7 @@ > #pragma once > > #if ENABLE(MATHML) >+#include "MathMLOperatorDictionary.h" > #include "MathMLTextElement.h" > > namespace WebCore { >@@ -35,6 +36,11 @@ public: > static Ref<MathMLOperatorElement> create(const QualifiedName& tagName, Document&); > static UChar parseOperatorText(const String&); > UChar operatorText(); >+ void setOperatorFormDirty() { m_dictionaryProperty.dirty = true; } >+ MathMLOperatorDictionary::Form form() { return dictionaryProperty().form; } >+ unsigned short flags(); >+ Length defaultLeadingSpace(); >+ Length defaultTrailingSpace(); > > private: > MathMLOperatorElement(const QualifiedName& tagName, Document&); >@@ -43,6 +49,16 @@ private: > void parseAttribute(const QualifiedName&, const AtomicString&) final; > > Optional<UChar> m_operatorText; >+ >+ struct DictionaryProperty { >+ MathMLOperatorDictionary::Form form; >+ unsigned short leadingSpaceInMathUnit; >+ unsigned short trailingSpaceInMathUnit; >+ unsigned short flags; >+ bool dirty { true }; >+ }; >+ DictionaryProperty m_dictionaryProperty; >+ const DictionaryProperty& dictionaryProperty(); > }; > > } >diff --git a/Source/WebCore/rendering/mathml/RenderMathMLFencedOperator.cpp b/Source/WebCore/rendering/mathml/RenderMathMLFencedOperator.cpp >index 8a1038861a76e3b8f08c189fa8447057b6990196..dd53782b55e817e46f2ec1c6e45d77097f302fd9 100644 >--- a/Source/WebCore/rendering/mathml/RenderMathMLFencedOperator.cpp >+++ b/Source/WebCore/rendering/mathml/RenderMathMLFencedOperator.cpp >@@ -26,16 +26,26 @@ > #include "config.h" > > #if ENABLE(MATHML) >+ > #include "RenderMathMLFencedOperator.h" > >+#include "MathMLOperatorDictionary.h" > #include "MathMLOperatorElement.h" > > namespace WebCore { > >+using namespace MathMLOperatorDictionary; >+ >+static const MathMLElement::Length gThickMathSpace = { MathMLElement::LengthType::MathUnit, 5 }; >+ > RenderMathMLFencedOperator::RenderMathMLFencedOperator(Document& document, RenderStyle&& style, const String& operatorString, MathMLOperatorDictionary::Form form, unsigned short flags) >- : RenderMathMLOperator(document, WTFMove(style), form, flags) >+ : RenderMathMLOperator(document, WTFMove(style), flags) >+ , m_operatorForm(form) > { > updateOperatorContent(operatorString); >+ >+ // maxsize always has the default value "infinity" value for mfenced operators. >+ m_maxSize = intMaxForLayoutUnit; > } > > void RenderMathMLFencedOperator::updateOperatorContent(const String& operatorString) >@@ -44,6 +54,32 @@ void RenderMathMLFencedOperator::updateOperatorContent(const String& operatorStr > rebuildTokenContent(); > } > >+void RenderMathMLFencedOperator::setOperatorProperties() >+{ >+ // We determine the stretch direction (default is vertical). >+ m_isVertical = MathMLOperatorDictionary::isVertical(m_textContent); >+ >+ // Resets all but the Fence and Separator properties. >+ m_operatorFlags &= MathMLOperatorDictionary::Fence | MathMLOperatorDictionary::Separator; >+ >+ // Default spacing is thickmathspace. >+ LayoutUnit thickMathSpace = toUserUnits(gThickMathSpace, style(), 0); >+ m_leadingSpace = thickMathSpace; >+ m_trailingSpace = thickMathSpace; >+ >+ // minsize always has the default value "1em" value for mfenced operators. >+ m_minSize = style().fontCascade().size(); >+ >+ if (Optional<Entry> entry = search(m_textContent, m_operatorForm, true)) { >+ // Resolve the rspace and lspace values. >+ m_leadingSpace = toUserUnits({ MathMLElement::LengthType::MathUnit, static_cast<float>(entry.value().lspace) }, style(), 0); >+ m_leadingSpace = toUserUnits({ MathMLElement::LengthType::MathUnit, static_cast<float>(entry.value().rspace) }, style(), 0); >+ >+ // We preserve the Fence and Separator properties. >+ m_operatorFlags = (m_operatorFlags & (MathMLOperatorDictionary::Fence | MathMLOperatorDictionary::Separator)) | entry.value().flags; >+ } >+} >+ > } > > #endif >diff --git a/Source/WebCore/rendering/mathml/RenderMathMLFencedOperator.h b/Source/WebCore/rendering/mathml/RenderMathMLFencedOperator.h >index 5c091e362ab2d70734566c9332048d52852a5de6..04f969a9a8a4cc464a33d06d81d7aa4b931750d2 100644 >--- a/Source/WebCore/rendering/mathml/RenderMathMLFencedOperator.h >+++ b/Source/WebCore/rendering/mathml/RenderMathMLFencedOperator.h >@@ -39,9 +39,11 @@ public: > > private: > bool isRenderMathMLFencedOperator() const final { return true; } >+ void setOperatorProperties() final; > UChar textContent() const final { return m_textContent; } > > UChar m_textContent { 0 }; >+ MathMLOperatorDictionary::Form m_operatorForm; > }; > > }; // namespace WebCore >diff --git a/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp b/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp >index fc574f429748516d79ea8c779017f4021f613274..5712df9a8d2c0765d61600b7d493abb5d514c603 100644 >--- a/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp >+++ b/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp >@@ -53,9 +53,8 @@ RenderMathMLOperator::RenderMathMLOperator(MathMLOperatorElement& element, Rende > updateTokenContent(); > } > >-RenderMathMLOperator::RenderMathMLOperator(Document& document, RenderStyle&& style, MathMLOperatorDictionary::Form form, unsigned short flags) >+RenderMathMLOperator::RenderMathMLOperator(Document& document, RenderStyle&& style, unsigned short flags) > : RenderMathMLToken(document, WTFMove(style)) >- , m_operatorForm(form) > , m_operatorFlags(flags) > { > } >@@ -87,72 +86,18 @@ void RenderMathMLOperator::setOperatorFlagFromAttributeValue(MathMLOperatorDicti > // We ignore absent or invalid attributes. > } > >-void RenderMathMLOperator::setOperatorPropertiesFromOpDictEntry(const MathMLOperatorDictionary::Entry* entry) >-{ >- // If this operator is anonymous, we preserve the Fence and Separator properties. This is to handle the case of RenderMathMLFenced. >- if (isAnonymous()) >- m_operatorFlags = (m_operatorFlags & (MathMLOperatorDictionary::Fence | MathMLOperatorDictionary::Separator)) | entry->flags; >- else >- m_operatorFlags = entry->flags; >- >- // Leading and trailing space is specified as multiple of 1/18em. >- m_leadingSpace = entry->lspace * style().fontCascade().size() / 18; >- m_trailingSpace = entry->rspace * style().fontCascade().size() / 18; >-} >- > void RenderMathMLOperator::setOperatorProperties() > { > // We determine the stretch direction (default is vertical). > m_isVertical = MathMLOperatorDictionary::isVertical(textContent()); > >- // We determine the form of the operator. >- bool explicitForm = true; >- if (!isAnonymous()) { >- const AtomicString& form = element().attributeWithoutSynchronization(MathMLNames::formAttr); >- if (form == "prefix") >- m_operatorForm = MathMLOperatorDictionary::Prefix; >- else if (form == "infix") >- m_operatorForm = MathMLOperatorDictionary::Infix; >- else if (form == "postfix") >- m_operatorForm = MathMLOperatorDictionary::Postfix; >- else { >- // FIXME: We should use more advanced heuristics indicated in the specification to determine the operator form (https://bugs.webkit.org/show_bug.cgi?id=124829). >- explicitForm = false; >- if (!element().previousSibling() && element().nextSibling()) >- m_operatorForm = MathMLOperatorDictionary::Prefix; >- else if (element().previousSibling() && !element().nextSibling()) >- m_operatorForm = MathMLOperatorDictionary::Postfix; >- else >- m_operatorForm = MathMLOperatorDictionary::Infix; >- } >- } >- >- // We determine the default values of the operator properties. >- >- // First we initialize with the default values for unknown operators. >- if (isAnonymous()) >- m_operatorFlags &= MathMLOperatorDictionary::Fence | MathMLOperatorDictionary::Separator; // This resets all but the Fence and Separator properties. >- else >- m_operatorFlags = 0; // This resets all the operator properties. >- m_leadingSpace = 5 * style().fontCascade().size() / 18; // This sets leading space to "thickmathspace". >- m_trailingSpace = 5 * style().fontCascade().size() / 18; // This sets trailing space to "thickmathspace". >+ // Initialize with the default values. >+ m_operatorFlags = element().flags(); >+ m_leadingSpace = toUserUnits(element().defaultLeadingSpace(), style(), 0); >+ m_trailingSpace = toUserUnits(element().defaultTrailingSpace(), style(), 0); > m_minSize = style().fontCascade().size(); // This sets minsize to "1em". > m_maxSize = intMaxForLayoutUnit; // This sets maxsize to "infinity". > >- if (textContent()) { >- // Then we try to find the default values from the operator dictionary. >- if (const MathMLOperatorDictionary::Entry* entry = MathMLOperatorDictionary::getEntry(textContent(), m_operatorForm)) >- setOperatorPropertiesFromOpDictEntry(entry); >- else if (!explicitForm) { >- // If we did not find the desired operator form and if it was not set explicitely, we use the first one in the following order: Infix, Prefix, Postfix. >- // This is to handle bad MathML markup without explicit <mrow> delimiters like "<mo>(</mo><mi>a</mi><mo>)</mo><mo>(</mo><mi>b</mi><mo>)</mo>" where the inner parenthesis should not be considered infix. >- if (const MathMLOperatorDictionary::Entry* entry = MathMLOperatorDictionary::getEntry(textContent())) { >- m_operatorForm = static_cast<MathMLOperatorDictionary::Form>(entry->form); // We override the form previously determined. >- setOperatorPropertiesFromOpDictEntry(entry); >- } >- } >- } >- > if (!isAnonymous()) { > // Finally, we make the attribute values override the default. > >diff --git a/Source/WebCore/rendering/mathml/RenderMathMLOperator.h b/Source/WebCore/rendering/mathml/RenderMathMLOperator.h >index 0d1b69edc9a0bd35e0c8260ea370b570cdac2e31..c9508fba24b86cd9f749f221709c6b380b5b6e61 100644 >--- a/Source/WebCore/rendering/mathml/RenderMathMLOperator.h >+++ b/Source/WebCore/rendering/mathml/RenderMathMLOperator.h >@@ -39,7 +39,7 @@ class MathMLOperatorElement; > class RenderMathMLOperator : public RenderMathMLToken { > public: > RenderMathMLOperator(MathMLOperatorElement&, RenderStyle&&); >- RenderMathMLOperator(Document&, RenderStyle&&, MathMLOperatorDictionary::Form, unsigned short flags = 0); >+ RenderMathMLOperator(Document&, RenderStyle&&, unsigned short flags = 0); > MathMLOperatorElement& element() const; > > void stretchTo(LayoutUnit heightAboveBaseline, LayoutUnit depthBelowBaseline); >@@ -60,12 +60,16 @@ public: > > protected: > void rebuildTokenContent(); >+ virtual void setOperatorProperties(); > >- MathMLOperatorDictionary::Form m_operatorForm; >+ bool m_isVertical { true }; >+ LayoutUnit m_leadingSpace; >+ LayoutUnit m_trailingSpace; >+ LayoutUnit m_minSize; >+ LayoutUnit m_maxSize; > unsigned short m_operatorFlags; > > private: >- virtual void setOperatorProperties(); > void styleDidChange(StyleDifference, const RenderStyle* oldStyle) final; > void computePreferredLogicalWidths() final; > void layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeight = 0) final; >@@ -88,7 +92,6 @@ private: > > void setOperatorFlagFromAttribute(MathMLOperatorDictionary::Flag, const QualifiedName&); > void setOperatorFlagFromAttributeValue(MathMLOperatorDictionary::Flag, const AtomicString& attributeValue); >- void setOperatorPropertiesFromOpDictEntry(const MathMLOperatorDictionary::Entry*); > > LayoutUnit verticalStretchedOperatorShift() const; > >@@ -96,11 +99,6 @@ private: > LayoutUnit m_stretchDepthBelowBaseline { 0 }; > LayoutUnit m_stretchWidth; > >- bool m_isVertical { true }; >- LayoutUnit m_leadingSpace; >- LayoutUnit m_trailingSpace; >- LayoutUnit m_minSize; >- LayoutUnit m_maxSize; > MathOperator m_mathOperator; > }; >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 160239
:
284686
|
284762
|
284782
|
284992
|
284993
|
284994
|
284995
|
284996
|
284998
|
284999
|
285002
|
285003
|
285004
|
285011
|
285021
|
285090
|
285093
|
285095