Changeset 144696 in webkit


Ignore:
Timestamp:
Mar 4, 2013 4:42:32 PM (11 years ago)
Author:
commit-queue@webkit.org
Message:

<link rel="apple-touch-icon"> tag is not honored on CNN.com, workflowy.com etc
https://bugs.webkit.org/show_bug.cgi?id=109061

Patch by Ruslan Abdikeev <aruslan@chromium.org> on 2013-03-04
Reviewed by Adam Barth.

.:

  • Source/autotools/symbols.filter:

Source/WebCore:

Test: fast/dom/icon-url-list-apple-touch.html

Added iconTypes parameter to Document::iconURLs().
Added Document::shortcutIconURLs() with original semantics of iconURLs().
Fixed IconController.cpp to provide iconTypesMask to iconURLs().
Renamed iconTypes to iconTypesMask to make the meaning clearer.

  • WebCore.exp.in:
  • dom/Document.cpp:

(WebCore::Document::shortcutIconURLs):
(WebCore):
(WebCore::Document::iconURLs):

  • dom/Document.h:

(Document):

  • loader/icon/IconController.cpp:

(WebCore::IconController::iconURL):
(WebCore::IconController::urlsForTypes):

  • testing/Internals.cpp:

(WebCore::Internals::iconURLs):
(WebCore::Internals::shortcutIconURLs):
(WebCore):
(WebCore::Internals::allIconURLs):

  • testing/Internals.h:
  • testing/Internals.idl:

LayoutTests:

Added test for apple-touch-icon in allIconURLs().
Changed iconURLs() to shortcutIconURLs().

  • fast/dom/icon-url-change.html:
  • fast/dom/icon-url-list-apple-touch-expected.txt: Added.
  • fast/dom/icon-url-list-apple-touch.html: Added.
  • fast/dom/icon-url-list.html:
  • fast/dom/icon-url-property.html:
Location:
trunk
Files:
3 added
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r144614 r144696  
     12013-03-04  Ruslan Abdikeev  <aruslan@chromium.org>
     2
     3        <link rel="apple-touch-icon"> tag is not honored on CNN.com, workflowy.com etc
     4        https://bugs.webkit.org/show_bug.cgi?id=109061
     5
     6        Reviewed by Adam Barth.
     7
     8        * Source/autotools/symbols.filter:
     9
    1102013-03-04  Kunihiko Sakamoto  <ksakamoto@chromium.org>
    211
  • trunk/LayoutTests/ChangeLog

    r144694 r144696  
     12013-03-04  Ruslan Abdikeev  <aruslan@chromium.org>
     2
     3        <link rel="apple-touch-icon"> tag is not honored on CNN.com, workflowy.com etc
     4        https://bugs.webkit.org/show_bug.cgi?id=109061
     5
     6        Reviewed by Adam Barth.
     7
     8        Added test for apple-touch-icon in allIconURLs().
     9        Changed iconURLs() to shortcutIconURLs().
     10
     11        * fast/dom/icon-url-change.html:
     12        * fast/dom/icon-url-list-apple-touch-expected.txt: Added.
     13        * fast/dom/icon-url-list-apple-touch.html: Added.
     14        * fast/dom/icon-url-list.html:
     15        * fast/dom/icon-url-property.html:
     16
    1172013-02-27  Jeffrey Pfau  <jpfau@apple.com>
    218
  • trunk/LayoutTests/fast/dom/icon-url-change.html

    r144572 r144696  
    4646    // check that the URL list in the document is as we expect
    4747    var expectedURLs = "http://test.com/oldfavicon.ico";
    48     var iconURLs = window.internals.iconURLs(document);
     48    var iconURLs = window.internals.shortcutIconURLs(document);
    4949    if (expectedURLs == iconURLs[0])
    5050        testPassed('URL list matches expected');
  • trunk/LayoutTests/fast/dom/icon-url-list.html

    r144572 r144696  
    4949    var expectedURL1 = "http://test.com/foofavicon.ico";
    5050    var expectedURL2 = "http://test.com/newfavicon.ico";
    51     var iconURLs = window.internals.iconURLs(document);
     51    var iconURLs = window.internals.shortcutIconURLs(document);
    5252    if (expectedURL0 == iconURLs[0] && expectedURL1 == iconURLs[1] && expectedURL2 == iconURLs[2])
    5353        testPassed('URL list matches expected');
  • trunk/LayoutTests/fast/dom/icon-url-property.html

    r144572 r144696  
    4444    // check that the URL list in the document is as we expect
    4545    var expectedURLs = "http://test.com/newfavicon.ico";
    46     var iconURLs = window.internals.iconURLs(document);
     46    var iconURLs = window.internals.shortcutIconURLs(document);
    4747    if (expectedURLs == iconURLs[0])
    4848        debugOutput('PASS - URL list matches expected');
  • trunk/Source/WebCore/ChangeLog

    r144694 r144696  
     12013-03-04  Ruslan Abdikeev  <aruslan@chromium.org>
     2
     3        <link rel="apple-touch-icon"> tag is not honored on CNN.com, workflowy.com etc
     4        https://bugs.webkit.org/show_bug.cgi?id=109061
     5
     6        Reviewed by Adam Barth.
     7
     8        Test: fast/dom/icon-url-list-apple-touch.html
     9
     10        Added iconTypes parameter to Document::iconURLs().
     11        Added Document::shortcutIconURLs() with original semantics of iconURLs().
     12        Fixed IconController.cpp to provide iconTypesMask to iconURLs().
     13        Renamed iconTypes to iconTypesMask to make the meaning clearer.
     14
     15        * WebCore.exp.in:
     16        * dom/Document.cpp:
     17        (WebCore::Document::shortcutIconURLs):
     18        (WebCore):
     19        (WebCore::Document::iconURLs):
     20        * dom/Document.h:
     21        (Document):
     22        * loader/icon/IconController.cpp:
     23        (WebCore::IconController::iconURL):
     24        (WebCore::IconController::urlsForTypes):
     25        * testing/Internals.cpp:
     26        (WebCore::Internals::iconURLs):
     27        (WebCore::Internals::shortcutIconURLs):
     28        (WebCore):
     29        (WebCore::Internals::allIconURLs):
     30        * testing/Internals.h:
     31        * testing/Internals.idl:
     32
    1332013-02-27  Jeffrey Pfau  <jpfau@apple.com>
    234
  • trunk/Source/WebCore/WebCore.exp.in

    r144572 r144696  
    983983__ZN7WebCore8FormData28removeGeneratedFilesIfNeededEv
    984984__ZN7WebCore8FormData6decodeERN3WTF7DecoderE
    985 __ZN7WebCore8Document8iconURLsEv
     985__ZN7WebCore8Document8iconURLsEi
     986__ZN7WebCore8Document16shortcutIconURLsEv
    986987__ZN7WebCore8FormData6createEPKvm
    987988__ZN7WebCore8FormDataD1Ev
  • trunk/Source/WebCore/dom/Document.cpp

    r144607 r144696  
    45004500}
    45014501
    4502 const Vector<IconURL>& Document::iconURLs()
     4502const Vector<IconURL>& Document::shortcutIconURLs()
     4503{
     4504    // Include any icons where type = link, rel = "shortcut icon".
     4505    return iconURLs(Favicon);
     4506}
     4507
     4508const Vector<IconURL>& Document::iconURLs(int iconTypesMask)
    45034509{
    45044510    m_iconURLs.clear();
     
    45074513        return m_iconURLs;
    45084514
    4509     // Include any icons where type = link, rel = "shortcut icon".
    45104515    RefPtr<HTMLCollection> children = head()->children();
    45114516    unsigned int length = children->length();
     
    45154520            continue;
    45164521        HTMLLinkElement* linkElement = static_cast<HTMLLinkElement*>(child);
    4517         if (linkElement->iconType() != Favicon)
     4522        if (!(linkElement->iconType() & iconTypesMask))
    45184523            continue;
    45194524        if (linkElement->href().isEmpty())
  • trunk/Source/WebCore/dom/Document.h

    r144572 r144696  
    944944    void setHasNodesWithPlaceholderStyle() { m_hasNodesWithPlaceholderStyle = true; }
    945945
    946     const Vector<IconURL>& iconURLs();
     946    const Vector<IconURL>& shortcutIconURLs();
     947    const Vector<IconURL>& iconURLs(int iconTypesMask);
    947948    void addIconURL(const String& url, const String& mimeType, const String& size, IconType);
    948949
  • trunk/Source/WebCore/loader/icon/IconController.cpp

    r144572 r144696  
    7070{
    7171    IconURL result;
    72     const Vector<IconURL>& iconURLs = m_frame->document()->iconURLs();
     72    const Vector<IconURL>& iconURLs = m_frame->document()->iconURLs(iconType);
    7373    Vector<IconURL>::const_iterator iter(iconURLs.begin());
    7474    for (; iter != iconURLs.end(); ++iter) {
    75         if (iter->m_iconType == iconType) {
    76             if (result.m_iconURL.isEmpty() || !iter->m_mimeType.isEmpty())
    77                 result = *iter;
    78         }
     75        if (result.m_iconURL.isEmpty() || !iter->m_mimeType.isEmpty())
     76            result = *iter;
    7977    }
    8078
     
    8280}
    8381
    84 IconURLs IconController::urlsForTypes(int iconTypes)
     82IconURLs IconController::urlsForTypes(int iconTypesMask)
    8583{
    8684    IconURLs iconURLs;
     
    8886        return iconURLs;
    8987       
    90     if (iconTypes & Favicon && !appendToIconURLs(Favicon, &iconURLs))
     88    if (iconTypesMask & Favicon && !appendToIconURLs(Favicon, &iconURLs))
    9189        iconURLs.append(defaultURL(Favicon));
    9290
    9391#if ENABLE(TOUCH_ICON_LOADING)
    9492    int missedIcons = 0;
    95     if (iconTypes & TouchPrecomposedIcon)
     93    if (iconTypesMask & TouchPrecomposedIcon)
    9694        missedIcons += appendToIconURLs(TouchPrecomposedIcon, &iconURLs) ? 0:1;
    9795
    98     if (iconTypes & TouchIcon)
     96    if (iconTypesMask & TouchIcon)
    9997      missedIcons += appendToIconURLs(TouchIcon, &iconURLs) ? 0:1;
    10098
     
    107105
    108106    // Finally, append all remaining icons of this type.
    109     const Vector<IconURL>& allIconURLs = m_frame->document()->iconURLs();
     107    const Vector<IconURL>& allIconURLs = m_frame->document()->iconURLs(iconTypesMask);
    110108    for (Vector<IconURL>::const_iterator iter = allIconURLs.begin(); iter != allIconURLs.end(); ++iter) {
    111         if (!(iter->m_iconType & iconTypes))
    112             continue;
    113 
    114109        int i;
    115110        int iconCount = iconURLs.size();
  • trunk/Source/WebCore/loader/icon/IconController.h

    r144572 r144696  
    4949
    5050    KURL url();
    51     IconURLs urlsForTypes(int iconTypes);
     51    IconURLs urlsForTypes(int iconTypesMask);
    5252    IconURL iconURL(IconType) const;
    5353
  • trunk/Source/WebCore/testing/Internals.cpp

    r144572 r144696  
    17671767}
    17681768
    1769 Vector<String> Internals::iconURLs(Document* document) const
    1770 {
    1771     Vector<IconURL> iconURLs = document->iconURLs();
     1769Vector<String> Internals::iconURLs(Document* document, int iconTypesMask) const
     1770{
     1771    Vector<IconURL> iconURLs = document->iconURLs(iconTypesMask);
    17721772    Vector<String> array;
    17731773
     
    17771777
    17781778    return array;
     1779}
     1780
     1781Vector<String> Internals::shortcutIconURLs(Document* document) const
     1782{
     1783    return iconURLs(document, Favicon);
     1784}
     1785
     1786Vector<String> Internals::allIconURLs(Document* document) const
     1787{
     1788    return iconURLs(document, Favicon | TouchIcon | TouchPrecomposedIcon);
    17791789}
    17801790
  • trunk/Source/WebCore/testing/Internals.h

    r144572 r144696  
    252252
    253253    int pageNumber(Element*, float pageWidth = 800, float pageHeight = 600);
    254     Vector<String> iconURLs(Document*) const;
     254    Vector<String> shortcutIconURLs(Document*) const;
     255    Vector<String> allIconURLs(Document*) const;
    255256
    256257    int numberOfPages(float pageWidthInPixels = 800, float pageHeightInPixels = 600);
     
    299300    Document* contextDocument() const;
    300301    Frame* frame() const;
     302    Vector<String> iconURLs(Document*, int iconTypesMask) const;
    301303
    302304    DocumentMarker* markerAt(Node*, const String& markerType, unsigned index, ExceptionCode&);
  • trunk/Source/WebCore/testing/Internals.idl

    r144572 r144696  
    218218    DOMString counterValue(in Element element);
    219219    long pageNumber(in Element element, in [Optional] float pageWidth, in [Optional] float pageHeight);
    220     DOMString[] iconURLs(in Document document);
     220    DOMString[] shortcutIconURLs(in Document document);
     221    DOMString[] allIconURLs(in Document document);
    221222    long numberOfPages(in [Optional] double pageWidthInPixels, in [Optional] double pageHeightInPixels);
    222223    DOMString pageProperty(in DOMString propertyName, in long pageNumber) raises (DOMException);
  • trunk/Source/WebKit/WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in

    r144663 r144696  
    327327        ?registerURLSchemeAsBypassingContentSecurityPolicy@SchemeRegistry@WebCore@@SAXABVString@WTF@@@Z
    328328        ?removeURLSchemeRegisteredAsBypassingContentSecurityPolicy@SchemeRegistry@WebCore@@SAXABVString@WTF@@@Z
    329         ?iconURLs@Document@WebCore@@QAEABV?$Vector@UIconURL@WebCore@@$0A@@WTF@@XZ
     329        ?shortcutIconURLs@Document@WebCore@@QAEABV?$Vector@UIconURL@WebCore@@$0A@@WTF@@XZ
     330        ?iconURLs@Document@WebCore@@QAEABV?$Vector@UIconURL@WebCore@@$0A@@WTF@@H@Z
    330331        ?numberOfPages@PrintContext@WebCore@@SAHPAVFrame@2@ABVFloatSize@2@@Z
    331332        ?pageProperty@PrintContext@WebCore@@SA?AVString@WTF@@PAVFrame@2@PBDH@Z
  • trunk/Source/WebKit/chromium/public/WebFrame.h

    r144572 r144696  
    131131
    132132    // The urls of the given combination types of favicon (if any) specified by
    133     // the document loaded in this frame. The iconTypes is a bit-mask of
     133    // the document loaded in this frame. The iconTypesMask is a bit-mask of
    134134    // WebIconURL::Type values, used to select from the available set of icon
    135135    // URLs
    136     virtual WebVector<WebIconURL> iconURLs(int iconTypes) const = 0;
     136    virtual WebVector<WebIconURL> iconURLs(int iconTypesMask) const = 0;
    137137
    138138
  • trunk/Source/WebKit/chromium/src/WebFrameImpl.cpp

    r144572 r144696  
    575575}
    576576
    577 WebVector<WebIconURL> WebFrameImpl::iconURLs(int iconTypes) const
     577WebVector<WebIconURL> WebFrameImpl::iconURLs(int iconTypesMask) const
    578578{
    579579    // The URL to the icon may be in the header. As such, only
    580580    // ask the loader for the icon if it's finished loading.
    581581    if (frame()->loader()->state() == FrameStateComplete)
    582         return frame()->loader()->icon()->urlsForTypes(iconTypes);
     582        return frame()->loader()->icon()->urlsForTypes(iconTypesMask);
    583583    return WebVector<WebIconURL>();
    584584}
  • trunk/Source/WebKit/chromium/src/WebFrameImpl.h

    r144572 r144696  
    7979    virtual void setName(const WebString&);
    8080    virtual long long identifier() const;
    81     virtual WebVector<WebIconURL> iconURLs(int iconTypes) const;
     81    virtual WebVector<WebIconURL> iconURLs(int iconTypesMask) const;
    8282    virtual WebSize scrollOffset() const;
    8383    virtual void setScrollOffset(const WebSize&);
  • trunk/Source/WebKit/win/WebKit.vcproj/WebKitExports.def.in

    r144573 r144696  
    329329        ?registerURLSchemeAsBypassingContentSecurityPolicy@SchemeRegistry@WebCore@@SAXABVString@WTF@@@Z
    330330        ?removeURLSchemeRegisteredAsBypassingContentSecurityPolicy@SchemeRegistry@WebCore@@SAXABVString@WTF@@@Z
    331         ?iconURLs@Document@WebCore@@QAEABV?$Vector@UIconURL@WebCore@@$0A@@WTF@@XZ
     331        ?shortcutIconURLs@Document@WebCore@@QAEABV?$Vector@UIconURL@WebCore@@$0A@@WTF@@XZ
     332        ?iconURLs@Document@WebCore@@QAEABV?$Vector@UIconURL@WebCore@@$0A@@WTF@@H@Z
    332333        ?numberOfPages@PrintContext@WebCore@@SAHPAVFrame@2@ABVFloatSize@2@@Z
    333334        ?pageProperty@PrintContext@WebCore@@SA?AVString@WTF@@PAVFrame@2@PBDH@Z
  • trunk/Source/autotools/symbols.filter

    r144572 r144696  
    4343_ZN7WebCore5RangeD1Ev;
    4444_ZN7WebCore8Document36updateLayoutIgnorePendingStylesheetsEv;
    45 _ZN7WebCore8Document8iconURLsEv;
     45_ZN7WebCore8Document8iconURLsEi;
     46_ZN7WebCore8Document16shortcutIconURLsEv;
    4647_ZN7WebCore8Settings19minDOMTimerIntervalEv;
    4748_ZN7WebCore8Settings22setMinDOMTimerIntervalEd;
Note: See TracChangeset for help on using the changeset viewer.