Changeset 200519 in webkit
- Timestamp:
- May 6, 2016 1:38:55 PM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 1 deleted
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r200516 r200519 1 2016-05-06 Anders Carlsson <andersca@apple.com> 2 3 Tidy up the LinkRelAttribute code 4 https://bugs.webkit.org/show_bug.cgi?id=157429 5 6 Reviewed by Sam Weinig. 7 8 Get rid of IconURL.h and move the IconType enumeration inside LinkRelAttribute. 9 Remove the InvalidIcon enum declaration and use WTF::Optional instead. 10 11 * WebCore.xcodeproj/project.pbxproj: 12 * dom/IconURL.h: Removed. 13 * html/HTMLLinkElement.cpp: 14 (WebCore::HTMLLinkElement::iconType): 15 (WebCore::HTMLLinkElement::addSubresourceAttributeURLs): 16 * html/HTMLLinkElement.h: 17 * html/LinkRelAttribute.cpp: 18 (WebCore::LinkRelAttribute::LinkRelAttribute): 19 * html/LinkRelAttribute.h: 20 * html/parser/HTMLPreloadScanner.cpp: 21 (WebCore::TokenPreloadScanner::StartTagScanner::relAttributeIsStyleSheet): 22 * loader/FrameLoader.h: 23 * loader/FrameLoaderClient.h: 24 * loader/icon/IconController.cpp: 25 (WebCore::iconFromLinkElements): 26 1 27 2016-05-06 Jer Noble <jer.noble@apple.com> 2 28 -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r200507 r200519 1730 1730 458FE4091589DF0B005609E6 /* RenderSearchField.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 458FE4071589DF0B005609E6 /* RenderSearchField.cpp */; }; 1731 1731 458FE40A1589DF0B005609E6 /* RenderSearchField.h in Headers */ = {isa = PBXBuildFile; fileRef = 458FE4081589DF0B005609E6 /* RenderSearchField.h */; }; 1732 45BAC2B01360BBAB005DA258 /* IconURL.h in Headers */ = {isa = PBXBuildFile; fileRef = 45BAC2AF1360BBAB005DA258 /* IconURL.h */; settings = {ATTRIBUTES = (Private, ); }; };1733 1732 45FEA5CF156DDE8C00654101 /* Decimal.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 45FEA5CD156DDE8C00654101 /* Decimal.cpp */; }; 1734 1733 45FEA5D0156DDE8C00654101 /* Decimal.h in Headers */ = {isa = PBXBuildFile; fileRef = 45FEA5CE156DDE8C00654101 /* Decimal.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 9273 9272 458FE4071589DF0B005609E6 /* RenderSearchField.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSearchField.cpp; sourceTree = "<group>"; }; 9274 9273 458FE4081589DF0B005609E6 /* RenderSearchField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSearchField.h; sourceTree = "<group>"; }; 9275 45BAC2AF1360BBAB005DA258 /* IconURL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IconURL.h; sourceTree = "<group>"; };9276 9274 45FEA5CD156DDE8C00654101 /* Decimal.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Decimal.cpp; sourceTree = "<group>"; }; 9277 9275 45FEA5CE156DDE8C00654101 /* Decimal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Decimal.h; sourceTree = "<group>"; }; … … 24402 24400 2442BBF81194C9D300D49469 /* HashChangeEvent.h */, 24403 24401 8482B7441198C32E00BFB005 /* HashChangeEvent.idl */, 24404 45BAC2AF1360BBAB005DA258 /* IconURL.h */,24405 24402 C3CF17A015B0063F00276D39 /* IdTargetObserver.cpp */, 24406 24403 C3CF17A115B0063F00276D39 /* IdTargetObserver.h */, … … 26339 26336 513F14540AB634C400094DDF /* IconLoader.h in Headers */, 26340 26337 51E1ECC10C91C90400DC255B /* IconRecord.h in Headers */, 26341 45BAC2B01360BBAB005DA258 /* IconURL.h in Headers */,26342 26338 51BA4ACC1BBC5BDD00DF3D6D /* IDBBackingStore.h in Headers */, 26343 26339 C585A66311D4FAC5004C3E4B /* IDBBindingUtilities.h in Headers */, -
trunk/Source/WebCore/html/HTMLLinkElement.cpp
r200041 r200519 496 496 } 497 497 498 IconTypeHTMLLinkElement::iconType() const498 Optional<LinkRelAttribute::IconType> HTMLLinkElement::iconType() const 499 499 { 500 500 return m_relAttribute.iconType; … … 511 511 512 512 // Favicons are handled by a special case in LegacyWebArchive::create() 513 if (m_relAttribute.iconType != InvalidIcon)513 if (m_relAttribute.iconType) 514 514 return; 515 515 -
trunk/Source/WebCore/html/HTMLLinkElement.h
r199650 r200519 55 55 const AtomicString& type() const; 56 56 57 IconTypeiconType() const;57 Optional<LinkRelAttribute::IconType> iconType() const; 58 58 59 59 // the icon size string as parsed from the HTML attribute -
trunk/Source/WebCore/html/LinkRelAttribute.cpp
r199650 r200519 47 47 isStyleSheet = true; 48 48 else if (equalLettersIgnoringASCIICase(rel, "icon") || equalLettersIgnoringASCIICase(rel, "shortcut icon")) 49 iconType = Favicon; 50 #if ENABLE(TOUCH_ICON_LOADING) 49 iconType = IconType::Favicon; 51 50 else if (equalLettersIgnoringASCIICase(rel, "apple-touch-icon")) 52 iconType = TouchIcon;51 iconType = IconType::TouchIcon; 53 52 else if (equalLettersIgnoringASCIICase(rel, "apple-touch-icon-precomposed")) 54 iconType = TouchPrecomposedIcon; 55 #endif 53 iconType = IconType::TouchPrecomposedIcon; 56 54 else if (equalLettersIgnoringASCIICase(rel, "dns-prefetch")) 57 55 isDNSPrefetch = true; … … 73 71 isAlternate = true; 74 72 else if (equalLettersIgnoringASCIICase(word, "icon")) 75 iconType = Favicon; 76 #if ENABLE(TOUCH_ICON_LOADING) 73 iconType = IconType::Favicon; 77 74 else if (equalLettersIgnoringASCIICase(word, "apple-touch-icon")) 78 iconType = TouchIcon;75 iconType = IconType::TouchIcon; 79 76 else if (equalLettersIgnoringASCIICase(word, "apple-touch-icon-precomposed")) 80 iconType = TouchPrecomposedIcon; 81 #endif 77 iconType = IconType::TouchPrecomposedIcon; 82 78 #if ENABLE(LINK_PREFETCH) 83 79 else if (equalLettersIgnoringASCIICase(word, "prefetch")) -
trunk/Source/WebCore/html/LinkRelAttribute.h
r199650 r200519 1 1 /* 2 2 * Copyright (C) 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2016 Apple Inc. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 30 31 */ 31 32 32 #ifndef LinkRelAttribute_h 33 #define LinkRelAttribute_h 33 #pragma once 34 34 35 #include "IconURL.h"36 35 #include <wtf/Forward.h> 36 #include <wtf/Optional.h> 37 37 38 38 namespace WebCore { 39 39 40 40 struct LinkRelAttribute { 41 enum class IconType { 42 Favicon, 43 TouchIcon, 44 TouchPrecomposedIcon, 45 }; 46 41 47 bool isStyleSheet { false }; 42 IconType iconType { InvalidIcon };48 Optional<IconType> iconType; 43 49 bool isAlternate { false }; 44 50 bool isDNSPrefetch { false }; … … 54 60 55 61 } 56 57 #endif -
trunk/Source/WebCore/html/parser/HTMLPreloadScanner.cpp
r200075 r200519 242 242 { 243 243 LinkRelAttribute parsedAttribute { attributeValue }; 244 return parsedAttribute.isStyleSheet && !parsedAttribute.isAlternate && parsedAttribute.iconType == InvalidIcon&& !parsedAttribute.isDNSPrefetch;244 return parsedAttribute.isStyleSheet && !parsedAttribute.isAlternate && !parsedAttribute.iconType && !parsedAttribute.isDNSPrefetch; 245 245 } 246 246 -
trunk/Source/WebCore/loader/FrameLoader.h
r199612 r200519 36 36 #include "FrameLoaderStateMachine.h" 37 37 #include "FrameLoaderTypes.h" 38 #include "IconURL.h"39 38 #include "LayoutMilestones.h" 40 39 #include "MixedContentChecker.h" -
trunk/Source/WebCore/loader/FrameLoaderClient.h
r199673 r200519 32 32 33 33 #include "FrameLoaderTypes.h" 34 #include "IconURL.h"35 34 #include "LayoutMilestones.h" 36 35 #include "ResourceLoadPriority.h" … … 52 51 #endif 53 52 #endif 54 55 typedef class _jobject* jobject;56 53 57 54 #if PLATFORM(COCOA) -
trunk/Source/WebCore/loader/icon/IconController.cpp
r183015 r200519 80 80 81 81 for (auto& linkElement : childrenOfType<HTMLLinkElement>(*head)) { 82 if (!(linkElement.iconType() & Favicon)) 82 if (!linkElement.iconType()) 83 continue; 84 if (*linkElement.iconType() != LinkRelAttribute::IconType::Favicon) 83 85 continue; 84 86 if (linkElement.href().isEmpty())
Note: See TracChangeset
for help on using the changeset viewer.