summaryrefslogtreecommitdiff
path: root/Source/WebCore/html/HTMLSelectElement.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-05-07 11:21:11 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-05-07 11:21:11 +0200
commit2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47 (patch)
tree988e8c5b116dd0466244ae2fe5af8ee9be926d76 /Source/WebCore/html/HTMLSelectElement.cpp
parentdd91e772430dc294e3bf478c119ef8d43c0a3358 (diff)
downloadqtwebkit-2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47.tar.gz
Imported WebKit commit 7e538425aa020340619e927792f3d895061fb54b (http://svn.webkit.org/repository/webkit/trunk@116286)
Diffstat (limited to 'Source/WebCore/html/HTMLSelectElement.cpp')
-rw-r--r--Source/WebCore/html/HTMLSelectElement.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/Source/WebCore/html/HTMLSelectElement.cpp b/Source/WebCore/html/HTMLSelectElement.cpp
index 413b771a8..58a9a739c 100644
--- a/Source/WebCore/html/HTMLSelectElement.cpp
+++ b/Source/WebCore/html/HTMLSelectElement.cpp
@@ -276,8 +276,11 @@ void HTMLSelectElement::parseAttribute(Attribute* attr)
// This is important since the style rules for this attribute can determine the appearance property.
int size = attr->value().toInt();
String attrSize = String::number(size);
- if (attrSize != attr->value())
- attr->setValue(attrSize);
+ if (attrSize != attr->value()) {
+ // FIXME: This is horribly factored.
+ if (Attribute* sizeAttribute = getAttributeItem(sizeAttr))
+ sizeAttribute->setValue(attrSize);
+ }
size = max(size, 1);
// Ensure that we've determined selectedness of the items at least once prior to changing the size.
@@ -328,7 +331,7 @@ RenderObject* HTMLSelectElement::createRenderer(RenderArena* arena, RenderStyle*
bool HTMLSelectElement::childShouldCreateRenderer(const NodeRenderingContext& childContext) const
{
- return childContext.isOnEncapsulationBoundary() && HTMLFormControlElementWithState::childShouldCreateRenderer(childContext);
+ return childContext.isOnUpperEncapsulationBoundary() && HTMLFormControlElementWithState::childShouldCreateRenderer(childContext);
}
HTMLCollection* HTMLSelectElement::selectedOptions()
@@ -1472,13 +1475,14 @@ void HTMLSelectElement::typeAheadFind(KeyboardEvent* event)
}
}
-void HTMLSelectElement::insertedIntoTree(bool deep)
+Node::InsertionNotificationRequest HTMLSelectElement::insertedInto(Node* insertionPoint)
{
// When the element is created during document parsing, it won't have any
// items yet - but for innerHTML and related methods, this method is called
// after the whole subtree is constructed.
recalcListItems();
- HTMLFormControlElementWithState::insertedIntoTree(deep);
+ HTMLFormControlElementWithState::insertedInto(insertionPoint);
+ return InsertionDone;
}
void HTMLSelectElement::accessKeySetSelectedIndex(int index)