summaryrefslogtreecommitdiffstats
path: root/dom
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2020-02-07 09:52:57 +0100
committerGitHub <noreply@github.com>2020-02-07 09:52:57 +0100
commita6ef90b1830e263fefda7bcb6e7b74464044a678 (patch)
tree85fc59a89d370d98e2c132e2b4b77343eb507ff0 /dom
parent99aa809cb850a19d09cb7fc3b92899085b4b447e (diff)
parent3a7d5d01cccf6abb3b83db8cf31ca213724f3ee7 (diff)
downloadUXP-a6ef90b1830e263fefda7bcb6e7b74464044a678.tar
UXP-a6ef90b1830e263fefda7bcb6e7b74464044a678.tar.gz
UXP-a6ef90b1830e263fefda7bcb6e7b74464044a678.tar.lz
UXP-a6ef90b1830e263fefda7bcb6e7b74464044a678.tar.xz
UXP-a6ef90b1830e263fefda7bcb6e7b74464044a678.zip
Merge pull request #1388 from win7-7/devirtualize-pr
Merging this in even without a test performed since the code change looks sane. real-world testing will have to be performed.
Diffstat (limited to 'dom')
-rw-r--r--dom/mathml/nsMathMLElement.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/dom/mathml/nsMathMLElement.cpp b/dom/mathml/nsMathMLElement.cpp
index d6aef876c..2be931682 100644
--- a/dom/mathml/nsMathMLElement.cpp
+++ b/dom/mathml/nsMathMLElement.cpp
@@ -9,6 +9,7 @@
#include "base/compiler_specific.h"
#include "mozilla/ArrayUtils.h"
#include "nsGkAtoms.h"
+#include "nsITableCellLayout.h" // for MAX_COLSPAN / MAX_ROWSPAN
#include "nsCRT.h"
#include "nsLayoutStylesheetCache.h"
#include "nsRuleData.h"
@@ -150,8 +151,9 @@ nsMathMLElement::ParseAttribute(int32_t aNamespaceID,
const nsAString& aValue,
nsAttrValue& aResult)
{
+ MOZ_ASSERT(IsMathMLElement());
if (aNamespaceID == kNameSpaceID_None) {
- if (IsMathMLElement(nsGkAtoms::math) && aAttribute == nsGkAtoms::mode) {
+ if (mNodeInfo->Equals(nsGkAtoms::math) && aAttribute == nsGkAtoms::mode) {
WarnDeprecated(nsGkAtoms::mode->GetUTF16String(),
nsGkAtoms::display->GetUTF16String(), OwnerDoc());
}
@@ -165,6 +167,16 @@ nsMathMLElement::ParseAttribute(int32_t aNamespaceID,
aAttribute == nsGkAtoms::mathbackground_) {
return aResult.ParseColor(aValue);
}
+ if (mNodeInfo->Equals(nsGkAtoms::mtd_)) {
+ if (aAttribute == nsGkAtoms::columnspan_) {
+ aResult.ParseClampedNonNegativeInt(aValue, 1, 1, MAX_COLSPAN);
+ return true;
+ }
+ if (aAttribute == nsGkAtoms::rowspan) {
+ aResult.ParseClampedNonNegativeInt(aValue, 1, 0, MAX_ROWSPAN);
+ return true;
+ }
+ }
}
return nsMathMLElementBase::ParseAttribute(aNamespaceID, aAttribute,
@@ -209,6 +221,8 @@ static Element::MappedAttributeEntry sDirStyles[] = {
bool
nsMathMLElement::IsAttributeMapped(const nsIAtom* aAttribute) const
{
+ MOZ_ASSERT(IsMathMLElement());
+
static const MappedAttributeEntry* const mtableMap[] = {
sMtableStyles,
sCommonPresStyles
@@ -240,10 +254,10 @@ nsMathMLElement::IsAttributeMapped(const nsIAtom* aAttribute) const
if (IsAnyOfMathMLElements(nsGkAtoms::mstyle_, nsGkAtoms::math))
return FindAttributeDependence(aAttribute, mstyleMap);
- if (IsMathMLElement(nsGkAtoms::mtable_))
+ if (mNodeInfo->Equals(nsGkAtoms::mtable_))
return FindAttributeDependence(aAttribute, mtableMap);
- if (IsMathMLElement(nsGkAtoms::mrow_))
+ if (mNodeInfo->Equals(nsGkAtoms::mrow_))
return FindAttributeDependence(aAttribute, mrowMap);
if (IsAnyOfMathMLElements(nsGkAtoms::maction_,