From 2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 7 May 2012 11:21:11 +0200 Subject: Imported WebKit commit 7e538425aa020340619e927792f3d895061fb54b (http://svn.webkit.org/repository/webkit/trunk@116286) --- Source/WebCore/html/HTMLSelectElement.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'Source/WebCore/html/HTMLSelectElement.cpp') 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) -- cgit v1.2.1