Bug 374216 - Setting element.style.someSvgProperty has no effect. r=dbaron,sr=roc

This commit is contained in:
Robert Longson 2010-02-06 13:46:54 +00:00
Родитель abca07a91f
Коммит 949ccfba39
9 изменённых файлов: 181 добавлений и 39 удалений

Просмотреть файл

@ -2630,6 +2630,7 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_BEGIN(CSSStyleDeclaration, nsIDOMCSSStyleDeclaration)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSStyleDeclaration)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSS2Properties)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGCSS2Properties)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSCSS2Properties)
DOM_CLASSINFO_MAP_END
@ -2637,6 +2638,7 @@ nsDOMClassInfo::Init()
nsIDOMCSSStyleDeclaration)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSStyleDeclaration)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSS2Properties)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGCSS2Properties)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSCSS2Properties)
DOM_CLASSINFO_MAP_END

Просмотреть файл

@ -72,6 +72,7 @@ XPIDLSRCS = \
nsIDOMNSCSS2Properties.idl \
nsIDOMRGBColor.idl \
nsIDOMRect.idl \
nsIDOMSVGCSS2Properties.idl \
nsIDOMViewCSS.idl \
nsIDOMNSRGBAColor.idl \
$(NULL)

Просмотреть файл

@ -38,10 +38,10 @@
*
* ***** END LICENSE BLOCK ***** */
#include "nsIDOMCSS2Properties.idl"
#include "nsIDOMSVGCSS2Properties.idl"
[scriptable, uuid(cc0a6325-770b-476d-8cb8-c2a02a43c348)]
interface nsIDOMNSCSS2Properties : nsIDOMCSS2Properties
[scriptable, uuid(be39bc6d-3b24-4421-9599-8fdf3ad33baf)]
interface nsIDOMNSCSS2Properties : nsIDOMSVGCSS2Properties
{
/* Non-DOM 2 extensions */

Просмотреть файл

@ -0,0 +1,136 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** 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 Takeshi Kurosawa
* Portions created by the Initial Developer are Copyright (C) 2008
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Robert Longson <longsonr@gmail.com>
*
* 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 ***** */
#include "nsIDOMCSS2Properties.idl"
[scriptable, uuid(b555e226-a387-4953-b2bc-c77296d146ec)]
interface nsIDOMSVGCSS2Properties : nsIDOMCSS2Properties
{
/* SVG CSS properties */
attribute DOMString clipPath;
// raises(DOMException) on setting
attribute DOMString clipRule;
// raises(DOMException) on setting
attribute DOMString colorInterpolation;
// raises(DOMException) on setting
attribute DOMString colorInterpolationFilters;
// raises(DOMException) on setting
attribute DOMString dominantBaseline;
// raises(DOMException) on setting
attribute DOMString fill;
// raises(DOMException) on setting
attribute DOMString fillOpacity;
// raises(DOMException) on setting
attribute DOMString fillRule;
// raises(DOMException) on setting
attribute DOMString filter;
// raises(DOMException) on setting
attribute DOMString floodColor;
// raises(DOMException) on setting
attribute DOMString floodOpacity;
// raises(DOMException) on setting
attribute DOMString imageRendering;
// raises(DOMException) on setting
attribute DOMString lightingColor;
// raises(DOMException) on setting
attribute DOMString marker;
// raises(DOMException) on setting
attribute DOMString markerEnd;
// raises(DOMException) on setting
attribute DOMString markerMid;
// raises(DOMException) on setting
attribute DOMString markerStart;
// raises(DOMException) on setting
attribute DOMString mask;
// raises(DOMException) on setting
attribute DOMString shapeRendering;
// raises(DOMException) on setting
attribute DOMString stopColor;
// raises(DOMException) on setting
attribute DOMString stopOpacity;
// raises(DOMException) on setting
attribute DOMString stroke;
// raises(DOMException) on setting
attribute DOMString strokeDasharray;
// raises(DOMException) on setting
attribute DOMString strokeDashoffset;
// raises(DOMException) on setting
attribute DOMString strokeLinecap;
// raises(DOMException) on setting
attribute DOMString strokeLinejoin;
// raises(DOMException) on setting
attribute DOMString strokeMiterlimit;
// raises(DOMException) on setting
attribute DOMString strokeOpacity;
// raises(DOMException) on setting
attribute DOMString strokeWidth;
// raises(DOMException) on setting
attribute DOMString textAnchor;
// raises(DOMException) on setting
attribute DOMString textRendering;
// raises(DOMException) on setting
};

Просмотреть файл

@ -2707,9 +2707,6 @@ CSS_PROP_FONT(
#endif
#endif
// XXX treat SVG's CSS Properties as internal for now.
// Do we want to create an nsIDOMSVGCSS2Properties interface?
#ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
CSS_PROP_SVGRESET(
clip-path,
clip_path,
@ -3045,7 +3042,6 @@ CSS_PROP_SVG(
kTextRenderingKTable,
offsetof(nsStyleSVG, mTextRendering),
eStyleAnimType_EnumU8)
#endif /* !defined (CSS_PROP_LIST_EXCLUDE_INTERNAL) */
// Callers that want information on the properties that are in
// the style structs but not in the nsCSS* structs should define

Просмотреть файл

@ -168,6 +168,8 @@ NS_INTERFACE_TABLE_HEAD(nsComputedDOMStyle)
NS_INTERFACE_MAP_ENTRIES_CYCLE_COLLECTION(nsComputedDOMStyle)
NS_INTERFACE_MAP_ENTRY_AGGREGATED(nsIDOMCSS2Properties,
new CSS2PropertiesTearoff(this))
NS_INTERFACE_MAP_ENTRY_AGGREGATED(nsIDOMSVGCSS2Properties,
new CSS2PropertiesTearoff(this))
NS_INTERFACE_MAP_ENTRY_AGGREGATED(nsIDOMNSCSS2Properties,
new CSS2PropertiesTearoff(this))
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(ComputedCSSStyleDeclaration)

Просмотреть файл

@ -67,6 +67,8 @@ NS_INTERFACE_TABLE_HEAD(nsDOMCSSDeclaration)
NS_OFFSET_AND_INTERFACE_TABLE_TO_MAP_SEGUE
NS_INTERFACE_MAP_ENTRY_AGGREGATED(nsIDOMCSS2Properties,
new CSS2PropertiesTearoff(this))
NS_INTERFACE_MAP_ENTRY_AGGREGATED(nsIDOMSVGCSS2Properties,
new CSS2PropertiesTearoff(this))
NS_INTERFACE_MAP_ENTRY_AGGREGATED(nsIDOMNSCSS2Properties,
new CSS2PropertiesTearoff(this))
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(CSSStyleDeclaration)
@ -384,13 +386,15 @@ NS_IMPL_CYCLE_COLLECTING_ADDREF(CSS2PropertiesTearoff)
NS_IMPL_CYCLE_COLLECTING_RELEASE(CSS2PropertiesTearoff)
NS_INTERFACE_TABLE_HEAD(CSS2PropertiesTearoff)
NS_INTERFACE_TABLE_INHERITED2(CSS2PropertiesTearoff,
NS_INTERFACE_TABLE_INHERITED3(CSS2PropertiesTearoff,
nsIDOMCSS2Properties,
nsIDOMSVGCSS2Properties,
nsIDOMNSCSS2Properties)
NS_INTERFACE_TABLE_TO_MAP_SEGUE_CYCLE_COLLECTION(CSS2PropertiesTearoff)
NS_INTERFACE_MAP_END_AGGREGATED(mOuter)
// nsIDOMCSS2Properties
// nsIDOMSVGCSS2Properties
// nsIDOMNSCSS2Properties
#define CSS_PROP(name_, id_, method_, flags_, datastruct_, member_, type_, \

Просмотреть файл

@ -59,6 +59,7 @@ public:
NS_DECL_CYCLE_COLLECTION_CLASS(CSS2PropertiesTearoff)
NS_DECL_NSIDOMCSS2PROPERTIES
NS_DECL_NSIDOMSVGCSS2PROPERTIES
NS_DECL_NSIDOMNSCSS2PROPERTIES
CSS2PropertiesTearoff(nsICSSDeclaration *aOuter);

Просмотреть файл

@ -2096,7 +2096,7 @@ var gCSSProperties = {
}
,
"clip-path": {
domProp: null,
domProp: "clipPath",
inherited: false,
type: CSS_TYPE_LONGHAND,
initial_values: [ "none" ],
@ -2104,7 +2104,7 @@ var gCSSProperties = {
invalid_values: []
},
"clip-rule": {
domProp: null,
domProp: "clipRule",
inherited: true,
type: CSS_TYPE_LONGHAND,
initial_values: [ "nonzero" ],
@ -2112,7 +2112,7 @@ var gCSSProperties = {
invalid_values: []
},
"color-interpolation": {
domProp: null,
domProp: "colorInterpolation",
inherited: true,
type: CSS_TYPE_LONGHAND,
initial_values: [ "sRGB" ],
@ -2120,7 +2120,7 @@ var gCSSProperties = {
invalid_values: []
},
"color-interpolation-filters": {
domProp: null,
domProp: "colorInterpolationFilters",
inherited: true,
type: CSS_TYPE_LONGHAND,
initial_values: [ "linearRGB" ],
@ -2128,7 +2128,7 @@ var gCSSProperties = {
invalid_values: []
},
"dominant-baseline": {
domProp: null,
domProp: "dominantBaseline",
inherited: false,
type: CSS_TYPE_LONGHAND,
initial_values: [ "auto" ],
@ -2136,7 +2136,7 @@ var gCSSProperties = {
invalid_values: []
},
"fill": {
domProp: null,
domProp: "fill",
inherited: true,
type: CSS_TYPE_LONGHAND,
prerequisites: { "color": "blue" },
@ -2145,7 +2145,7 @@ var gCSSProperties = {
invalid_values: []
},
"fill-opacity": {
domProp: null,
domProp: "fillOpacity",
inherited: true,
type: CSS_TYPE_LONGHAND,
initial_values: [ "1", "2.8", "1.000" ],
@ -2153,7 +2153,7 @@ var gCSSProperties = {
invalid_values: []
},
"fill-rule": {
domProp: null,
domProp: "fillRule",
inherited: true,
type: CSS_TYPE_LONGHAND,
initial_values: [ "nonzero" ],
@ -2161,7 +2161,7 @@ var gCSSProperties = {
invalid_values: []
},
"filter": {
domProp: null,
domProp: "filter",
inherited: false,
type: CSS_TYPE_LONGHAND,
initial_values: [ "none" ],
@ -2169,7 +2169,7 @@ var gCSSProperties = {
invalid_values: [ "url(#myfilt) none" ]
},
"flood-color": {
domProp: null,
domProp: "floodColor",
inherited: false,
type: CSS_TYPE_LONGHAND,
prerequisites: { "color": "blue" },
@ -2178,7 +2178,7 @@ var gCSSProperties = {
invalid_values: [ "url('#myserver')", "url(foo.svg#myserver)", 'url("#myserver") green' ]
},
"flood-opacity": {
domProp: null,
domProp: "floodOpacity",
inherited: false,
type: CSS_TYPE_LONGHAND,
initial_values: [ "1", "2.8", "1.000" ],
@ -2186,7 +2186,7 @@ var gCSSProperties = {
invalid_values: []
},
"image-rendering": {
domProp: null,
domProp: "imageRendering",
inherited: true,
type: CSS_TYPE_LONGHAND,
initial_values: [ "auto" ],
@ -2194,7 +2194,7 @@ var gCSSProperties = {
invalid_values: []
},
"lighting-color": {
domProp: null,
domProp: "lightingColor",
inherited: false,
type: CSS_TYPE_LONGHAND,
prerequisites: { "color": "blue" },
@ -2203,7 +2203,7 @@ var gCSSProperties = {
invalid_values: [ "url('#myserver')", "url(foo.svg#myserver)", 'url("#myserver") green' ]
},
"marker": {
domProp: null,
domProp: "marker",
inherited: true,
type: CSS_TYPE_TRUE_SHORTHAND,
subproperties: [ "marker-start", "marker-mid", "marker-end" ],
@ -2212,7 +2212,7 @@ var gCSSProperties = {
invalid_values: [ "none none", "url(#mysym) url(#mysym)", "none url(#mysym)", "url(#mysym) none" ]
},
"marker-end": {
domProp: null,
domProp: "markerEnd",
inherited: true,
type: CSS_TYPE_LONGHAND,
initial_values: [ "none" ],
@ -2220,7 +2220,7 @@ var gCSSProperties = {
invalid_values: []
},
"marker-mid": {
domProp: null,
domProp: "markerMid",
inherited: true,
type: CSS_TYPE_LONGHAND,
initial_values: [ "none" ],
@ -2228,7 +2228,7 @@ var gCSSProperties = {
invalid_values: []
},
"marker-start": {
domProp: null,
domProp: "markerStart",
inherited: true,
type: CSS_TYPE_LONGHAND,
initial_values: [ "none" ],
@ -2236,7 +2236,7 @@ var gCSSProperties = {
invalid_values: []
},
"mask": {
domProp: null,
domProp: "mask",
inherited: false,
type: CSS_TYPE_LONGHAND,
initial_values: [ "none" ],
@ -2244,7 +2244,7 @@ var gCSSProperties = {
invalid_values: []
},
"shape-rendering": {
domProp: null,
domProp: "shapeRendering",
inherited: true,
type: CSS_TYPE_LONGHAND,
initial_values: [ "auto" ],
@ -2252,7 +2252,7 @@ var gCSSProperties = {
invalid_values: []
},
"stop-color": {
domProp: null,
domProp: "stopColor",
inherited: false,
type: CSS_TYPE_LONGHAND,
prerequisites: { "color": "blue" },
@ -2261,7 +2261,7 @@ var gCSSProperties = {
invalid_values: [ "url('#myserver')", "url(foo.svg#myserver)", 'url("#myserver") green' ]
},
"stop-opacity": {
domProp: null,
domProp: "stopOpacity",
inherited: false,
type: CSS_TYPE_LONGHAND,
initial_values: [ "1", "2.8", "1.000" ],
@ -2269,7 +2269,7 @@ var gCSSProperties = {
invalid_values: []
},
"stroke": {
domProp: null,
domProp: "stroke",
inherited: true,
type: CSS_TYPE_LONGHAND,
initial_values: [ "none" ],
@ -2277,7 +2277,7 @@ var gCSSProperties = {
invalid_values: []
},
"stroke-dasharray": {
domProp: null,
domProp: "strokeDasharray",
inherited: true,
type: CSS_TYPE_LONGHAND,
initial_values: [ "none" ],
@ -2285,7 +2285,7 @@ var gCSSProperties = {
invalid_values: []
},
"stroke-dashoffset": {
domProp: null,
domProp: "strokeDashoffset",
inherited: true,
type: CSS_TYPE_LONGHAND,
initial_values: [ "0", "-0px", "0em" ],
@ -2293,7 +2293,7 @@ var gCSSProperties = {
invalid_values: []
},
"stroke-linecap": {
domProp: null,
domProp: "strokeLinecap",
inherited: true,
type: CSS_TYPE_LONGHAND,
initial_values: [ "butt" ],
@ -2301,7 +2301,7 @@ var gCSSProperties = {
invalid_values: []
},
"stroke-linejoin": {
domProp: null,
domProp: "strokeLinejoin",
inherited: true,
type: CSS_TYPE_LONGHAND,
initial_values: [ "miter" ],
@ -2309,7 +2309,7 @@ var gCSSProperties = {
invalid_values: []
},
"stroke-miterlimit": {
domProp: null,
domProp: "strokeMiterlimit",
inherited: true,
type: CSS_TYPE_LONGHAND,
initial_values: [ "4" ],
@ -2317,7 +2317,7 @@ var gCSSProperties = {
invalid_values: [ "0.9", "0", "-1", "3px", "-0.3" ]
},
"stroke-opacity": {
domProp: null,
domProp: "strokeOpacity",
inherited: true,
type: CSS_TYPE_LONGHAND,
initial_values: [ "1", "2.8", "1.000" ],
@ -2325,7 +2325,7 @@ var gCSSProperties = {
invalid_values: []
},
"stroke-width": {
domProp: null,
domProp: "strokeWidth",
inherited: true,
type: CSS_TYPE_LONGHAND,
initial_values: [ "1px" ],
@ -2333,7 +2333,7 @@ var gCSSProperties = {
invalid_values: [ "-0.1px", "-3px" ]
},
"text-anchor": {
domProp: null,
domProp: "textAnchor",
inherited: true,
type: CSS_TYPE_LONGHAND,
initial_values: [ "start" ],
@ -2341,7 +2341,7 @@ var gCSSProperties = {
invalid_values: []
},
"text-rendering": {
domProp: null,
domProp: "textRendering",
inherited: true,
type: CSS_TYPE_LONGHAND,
initial_values: [ "auto" ],