WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Retry commit
bug-60602-20110513101739.patch (text/plain), 10.08 KB, created by
Kenichi Ishibashi
on 2011-05-12 18:17:41 PDT
(
hide
)
Description:
Retry commit
Filename:
MIME Type:
Creator:
Kenichi Ishibashi
Created:
2011-05-12 18:17:41 PDT
Size:
10.08 KB
patch
obsolete
>Subversion Revision: 86404 >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 4283ed442f428faa67cb379483ddd801949c5a24..5dfda0fd37b6bf3b347b6f160c4f276142045677 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,15 @@ >+2011-05-12 Kenichi Ishibashi <bashi@chromium.org> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ <output>, <meter> and <progress> elements with display:block can be focused if you try to tab to it >+ https://bugs.webkit.org/show_bug.cgi?id=60602 >+ >+ Add a test that ensures <output>, <meter> and <progress> are not focused. >+ >+ * fast/forms/focus-with-display-block-expected.txt: Added. >+ * fast/forms/focus-with-display-block.html: Added. >+ > 2011-05-12 Andrew Wilson <atwilson@chromium.org> > > Unreviewed expectations tweaks for chromium. >diff --git a/LayoutTests/fast/forms/focus-with-display-block-expected.txt b/LayoutTests/fast/forms/focus-with-display-block-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..aed5cac20314bfad21e69e815a1253d192ef4d6d >--- /dev/null >+++ b/LayoutTests/fast/forms/focus-with-display-block-expected.txt >@@ -0,0 +1,16 @@ >+This test ensures that <output>, <meter> and <progress> are not focused. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+- Moves the focus by using keyDown() in DRT, otherwise using element.focus(). >+- checkFocus() returns true when <output>, <meter> and <progress> do not have focus. >+PASS checkFocus() is true >+PASS checkFocus() is true >+PASS checkFocus() is true >+PASS checkFocus() is true >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+Text in output element >+ >diff --git a/LayoutTests/fast/forms/focus-with-display-block.html b/LayoutTests/fast/forms/focus-with-display-block.html >new file mode 100644 >index 0000000000000000000000000000000000000000..a0704126bfde643e969131199ab8cde26c6a98ad >--- /dev/null >+++ b/LayoutTests/fast/forms/focus-with-display-block.html >@@ -0,0 +1,63 @@ >+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> >+<html> >+<head> >+<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css"> >+<script src="../../fast/js/resources/js-test-pre.js"></script> >+<style> >+output, meter, progress { >+ display: block; >+} >+</style> >+</head> >+<body> >+<p id="description"></p> >+<div id="console"></div> >+<script> >+description('This test ensures that <output>, <meter> and <progress> are not focused.'); >+ >+function moveFocus(element) { >+ if (window.layoutTestController) >+ eventSender.keyDown('\t'); >+ else >+ element.focus(); >+} >+ >+function checkFocus() { >+ var active = document.activeElement.nodeName; >+ if (active == "OUTPUT" || active == "METER" || active == "PROGRESS") { >+ debug(active + ' should not have focus.'); >+ return false; >+ } >+ return true; >+} >+ >+var input = document.createElement('input'); >+var output = document.createElement('output'); >+var progress = document.createElement('progress'); >+var meter = document.createElement('meter'); >+ >+// Set a placeholder text to the output element to display the element. >+output.innerHTML = 'Text in output element'; >+ >+document.body.appendChild(input); >+document.body.appendChild(output); >+document.body.appendChild(progress); >+document.body.appendChild(meter); >+ >+debug('- Moves the focus by using keyDown() in DRT, otherwise using element.focus().'); >+debug('- checkFocus() returns true when <output>, <meter> and <progress> do not have focus.'); >+ >+moveFocus(input); >+shouldBeTrue('checkFocus()'); >+moveFocus(output); >+shouldBeTrue('checkFocus()'); >+moveFocus(progress); >+shouldBeTrue('checkFocus()'); >+moveFocus(meter); >+shouldBeTrue('checkFocus()'); >+ >+var successfullyParsed = true; >+</script> >+<script src="../../fast/js/resources/js-test-post.js"></script> >+</body> >+</html> >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 3fa9894f1ffddced4e7731e2a3b84e9dd0bfcbd9..4a26d615e040a29a13a09c048245fa8d3e5b7f43 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,30 @@ >+2011-05-12 Kenichi Ishibashi <bashi@chromium.org> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ <output>, <meter> and <progress> elements with display:block can be focused if you try to tab to it >+ https://bugs.webkit.org/show_bug.cgi?id=60602 >+ >+ HTMLFormControlElement::isFocusable() returns true when the element is >+ visible as a block element. However, for output, meter, and progress >+ elements, the function should not return true unless they have >+ tabindex attributes. Override supportsFocus() of these elements to >+ apply the result of Node::supportsFocus() because it takes care of >+ whether the element has tabindex or not. >+ >+ Test: fast/forms/focus-with-display-block.html >+ >+ * html/HTMLFormControlElement.h: Made supportsFocus() protected. >+ * html/HTMLMeterElement.cpp: >+ (WebCore::HTMLMeterElement::supportsFocus): Added. >+ * html/HTMLMeterElement.h: >+ * html/HTMLOutputElement.cpp: >+ (WebCore::HTMLOutputElement::supportsFocus): Added. >+ * html/HTMLOutputElement.h: >+ * html/HTMLProgressElement.cpp: >+ (WebCore::HTMLProgressElement::supportsFocus): Added. >+ * html/HTMLProgressElement.h: >+ > 2011-05-12 Daniel Bates <dbates@rim.com> > > Attempt to fix the build after changeset 86391 <http://trac.webkit.org/changeset/86391> >diff --git a/Source/WebCore/html/HTMLFormControlElement.h b/Source/WebCore/html/HTMLFormControlElement.h >index 884ace0d939fc6f173ca4860c11554873b36fea0..0ad21814fbd5bf9c3d79138f6f7693321e715971 100644 >--- a/Source/WebCore/html/HTMLFormControlElement.h >+++ b/Source/WebCore/html/HTMLFormControlElement.h >@@ -117,6 +117,7 @@ protected: > virtual void removedFromDocument(); > virtual void willMoveToNewOwnerDocument(); > >+ virtual bool supportsFocus() const; > virtual bool isKeyboardFocusable(KeyboardEvent*) const; > virtual bool isMouseFocusable() const; > >@@ -139,8 +140,6 @@ private: > > virtual bool isFormControlElement() const { return true; } > >- virtual bool supportsFocus() const; >- > virtual short tabIndex() const; > > virtual HTMLFormElement* virtualForm() const; >diff --git a/Source/WebCore/html/HTMLMeterElement.cpp b/Source/WebCore/html/HTMLMeterElement.cpp >index 88b16221f157b4c43711f9e9c6e2afcdb0c2052e..13e02ed445895c020b4fe818b56387c9059e3153 100644 >--- a/Source/WebCore/html/HTMLMeterElement.cpp >+++ b/Source/WebCore/html/HTMLMeterElement.cpp >@@ -66,6 +66,11 @@ const AtomicString& HTMLMeterElement::formControlType() const > return meter; > } > >+bool HTMLMeterElement::supportsFocus() const >+{ >+ return Node::supportsFocus() && !disabled(); >+} >+ > void HTMLMeterElement::parseMappedAttribute(Attribute* attribute) > { > if (attribute->name() == valueAttr || attribute->name() == minAttr || attribute->name() == maxAttr || attribute->name() == lowAttr || attribute->name() == highAttr || attribute->name() == optimumAttr) >diff --git a/Source/WebCore/html/HTMLMeterElement.h b/Source/WebCore/html/HTMLMeterElement.h >index 5ce1193890d814104ff5db02f1084682f339dfa5..8844e606dfef0117f1b9478685c949a507bc322f 100644 >--- a/Source/WebCore/html/HTMLMeterElement.h >+++ b/Source/WebCore/html/HTMLMeterElement.h >@@ -63,6 +63,8 @@ private: > HTMLMeterElement(const QualifiedName&, Document*, HTMLFormElement*); > virtual ~HTMLMeterElement(); > >+ virtual bool supportsFocus() const; >+ > virtual bool recalcWillValidate() const { return false; } > virtual const AtomicString& formControlType() const; > virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); >diff --git a/Source/WebCore/html/HTMLOutputElement.cpp b/Source/WebCore/html/HTMLOutputElement.cpp >index 8be5d911c0798462c554076c36999328d8f38ac1..a85bfd42f0e9dad6f98d2b37066f7d0c4e58e2ef 100644 >--- a/Source/WebCore/html/HTMLOutputElement.cpp >+++ b/Source/WebCore/html/HTMLOutputElement.cpp >@@ -56,6 +56,11 @@ const AtomicString& HTMLOutputElement::formControlType() const > return output; > } > >+bool HTMLOutputElement::supportsFocus() const >+{ >+ return Node::supportsFocus() && !disabled(); >+} >+ > void HTMLOutputElement::parseMappedAttribute(Attribute* attr) > { > if (attr->name() == HTMLNames::forAttr) >diff --git a/Source/WebCore/html/HTMLOutputElement.h b/Source/WebCore/html/HTMLOutputElement.h >index 83ecee2f49f8616f7b10ec9dbdc2de0730a3fded..100dbbc7c88d121d70273cfa669c88ccba3f7f8a 100644 >--- a/Source/WebCore/html/HTMLOutputElement.h >+++ b/Source/WebCore/html/HTMLOutputElement.h >@@ -56,6 +56,7 @@ private: > virtual void parseMappedAttribute(Attribute*); > virtual const AtomicString& formControlType() const; > virtual bool isEnumeratable() const { return true; } >+ virtual bool supportsFocus() const; > virtual void childrenChanged(bool createdByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0); > virtual void reset(); > >diff --git a/Source/WebCore/html/HTMLProgressElement.cpp b/Source/WebCore/html/HTMLProgressElement.cpp >index 710f7e49dc10640933b017db7ec777e7f2cada8e..94f820afe8a80632c17ca83c4318d85494249261 100644 >--- a/Source/WebCore/html/HTMLProgressElement.cpp >+++ b/Source/WebCore/html/HTMLProgressElement.cpp >@@ -64,6 +64,11 @@ RenderObject* HTMLProgressElement::createRenderer(RenderArena* arena, RenderStyl > return new (arena) RenderProgress(this); > } > >+bool HTMLProgressElement::supportsFocus() const >+{ >+ return Node::supportsFocus() && !disabled(); >+} >+ > const AtomicString& HTMLProgressElement::formControlType() const > { > DEFINE_STATIC_LOCAL(const AtomicString, progress, ("progress")); >diff --git a/Source/WebCore/html/HTMLProgressElement.h b/Source/WebCore/html/HTMLProgressElement.h >index 42109f7627599c5e1c8865438c627343efcced82..f584cd218e154e1d488e3a74606b14023eb2ab07 100644 >--- a/Source/WebCore/html/HTMLProgressElement.h >+++ b/Source/WebCore/html/HTMLProgressElement.h >@@ -47,6 +47,8 @@ private: > HTMLProgressElement(const QualifiedName&, Document*, HTMLFormElement*); > virtual ~HTMLProgressElement(); > >+ virtual bool supportsFocus() const; >+ > virtual bool recalcWillValidate() const { return false; } > > virtual const AtomicString& formControlType() const;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 60602
:
93075
|
93088
|
93094
|
93224
|
93259
|
93378
|
93398
|
93600