[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da
satish at chromium.org
satish at chromium.org
Wed Dec 22 17:47:50 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 2e7d555b6e2c45b3b85574559ab63f85736f9b9e
Author: satish at chromium.org <satish at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Nov 30 15:33:11 2010 +0000
2010-11-25 Satish Sampath <satish at chromium.org>
Reviewed by Kent Tamura.
Fix rendering of speech button when setting the attribute dynamically.
https://bugs.webkit.org/show_bug.cgi?id=50077
* fast/speech/input-appearance-speechbutton.html:
2010-11-25 Satish Sampath <satish at chromium.org>
Reviewed by Kent Tamura.
Fix rendering of speech button when setting the attribute dynamically.
https://bugs.webkit.org/show_bug.cgi?id=50077
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::parseMappedAttribute):
* rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::speechAttributeChanged):
* rendering/RenderTextControlSingleLine.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72915 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index a6c35cc..6dd17f8 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,12 @@
+2010-11-25 Satish Sampath <satish at chromium.org>
+
+ Reviewed by Kent Tamura.
+
+ Fix rendering of speech button when setting the attribute dynamically.
+ https://bugs.webkit.org/show_bug.cgi?id=50077
+
+ * fast/speech/input-appearance-speechbutton.html:
+
2010-11-30 Adam Roben <aroben at apple.com>
Fix recently-added bug numbers
diff --git a/LayoutTests/fast/speech/input-appearance-speechbutton.html b/LayoutTests/fast/speech/input-appearance-speechbutton.html
index 7af05e4..1f408bf 100644
--- a/LayoutTests/fast/speech/input-appearance-speechbutton.html
+++ b/LayoutTests/fast/speech/input-appearance-speechbutton.html
@@ -30,6 +30,18 @@ for (var i = 0; i < cells.length; ++i) {
div.innerHTML = cells[i];
document.getElementById('p' + (i + 1)).appendChild(div);
}
+
+// Also check that setting the attribute from script renders similarly.
+var inputWithAttribute = document.createElement('input');
+document.body.appendChild(inputWithAttribute);
+inputWithAttribute.setAttribute('x-webkit-speech', 'x-webkit-speech');
+
+// Similar to above, check if removing the attribute with script renders an empty input field.
+var inputWithoutAttribute = document.createElement('input');
+inputWithoutAttribute.setAttribute('x-webkit-speech', 'x-webkit-speech');
+document.body.appendChild(inputWithoutAttribute);
+inputWithoutAttribute.removeAttribute('x-webkit-speech');
+
</script>
</body>
</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index d29e7ff..7a9e75b 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2010-11-25 Satish Sampath <satish at chromium.org>
+
+ Reviewed by Kent Tamura.
+
+ Fix rendering of speech button when setting the attribute dynamically.
+ https://bugs.webkit.org/show_bug.cgi?id=50077
+
+ * html/HTMLInputElement.cpp:
+ (WebCore::HTMLInputElement::parseMappedAttribute):
+ * rendering/RenderTextControlSingleLine.cpp:
+ (WebCore::RenderTextControlSingleLine::speechAttributeChanged):
+ * rendering/RenderTextControlSingleLine.h:
+
2010-11-30 Alexander Pavlov <apavlov at chromium.org>
Reviewed by Yury Semikhatsky.
diff --git a/WebCore/html/HTMLInputElement.cpp b/WebCore/html/HTMLInputElement.cpp
index 3d17194..e474773 100644
--- a/WebCore/html/HTMLInputElement.cpp
+++ b/WebCore/html/HTMLInputElement.cpp
@@ -777,7 +777,7 @@ void HTMLInputElement::parseMappedAttribute(Attribute* attr)
#if ENABLE(INPUT_SPEECH)
else if (attr->name() == webkitspeechAttr) {
if (renderer())
- renderer()->updateFromElement();
+ toRenderTextControlSingleLine(renderer())->speechAttributeChanged();
setNeedsStyleRecalc();
} else if (attr->name() == onwebkitspeechchangeAttr)
setAttributeEventListener(eventNames().webkitspeechchangeEvent, createAttributeEventListener(this, attr));
diff --git a/WebCore/rendering/RenderTextControlSingleLine.cpp b/WebCore/rendering/RenderTextControlSingleLine.cpp
index f638907..2df96a2 100644
--- a/WebCore/rendering/RenderTextControlSingleLine.cpp
+++ b/WebCore/rendering/RenderTextControlSingleLine.cpp
@@ -665,6 +665,21 @@ void RenderTextControlSingleLine::createSubtreeIfNeeded()
}
}
+#if ENABLE(INPUT_SPEECH)
+void RenderTextControlSingleLine::speechAttributeChanged()
+{
+ // The inner text element of this renderer has different styles depending on whether the
+ // speech button is visible or not. So when the speech attribute changes, we reset the
+ // whole thing and recreate to get the right styles and layout.
+ if (m_speechButton)
+ m_speechButton->detach();
+ setChildrenInline(true);
+ RenderStyle* parentStyle = m_innerBlock ? m_innerBlock->renderer()->style() : style();
+ setStyle(createInnerTextStyle(parentStyle));
+ updateFromElement();
+}
+#endif
+
void RenderTextControlSingleLine::updateFromElement()
{
createSubtreeIfNeeded();
diff --git a/WebCore/rendering/RenderTextControlSingleLine.h b/WebCore/rendering/RenderTextControlSingleLine.h
index 26987fd..d51d7f3 100644
--- a/WebCore/rendering/RenderTextControlSingleLine.h
+++ b/WebCore/rendering/RenderTextControlSingleLine.h
@@ -59,6 +59,10 @@ public:
// Decoration width outside of the text field.
int decorationWidthRight() const;
+#if ENABLE(INPUT_SPEECH)
+ void speechAttributeChanged();
+#endif
+
private:
int preferredDecorationWidthRight() const;
virtual bool hasControlClip() const;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list