Closed Bug 316908 Opened 16 years ago Closed 14 years ago

Add SVG to nsComputedDOMStyle

Categories

(Core :: SVG, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: tor, Unassigned)

References

Details

Attachments

(2 files, 4 obsolete files)

 
Status: NEW → ASSIGNED
Blocks: 383184
Attachment #203462 - Attachment is obsolete: true
Attachment #273143 - Flags: review?(dbaron)
Comment on attachment 273143 [details] [diff] [review]
update SVG nsComputedDOMStyle to tip, fix problems revealed by mochitests

> const PRInt32 nsCSSProps::kPointerEventsKTable[] = {
>+  eCSSKeyword_none, NS_STYLE_POINTER_EVENTS_NONE,

Instead of doing this, you should write nsComputedDOMStyle::GetPointerEvents like GetClear or GetBorderStyleFor.
GetSVGPaintFor needs to do something about the fallback color -- it probably should create a space-separated value list.

I'm not sure if the stroke-dasharray stuff is ideal, but it'll do.

GetColorInterpolation and GetColorInterpolationFilters should use the |svg| variable rather than calling GetStyleSVG() again.

r+sr=dbaron with those changes.
Attachment #273143 - Attachment is obsolete: true
Attachment #273146 - Flags: review?(dbaron)
Attachment #273143 - Flags: review?(dbaron)
Attachment #273146 - Flags: review?(dbaron)
Not sure if this is exactly what you had in mind - currently appending the fallback for paint servers only.
Attachment #273146 - Attachment is obsolete: true
Attachment #273161 - Flags: review?(dbaron)
It's the right place.  But I'd rather you created two values and made a value list out of them rather than duplicating the URI and Color code.  See, for example, GetCounterIncrement or GetBorderSpacing.
Attachment #273161 - Attachment is obsolete: true
Attachment #273174 - Flags: review?(dbaron)
Attachment #273161 - Flags: review?(dbaron)
Comment on attachment 273174 [details] [diff] [review]
switch GetSVGPaintFor and GetStrokeDasharray to value lists

>+    if (!fallback) {
>+      delete valueList;
>+      return NS_ERROR_OUT_OF_MEMORY;
>+    }
>+
>+    if (!valueList->AppendCSSValue(fallback)) {
>+      delete valueList;
>+      delete fallback;
>+      return NS_ERROR_OUT_OF_MEMORY;
>+    }

Since delete is null-safe, you could combine these two into

if (!fallback || !valueList->AppendCSSValue(fallback)) {
  delete valueList;
  delete fallback;
  return NS_ERROR_OUT_OF_MEMORY;
}

r+sr=dbaron with that change
Attachment #273174 - Flags: superreview+
Attachment #273174 - Flags: review?(dbaron)
Attachment #273174 - Flags: review+
Checked in.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Blocks: 389193
Depends on: 390483
You need to log in before you can comment on or make changes to this bug.