Disable -moz-transform and -moz-transform-origin for :first-line and :first-letter pseudo-elements. (Bug 466845) r+sr=bzbarsky a=blocking1.9.1+
authorL. David Baron <dbaron@dbaron.org>
Fri, 12 Dec 2008 10:59:03 -0800
changeset 22736 6a542abb36a8fb73c350526f2ceb27258c35b97d
parent 22735 3a0da92f1ea259f2382ab28d0d8e4ee8f8e2fc0e
child 22737 3d372e6ff724efd1a7e02cb54a8e57ca5737113c
push idunknown
push userunknown
push dateunknown
reviewersblocking1.9.1
bugs466845
milestone1.9.2a1pre
Disable -moz-transform and -moz-transform-origin for :first-line and :first-letter pseudo-elements. (Bug 466845) r+sr=bzbarsky a=blocking1.9.1+
layout/style/crashtests/466845-1.html
layout/style/crashtests/crashtests.list
layout/style/nsHTMLCSSStyleSheet.cpp
new file mode 100644
--- /dev/null
+++ b/layout/style/crashtests/466845-1.html
@@ -0,0 +1,14 @@
+<html>
+<head>
+<title>Crash [@ nsViewManager::CreateView] with ::first-line position: absolute and -moz-transform</title>
+<style>
+#a::first-line {  -moz-transform: translate(50px);}
+</style>
+</head>
+<body style="position: absolute;">
+<span style="position: absolute;" id="a">
+<span style="-moz-transform: translate(50px);">&#1593; &#1593; &#1593;
+</span>
+</span>
+</body>
+</html>
--- a/layout/style/crashtests/crashtests.list
+++ b/layout/style/crashtests/crashtests.list
@@ -18,8 +18,9 @@ skip load 439184-1.html # skip until we 
 load 444237-1.html
 load 444848-1.html 
 load 447776-1.html
 load 447783-1.html
 load 448161-1.html
 load 448161-2.html
 load 456196.html
 load 460217-1.html
+load 466845-1.html
--- a/layout/style/nsHTMLCSSStyleSheet.cpp
+++ b/layout/style/nsHTMLCSSStyleSheet.cpp
@@ -76,24 +76,26 @@ public:
   // functions.
   void CommonMapRuleInfoInto(nsRuleData* aRuleData);
 
 #ifdef DEBUG
   NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0) const;
 #endif
 protected:
   nsCSSValueList mInheritList;
+  nsCSSValueList mNoneList;
   nsCSSValuePairList mInheritQuotes;
   nsCSSValuePairList mNoneCounter;
 };
 
 CSSDisablePropsRule::CSSDisablePropsRule()
 {
   nsCSSValue none(eCSSUnit_None);
   mNoneCounter.mXValue = none;
+  mNoneList.mValue = none;
   nsCSSValue inherit(eCSSUnit_Inherit);
   mInheritList.mValue = inherit;
   mInheritQuotes.mXValue = inherit;
 }
 
 class CSSFirstLineRule : public CSSDisablePropsRule {
 public:
   CSSFirstLineRule() {}
@@ -181,16 +183,22 @@ CSSDisablePropsRule::CommonMapRuleInfoIn
     aData->mDisplayData->mPosition = staticposition;
 
     nsCSSValue visible(NS_STYLE_OVERFLOW_VISIBLE, eCSSUnit_Enumerated);
     aData->mDisplayData->mOverflowX = visible;
     aData->mDisplayData->mOverflowY = visible;
 
     aData->mDisplayData->mClear = none;
 
+    aData->mDisplayData->mTransform = &mNoneList;
+
+    nsCSSValue fiftyPercent(0.5f, eCSSUnit_Percent);
+    aData->mDisplayData->mTransformOrigin.mXValue = fiftyPercent;
+    aData->mDisplayData->mTransformOrigin.mYValue = fiftyPercent;
+
     // Nobody will care about 'break-before' or 'break-after', since
     // they only apply to blocks (assuming we implement them correctly).
   }
 
   // NOTE:  We'll never do anything with what's in nsCSSList,
   // nsCSSTable, nsCSSBreaks, nsCSSPage, nsCSSAural, nsCSSXUL, or
   // nsCSSSVG, so don't bother.