WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
80380
[Forms] The "meter" element should not be a form-associated element.
https://bugs.webkit.org/show_bug.cgi?id=80380
Summary
[Forms] The "meter" element should not be a form-associated element.
yosin
Reported
2012-03-05 22:21:43 PST
According the specification, the "optgroup" element isn't a form-associate element.
http://www.whatwg.org/specs/web-apps/current-work/multipage/forms.html#form-associated-element
However, current implementation of HTMLMeterElement is derived from HTMLFormControlElement. We have unexpected dependency between HTMLOptGroupElement and HTMLFormControlElement and FormAssociatedElement. Also, We waste time in loop of HTMLFormElement::m_associatedElements. For clear understanding and better maintainability, it is better that C++ class hierarchy should be similar to specified in the specification.
Attachments
Patch 1
(16.46 KB, patch)
2012-03-13 21:09 PDT
,
yosin
no flags
Details
Formatted Diff
Diff
Patch 2
(25.70 KB, patch)
2012-03-14 01:28 PDT
,
yosin
no flags
Details
Formatted Diff
Diff
Patch 3
(25.98 KB, patch)
2012-03-14 03:24 PDT
,
yosin
no flags
Details
Formatted Diff
Diff
Patch 4
(26.67 KB, patch)
2012-03-14 18:52 PDT
,
yosin
no flags
Details
Formatted Diff
Diff
Show Obsolete
(3)
View All
Add attachment
proposed patch, testcase, etc.
yosin
Comment 1
2012-03-13 21:09:18 PDT
Created
attachment 131778
[details]
Patch 1
yosin
Comment 2
2012-03-13 21:14:35 PDT
Patch 1 contains changes for HTMLMeterElement itself and HTMLLabelElement for supporting LabelabelElement instead of HTMLFormControlElement. This HTMLLabelElement changes is also required to change base class of the "progress" element to LabelableElement.
Kent Tamura
Comment 3
2012-03-13 21:41:45 PDT
Comment on
attachment 131778
[details]
Patch 1 View in context:
https://bugs.webkit.org/attachment.cgi?id=131778&action=review
> Source/WebCore/html/HTMLElement.h:105 > + virtual bool isLabelable() const { return false; }
The function means: * This HTMLElement can be casted to LabelableElement, AND * This LabelableElement actually supports "labels" property. isClassName() functions of HTMLElement and Element usually have only the first role. isLabelable() in this patch will make other developers confused. I recommend to rename the existing LabelableElement::isLabelable() to LabelableElement::supportLabels(), and restrict the role of HTMLElement::isLabelable().
yosin
Comment 4
2012-03-14 01:28:52 PDT
Created
attachment 131805
[details]
Patch 2
Kent Tamura
Comment 5
2012-03-14 01:52:18 PDT
Comment on
attachment 131805
[details]
Patch 2 View in context:
https://bugs.webkit.org/attachment.cgi?id=131805&action=review
> Source/WebCore/html/LabelableElement.h:50 > + virtual bool isLabelable() const OVERRIDE { return true; }
This should be "isLabelable() const OVERRIDE FINAL { return true; }" because subclasses must not override this.
> LayoutTests/ChangeLog:14 > + * fast/dom/HTMLMeterElement/meter-element-form-expected.txt: Removed. > + * fast/dom/HTMLMeterElement/meter-element-form.html: Removed.
Please do not remove the test. We should change it so that it confirms HTMLMeterElement doesn't support "form" IDL attribute.
yosin
Comment 6
2012-03-14 03:24:16 PDT
Created
attachment 131819
[details]
Patch 3
Kent Tamura
Comment 7
2012-03-14 07:35:38 PDT
Comment on
attachment 131819
[details]
Patch 3 View in context:
https://bugs.webkit.org/attachment.cgi?id=131819&action=review
> LayoutTests/fast/dom/HTMLMeterElement/meter-element-form.html:16 > +if (document.getElementById('meter1').form == null)
Should it be undefined, not null, because HTMLMeterElement doesn't have form IDL attribute?
yosin
Comment 8
2012-03-14 18:52:34 PDT
Created
attachment 131972
[details]
Patch 4
yosin
Comment 9
2012-03-14 18:53:28 PDT
(In reply to
comment #7
)
> (From update of
attachment 131819
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=131819&action=review
> > > LayoutTests/fast/dom/HTMLMeterElement/meter-element-form.html:16 > > +if (document.getElementById('meter1').form == null) > > Should it be undefined, not null, because HTMLMeterElement doesn't have form IDL attribute?
You're right. I forgot to update IDL file which contains the "form" attribute of the "meter" lement.
Kent Tamura
Comment 10
2012-03-14 19:27:15 PDT
Comment on
attachment 131972
[details]
Patch 4 ok
WebKit Review Bot
Comment 11
2012-03-15 18:49:23 PDT
Comment on
attachment 131972
[details]
Patch 4 Clearing flags on attachment: 131972 Committed
r110927
: <
http://trac.webkit.org/changeset/110927
>
WebKit Review Bot
Comment 12
2012-03-15 18:49:28 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug