Bug 508179. Implement 'pointer-events:none;' for all elements. r=roc, r=dbaron.
authorJonathan Watt <jwatt@jwatt.org>
Wed, 26 Aug 2009 20:53:35 -0700
changeset 32021 390fb109b9fe6e804cb0d9348201e375bcab2651
parent 32020 814a26052bf55558d7dc9cf0b88ec1596f7e3fe9
child 32022 5baf439a991a1d03bda69c3db19bbee2ce491ad4
push idunknown
push userunknown
push dateunknown
reviewersroc, dbaron
bugs508179
milestone1.9.3a1pre
Bug 508179. Implement 'pointer-events:none;' for all elements. r=roc, r=dbaron.
dom/interfaces/css/nsIDOMNSCSS2Properties.idl
layout/base/nsDisplayList.cpp
layout/base/nsStyleConsts.h
layout/generic/nsFrameFrame.cpp
layout/html/tests/css/pointer-events.css
layout/style/nsCSSKeywordList.h
layout/style/nsCSSParser.cpp
layout/style/nsCSSPropList.h
layout/style/nsCSSProps.cpp
layout/style/nsCSSProps.h
layout/style/nsCSSStruct.h
layout/style/nsComputedDOMStyle.cpp
layout/style/nsComputedDOMStyle.h
layout/style/nsRuleNode.cpp
layout/style/nsStyleStruct.cpp
layout/style/nsStyleStruct.h
layout/style/test/Makefile.in
layout/style/test/property_database.js
layout/style/test/test_pointer-events.html
layout/svg/base/src/nsSVGGlyphFrame.cpp
layout/svg/base/src/nsSVGImageFrame.cpp
layout/svg/base/src/nsSVGPathGeometryFrame.cpp
--- a/dom/interfaces/css/nsIDOMNSCSS2Properties.idl
+++ b/dom/interfaces/css/nsIDOMNSCSS2Properties.idl
@@ -35,17 +35,17 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMCSS2Properties.idl"
 
-[scriptable, uuid(73902da2-9475-4e96-b0ed-85003721cf37)]
+[scriptable, uuid(8C31E4A6-8F3A-4BB9-B180-8385AC2A4080)]
 interface nsIDOMNSCSS2Properties : nsIDOMCSS2Properties
 {
            /* Non-DOM 2 extensions */
 
            /* Mozilla extension CSS properties */
            attribute DOMString        MozAppearance;
                                         // raises(DOMException) on setting
 
@@ -271,9 +271,11 @@ interface nsIDOMNSCSS2Properties : nsIDO
                                         // raises(DOMException) on setting
 
            attribute DOMString        MozTransitionTimingFunction;
                                         // raises(DOMException) on setting
 
            attribute DOMString        MozTransition;
                                         // raises(DOMException) on setting
 
+           attribute DOMString        pointerEvents;
+                                        // raises(DOMException) on setting
 };
--- a/layout/base/nsDisplayList.cpp
+++ b/layout/base/nsDisplayList.cpp
@@ -421,19 +421,20 @@ nsIFrame* nsDisplayList::HitTest(nsDispl
   for (PRInt32 i = aState->mItemBuffer.Length() - 1; i >= itemBufferStart; --i) {
     // Pop element off the end of the buffer. We want to shorten the buffer
     // so that recursive calls to HitTest have more buffer space.
     item = aState->mItemBuffer[i];
     aState->mItemBuffer.SetLength(i);
 
     if (item->GetBounds(aBuilder).Contains(aPt)) {
       nsIFrame* f = item->HitTest(aBuilder, aPt, aState);
-      // Handle the XUL 'mousethrough' feature.
+      // Handle the XUL 'mousethrough' feature and 'pointer-events'.
       if (f) {
-        if (!f->GetMouseThrough()) {
+        if (!f->GetMouseThrough() &&
+            f->GetStyleVisibility()->mPointerEvents != NS_STYLE_POINTER_EVENTS_NONE) {
           aState->mItemBuffer.SetLength(itemBufferStart);
           return f;
         }
       }
     }
   }
   NS_ASSERTION(aState->mItemBuffer.Length() == PRUint32(itemBufferStart),
                "How did we forget to pop some elements?");
--- a/layout/base/nsStyleConsts.h
+++ b/layout/base/nsStyleConsts.h
@@ -579,16 +579,28 @@
 
 // See nsStyleList
 #define NS_STYLE_LIST_STYLE_POSITION_INSIDE     0
 #define NS_STYLE_LIST_STYLE_POSITION_OUTSIDE    1
 
 // See nsStyleMargin
 #define NS_STYLE_MARGIN_SIZE_AUTO               0
 
+// See nsStyleDisplay
+#define NS_STYLE_POINTER_EVENTS_NONE            0
+#define NS_STYLE_POINTER_EVENTS_VISIBLEPAINTED  1
+#define NS_STYLE_POINTER_EVENTS_VISIBLEFILL     2
+#define NS_STYLE_POINTER_EVENTS_VISIBLESTROKE   3
+#define NS_STYLE_POINTER_EVENTS_VISIBLE         4
+#define NS_STYLE_POINTER_EVENTS_PAINTED         5
+#define NS_STYLE_POINTER_EVENTS_FILL            6
+#define NS_STYLE_POINTER_EVENTS_STROKE          7
+#define NS_STYLE_POINTER_EVENTS_ALL             8
+#define NS_STYLE_POINTER_EVENTS_AUTO            9
+
 // See nsStyleText
 #define NS_STYLE_TEXT_ALIGN_DEFAULT               0
 #define NS_STYLE_TEXT_ALIGN_LEFT                  1
 #define NS_STYLE_TEXT_ALIGN_RIGHT                 2
 #define NS_STYLE_TEXT_ALIGN_CENTER                3
 #define NS_STYLE_TEXT_ALIGN_JUSTIFY               4
 #define NS_STYLE_TEXT_ALIGN_CHAR                  5   //align based on a certain character, for table cell
 #define NS_STYLE_TEXT_ALIGN_END                   6
@@ -755,27 +767,16 @@
 #define NS_STYLE_FILL_RULE_EVENODD              1
 
 // image-rendering
 #define NS_STYLE_IMAGE_RENDERING_AUTO             0
 #define NS_STYLE_IMAGE_RENDERING_OPTIMIZESPEED    1
 #define NS_STYLE_IMAGE_RENDERING_OPTIMIZEQUALITY  2
 #define NS_STYLE_IMAGE_RENDERING_CRISPEDGES       3
 
-// pointer-events
-#define NS_STYLE_POINTER_EVENTS_NONE            0
-#define NS_STYLE_POINTER_EVENTS_VISIBLEPAINTED  1
-#define NS_STYLE_POINTER_EVENTS_VISIBLEFILL     2
-#define NS_STYLE_POINTER_EVENTS_VISIBLESTROKE   3
-#define NS_STYLE_POINTER_EVENTS_VISIBLE         4
-#define NS_STYLE_POINTER_EVENTS_PAINTED         5
-#define NS_STYLE_POINTER_EVENTS_FILL            6
-#define NS_STYLE_POINTER_EVENTS_STROKE          7
-#define NS_STYLE_POINTER_EVENTS_ALL             8
-
 // shape-rendering
 #define NS_STYLE_SHAPE_RENDERING_AUTO               0
 #define NS_STYLE_SHAPE_RENDERING_OPTIMIZESPEED      1
 #define NS_STYLE_SHAPE_RENDERING_CRISPEDGES         2
 #define NS_STYLE_SHAPE_RENDERING_GEOMETRICPRECISION 3
 
 // stroke-linecap
 #define NS_STYLE_STROKE_LINECAP_BUTT            0
--- a/layout/generic/nsFrameFrame.cpp
+++ b/layout/generic/nsFrameFrame.cpp
@@ -313,16 +313,20 @@ nsSubDocumentFrame::GetSkipSides() const
 NS_IMETHODIMP
 nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder*   aBuilder,
                                      const nsRect&           aDirtyRect,
                                      const nsDisplayListSet& aLists)
 {
   if (!IsVisibleForPainting(aBuilder))
     return NS_OK;
 
+  if (aBuilder->IsForEventDelivery() &&
+      GetStyleVisibility()->mPointerEvents == NS_STYLE_POINTER_EVENTS_NONE)
+    return NS_OK;
+
   nsresult rv = DisplayBorderBackgroundOutline(aBuilder, aLists);
   NS_ENSURE_SUCCESS(rv, rv);
   
   if (!mInnerView)
     return NS_OK;
   nsIView* subdocView = mInnerView->GetFirstChild();
   if (!subdocView)
     return NS_OK;
new file mode 100644
--- /dev/null
+++ b/layout/html/tests/css/pointer-events.css
@@ -0,0 +1,46 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+GOOD { pointer-events: visiblePainted; }
+GOOD { pointer-events: visibleFill; }
+GOOD { pointer-events: visibleStroke; }
+GOOD { pointer-events: visible; }
+GOOD { pointer-events: painted; }
+GOOD { pointer-events: fill; }
+GOOD { pointer-events: stroke; }
+GOOD { pointer-events: all; }
+GOOD { pointer-events: none; }
+GOOD { pointer-events: inherit; }
+GOOD { pointer-events: auto; }
--- a/layout/style/nsCSSKeywordList.h
+++ b/layout/style/nsCSSKeywordList.h
@@ -280,16 +280,17 @@ CSS_KEY(ex, ex)
 CSS_KEY(expanded, expanded)
 CSS_KEY(extra-condensed, extra_condensed)
 CSS_KEY(extra-expanded, extra_expanded)
 CSS_KEY(ew-resize, ew_resize)
 CSS_KEY(far-left, far_left)
 CSS_KEY(far-right, far_right)
 CSS_KEY(fast, fast)
 CSS_KEY(faster, faster)
+CSS_KEY(fill, fill)
 CSS_KEY(fixed, fixed)
 CSS_KEY(georgian, georgian)
 CSS_KEY(grad, grad)
 CSS_KEY(graytext, graytext)
 CSS_KEY(groove, groove)
 CSS_KEY(hebrew, hebrew)
 CSS_KEY(help, help)
 CSS_KEY(hidden, hidden)
@@ -377,16 +378,17 @@ CSS_KEY(nwse-resize, nwse_resize)
 CSS_KEY(oblique, oblique)
 CSS_KEY(once, once)
 CSS_KEY(open-quote, open_quote)
 CSS_KEY(outset, outset)
 CSS_KEY(outside, outside)
 CSS_KEY(overline, overline)
 CSS_KEY(padding, padding)
 CSS_KEY(padding-box, padding_box)
+CSS_KEY(painted, painted)
 CSS_KEY(pc, pc)
 CSS_KEY(physical, physical)
 CSS_KEY(pointer, pointer)
 CSS_KEY(portrait, portrait)
 CSS_KEY(pre, pre)
 CSS_KEY(pre-wrap, pre_wrap)
 CSS_KEY(pre-line, pre_line)
 CSS_KEY(progress, progress)
@@ -441,16 +443,17 @@ CSS_KEY(soft, soft)
 CSS_KEY(solid, solid)
 CSS_KEY(spell-out, spell_out)
 CSS_KEY(square, square)
 CSS_KEY(start, start)
 CSS_KEY(static, static)
 CSS_KEY(status-bar, status_bar)
 CSS_KEY(stretch, stretch)
 CSS_KEY(stretch-to-fit, stretch_to_fit)
+CSS_KEY(stroke, stroke)
 CSS_KEY(sub, sub)
 CSS_KEY(super, super)
 CSS_KEY(sw-resize, sw_resize)
 CSS_KEY(table, table)
 CSS_KEY(table-caption, table_caption)
 CSS_KEY(table-cell, table_cell)
 CSS_KEY(table-column, table_column)
 CSS_KEY(table-column-group, table_column_group)
@@ -481,16 +484,19 @@ CSS_KEY(ultra-expanded, ultra_expanded)
 CSS_KEY(underline, underline)
 CSS_KEY(upper-alpha, upper_alpha)
 CSS_KEY(upper-latin, upper_latin)
 CSS_KEY(upper-roman, upper_roman)
 CSS_KEY(uppercase, uppercase)
 CSS_KEY(vertical, vertical)
 CSS_KEY(vertical-text, vertical_text)
 CSS_KEY(visible, visible)
+CSS_KEY(visiblefill, visiblefill)
+CSS_KEY(visiblepainted, visiblepainted)
+CSS_KEY(visiblestroke, visiblestroke)
 CSS_KEY(w-resize, w_resize)
 CSS_KEY(wait, wait)
 CSS_KEY(wider, wider)
 CSS_KEY(window, window)
 CSS_KEY(windowframe, windowframe)
 CSS_KEY(windowtext, windowtext)
 CSS_KEY(write-only, write_only)
 CSS_KEY(x-fast, x_fast)
@@ -588,46 +594,36 @@ CSS_KEY(-moz-win-media-toolbox, _moz_win
 CSS_KEY(-moz-win-communications-toolbox, _moz_win_communications_toolbox)
 CSS_KEY(-moz-win-browsertabbar-toolbox, _moz_win_browsertabbar_toolbox)
 CSS_KEY(-moz-win-mediatext, _moz_win_mediatext)
 CSS_KEY(-moz-win-communicationstext, _moz_win_communicationstext)
 CSS_KEY(-moz-win-glass, _moz_win_glass)
 CSS_KEY(-moz-mac-unified-toolbar, _moz_mac_unified_toolbar)
 
 #ifdef MOZ_SVG
-//CSS_KEY(all, all)
 CSS_KEY(alphabetic, alphabetic)
-//CSS_KEY(auto, auto)
 CSS_KEY(bevel, bevel)
 CSS_KEY(butt, butt)
 CSS_KEY(central, central)
 CSS_KEY(crispedges, crispedges)
 //CSS_KEY(end, end)
 CSS_KEY(evenodd, evenodd)
-CSS_KEY(fill, fill)
 CSS_KEY(geometricprecision, geometricprecision)
 CSS_KEY(hanging, hanging)
 CSS_KEY(ideographic, ideographic)
 CSS_KEY(linearrgb, linearrgb)
 CSS_KEY(mathematical, mathematical)
 //CSS_KEY(middle, middle)
 CSS_KEY(miter, miter)
 CSS_KEY(no-change, no_change)
-//CSS_KEY(none, none)
 CSS_KEY(nonzero, nonzero)
 CSS_KEY(optimizelegibility, optimizelegibility)
 CSS_KEY(optimizequality, optimizequality)
 CSS_KEY(optimizespeed, optimizespeed)
-CSS_KEY(painted, painted)
 CSS_KEY(reset-size, reset_size)
 //CSS_KEY(square, square)
 //CSS_KEY(start, start)
 CSS_KEY(srgb, srgb)
-CSS_KEY(stroke, stroke)
 CSS_KEY(text-after-edge, text_after_edge)
 CSS_KEY(text-before-edge, text_before_edge)
 CSS_KEY(use-script, use_script)
-//CSS_KEY(visible, visible)
-CSS_KEY(visiblefill, visiblefill)
-CSS_KEY(visiblepainted, visiblepainted)
-CSS_KEY(visiblestroke, visiblestroke)
 CSS_KEY(-moz-crisp-edges, _moz_crisp_edges)
 #endif
--- a/layout/style/nsCSSParser.cpp
+++ b/layout/style/nsCSSParser.cpp
@@ -5832,19 +5832,16 @@ CSSParserImpl::ParseSingleValueProperty(
   case eCSSProperty_lighting_color:
     return ParseVariant(aValue, VARIANT_HC, nsnull);
   case eCSSProperty_marker_end:
   case eCSSProperty_marker_mid:
   case eCSSProperty_marker_start:
     return ParseVariant(aValue, VARIANT_HUO, nsnull);
   case eCSSProperty_mask:
     return ParseVariant(aValue, VARIANT_HUO, nsnull);
-  case eCSSProperty_pointer_events:
-    return ParseVariant(aValue, VARIANT_HOK,
-                        nsCSSProps::kPointerEventsKTable);
   case eCSSProperty_shape_rendering:
     return ParseVariant(aValue, VARIANT_AHK,
                         nsCSSProps::kShapeRenderingKTable);
   case eCSSProperty_stop_color:
     return ParseVariant(aValue, VARIANT_HC,
                         nsnull);
   case eCSSProperty_stop_opacity:
     return ParseVariant(aValue, VARIANT_HN,
@@ -6017,16 +6014,19 @@ CSSParserImpl::ParseSingleValueProperty(
                         nsCSSProps::kPageBreakInsideKTable);
   case eCSSProperty_pause_after:
   case eCSSProperty_pause_before:
     return ParseVariant(aValue, VARIANT_HTP, nsnull);
   case eCSSProperty_pitch:
     return ParseVariant(aValue, VARIANT_HKF, nsCSSProps::kPitchKTable);
   case eCSSProperty_pitch_range:
     return ParseVariant(aValue, VARIANT_HN, nsnull);
+  case eCSSProperty_pointer_events:
+    return ParseVariant(aValue, VARIANT_HOK,
+                        nsCSSProps::kPointerEventsKTable);
   case eCSSProperty_position:
     return ParseVariant(aValue, VARIANT_HK, nsCSSProps::kPositionKTable);
   case eCSSProperty_richness:
     return ParseVariant(aValue, VARIANT_HN, nsnull);
 #ifdef MOZ_MATHML
   // script-level can take Integer or Number values, but only Integer ("relative")
   // values can be specified in a style sheet. Also we only allow this property
   // when unsafe rules are enabled, because otherwise it could interfere
--- a/layout/style/nsCSSPropList.h
+++ b/layout/style/nsCSSPropList.h
@@ -1844,16 +1844,25 @@ CSS_PROP_BACKENDONLY(
     pitch-range,
     pitch_range,
     PitchRange,
     0,
     Aural,
     mPitchRange,
     eCSSType_Value,
     nsnull)
+CSS_PROP_VISIBILITY(
+    pointer-events,
+    pointer_events,
+    PointerEvents,
+    0,
+    Display,
+    mPointerEvents,
+    eCSSType_Value,
+    kPointerEventsKTable)
 CSS_PROP_DISPLAY(
     position,
     position,
     Position,
     0,
     Display,
     mPosition,
     eCSSType_Value,
@@ -2474,25 +2483,16 @@ CSS_PROP_SVGRESET(
     mask,
     Mask,
     0,
     SVG,
     mMask,
     eCSSType_Value,
     nsnull)
 CSS_PROP_SVG(
-    pointer-events,
-    pointer_events,
-    PointerEvents,
-    0,
-    SVG,
-    mPointerEvents,
-    eCSSType_Value,
-    kPointerEventsKTable)
-CSS_PROP_SVG(
     shape-rendering,
     shape_rendering,
     ShapeRendering,
     0,
     SVG,
     mShapeRendering,
     eCSSType_Value,
     kShapeRenderingKTable)
--- a/layout/style/nsCSSProps.cpp
+++ b/layout/style/nsCSSProps.cpp
@@ -1024,16 +1024,29 @@ const PRInt32 nsCSSProps::kPitchKTable[]
   eCSSKeyword_x_low, NS_STYLE_PITCH_X_LOW,
   eCSSKeyword_low, NS_STYLE_PITCH_LOW,
   eCSSKeyword_medium, NS_STYLE_PITCH_MEDIUM,
   eCSSKeyword_high, NS_STYLE_PITCH_HIGH,
   eCSSKeyword_x_high, NS_STYLE_PITCH_X_HIGH,
   eCSSKeyword_UNKNOWN,-1
 };
 
+const PRInt32 nsCSSProps::kPointerEventsKTable[] = {
+  eCSSKeyword_visiblepainted, NS_STYLE_POINTER_EVENTS_VISIBLEPAINTED,
+  eCSSKeyword_visiblefill, NS_STYLE_POINTER_EVENTS_VISIBLEFILL,
+  eCSSKeyword_visiblestroke, NS_STYLE_POINTER_EVENTS_VISIBLESTROKE,
+  eCSSKeyword_visible, NS_STYLE_POINTER_EVENTS_VISIBLE,
+  eCSSKeyword_painted, NS_STYLE_POINTER_EVENTS_PAINTED,
+  eCSSKeyword_fill, NS_STYLE_POINTER_EVENTS_FILL,
+  eCSSKeyword_stroke, NS_STYLE_POINTER_EVENTS_STROKE,
+  eCSSKeyword_all, NS_STYLE_POINTER_EVENTS_ALL,
+  eCSSKeyword_auto, NS_STYLE_POINTER_EVENTS_AUTO,
+  eCSSKeyword_UNKNOWN, -1
+};
+
 const PRInt32 nsCSSProps::kPositionKTable[] = {
   eCSSKeyword_static, NS_STYLE_POSITION_STATIC,
   eCSSKeyword_relative, NS_STYLE_POSITION_RELATIVE,
   eCSSKeyword_absolute, NS_STYLE_POSITION_ABSOLUTE,
   eCSSKeyword_fixed, NS_STYLE_POSITION_FIXED,
   eCSSKeyword_UNKNOWN,-1
 };
 
@@ -1275,28 +1288,16 @@ const PRInt32 nsCSSProps::kFillRuleKTabl
 
 const PRInt32 nsCSSProps::kImageRenderingKTable[] = {
   eCSSKeyword_optimizespeed, NS_STYLE_IMAGE_RENDERING_OPTIMIZESPEED,
   eCSSKeyword_optimizequality, NS_STYLE_IMAGE_RENDERING_OPTIMIZEQUALITY,
   eCSSKeyword__moz_crisp_edges, NS_STYLE_IMAGE_RENDERING_CRISPEDGES,
   eCSSKeyword_UNKNOWN, -1
 };
 
-const PRInt32 nsCSSProps::kPointerEventsKTable[] = {
-  eCSSKeyword_visiblepainted, NS_STYLE_POINTER_EVENTS_VISIBLEPAINTED,
-  eCSSKeyword_visiblefill, NS_STYLE_POINTER_EVENTS_VISIBLEFILL,
-  eCSSKeyword_visiblestroke, NS_STYLE_POINTER_EVENTS_VISIBLESTROKE,
-  eCSSKeyword_visible, NS_STYLE_POINTER_EVENTS_VISIBLE,
-  eCSSKeyword_painted, NS_STYLE_POINTER_EVENTS_PAINTED,
-  eCSSKeyword_fill, NS_STYLE_POINTER_EVENTS_FILL,
-  eCSSKeyword_stroke, NS_STYLE_POINTER_EVENTS_STROKE,
-  eCSSKeyword_all, NS_STYLE_POINTER_EVENTS_ALL,
-  eCSSKeyword_UNKNOWN, -1
-};
-
 const PRInt32 nsCSSProps::kShapeRenderingKTable[] = {
   eCSSKeyword_optimizespeed, NS_STYLE_SHAPE_RENDERING_OPTIMIZESPEED,
   eCSSKeyword_crispedges, NS_STYLE_SHAPE_RENDERING_CRISPEDGES,
   eCSSKeyword_geometricprecision, NS_STYLE_SHAPE_RENDERING_GEOMETRICPRECISION,
   eCSSKeyword_UNKNOWN, -1
 };
 
 const PRInt32 nsCSSProps::kStrokeLinecapKTable[] = {
--- a/layout/style/nsCSSProps.h
+++ b/layout/style/nsCSSProps.h
@@ -180,17 +180,16 @@ public:
   static const PRInt32 kBoxAlignKTable[];
   static const PRInt32 kBoxDirectionKTable[];
   static const PRInt32 kBoxOrientKTable[];
   static const PRInt32 kBoxPackKTable[];
 #ifdef MOZ_SVG
   static const PRInt32 kDominantBaselineKTable[];
   static const PRInt32 kFillRuleKTable[];
   static const PRInt32 kImageRenderingKTable[];
-  static const PRInt32 kPointerEventsKTable[];
   static const PRInt32 kShapeRenderingKTable[];
   static const PRInt32 kStrokeLinecapKTable[];
   static const PRInt32 kStrokeLinejoinKTable[];
   static const PRInt32 kTextAnchorKTable[];
   static const PRInt32 kTextRenderingKTable[];
   static const PRInt32 kColorInterpolationKTable[];
 #endif
   static const PRInt32 kBoxPropSourceKTable[];
@@ -221,16 +220,17 @@ public:
   static const PRInt32 kOutlineColorKTable[];
   static const PRInt32 kOverflowKTable[];
   static const PRInt32 kOverflowSubKTable[];
   static const PRInt32 kPageBreakKTable[];
   static const PRInt32 kPageBreakInsideKTable[];
   static const PRInt32 kPageMarksKTable[];
   static const PRInt32 kPageSizeKTable[];
   static const PRInt32 kPitchKTable[];
+  static const PRInt32 kPointerEventsKTable[];
   static const PRInt32 kPositionKTable[];
   static const PRInt32 kSpeakKTable[];
   static const PRInt32 kSpeakHeaderKTable[];
   static const PRInt32 kSpeakNumeralKTable[];
   static const PRInt32 kSpeakPunctuationKTable[];
   static const PRInt32 kSpeechRateKTable[];
   static const PRInt32 kStackSizingKTable[];
   static const PRInt32 kTableLayoutKTable[];
--- a/layout/style/nsCSSStruct.h
+++ b/layout/style/nsCSSStruct.h
@@ -366,16 +366,17 @@ struct nsCSSDisplay : public nsCSSStruct
   nsCSSValue mBinding;
   nsCSSValue mAppearance;
   nsCSSValue mPosition;
   nsCSSValue mFloat;
   nsCSSValue mClear;
   nsCSSRect  mClip;
   nsCSSValue mOverflowX;
   nsCSSValue mOverflowY;
+  nsCSSValue mPointerEvents;
   nsCSSValue mVisibility;
   nsCSSValue mOpacity;
   nsCSSValueList *mTransform; // List of Arrays containing transform information
   nsCSSValuePair mTransformOrigin;
   nsCSSValueList* mTransitionProperty;
   nsCSSValueList* mTransitionDuration;
   nsCSSValueList* mTransitionTimingFunction;
   nsCSSValueList* mTransitionDelay;
@@ -687,17 +688,16 @@ struct nsCSSSVG : public nsCSSStruct {
   nsCSSValue mFloodColor;
   nsCSSValue mFloodOpacity;
   nsCSSValue mImageRendering;
   nsCSSValue mLightingColor;
   nsCSSValue mMarkerEnd;
   nsCSSValue mMarkerMid;
   nsCSSValue mMarkerStart;
   nsCSSValue mMask;
-  nsCSSValue mPointerEvents;
   nsCSSValue mShapeRendering;
   nsCSSValue mStopColor;
   nsCSSValue mStopOpacity;
   nsCSSValuePair mStroke;
   nsCSSValueList *mStrokeDasharray;
   nsCSSValue mStrokeDashoffset;
   nsCSSValue mStrokeLinecap;
   nsCSSValue mStrokeLinejoin;
--- a/layout/style/nsComputedDOMStyle.cpp
+++ b/layout/style/nsComputedDOMStyle.cpp
@@ -2627,16 +2627,34 @@ nsComputedDOMStyle::GetWordWrap(nsIDOMCS
   } else {
     val->SetIdent(eCSSKeyword_normal);
   }
 
   return CallQueryInterface(val, aValue);
 }
 
 nsresult
+nsComputedDOMStyle::GetPointerEvents(nsIDOMCSSValue** aValue)
+{
+  nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
+  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);
+  
+  const nsStyleVisibility* visibility = GetStyleVisibility();
+  
+  if (visibility->mPointerEvents != NS_STYLE_POINTER_EVENTS_NONE) {
+    val->SetIdent(nsCSSProps::ValueToKeywordEnum(visibility->mPointerEvents,
+                                                 nsCSSProps::kPointerEventsKTable));
+  } else {
+    val->SetIdent(eCSSKeyword_none);
+  }
+  
+  return CallQueryInterface(val, aValue);
+}
+
+nsresult
 nsComputedDOMStyle::GetVisibility(nsIDOMCSSValue** aValue)
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
   NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);
 
   val->SetIdent(nsCSSProps::ValueToKeywordEnum(GetStyleVisibility()->mVisible,
                                                nsCSSProps::kVisibilityKTable));
 
@@ -4268,35 +4286,16 @@ nsComputedDOMStyle::GetImageRendering(ns
   } else {
     val->SetIdent(eCSSKeyword_auto);
   }
 
   return CallQueryInterface(val, aValue);
 }
 
 nsresult
-nsComputedDOMStyle::GetPointerEvents(nsIDOMCSSValue** aValue)
-{
-  nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
-  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);
-
-  const nsStyleSVG* svg = GetStyleSVG();
-
-  if (svg->mPointerEvents != NS_STYLE_POINTER_EVENTS_NONE) {
-    val->SetIdent(
-      nsCSSProps::ValueToKeywordEnum(svg->mPointerEvents,
-                                     nsCSSProps::kPointerEventsKTable));
-  } else {
-    val->SetIdent(eCSSKeyword_none);
-  }
-
-  return CallQueryInterface(val, aValue);
-}
-
-nsresult
 nsComputedDOMStyle::GetShapeRendering(nsIDOMCSSValue** aValue)
 {
   nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
   NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);
 
   const nsStyleSVG* svg = GetStyleSVG();
 
   if (svg->mShapeRendering != NS_STYLE_SHAPE_RENDERING_AUTO) {
@@ -4660,16 +4659,17 @@ nsComputedDOMStyle::GetQueryableProperty
     COMPUTED_STYLE_MAP_ENTRY(page_break_after,              PageBreakAfter),
     COMPUTED_STYLE_MAP_ENTRY(page_break_before,             PageBreakBefore),
     // COMPUTED_STYLE_MAP_ENTRY(page_break_inside,          PageBreakInside),
     //// COMPUTED_STYLE_MAP_ENTRY(pause,                    Pause),
     // COMPUTED_STYLE_MAP_ENTRY(pause_after,                PauseAfter),
     // COMPUTED_STYLE_MAP_ENTRY(pause_before,               PauseBefore),
     // COMPUTED_STYLE_MAP_ENTRY(pitch,                      Pitch),
     // COMPUTED_STYLE_MAP_ENTRY(pitch_range,                PitchRange),
+    COMPUTED_STYLE_MAP_ENTRY(pointer_events,                PointerEvents),
     COMPUTED_STYLE_MAP_ENTRY(position,                      Position),
     COMPUTED_STYLE_MAP_ENTRY(quotes,                        Quotes),
     // COMPUTED_STYLE_MAP_ENTRY(richness,                   Richness),
     COMPUTED_STYLE_MAP_ENTRY_LAYOUT(right,                  Right),
     //// COMPUTED_STYLE_MAP_ENTRY(size,                     Size),
     // COMPUTED_STYLE_MAP_ENTRY(speak,                      Speak),
     // COMPUTED_STYLE_MAP_ENTRY(speak_header,               SpeakHeader),
     // COMPUTED_STYLE_MAP_ENTRY(speak_numeral,              SpeakNumeral),
@@ -4763,17 +4763,16 @@ nsComputedDOMStyle::GetQueryableProperty
     COMPUTED_STYLE_MAP_ENTRY(flood_color,                   FloodColor),
     COMPUTED_STYLE_MAP_ENTRY(flood_opacity,                 FloodOpacity),
     COMPUTED_STYLE_MAP_ENTRY(lighting_color,                LightingColor),
     COMPUTED_STYLE_MAP_ENTRY(image_rendering,               ImageRendering),
     COMPUTED_STYLE_MAP_ENTRY(mask,                          Mask),
     COMPUTED_STYLE_MAP_ENTRY(marker_end,                    MarkerEnd),
     COMPUTED_STYLE_MAP_ENTRY(marker_mid,                    MarkerMid),
     COMPUTED_STYLE_MAP_ENTRY(marker_start,                  MarkerStart),
-    COMPUTED_STYLE_MAP_ENTRY(pointer_events,                PointerEvents),
     COMPUTED_STYLE_MAP_ENTRY(shape_rendering,               ShapeRendering),
     COMPUTED_STYLE_MAP_ENTRY(stop_color,                    StopColor),
     COMPUTED_STYLE_MAP_ENTRY(stop_opacity,                  StopOpacity),
     COMPUTED_STYLE_MAP_ENTRY(stroke,                        Stroke),
     COMPUTED_STYLE_MAP_ENTRY(stroke_dasharray,              StrokeDasharray),
     COMPUTED_STYLE_MAP_ENTRY(stroke_dashoffset,             StrokeDashoffset),
     COMPUTED_STYLE_MAP_ENTRY(stroke_linecap,                StrokeLinecap),
     COMPUTED_STYLE_MAP_ENTRY(stroke_linejoin,               StrokeLinejoin),
--- a/layout/style/nsComputedDOMStyle.h
+++ b/layout/style/nsComputedDOMStyle.h
@@ -286,16 +286,17 @@ private:
   nsresult GetTextShadow(nsIDOMCSSValue** aValue);
   nsresult GetLetterSpacing(nsIDOMCSSValue** aValue);
   nsresult GetWordSpacing(nsIDOMCSSValue** aValue);
   nsresult GetWhiteSpace(nsIDOMCSSValue** aValue);
   nsresult GetWordWrap(nsIDOMCSSValue** aValue);
 
   /* Visibility properties */
   nsresult GetOpacity(nsIDOMCSSValue** aValue);
+  nsresult GetPointerEvents(nsIDOMCSSValue** aValue);
   nsresult GetVisibility(nsIDOMCSSValue** aValue);
 
   /* Direction properties */
   nsresult GetDirection(nsIDOMCSSValue** aValue);
   nsresult GetUnicodeBidi(nsIDOMCSSValue** aValue);
 
   /* Display properties */
   nsresult GetBinding(nsIDOMCSSValue** aValue);
@@ -360,17 +361,16 @@ private:
   nsresult GetStrokeLinecap(nsIDOMCSSValue** aValue);
   nsresult GetStrokeLinejoin(nsIDOMCSSValue** aValue);
   nsresult GetTextAnchor(nsIDOMCSSValue** aValue);
 
   nsresult GetColorInterpolation(nsIDOMCSSValue** aValue);
   nsresult GetColorInterpolationFilters(nsIDOMCSSValue** aValue);
   nsresult GetDominantBaseline(nsIDOMCSSValue** aValue);
   nsresult GetImageRendering(nsIDOMCSSValue** aValue);
-  nsresult GetPointerEvents(nsIDOMCSSValue** aValue);
   nsresult GetShapeRendering(nsIDOMCSSValue** aValue);
   nsresult GetTextRendering(nsIDOMCSSValue** aValue);
 
   nsresult GetFloodColor(nsIDOMCSSValue** aValue);
   nsresult GetLightingColor(nsIDOMCSSValue** aValue);
   nsresult GetStopColor(nsIDOMCSSValue** aValue);
 
   nsresult GetClipPath(nsIDOMCSSValue** aValue);
--- a/layout/style/nsRuleNode.cpp
+++ b/layout/style/nsRuleNode.cpp
@@ -4188,16 +4188,23 @@ nsRuleNode::ComputeVisibilityData(void* 
               0, 0, 0, 0);
 
   // visibility: enum, inherit, initial
   SetDiscrete(displayData.mVisibility, visibility->mVisible,
               canStoreInRuleTree,
               SETDSC_ENUMERATED, parentVisibility->mVisible,
               NS_STYLE_VISIBILITY_VISIBLE, 0, 0, 0, 0);
 
+  // pointer-events: enum, none, inherit, initial
+  SetDiscrete(displayData.mPointerEvents, visibility->mPointerEvents,
+              canStoreInRuleTree,
+              SETDSC_ENUMERATED | SETDSC_NONE, parentVisibility->mPointerEvents,
+              NS_STYLE_POINTER_EVENTS_AUTO, 0,
+              NS_STYLE_POINTER_EVENTS_NONE, 0, 0);
+  
   // lang: string, inherit
   // this is not a real CSS property, it is a html attribute mapped to CSS struture
   if (eCSSUnit_Ident == displayData.mLang.GetUnit()) {
     if (!gLangService) {
       CallGetService(NS_LANGUAGEATOMSERVICE_CONTRACTID, &gLangService);
     }
 
     if (gLangService) {
@@ -5809,22 +5816,16 @@ nsRuleNode::ComputeSVGData(void* aStartS
   } else if (eCSSUnit_None == SVGData.mMarkerStart.GetUnit() ||
              eCSSUnit_Initial == SVGData.mMarkerStart.GetUnit()) {
     svg->mMarkerStart = nsnull;
   } else if (eCSSUnit_Inherit == SVGData.mMarkerStart.GetUnit()) {
     canStoreInRuleTree = PR_FALSE;
     svg->mMarkerStart = parentSVG->mMarkerStart;
   }
 
-  // pointer-events: enum, none, inherit, initial
-  SetDiscrete(SVGData.mPointerEvents, svg->mPointerEvents, canStoreInRuleTree,
-              SETDSC_ENUMERATED | SETDSC_NONE, parentSVG->mPointerEvents,
-              NS_STYLE_POINTER_EVENTS_VISIBLEPAINTED, 0,
-              NS_STYLE_POINTER_EVENTS_NONE, 0, 0);
-
   // shape-rendering: enum, auto, inherit
   SetDiscrete(SVGData.mShapeRendering, svg->mShapeRendering, canStoreInRuleTree,
               SETDSC_ENUMERATED | SETDSC_AUTO,
               parentSVG->mShapeRendering,
               NS_STYLE_SHAPE_RENDERING_AUTO, 
               NS_STYLE_SHAPE_RENDERING_AUTO, 0, 0, 0);
 
   // stroke: 
--- a/layout/style/nsStyleStruct.cpp
+++ b/layout/style/nsStyleStruct.cpp
@@ -805,17 +805,16 @@ nsStyleSVG::nsStyleSVG()
     mStrokeOpacity           = 1.0f;
 
     mStrokeDasharrayLength   = 0;
     mClipRule                = NS_STYLE_FILL_RULE_NONZERO;
     mColorInterpolation      = NS_STYLE_COLOR_INTERPOLATION_SRGB;
     mColorInterpolationFilters = NS_STYLE_COLOR_INTERPOLATION_LINEARRGB;
     mFillRule                = NS_STYLE_FILL_RULE_NONZERO;
     mImageRendering          = NS_STYLE_IMAGE_RENDERING_AUTO;
-    mPointerEvents           = NS_STYLE_POINTER_EVENTS_VISIBLEPAINTED;
     mShapeRendering          = NS_STYLE_SHAPE_RENDERING_AUTO;
     mStrokeLinecap           = NS_STYLE_STROKE_LINECAP_BUTT;
     mStrokeLinejoin          = NS_STYLE_STROKE_LINEJOIN_MITER;
     mTextAnchor              = NS_STYLE_TEXT_ANCHOR_START;
     mTextRendering           = NS_STYLE_TEXT_RENDERING_AUTO;
 }
 
 nsStyleSVG::~nsStyleSVG() 
@@ -854,17 +853,16 @@ nsStyleSVG::nsStyleSVG(const nsStyleSVG&
   mStrokeMiterlimit = aSource.mStrokeMiterlimit;
   mStrokeOpacity = aSource.mStrokeOpacity;
 
   mClipRule = aSource.mClipRule;
   mColorInterpolation = aSource.mColorInterpolation;
   mColorInterpolationFilters = aSource.mColorInterpolationFilters;
   mFillRule = aSource.mFillRule;
   mImageRendering = aSource.mImageRendering;
-  mPointerEvents = aSource.mPointerEvents;
   mShapeRendering = aSource.mShapeRendering;
   mStrokeLinecap = aSource.mStrokeLinecap;
   mStrokeLinejoin = aSource.mStrokeLinejoin;
   mTextAnchor = aSource.mTextAnchor;
   mTextRendering = aSource.mTextRendering;
 }
 
 static PRBool PaintURIChanged(const nsStyleSVGPaint& aPaint1,
@@ -1928,24 +1926,26 @@ nsStyleVisibility::nsStyleVisibility(nsP
   PRUint32 bidiOptions = aPresContext->GetBidi();
   if (GET_BIDI_OPTION_DIRECTION(bidiOptions) == IBMBIDI_TEXTDIRECTION_RTL)
     mDirection = NS_STYLE_DIRECTION_RTL;
   else
     mDirection = NS_STYLE_DIRECTION_LTR;
 
   mLangGroup = aPresContext->GetLangGroup();
   mVisible = NS_STYLE_VISIBILITY_VISIBLE;
+  mPointerEvents = NS_STYLE_POINTER_EVENTS_AUTO;
 }
 
 nsStyleVisibility::nsStyleVisibility(const nsStyleVisibility& aSource)
 {
   MOZ_COUNT_CTOR(nsStyleVisibility);
   mDirection = aSource.mDirection;
   mVisible = aSource.mVisible;
   mLangGroup = aSource.mLangGroup;
+  mPointerEvents = aSource.mPointerEvents;
 } 
 
 nsChangeHint nsStyleVisibility::CalcDifference(const nsStyleVisibility& aOther) const
 {
   if ((mDirection == aOther.mDirection) &&
       (mLangGroup == aOther.mLangGroup)) {
     if ((mVisible == aOther.mVisible)) {
       return NS_STYLE_HINT_NONE;
--- a/layout/style/nsStyleStruct.h
+++ b/layout/style/nsStyleStruct.h
@@ -1108,17 +1108,18 @@ struct nsStyleVisibility {
   nsChangeHint CalcDifference(const nsStyleVisibility& aOther) const;
 #ifdef DEBUG
   static nsChangeHint MaxDifference();
 #endif
   
   PRUint8 mDirection;                  // [inherited] see nsStyleConsts.h NS_STYLE_DIRECTION_*
   PRUint8   mVisible;                  // [inherited]
   nsCOMPtr<nsIAtom> mLangGroup;        // [inherited]
- 
+  PRUint8 mPointerEvents;              // [inherited] see nsStyleConsts.h
+
   PRBool IsVisible() const {
     return (mVisible == NS_STYLE_VISIBILITY_VISIBLE);
   }
 
   PRBool IsVisibleOrCollapsed() const {
     return ((mVisible == NS_STYLE_VISIBILITY_VISIBLE) ||
             (mVisible == NS_STYLE_VISIBILITY_COLLAPSE));
   }
@@ -1773,17 +1774,16 @@ struct nsStyleSVG {
   float            mStrokeOpacity;    // [inherited]
 
   PRUint32         mStrokeDasharrayLength;
   PRUint8          mClipRule;         // [inherited]
   PRUint8          mColorInterpolation; // [inherited] see nsStyleConsts.h
   PRUint8          mColorInterpolationFilters; // [inherited] see nsStyleConsts.h
   PRUint8          mFillRule;         // [inherited] see nsStyleConsts.h
   PRUint8          mImageRendering;   // [inherited] see nsStyleConsts.h
-  PRUint8          mPointerEvents;    // [inherited] see nsStyleConsts.h
   PRUint8          mShapeRendering;   // [inherited] see nsStyleConsts.h
   PRUint8          mStrokeLinecap;    // [inherited] see nsStyleConsts.h
   PRUint8          mStrokeLinejoin;   // [inherited] see nsStyleConsts.h
   PRUint8          mTextAnchor;       // [inherited] see nsStyleConsts.h
   PRUint8          mTextRendering;    // [inherited] see nsStyleConsts.h
 };
 
 struct nsStyleSVGReset {
--- a/layout/style/test/Makefile.in
+++ b/layout/style/test/Makefile.in
@@ -119,16 +119,17 @@ GARBAGE += css_properties.js
 		test_initial_storage.html \
 		test_media_queries.html \
 		test_media_queries_dynamic.html \
 		test_media_queries_dynamic_xbl.html \
 		test_namespace_rule.html \
 		test_of_type_selectors.xhtml \
 		test_parse_rule.html \
 		test_parse_url.html \
+		test_pointer-events.html \
 		test_property_database.html \
 		test_priority_preservation.html \
 		test_property_syntax_errors.html \
 		test_rem_unit.html \
 		test_selectors.html \
 		test_selectors_on_anonymous_content.html \
 		test_shorthand_property_getters.html \
 		test_style_struct_copy_constructors.html \
--- a/layout/style/test/property_database.js
+++ b/layout/style/test/property_database.js
@@ -1563,16 +1563,25 @@ var gCSSProperties = {
 		domProp: "pitchRange",
 		inherited: true,
 		backend_only: true,
 		type: CSS_TYPE_LONGHAND,
 		initial_values: [ "50", "50.0" ],
 		other_values: [ "0", "100.0", "99.7", "47", "3.2" ],
 		invalid_values: [" -0.01", "100.2", "108", "-3" ]
 	},
+	"pointer-events": {
+		domProp: "pointerEvents",
+		inherited: true,
+		type: CSS_TYPE_LONGHAND,
+		initial_values: [ "auto" ],
+		other_values: [ "visiblePainted", "visibleFill", "visibleStroke", "visible",
+		                "painted", "fill", "stroke", "all", "none" ],
+		invalid_values: []
+	},
 	"position": {
 		domProp: "position",
 		inherited: false,
 		type: CSS_TYPE_LONGHAND,
 		initial_values: [ "static" ],
 		other_values: [ "relative", "absolute", "fixed" ],
 		invalid_values: []
 	},
@@ -2012,24 +2021,16 @@ var gCSSProperties = {
 	"mask": {
 		domProp: null,
 		inherited: false,
 		type: CSS_TYPE_LONGHAND,
 		initial_values: [ "none" ],
 		other_values: [ "url(#mymask)" ],
 		invalid_values: []
 	},
-	"pointer-events": {
-		domProp: null,
-		inherited: true,
-		type: CSS_TYPE_LONGHAND,
-		initial_values: [ "visiblepainted" ],
-		other_values: [ "visibleFill", "visiblestroke", "Visible", "painted", "fill", "stroke", "all", "none" ],
-		invalid_values: []
-	},
 	"shape-rendering": {
 		domProp: null,
 		inherited: true,
 		type: CSS_TYPE_LONGHAND,
 		initial_values: [ "auto" ],
 		other_values: [ "optimizeSpeed", "crispEdges", "geometricPrecision" ],
 		invalid_values: []
 	},
new file mode 100644
--- /dev/null
+++ b/layout/style/test/test_pointer-events.html
@@ -0,0 +1,116 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+  <title>Test for pointer-events in HTML</title>
+  <script type="application/javascript" src="/MochiKit/packed.js"></script>
+  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+  <style type="text/css">
+
+  div       { height: 10px; width: 10px; background: black; }
+
+  </style>
+</head>
+<!-- need a set timeout because we need things to start after painting suppression ends -->
+<body onload="setTimeout(run_test, 0)">
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=">Mozilla Bug </a>
+<div id="display" style="position: absolute; top: 0; left: 0; width: 300px; height: 300px">
+
+  <div id="one"></div>
+  <div id="two" style="pointer-events: visiblePainted;"></div>
+  <div id="three" style="height: 20px; pointer-events: none;">
+    <div id="four"style="margin-top: 10px;"></div>
+  </div>
+  <a id="five" style="pointer-events: none;" href="http://mozilla.org/">link</a>
+  <input id="six" style="pointer-events: none;" type="button" value="button" />
+  <table>
+    <tr style="pointer-events: none;">
+      <td id="seven">no</td>
+      <td id="eight" style="pointer-events: visiblePainted;">yes</td>
+      <td id="nine" style="pointer-events: auto;">yes</td>
+    </td>
+    <tr style="opacity: 0.5; pointer-events: none;">
+      <td id="ten">no</td>
+      <td id="eleven" style="pointer-events: visiblePainted;">yes</td>
+     <td id="twelve" style="pointer-events: auto;">yes</td>
+    </td>
+  </table>
+  <iframe id="thirteen" style="pointer-events: none;" src="about:blank" width="100" height="100"></iframe>
+  <script type="application/javascript">
+    var iframe = document.getElementById("thirteen");
+    iframe.contentDocument.open();
+    iframe.contentDocument.writeln("<script type='application/javascript'>");
+    iframe.contentDocument.writeln("document.addEventListener('mousedown', fail, false);");
+    iframe.contentDocument.writeln("function fail() { parent.ok(false, 'thirteen: iframe content must not get pointer events with explicit none') }");
+    iframe.contentDocument.writeln("<"+"/script>");
+    iframe.contentDocument.close();
+  </script>
+
+</div>
+<pre id="test">
+<script type="application/javascript;version=1.8">
+
+SimpleTest.waitForExplicitFinish();
+
+function catches_pointer_events(element_id)
+{
+    // we just assume the element is on top here.
+    var element = document.getElementById(element_id);
+    var bounds = element.getBoundingClientRect();
+    var point = { x: bounds.left + bounds.width/2, y: bounds.top + bounds.height/2 };
+    return element == document.elementFromPoint(point.x, point.y);
+}
+
+function synthesizeMouseEvent(type,                // string
+                              x,                   // float
+                              y,                   // float
+                              button,              // long
+                              clickCount,          // long
+                              modifiers,           // long
+                              ignoreWindowBounds)  // boolean
+{
+  netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
+
+  var utils = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor).
+                     getInterface(Components.interfaces.nsIDOMWindowUtils);
+
+  utils.sendMouseEvent(type, x, y, button, clickCount, modifiers, ignoreWindowBounds);
+}
+
+function run_test()
+{
+    ok(catches_pointer_events("one"), "one: div should default to catching pointer events");
+    ok(catches_pointer_events("two"), "two: div should catch pointer events with explicit visiblePainted");
+    ok(!catches_pointer_events("three"), "three: div should not catch pointer events with explicit none");
+    ok(!catches_pointer_events("four"), "four: div should not catch pointer events with inherited none");
+    ok(!catches_pointer_events("five"), "five: link should not catch pointer events with explicit none");
+    ok(!catches_pointer_events("six"), "six: native-themed form control should not catch pointer events with explicit none");
+    ok(!catches_pointer_events("seven"), "seven: td should not catch pointer events with inherited none");
+    ok(catches_pointer_events("eight"), "eight: td should catch pointer events with explicit visiblePainted overriding inherited none");
+    ok(catches_pointer_events("nine"), "nine: td should catch pointer events with explicit auto overriding inherited none");
+    ok(!catches_pointer_events("ten"), "ten: td should not catch pointer events with inherited none");
+    ok(catches_pointer_events("eleven"), "eleven: td should catch pointer events with explicit visiblePainted overriding inherited none");
+    ok(catches_pointer_events("twelve"), "twelve: td should catch pointer events with explicit auto overriding inherited none");
+
+    // elementFromPoint can't be used for iframe
+    var iframe = document.getElementById("thirteen");
+    iframe.parentNode.addEventListener('mousedown', handleIFrameClick, false);
+    var bounds = iframe.getBoundingClientRect();
+    var x = bounds.left + bounds.width/2;
+    var y = bounds.top + bounds.height/2;
+    synthesizeMouseEvent('mousedown', x, y, 0, 1, 0, true);
+}
+
+function handleIFrameClick()
+{
+    ok(true, "thirteen: iframe content must not get pointer events with explicit none");
+
+    document.getElementById("display").style.display = "none";
+    SimpleTest.finish();
+}
+
+</script>
+</pre>
+</body>
+</html>
--- a/layout/svg/base/src/nsSVGGlyphFrame.cpp
+++ b/layout/svg/base/src/nsSVGGlyphFrame.cpp
@@ -390,20 +390,21 @@ nsSVGGlyphFrame::GetFrameForPoint(const 
 #ifdef DEBUG
   //printf("nsSVGGlyphFrame(%p)::GetFrameForPoint\n", this);
 #endif
 
   if (!mRect.Contains(aPoint))
     return nsnull;
 
   PRBool events = PR_FALSE;
-  switch (GetStyleSVG()->mPointerEvents) {
+  switch (GetStyleVisibility()->mPointerEvents) {
     case NS_STYLE_POINTER_EVENTS_NONE:
       break;
     case NS_STYLE_POINTER_EVENTS_VISIBLEPAINTED:
+    case NS_STYLE_POINTER_EVENTS_AUTO:
       if (GetStyleVisibility()->IsVisible() &&
           (GetStyleSVG()->mFill.mType != eStyleSVGPaintType_None ||
            GetStyleSVG()->mStroke.mType != eStyleSVGPaintType_None))
         events = PR_TRUE;
       break;
     case NS_STYLE_POINTER_EVENTS_VISIBLEFILL:
     case NS_STYLE_POINTER_EVENTS_VISIBLESTROKE:
     case NS_STYLE_POINTER_EVENTS_VISIBLE:
--- a/layout/svg/base/src/nsSVGImageFrame.cpp
+++ b/layout/svg/base/src/nsSVGImageFrame.cpp
@@ -308,20 +308,21 @@ nsSVGImageFrame::GetType() const
 
 // Lie about our fill/stroke so that hit detection works properly
 
 PRUint16
 nsSVGImageFrame::GetHittestMask()
 {
   PRUint16 mask = 0;
 
-  switch(GetStyleSVG()->mPointerEvents) {
+  switch(GetStyleVisibility()->mPointerEvents) {
     case NS_STYLE_POINTER_EVENTS_NONE:
       break;
     case NS_STYLE_POINTER_EVENTS_VISIBLEPAINTED:
+    case NS_STYLE_POINTER_EVENTS_AUTO:
       if (GetStyleVisibility()->IsVisible()) {
         /* XXX: should check pixel transparency */
         mask |= HITTEST_MASK_FILL;
       }
       break;
     case NS_STYLE_POINTER_EVENTS_VISIBLEFILL:
     case NS_STYLE_POINTER_EVENTS_VISIBLESTROKE:
     case NS_STYLE_POINTER_EVENTS_VISIBLE:
--- a/layout/svg/base/src/nsSVGPathGeometryFrame.cpp
+++ b/layout/svg/base/src/nsSVGPathGeometryFrame.cpp
@@ -489,20 +489,21 @@ nsSVGPathGeometryFrame::GeneratePath(gfx
   static_cast<nsSVGPathGeometryElement*>(mContent)->ConstructPath(aContext);
 }
 
 PRUint16
 nsSVGPathGeometryFrame::GetHittestMask()
 {
   PRUint16 mask = 0;
 
-  switch(GetStyleSVG()->mPointerEvents) {
+  switch(GetStyleVisibility()->mPointerEvents) {
     case NS_STYLE_POINTER_EVENTS_NONE:
       break;
     case NS_STYLE_POINTER_EVENTS_VISIBLEPAINTED:
+    case NS_STYLE_POINTER_EVENTS_AUTO:
       if (GetStyleVisibility()->IsVisible()) {
         if (GetStyleSVG()->mFill.mType != eStyleSVGPaintType_None)
           mask |= HITTEST_MASK_FILL;
         if (GetStyleSVG()->mStroke.mType != eStyleSVGPaintType_None)
           mask |= HITTEST_MASK_STROKE;
       }
       break;
     case NS_STYLE_POINTER_EVENTS_VISIBLEFILL: