haikuwebkit/ManualTests/dom/form-control-for-label.html

13 lines
463 B
HTML
Raw Permalink Normal View History

Support control attribute of HTMLLabelElement https://bugs.webkit.org/show_bug.cgi?id=38688 Reviewed by Darin Adler. WebCore: Added support for the control attribute of HTMLLabelElement and changed the logic of determining which control is associated with the label to conform to HTML5 spec. Added a manual test for testing the logic of selecting the control to get focused, activated or hovered when the label gets focused, activated or is hovered. Test: fast/dom/HTMLLabelElement/click-label.html Test: fast/dom/HTMLLabelElement/focus-label.html Test: fast/dom/HTMLLabelElement/label-control.html * accessibility/AccessibilityRenderObject.cpp: (WebCore::labelForElement): (WebCore::AccessibilityRenderObject::correspondingControlForLabelElement): * html/HTMLFormControlElement.cpp: (WebCore::HTMLFormControlElement::isLabelable): * html/HTMLFormControlElement.h: * html/HTMLLabelElement.cpp: (WebCore::nodeAsLabelableFormControl): (WebCore::HTMLLabelElement::control): (WebCore::HTMLLabelElement::setActive): (WebCore::HTMLLabelElement::setHovered): (WebCore::HTMLLabelElement::defaultEventHandler): (WebCore::HTMLLabelElement::focus): (WebCore::HTMLLabelElement::accessKeyAction): * html/HTMLLabelElement.h: * html/HTMLLabelElement.idl: * manual-tests/dom/form-control-for-label.html: Added. WebKit/chromium: Renamed HTMLLabelElement::correspondingControl to HTMLLabelElement::control * src/WebLabelElement.cpp: (WebKit::WebLabelElement::correspondingControl): LayoutTests: * fast/dom/HTMLLabelElement/click-label-expected.txt: Added. * fast/dom/HTMLLabelElement/click-label.html: Added. * fast/dom/HTMLLabelElement/focus-label-expected.txt: Added. * fast/dom/HTMLLabelElement/focus-label.html: Added. * fast/dom/HTMLLabelElement/label-control-expected.txt: Added. * fast/dom/HTMLLabelElement/label-control.html: Added. * fast/dom/HTMLLabelElement/script-tests: Added. * fast/dom/HTMLLabelElement/script-tests/TEMPLATE.html: Added. * fast/dom/HTMLLabelElement/script-tests/label-control.js: Added. Canonical link: https://commits.webkit.org/50465@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@59227 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-05-12 13:02:27 +00:00
<html>
<style>
progress {border: 3px solid blue;}
progress:hover {border: 3px solid red;}
</style>
<body>
<h3>Test hover</h3>
<label>The border color of the progress bar should change from blue to red when you hover on this label text <progress></progress></label><br>
<label>The border of this progress bar would change color when it is inside fieldset and legend elements <fieldset><legend><progress></progress></legend></fieldset></label><br>
</body>
</html>