Changeset 91893 in webkit


Ignore:
Timestamp:
Jul 27, 2011 8:00:54 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

Implement sizes attribute for link tag from HTML5
https://bugs.webkit.org/show_bug.cgi?id=37674

Patch by Rachel Blum <groby@chromium.org> on 2011-07-27
Reviewed by Dimitri Glazkov.

Source/WebCore:

Test: fast/dom/icon-size-property.html

  • WebCore.gypi:
  • WebCore.pro:
  • bindings/js/JSHTMLLinkElementCustom.cpp:

(WebCore::JSHTMLLinkElement::sizes):
(WebCore::JSHTMLLinkElement::setSizes):

  • bindings/v8/custom/V8HTMLLinkElementCustom.cpp: Added.

(WebCore::V8HTMLLinkElement::sizesAccessorGetter):
(WebCore::V8HTMLLinkElement::sizesAccessorSetter):

  • html/HTMLAttributeNames.in:
  • html/HTMLLinkElement.cpp:

(WebCore::HTMLLinkElement::HTMLLinkElement):
(WebCore::HTMLLinkElement::parseMappedAttribute):
(WebCore::HTMLLinkElement::sizes):
(WebCore::HTMLLinkElement::setSizes):

  • html/HTMLLinkElement.h:
  • html/HTMLLinkElement.idl:

LayoutTests:

  • fast/dom/icon-size-property-expected.txt: Added.
  • fast/dom/icon-size-property.html: Added.
Location:
trunk
Files:
3 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r91891 r91893  
     12011-07-27  Rachel Blum  <groby@chromium.org>
     2
     3        Implement sizes attribute for link tag from HTML5
     4        https://bugs.webkit.org/show_bug.cgi?id=37674
     5
     6        Reviewed by Dimitri Glazkov.
     7
     8        * fast/dom/icon-size-property-expected.txt: Added.
     9        * fast/dom/icon-size-property.html: Added.
     10
    1112011-07-27  Ryosuke Niwa  <rniwa@webkit.org>
    212
  • trunk/Source/WebCore/ChangeLog

    r91885 r91893  
     12011-07-27  Rachel Blum  <groby@chromium.org>
     2
     3        Implement sizes attribute for link tag from HTML5
     4        https://bugs.webkit.org/show_bug.cgi?id=37674
     5
     6        Reviewed by Dimitri Glazkov.
     7
     8        Test: fast/dom/icon-size-property.html
     9
     10        * WebCore.gypi:
     11        * WebCore.pro:
     12        * bindings/js/JSHTMLLinkElementCustom.cpp:
     13        (WebCore::JSHTMLLinkElement::sizes):
     14        (WebCore::JSHTMLLinkElement::setSizes):
     15        * bindings/v8/custom/V8HTMLLinkElementCustom.cpp: Added.
     16        (WebCore::V8HTMLLinkElement::sizesAccessorGetter):
     17        (WebCore::V8HTMLLinkElement::sizesAccessorSetter):
     18        * html/HTMLAttributeNames.in:
     19        * html/HTMLLinkElement.cpp:
     20        (WebCore::HTMLLinkElement::HTMLLinkElement):
     21        (WebCore::HTMLLinkElement::parseMappedAttribute):
     22        (WebCore::HTMLLinkElement::sizes):
     23        (WebCore::HTMLLinkElement::setSizes):
     24        * html/HTMLLinkElement.h:
     25        * html/HTMLLinkElement.idl:
     26
    1272011-07-27  Pratik Solanki  <psolanki@apple.com>
    228
  • trunk/Source/WebCore/WebCore.gypi

    r91839 r91893  
    21552155            'bindings/v8/custom/V8HTMLImageElementConstructor.h',
    21562156            'bindings/v8/custom/V8HTMLInputElementCustom.cpp',
     2157            'bindings/v8/custom/V8HTMLLinkElementCustom.cpp',
    21572158            'bindings/v8/custom/V8HTMLOptionElementConstructor.cpp',
    21582159            'bindings/v8/custom/V8HTMLOptionElementConstructor.h',
  • trunk/Source/WebCore/WebCore.pro

    r91843 r91893  
    185185        bindings/v8/custom/V8HTMLImageElementConstructor.cpp \
    186186        bindings/v8/custom/V8HTMLInputElementCustom.cpp \
     187        bindings/v8/custom/V8HTMLLinkElementCustom.cpp \
    187188        bindings/v8/custom/V8HTMLOptionElementConstructor.cpp \
    188189        bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp \
  • trunk/Source/WebCore/bindings/js/JSHTMLLinkElementCustom.cpp

    r84584 r91893  
    11/*
    22 * Copyright (C) 2010 Apple Inc. All rights reserved.
     3 * Copyright (C) 2011 Google Inc. All rights reserved.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    2829
    2930#include "HTMLLinkElement.h"
     31#include "JSDOMBinding.h"
     32#include "JSDOMSettableTokenList.h"
     33#include <wtf/GetPtr.h>
    3034
    3135using namespace JSC;
     
    3337namespace WebCore {
    3438
     39JSValue JSHTMLLinkElement::sizes(ExecState* exec) const
     40{
     41    HTMLLinkElement* output = static_cast<HTMLLinkElement*>(impl());
     42    JSValue result = toJS(exec, globalObject(), WTF::getPtr(output->sizes()));
     43    return result;
    3544}
     45
     46void JSHTMLLinkElement::setSizes(ExecState* exec, JSValue value)
     47{
     48    HTMLLinkElement* output = static_cast<HTMLLinkElement*>(impl());
     49    output->setSizes(valueToStringWithNullCheck(exec, value));
     50}
     51
     52} // namespace WebCore
  • trunk/Source/WebCore/html/HTMLAttributeNames.in

    r91797 r91893  
    273273shape
    274274size
     275sizes
    275276sortable
    276277sortdirection
  • trunk/Source/WebCore/html/HTMLLinkElement.cpp

    r89146 r91893  
    55 * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
    66 * Copyright (C) 2009 Rob Buis (rwlbuis@gmail.com)
     7 * Copyright (C) 2011 Google Inc. All rights reserved.
    78 *
    89 * This library is free software; you can redistribute it and/or
     
    5455    : HTMLElement(tagName, document)
    5556    , m_linkLoader(this)
     57    , m_sizes(DOMSettableTokenList::create())
    5658    , m_loading(false)
    5759    , m_isEnabledViaScript(false)
     
    133135    } else if (attr->name() == typeAttr) {
    134136        m_type = attr->value();
     137        process();
     138    } else if (attr->name() == sizesAttr) {
     139        setSizes(attr->value());
    135140        process();
    136141    } else if (attr->name() == mediaAttr) {
     
    441446}
    442447
    443 }
     448DOMSettableTokenList* HTMLLinkElement::sizes() const
     449{
     450    return m_sizes.get();
     451}
     452
     453void HTMLLinkElement::setSizes(const String& value)
     454{
     455    m_sizes->setValue(value);
     456}
     457
     458} // namespace WebCore
  • trunk/Source/WebCore/html/HTMLLinkElement.h

    r89146 r91893  
    33 *           (C) 1999 Antti Koivisto (koivisto@kde.org)
    44 * Copyright (C) 2003, 2008, 2010 Apple Inc. All rights reserved.
     5 * Copyright (C) 2011 Google Inc. All rights reserved.
    56 *
    67 * This library is free software; you can redistribute it and/or
     
    2728#include "CachedResourceClient.h"
    2829#include "CachedResourceHandle.h"
     30#include "DOMSettableTokenList.h"
    2931#include "HTMLElement.h"
    3032#include "IconURL.h"
     
    5456    StyleSheet* sheet() const;
    5557
    56     // FIXME: This should be remaned isStyleSheetLoading as this is only used for stylesheets.
     58    // FIXME: This should be renamed isStyleSheetLoading as this is only used for stylesheets.
    5759    bool isLoading() const;
    5860    bool isEnabledViaScript() const { return m_isEnabledViaScript; }
    5961    bool disabled() const;
    6062    void setDisabled(bool);
     63    void setSizes(const String&);
     64    DOMSettableTokenList* sizes() const;
    6165
    6266private:
     
    100104    String m_type;
    101105    String m_media;
     106    RefPtr<DOMSettableTokenList> m_sizes;
    102107    LinkRelAttribute m_relAttribute;
    103108    bool m_loading;
  • trunk/Source/WebCore/html/HTMLLinkElement.idl

    r89269 r91893  
    22 * Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
    33 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
     4 * Copyright (C) 2011 Google Inc. All rights reserved.
    45 *
    56 * This library is free software; you can redistribute it and/or
     
    2930        attribute [Reflect] DOMString rel;
    3031        attribute [Reflect] DOMString rev;
     32#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
     33        attribute [Custom] DOMSettableTokenList sizes;
     34#endif
    3135        attribute [Reflect] DOMString target;
    3236        attribute [Reflect] DOMString type;
Note: See TracChangeset for help on using the changeset viewer.