Closed Bug 13526 Opened 26 years ago Closed 26 years ago

unable to set or read percent through DOM

Categories

(Core :: DOM: Core & HTML, defect, P3)

x86
Other
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: jcarpenter0524, Assigned: karnaze)

Details

Attachments

(1 file)

Overview Description: In tables, for example, I can't read or set cellPadding to a percentage value through DOM. The value I receive when I try to read a percentage value is the same as if I were reading a pixel value. Steps to Reproduce: - Will attach example code Actual Results: (from the example code) 10 Expected Results: (from the example code) 10% Build Date & Platform Bug Found: Win98 1999090311 Additional Builds and Platforms Tested On: WinNT, MacPPC, Linux Additional Information:
Attached file Attaching testcase
QA Contact: gerardok → janc
previous email concerning this bug: vidur: Seems like a bug in nsHTMLTableElement's StringToAttribute method. The current implementation has: if ((aAttribute == nsHTMLAtoms::cellspacing) || (aAttribute == nsHTMLAtoms::cellpadding)) { if (nsGenericHTMLElement::ParseValue(aValue, 0, aResult, eHTMLUnit_Pixel)) { return NS_CONTENT_ATTR_HAS_VALUE; } } Seems like we should be calling ParseValueOrPerecent() of ParseValue(). Cc:ing Peter to make sure I'm right - I've been wrong about this stuff before. --V peterl: Yes, that should be ParseValueOrPercent. Chris, you also need to ensure that you handle percent values in AttributeToString and MapAttributesInto (as well as in the actual cell padding/spacing code). P
Status: NEW → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
The attachment now works. Percentage values actually rendering properly is another bug and applies to cellpadding, cellspacing, etc.
Status: RESOLVED → VERIFIED
verified
verified
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: