Closed Bug 310326 Opened 15 years ago Closed 12 years ago

width of 'svg' element embedded inline in XHTML isn't updated

Categories

(Core :: SVG, defect, P3)

defect

Tracking

()

RESOLVED FIXED

People

(Reporter: jwatt, Unassigned)

References

Details

(Whiteboard: [reflow-refactor])

Attachments

(1 file)

In the following testcase the width of the 'svg' element is given a percentage
value of 100%. When the window is resized the width of the 'svg' element should
resize with it. Load the testcase with a narrow window, then widen it before
moving the mouse around. You'll see the width stays the same as it was at the
time the document loaded.
Attached image testcase
I just realised the testcase needs my fix for bug 272630 to work properly. You
can get the idea though if you place the left edge of the browser close to the
left edge of the screen.
When we call IsPercentageAwareChild on the outer svg frame, we have the
following code:

1146      const nsStylePosition* pos = aFrame->GetStylePosition();
1147
1148      if (eStyleUnit_Percent == pos->mWidth.GetUnit()

and gdb says the following:

(gdb) p pos->mWidth
$23 = {mUnit = eStyleUnit_Auto, mValue = {mInt = 0, mFloat = 0}}

So the frame is claiming to not have a percentage width, which means the block
code feels no need to reflow it when the available width changes.

Sounds to me like SVG should be mapping the width attribute into style...
Flags: blocking1.9a1?
OS: Windows XP → All
Hardware: PC → All
Whiteboard: [reflow-refactor]
Although the testcase fails with firefox 1.5, it does seem to work as expected with a current trunk build.
Hmm.... Yes, it does.  I wonder why.  When did that change?
Could be bug 326725.... who knows.

Worksforme, I guess, though someone should file a followup bug on fixing the code to actually be correct.
Status: NEW → RESOLVED
Closed: 14 years ago
Flags: blocking1.9a1?
Resolution: --- → WORKSFORME
Seems to be broken on current trunk.
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
Flags: blocking1.9?
Adding width/height to the nsSVGSVGElement attribute map does fix this problem, but causes gecko to complain about the testcase in bug 369850.
Depends on: 294086
Flags: blocking1.9? → blocking1.9+
Priority: -- → P3
This bug was just fixed by the fix for bug 294086. The reftest layout/reftests/svg/sizing/dynamic--inline-resize-window-width.xhtml (and others) checked in for bug 294086 cover this bug too.
Status: REOPENED → RESOLVED
Closed: 14 years ago12 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.