Closed Bug 97052 Opened 24 years ago Closed 23 years ago

[review]getComputedStyle returns default value for border width when there is no border

Categories

(Core :: DOM: CSS Object Model, defect, P4)

x86
All
defect

Tracking

()

RESOLVED FIXED
mozilla0.9.6

People

(Reporter: tfriesen, Assigned: pierre)

References

Details

(Whiteboard: [fix in hand])

Attachments

(3 files)

getComputedStyle returns "medium" as the default value for border width even if there is no border present. According to CSS2,this value is correct if there is actually a border. But if the border style has not been set (ie no border),then the border width should be "0"
reassign to harish
Assignee: jst → harishd
Summary: getComputedStyle returns default value for border width when there is no border → getComputedStyle returns default value for border width when there is no border
Attached file testcase
Status: UNCONFIRMED → NEW
Ever confirmed: true
Blocks: 42417
This is probably a style system bug since getComputedStyle just retrieves values from stylecontext. CCing pierre.
Priority: -- → P4
Actually, in this case the problem is that the stylecontext value should _not_ be used if border is none... Assumung I understand the style contexts correctly...
Thank you Boris for the testcase. I'll attach a patch. jst/boris: please review.
Assignee: harishd → pierre
Whiteboard: [fix in hand]
Target Milestone: --- → mozilla0.9.6
Attached patch patchSplinter Review
Status: NEW → ASSIGNED
Pierre, do you really need the temporary |borderStyle| var? I guess it's a style issue... not sure what's best there. Either way, looks good and works perfectly. r=bzbarsky
The variable is not necessary. Separating steps is an inconspicuous habit of mine that allows to put conditional breakpoints in debug builds. In optimized builds, I'm fairly sure no assignment is made (or maybe to an internal register, and it would have taken place anyhow).
Summary: getComputedStyle returns default value for border width when there is no border → [review]getComputedStyle returns default value for border width when there is no border
Comment on attachment 50742 [details] [diff] [review] patch sr=jst
Attachment #50742 - Flags: superreview+
Attachment #50742 - Flags: review+
Fix checked into the trunk.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: