[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
darin at apple.com
darin at apple.com
Wed Dec 22 13:28:56 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit a6cb255b7102ae73f9141e4c7b36ead6f20c8af5
Author: darin at apple.com <darin at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Sep 16 19:40:49 2010 +0000
2010-09-16 Darin Adler <darin at apple.com>
Reviewed by Andreas Kling.
Reduce use of HTMLInputElement::inputType so we can remove it later
https://bugs.webkit.org/show_bug.cgi?id=45903
* src/DOMUtilitiesPrivate.cpp:
(WebKit::elementHasLegalLinkAttribute): Use isImageButton.
* src/WebPasswordFormUtils.cpp:
(WebKit::findPasswordFormFields): Use isPasswordField.
* src/WebSearchableFormData.cpp:
(WebCore::IsInDefaultState): Use isCheckbox and isRadioButton.
(WebCore::HasSuitableTextElement): Use isFileUpload and isPasswordField.
2010-09-16 Darin Adler <darin at apple.com>
Reviewed by Andreas Kling.
Reduce use of HTMLInputElement::inputType so we can remove it later
https://bugs.webkit.org/show_bug.cgi?id=45903
* WebCoreSupport/DumpRenderTreeSupportQt.cpp:
(DumpRenderTreeSupportQt::elementDoesAutoCompleteForElementWithId):
Use isPasswordField.
2010-09-16 Darin Adler <darin at apple.com>
Reviewed by Andreas Kling.
Reduce use of HTMLInputElement::inputType so we can remove it later
https://bugs.webkit.org/show_bug.cgi?id=45903
* WebFrame.cpp:
(WebFrame::elementDoesAutoComplete): Use isPasswordField.
(WebFrame::elementIsPassword): Use isPasswordField.
2010-09-16 Darin Adler <darin at apple.com>
Reviewed by Andreas Kling.
Reduce use of HTMLInputElement::inputType so we can remove it later
https://bugs.webkit.org/show_bug.cgi?id=45903
* WebView/WebHTMLRepresentation.mm:
(-[WebHTMLRepresentation elementDoesAutoComplete:]): Use isPasswordField.
(-[WebHTMLRepresentation elementIsPassword:]): Use isPasswordField.
2010-09-16 Darin Adler <darin at apple.com>
Reviewed by Andreas Kling.
Reduce use of HTMLInputElement::inputType so we can remove it later
https://bugs.webkit.org/show_bug.cgi?id=45903
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::isFileUploadButton): Use isFileUpload.
(WebCore::AccessibilityRenderObject::isInputImage): Use isImageButton.
(WebCore::AccessibilityRenderObject::determineAccessibilityRole): Use
isCheckbox and isRadioButton.
* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::adjustRenderStyle): Use isImageButton.
* editing/Editor.cpp:
(WebCore::Editor::setBaseWritingDirection): Use isTextField.
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::doApply): Use isPasswordField.
* editing/SelectionController.cpp:
(WebCore::SelectionController::isInPasswordField): Use isPasswordField.
* html/HTMLInputElement.h: Added isFileUpload, isImageButton, and isSubmitButton.
* page/Chrome.cpp:
(WebCore::Chrome::setToolTip): Use isSubmitButton and isFileUpload.
* page/DragController.cpp:
(WebCore::asFileInput): Use isFileUpload.
* page/EventHandler.cpp:
(WebCore::isSubmitImage): Use isImageButton.
* rendering/RenderFileUploadControl.cpp:
(WebCore::RenderFileUploadControl::updateFromElement): Use isFileUpload.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67653 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 36b1b3f..aae333d 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,42 @@
+2010-09-16 Darin Adler <darin at apple.com>
+
+ Reviewed by Andreas Kling.
+
+ Reduce use of HTMLInputElement::inputType so we can remove it later
+ https://bugs.webkit.org/show_bug.cgi?id=45903
+
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore::AccessibilityRenderObject::isFileUploadButton): Use isFileUpload.
+ (WebCore::AccessibilityRenderObject::isInputImage): Use isImageButton.
+ (WebCore::AccessibilityRenderObject::determineAccessibilityRole): Use
+ isCheckbox and isRadioButton.
+
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::adjustRenderStyle): Use isImageButton.
+
+ * editing/Editor.cpp:
+ (WebCore::Editor::setBaseWritingDirection): Use isTextField.
+
+ * editing/ReplaceSelectionCommand.cpp:
+ (WebCore::ReplaceSelectionCommand::doApply): Use isPasswordField.
+
+ * editing/SelectionController.cpp:
+ (WebCore::SelectionController::isInPasswordField): Use isPasswordField.
+
+ * html/HTMLInputElement.h: Added isFileUpload, isImageButton, and isSubmitButton.
+
+ * page/Chrome.cpp:
+ (WebCore::Chrome::setToolTip): Use isSubmitButton and isFileUpload.
+
+ * page/DragController.cpp:
+ (WebCore::asFileInput): Use isFileUpload.
+
+ * page/EventHandler.cpp:
+ (WebCore::isSubmitImage): Use isImageButton.
+
+ * rendering/RenderFileUploadControl.cpp:
+ (WebCore::RenderFileUploadControl::updateFromElement): Use isFileUpload.
+
2010-09-16 Pavel Podivilov <podivilov at chromium.org>
Reviewed by Pavel Feldman.
diff --git a/WebCore/accessibility/AccessibilityRenderObject.cpp b/WebCore/accessibility/AccessibilityRenderObject.cpp
index b2c5023..5ca78ca 100644
--- a/WebCore/accessibility/AccessibilityRenderObject.cpp
+++ b/WebCore/accessibility/AccessibilityRenderObject.cpp
@@ -503,7 +503,7 @@ bool AccessibilityRenderObject::isFileUploadButton() const
{
if (m_renderer && m_renderer->node() && m_renderer->node()->hasTagName(inputTag)) {
HTMLInputElement* input = static_cast<HTMLInputElement*>(m_renderer->node());
- return input->inputType() == HTMLInputElement::FILE;
+ return input->isFileUpload();
}
return false;
@@ -514,7 +514,7 @@ bool AccessibilityRenderObject::isInputImage() const
Node* elementNode = node();
if (roleValue() == ButtonRole && elementNode && elementNode->hasTagName(inputTag)) {
HTMLInputElement* input = static_cast<HTMLInputElement*>(elementNode);
- return input->inputType() == HTMLInputElement::IMAGE;
+ return input->isImageButton();
}
return false;
@@ -3036,9 +3036,9 @@ AccessibilityRole AccessibilityRenderObject::determineAccessibilityRole()
if (node && node->hasTagName(inputTag)) {
HTMLInputElement* input = static_cast<HTMLInputElement*>(node);
- if (input->inputType() == HTMLInputElement::CHECKBOX)
+ if (input->isCheckbox())
return CheckBoxRole;
- if (input->inputType() == HTMLInputElement::RADIO)
+ if (input->isRadioButton())
return RadioButtonRole;
if (input->isTextButton())
return ButtonRole;
diff --git a/WebCore/css/CSSStyleSelector.cpp b/WebCore/css/CSSStyleSelector.cpp
index 89e16fa..b22ba8f 100644
--- a/WebCore/css/CSSStyleSelector.cpp
+++ b/WebCore/css/CSSStyleSelector.cpp
@@ -1796,7 +1796,7 @@ void CSSStyleSelector::adjustRenderStyle(RenderStyle* style, Element *e)
if (e && e->isFormControlElement() && style->fontSize() >= 11) {
// Don't apply intrinsic margins to image buttons. The designer knows how big the images are,
// so we have to treat all image buttons as though they were explicitly sized.
- if (!e->hasTagName(inputTag) || static_cast<HTMLInputElement*>(e)->inputType() != HTMLInputElement::IMAGE)
+ if (!e->hasTagName(inputTag) || !static_cast<HTMLInputElement*>(e)->isImageButton())
addIntrinsicMargins(style);
}
diff --git a/WebCore/editing/Editor.cpp b/WebCore/editing/Editor.cpp
index 125ecfa..24c1680 100644
--- a/WebCore/editing/Editor.cpp
+++ b/WebCore/editing/Editor.cpp
@@ -1451,9 +1451,7 @@ void Editor::toggleUnderline()
void Editor::setBaseWritingDirection(WritingDirection direction)
{
Node* focusedNode = frame()->document()->focusedNode();
- if (focusedNode && (focusedNode->hasTagName(textareaTag)
- || (focusedNode->hasTagName(inputTag) && (static_cast<HTMLInputElement*>(focusedNode)->inputType() == HTMLInputElement::TEXT
- || static_cast<HTMLInputElement*>(focusedNode)->inputType() == HTMLInputElement::SEARCH)))) {
+ if (focusedNode && (focusedNode->hasTagName(textareaTag) || (focusedNode->hasTagName(inputTag) && static_cast<HTMLInputElement*>(focusedNode)->isTextField()))) {
if (direction == NaturalWritingDirection)
return;
static_cast<HTMLElement*>(focusedNode)->setAttribute(dirAttr, direction == LeftToRightWritingDirection ? "ltr" : "rtl");
diff --git a/WebCore/editing/ReplaceSelectionCommand.cpp b/WebCore/editing/ReplaceSelectionCommand.cpp
index e754aef..49bdaca 100644
--- a/WebCore/editing/ReplaceSelectionCommand.cpp
+++ b/WebCore/editing/ReplaceSelectionCommand.cpp
@@ -1062,7 +1062,7 @@ void ReplaceSelectionCommand::doApply()
if (m_smartReplace && currentRoot) {
// Disable smart replace for password fields.
Node* start = currentRoot->shadowAncestorNode();
- if (start->hasTagName(inputTag) && static_cast<HTMLInputElement*>(start)->inputType() == HTMLInputElement::PASSWORD)
+ if (start->hasTagName(inputTag) && static_cast<HTMLInputElement*>(start)->isPasswordField())
m_smartReplace = false;
}
if (m_smartReplace) {
diff --git a/WebCore/editing/SelectionController.cpp b/WebCore/editing/SelectionController.cpp
index 1a0c031..c04fe25 100644
--- a/WebCore/editing/SelectionController.cpp
+++ b/WebCore/editing/SelectionController.cpp
@@ -1332,7 +1332,7 @@ bool SelectionController::isInPasswordField() const
if (!startNode->hasTagName(inputTag))
return false;
- return static_cast<HTMLInputElement*>(startNode)->inputType() == HTMLInputElement::PASSWORD;
+ return static_cast<HTMLInputElement*>(startNode)->isPasswordField();
}
bool SelectionController::caretRendersInsideNode(Node* node) const
diff --git a/WebCore/html/HTMLInputElement.h b/WebCore/html/HTMLInputElement.h
index e023796..a29ed02 100644
--- a/WebCore/html/HTMLInputElement.h
+++ b/WebCore/html/HTMLInputElement.h
@@ -102,16 +102,22 @@ public:
void stepUpFromRenderer(int);
bool isTextButton() const { return m_type == SUBMIT || m_type == RESET || m_type == BUTTON; }
+
virtual bool isRadioButton() const { return m_type == RADIO; }
virtual bool isTextField() const;
virtual bool isSearchField() const { return m_type == SEARCH; }
virtual bool isInputTypeHidden() const { return m_type == HIDDEN; }
virtual bool isPasswordField() const { return m_type == PASSWORD; }
virtual bool isCheckbox() const { return m_type == CHECKBOX; }
- bool isTelephoneField() const { return m_type == TELEPHONE; }
- bool isNumberField() const { return m_type == NUMBER; }
+
bool isEmailField() const { return m_type == EMAIL; }
- bool isUrlField() const { return m_type == URL; }
+ bool isFileUpload() const { return m_type == FILE; }
+ bool isImageButton() const { return m_type == IMAGE; }
+ bool isNumberField() const { return m_type == NUMBER; }
+ bool isSubmitButton() const { return m_type == SUBMIT; }
+ bool isTelephoneField() const { return m_type == TELEPHONE; }
+ bool isURLField() const { return m_type == URL; }
+
#if ENABLE(INPUT_SPEECH)
virtual bool isSpeechEnabled() const;
#endif
diff --git a/WebCore/page/Chrome.cpp b/WebCore/page/Chrome.cpp
index bff0100..8feedce 100644
--- a/WebCore/page/Chrome.cpp
+++ b/WebCore/page/Chrome.cpp
@@ -350,7 +350,7 @@ void Chrome::setToolTip(const HitTestResult& result)
// Get tooltip representing form action, if relevant
if (node->hasTagName(inputTag)) {
HTMLInputElement* input = static_cast<HTMLInputElement*>(node);
- if (input->inputType() == HTMLInputElement::SUBMIT)
+ if (input->isSubmitButton())
if (HTMLFormElement* form = input->form()) {
toolTip = form->action();
if (form->renderer())
@@ -379,7 +379,7 @@ void Chrome::setToolTip(const HitTestResult& result)
if (Node* node = result.innerNonSharedNode()) {
if (node->hasTagName(inputTag)) {
HTMLInputElement* input = static_cast<HTMLInputElement*>(node);
- if (input->inputType() == HTMLInputElement::FILE) {
+ if (input->isFileUpload()) {
FileList* files = input->files();
unsigned listSize = files->length();
if (files && listSize > 1) {
diff --git a/WebCore/page/DragController.cpp b/WebCore/page/DragController.cpp
index b55b7a1..0ba3a70 100644
--- a/WebCore/page/DragController.cpp
+++ b/WebCore/page/DragController.cpp
@@ -255,17 +255,17 @@ static HTMLInputElement* asFileInput(Node* node)
// The button for a FILE input is a sub element with no set input type
// In order to get around this problem we assume any non-FILE input element
// is this internal button, and try querying the shadow parent node.
- if (node->hasTagName(HTMLNames::inputTag) && node->isShadowNode() && static_cast<HTMLInputElement*>(node)->inputType() != HTMLInputElement::FILE)
- node = node->shadowParentNode();
+ if (node->hasTagName(HTMLNames::inputTag) && node->isShadowNode() && !static_cast<HTMLInputElement*>(node)->isFileUpload())
+ node = node->shadowParentNode();
if (!node || !node->hasTagName(HTMLNames::inputTag))
return 0;
- HTMLInputElement* inputElem = static_cast<HTMLInputElement*>(node);
- if (inputElem->inputType() == HTMLInputElement::FILE)
- return inputElem;
+ HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(node);
+ if (!inputElement->isFileUpload())
+ return 0;
- return 0;
+ return inputElement;
}
static Element* elementUnderMouse(Document* documentUnderMouse, const IntPoint& p)
diff --git a/WebCore/page/EventHandler.cpp b/WebCore/page/EventHandler.cpp
index bec55de..c0a87a3 100644
--- a/WebCore/page/EventHandler.cpp
+++ b/WebCore/page/EventHandler.cpp
@@ -1045,8 +1045,7 @@ Frame* EventHandler::subframeForTargetNode(Node* node)
static bool isSubmitImage(Node* node)
{
- return node && node->hasTagName(inputTag)
- && static_cast<HTMLInputElement*>(node)->inputType() == HTMLInputElement::IMAGE;
+ return node && node->hasTagName(inputTag) && static_cast<HTMLInputElement*>(node)->isImageButton();
}
// Returns true if the node's editable block is not current focused for editing
diff --git a/WebCore/rendering/RenderFileUploadControl.cpp b/WebCore/rendering/RenderFileUploadControl.cpp
index f31ca20..7e2d617 100644
--- a/WebCore/rendering/RenderFileUploadControl.cpp
+++ b/WebCore/rendering/RenderFileUploadControl.cpp
@@ -142,7 +142,7 @@ Chrome* RenderFileUploadControl::chrome() const
void RenderFileUploadControl::updateFromElement()
{
HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(node());
- ASSERT(inputElement->inputType() == HTMLInputElement::FILE);
+ ASSERT(inputElement->isFileUpload());
if (!m_button) {
m_button = ShadowInputElement::create(inputElement);
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 299f856..b819d56 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,18 @@
+2010-09-16 Darin Adler <darin at apple.com>
+
+ Reviewed by Andreas Kling.
+
+ Reduce use of HTMLInputElement::inputType so we can remove it later
+ https://bugs.webkit.org/show_bug.cgi?id=45903
+
+ * src/DOMUtilitiesPrivate.cpp:
+ (WebKit::elementHasLegalLinkAttribute): Use isImageButton.
+ * src/WebPasswordFormUtils.cpp:
+ (WebKit::findPasswordFormFields): Use isPasswordField.
+ * src/WebSearchableFormData.cpp:
+ (WebCore::IsInDefaultState): Use isCheckbox and isRadioButton.
+ (WebCore::HasSuitableTextElement): Use isFileUpload and isPasswordField.
+
2010-09-16 Kenneth Russell <kbr at google.com>
Reviewed by James Robinson.
diff --git a/WebKit/chromium/src/DOMUtilitiesPrivate.cpp b/WebKit/chromium/src/DOMUtilitiesPrivate.cpp
index 4081db6..6f952f7 100644
--- a/WebKit/chromium/src/DOMUtilitiesPrivate.cpp
+++ b/WebKit/chromium/src/DOMUtilitiesPrivate.cpp
@@ -97,7 +97,7 @@ bool elementHasLegalLinkAttribute(const Element* element,
if (element->hasTagName(HTMLNames::inputTag)) {
const HTMLInputElement* input =
static_cast<const HTMLInputElement*>(element);
- if (input->inputType() == HTMLInputElement::IMAGE)
+ if (input->isImageButton())
return true;
}
} else if (attrName == HTMLNames::hrefAttr) {
diff --git a/WebKit/chromium/src/WebPasswordFormUtils.cpp b/WebKit/chromium/src/WebPasswordFormUtils.cpp
index e5d5411..a34b17a 100644
--- a/WebKit/chromium/src/WebPasswordFormUtils.cpp
+++ b/WebKit/chromium/src/WebPasswordFormUtils.cpp
@@ -79,8 +79,8 @@ void findPasswordFormFields(HTMLFormElement* form, PasswordFormFields* fields)
continue;
if ((fields->passwords.size() < maxPasswords)
- && (inputElement->inputType() == HTMLInputElement::PASSWORD)
- && (inputElement->autoComplete())) {
+ && inputElement->isPasswordField()
+ && inputElement->autoComplete()) {
if (fields->passwords.isEmpty())
firstPasswordIndex = i;
fields->passwords.append(inputElement);
@@ -98,6 +98,7 @@ void findPasswordFormFields(HTMLFormElement* form, PasswordFormFields* fields)
if (!inputElement->isEnabledFormControl())
continue;
+ // FIXME: This needs to use a function other than inputType.
if ((inputElement->inputType() == HTMLInputElement::TEXT)
&& (inputElement->autoComplete())) {
fields->userName = inputElement;
diff --git a/WebKit/chromium/src/WebSearchableFormData.cpp b/WebKit/chromium/src/WebSearchableFormData.cpp
index 1864514..ba8a4f2 100644
--- a/WebKit/chromium/src/WebSearchableFormData.cpp
+++ b/WebKit/chromium/src/WebSearchableFormData.cpp
@@ -131,7 +131,7 @@ bool IsInDefaultState(const HTMLFormControlElement* formElement)
{
if (formElement->hasTagName(HTMLNames::inputTag)) {
const HTMLInputElement* inputElement = static_cast<const HTMLInputElement*>(formElement);
- if (inputElement->inputType() == HTMLInputElement::CHECKBOX || inputElement->inputType() == HTMLInputElement::RADIO)
+ if (inputElement->isCheckbox() || inputElement->isRadioButton())
return inputElement->checked() == inputElement->defaultChecked();
} else if (formElement->hasTagName(HTMLNames::selectTag))
return IsSelectInDefaultState(static_cast<const HTMLSelectElement*>(formElement));
@@ -166,19 +166,24 @@ bool HasSuitableTextElement(const HTMLFormElement* form, Vector<char>* encodedSt
bool isTextElement = false;
if (formElement->hasTagName(HTMLNames::inputTag)) {
+ if (static_cast<const HTMLInputElement*>(formElement)->isFileUpload()) {
+ // Too big, don't try to index this.
+ return 0;
+ }
+
+ if (static_cast<const HTMLInputElement*>(formElement)->isPasswordField()) {
+ // Don't store passwords! This is most likely an https anyway.
+ return 0;
+ }
+
+ // FIXME: This needs to use a function on HTMLInputElement other than inputType.
+ // Also, it's not clear why TEXT should be handled differently than, say, SEARCH.
switch (static_cast<const HTMLInputElement*>(formElement)->inputType()) {
case HTMLInputElement::TEXT:
case HTMLInputElement::ISINDEX:
isTextElement = true;
break;
- case HTMLInputElement::PASSWORD:
- // Don't store passwords! This is most likely an https anyway.
- // Fall through.
- case HTMLInputElement::FILE:
- // Too big, don't try to index this.
- return 0;
default:
- // All other input types are indexable.
break;
}
}
diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog
index e8c86fb..6c1d080 100644
--- a/WebKit/mac/ChangeLog
+++ b/WebKit/mac/ChangeLog
@@ -1,3 +1,14 @@
+2010-09-16 Darin Adler <darin at apple.com>
+
+ Reviewed by Andreas Kling.
+
+ Reduce use of HTMLInputElement::inputType so we can remove it later
+ https://bugs.webkit.org/show_bug.cgi?id=45903
+
+ * WebView/WebHTMLRepresentation.mm:
+ (-[WebHTMLRepresentation elementDoesAutoComplete:]): Use isPasswordField.
+ (-[WebHTMLRepresentation elementIsPassword:]): Use isPasswordField.
+
2010-09-16 Patrick Gansterer <paroga at paroga.com>
Reviewed by Darin Adler.
diff --git a/WebKit/mac/WebView/WebHTMLRepresentation.mm b/WebKit/mac/WebView/WebHTMLRepresentation.mm
index 307617e..2699472 100644
--- a/WebKit/mac/WebView/WebHTMLRepresentation.mm
+++ b/WebKit/mac/WebView/WebHTMLRepresentation.mm
@@ -306,15 +306,14 @@ static HTMLInputElement* inputElementFromDOMElement(DOMElement* element)
HTMLInputElement* inputElement = inputElementFromDOMElement(element);
return inputElement
&& inputElement->isTextField()
- && inputElement->inputType() != HTMLInputElement::PASSWORD
+ && !inputElement->isPasswordField()
&& inputElement->autoComplete();
}
- (BOOL)elementIsPassword:(DOMElement *)element
{
HTMLInputElement* inputElement = inputElementFromDOMElement(element);
- return inputElement
- && inputElement->inputType() == HTMLInputElement::PASSWORD;
+ return inputElement && inputElement->isPasswordField();
}
- (DOMElement *)formForElement:(DOMElement *)element
diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index bd4b2c2..a970404 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -1,3 +1,14 @@
+2010-09-16 Darin Adler <darin at apple.com>
+
+ Reviewed by Andreas Kling.
+
+ Reduce use of HTMLInputElement::inputType so we can remove it later
+ https://bugs.webkit.org/show_bug.cgi?id=45903
+
+ * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
+ (DumpRenderTreeSupportQt::elementDoesAutoCompleteForElementWithId):
+ Use isPasswordField.
+
2010-09-16 Robert Hogan <robert at webkit.org>
Reviewed by Antonio Gomes.
diff --git a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
index c4ad199..ed7ac32 100644
--- a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
+++ b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
@@ -533,9 +533,7 @@ bool DumpRenderTreeSupportQt::elementDoesAutoCompleteForElementWithId(QWebFrame*
if (!inputElement)
return false;
- return (inputElement->isTextField()
- && inputElement->inputType() != HTMLInputElement::PASSWORD
- && inputElement->autoComplete());
+ return inputElement->isTextField() && !inputElement->isPasswordField() && inputElement->autoComplete();
}
void DumpRenderTreeSupportQt::setEditingBehavior(QWebPage* page, const QString& editingBehavior)
diff --git a/WebKit/win/ChangeLog b/WebKit/win/ChangeLog
index 6f6a75d..41b6fa9 100644
--- a/WebKit/win/ChangeLog
+++ b/WebKit/win/ChangeLog
@@ -1,3 +1,14 @@
+2010-09-16 Darin Adler <darin at apple.com>
+
+ Reviewed by Andreas Kling.
+
+ Reduce use of HTMLInputElement::inputType so we can remove it later
+ https://bugs.webkit.org/show_bug.cgi?id=45903
+
+ * WebFrame.cpp:
+ (WebFrame::elementDoesAutoComplete): Use isPasswordField.
+ (WebFrame::elementIsPassword): Use isPasswordField.
+
2010-09-14 Ada Chan <adachan at apple.com>
Reviewed by Adam Roben.
diff --git a/WebKit/win/WebFrame.cpp b/WebKit/win/WebFrame.cpp
index d7f95e3..843f33a 100644
--- a/WebKit/win/WebFrame.cpp
+++ b/WebKit/win/WebFrame.cpp
@@ -1185,7 +1185,7 @@ HRESULT WebFrame::elementDoesAutoComplete(IDOMElement *element, BOOL *result)
if (!inputElement)
*result = false;
else
- *result = inputElement->isTextField() && inputElement->inputType() != HTMLInputElement::PASSWORD && inputElement->autoComplete();
+ *result = inputElement->isTextField() && !inputElement->isPasswordField() && inputElement->autoComplete();
return S_OK;
}
@@ -1390,9 +1390,8 @@ HRESULT WebFrame::controlsInForm(IDOMElement* form, IDOMElement** controls, int*
HRESULT WebFrame::elementIsPassword(IDOMElement *element, bool *result)
{
- HTMLInputElement *inputElement = inputElementFromDOMElement(element);
- *result = inputElement != 0
- && inputElement->inputType() == HTMLInputElement::PASSWORD;
+ HTMLInputElement* inputElement = inputElementFromDOMElement(element);
+ *result = inputElement && inputElement->isPasswordField();
return S_OK;
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list