Changeset 43779 in webkit


Ignore:
Timestamp:
May 15, 2009 1:09:36 PM (15 years ago)
Author:
weinig@apple.com
Message:

2009-05-15 Sam Weinig <sam@webkit.org>

Reviewed by Beth Dakin.

Fix for https://bugs.webkit.org/show_bug.cgi?id=25826
<rdar://problem/6884742>
REGRESSION: In Gmail's Edit Link dialog, I can't type in the Link To: field (due to <input type=url> support)

Added a site specific quirk for mail.google.com which returns "text" when getting the type of an <input type=url>

  • bindings/js/JSHTMLInputElementCustom.cpp: (WebCore::needsGmailQuirk): (WebCore::JSHTMLInputElement::type):
  • html/HTMLInputElement.idl:
Location:
trunk/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r43778 r43779  
     12009-05-15  Sam Weinig  <sam@webkit.org>
     2
     3        Reviewed by Beth Dakin.
     4
     5        Fix for https://bugs.webkit.org/show_bug.cgi?id=25826
     6        <rdar://problem/6884742>
     7        REGRESSION: In Gmail's Edit Link dialog, I can't type in the Link To: field (due to <input type=url> support)
     8
     9        Added a site specific quirk for mail.google.com which returns "text" when getting the type of an <input type=url>
     10
     11        * bindings/js/JSHTMLInputElementCustom.cpp:
     12        (WebCore::needsGmailQuirk):
     13        (WebCore::JSHTMLInputElement::type):
     14        * html/HTMLInputElement.idl:
     15
    1162009-05-14  Dimitri Glazkov  <dglazkov@chromium.org>
    217
  • trunk/WebCore/bindings/js/JSHTMLInputElementCustom.cpp

    r43661 r43779  
    2727#include "JSHTMLInputElement.h"
    2828
     29#include "Document.h"
    2930#include "HTMLInputElement.h"
     31#include "Settings.h"
    3032
    3133using namespace JSC;
    3234
    3335namespace WebCore {
     36
     37static bool needsGmailQuirk(HTMLInputElement* input)
     38{
     39    Document* document = input->document();
     40
     41    const KURL& url = document->url();
     42    if (url.host() != "mail.google.com")
     43        return false;
     44
     45    // As with other site-specific quirks, allow website developers to turn this off.
     46    // In theory, this allows website developers to check if their fixes are effective.
     47    Settings* settings = document->settings();
     48    if (!settings)
     49        return false;
     50    if (!settings->needsSiteSpecificQuirks())
     51        return false;
     52
     53    return true;
     54}
     55
     56JSValue JSHTMLInputElement::type(ExecState* exec) const
     57{
     58    HTMLInputElement* input = static_cast<HTMLInputElement*>(impl());
     59    const AtomicString& type = input->type();
     60
     61    DEFINE_STATIC_LOCAL(const AtomicString, url, ("url"));
     62    DEFINE_STATIC_LOCAL(const AtomicString, text, ("text"));
     63
     64    if (type == url && needsGmailQuirk(input))
     65        return jsString(exec, text);
     66    return jsString(exec, type);
     67}
    3468
    3569JSValue JSHTMLInputElement::selectionStart(ExecState* exec) const
  • trunk/WebCore/html/HTMLInputElement.idl

    r43605 r43779  
    4848#endif
    4949                 attribute [ConvertNullToNullString] DOMString src;
    50                  attribute [ConvertNullToNullString] DOMString type; // readonly dropped as part of DOM level 2
     50                 attribute [ConvertNullToNullString, CustomGetter] DOMString type; // readonly dropped as part of DOM level 2
    5151                 attribute [ConvertNullToNullString] DOMString useMap;
    5252                 attribute [ConvertNullToNullString] DOMString value;
Note: See TracChangeset for help on using the changeset viewer.