LayoutTests/ChangeLog

 12012-06-13 Pete Williamson <petewil@google.com>
 2
 3 Brought back some existing tests for favicons, and added new tests.
 4 The new tests cover changing the favicons via scripting.
 5 Made the existing tests work properly, and put them in test expectations
 6 https://bugs.webkit.org/show_bug.cgi?id=88665
 7
 8 Reviewed by NOBODY (OOPS!).
 9
 10 * fast/dom/icon-url-change-expected.txt: Added.
 11 * fast/dom/icon-url-change.html: Copied from LayoutTests/fast/dom/icon-url-property.html.
 12 * fast/dom/icon-url-list-expected.txt: Added.
 13 * fast/dom/icon-url-list.html: Copied from LayoutTests/fast/dom/icon-url-property.html.
 14 * fast/dom/icon-url-property-expected.txt:
 15 * fast/dom/icon-url-property.html:
 16 * platform/chromium/TestExpectations:
 17
1182012-06-13 Jeffrey Pfau <jpfau@apple.com>
219
320 Padding and borders can cause integer overflow in block layouts

LayoutTests/fast/dom/icon-url-property-expected.txt

1 main frame - didChangeIcons
21Original iconURL is: http://test.com/oldfavicon.ico
3 Setting new icon URL to: http://test.com/newfavion.ico
4 New iconURL is: http://test.com/newfavion.ico
 2Setting new icon URL to: http://test.com/newfavicon.ico
 3New iconURL is: http://test.com/newfavicon.ico
 4http://test.com/newfavicon.ico

LayoutTests/fast/dom/icon-url-property.html

@@function setFavIcon(iconURL) {
3131function runTests() {
3232 if (window.layoutTestController) {
3333 layoutTestController.dumpAsText();
34  layoutTestController.dumpIconChanges();
 34 layoutTestController.dumpIconList();
3535 }
3636 iconURL = document.getElementsByTagName("head")[0].getElementsByTagName("link")[0].href;
3737 debugOutput ('Original iconURL is: ' + iconURL);
38  newURL = 'http://test.com/newfavion.ico';
 38 newURL = 'http://test.com/newfavicon.ico';
3939 debugOutput ('Setting new icon URL to: ' + newURL);
4040 setFavIcon(newURL);
4141 iconURL = document.getElementsByTagName("head")[0].getElementsByTagName("link")[0].href;

LayoutTests/platform/chromium/TestExpectations

@@BUGWK71758 : fast/url/port.html = TEXT PASS
18901890// // Started failing at r58152
18911891// BUGWK38038 : fast/url/file-http-base.html = TEXT
18921892
1893 BUGWK33812 SKIP : fast/dom/icon-url-property.html = PASS
1894 
18951893// New layoutTestController function added at r57993
18961894BUGCR42696 : http/tests/xmlhttprequest/cross-origin-authorization-with-embedder.html = TIMEOUT
18971895

Source/WebCore/ChangeLog

 12012-06-13 Pete Williamson <petewil@google.com>
 2
 3 Need a short description and bug URL (OOPS!)
 4 Fixed a problem where the list of icon URLs was getting stale entries
 5 by providing a call to allow it to be recalculated from the DOM
 6 after any modifications made by scripting to the DOM.
 7 Also fixed a bug where the iconURL list was ending up with lots
 8 of duplicates.
 9 https://bugs.webkit.org/show_bug.cgi?id=88665
 10
 11 Reviewed by NOBODY (OOPS!).
 12
 13 Tests: fast/dom/icon-url-change.html
 14 fast/dom/icon-url-list.html
 15
 16 * dom/Document.cpp:
 17 (WebCore):
 18 (WebCore::Document::recalculateIconURLs):
 19 (WebCore::Document::addIconURL):
 20 * dom/Document.h:
 21 (Document):
 22 * html/HTMLLinkElement.cpp:
 23 (WebCore::HTMLLinkElement::iconType):
 24 (WebCore):
 25 (WebCore::HTMLLinkElement::iconSizes):
 26 * html/HTMLLinkElement.h:
 27 (HTMLLinkElement):
 28 * loader/icon/IconController.cpp:
 29 (WebCore::IconController::urlsForTypes):
 30
1312012-06-13 Shawn Singh <shawnsingh@chromium.org>
232
333 [chromium] Implement hit-testing for impl-side input handling in accelerated compositor

Source/WebCore/dom/Document.cpp

@@const Vector<IconURL>& Document::iconURLs() const
48174817 return m_iconURLs;
48184818}
48194819
 4820// instead of using the cached list, get the current list because
 4821// we expect some JS to have removed some elements
 4822void Document::recalculateIconURLs()
 4823{
 4824 static const char* const iconMIMEType = "image/x-icon";
 4825
 4826 // Clear the list of iconURLs. This is the only way to get rid of old urls in the list.
 4827 m_iconURLs.clear();
 4828
 4829 // Walk the children of the head looking for type = link, rel = "shortcut icon".
 4830 HTMLCollection* children = head()->children();
 4831 for (Node* child = children->firstItem(); child; child = children->nextItem()) {
 4832 if (!child->hasTagName(linkTag))
 4833 continue;
 4834 HTMLLinkElement* linkElement = static_cast<HTMLLinkElement*>(child);
 4835 if (!equalIgnoringCase(linkElement->type(), iconMIMEType)
 4836 || !(linkElement->iconType() == Favicon))
 4837 continue;
 4838 if (linkElement->href().isEmpty())
 4839 continue;
 4840
 4841 // Add the URL to our list. We put it at the front to ensure that icons seen later
 4842 // take precedence as required by the spec.
 4843 IconURL newURL(KURL(ParsedURLString, linkElement->href().string().ascii().data()),
 4844 linkElement->iconSizes().ascii().data(),
 4845 linkElement->type().ascii().data(),
 4846 linkElement->iconType());
 4847 m_iconURLs.prepend(newURL);
 4848 }
 4849
 4850 return;
 4851}
 4852
48204853void Document::addIconURL(const String& url, const String& mimeType, const String& sizes, IconType iconType)
48214854{
48224855 if (url.isEmpty())
48234856 return;
48244857
 4858 // Ensure URL is not already in the list before adding it.
 4859 for (size_t index = 0; index < m_iconURLs.size(); ++index) {
 4860 if (m_iconURLs.at(index).m_iconURL.string() == url)
 4861 return;
 4862 }
 4863
48254864 // FIXME - <rdar://problem/4727645> - At some point in the future, we might actually honor the "mimeType"
48264865 IconURL newURL(KURL(ParsedURLString, url), sizes, mimeType, iconType);
48274866 m_iconURLs.append(newURL);

Source/WebCore/dom/Document.h

@@public:
925925 void setHasNodesWithPlaceholderStyle() { m_hasNodesWithPlaceholderStyle = true; }
926926
927927 const Vector<IconURL>& iconURLs() const;
 928
 929 void recalculateIconURLs();
 930
928931 void addIconURL(const String& url, const String& mimeType, const String& size, IconType);
929932
930933 void setUseSecureKeyboardEntryWhenActive(bool);

Source/WebCore/html/HTMLLinkElement.cpp

@@String HTMLLinkElement::type() const
418418 return getAttribute(typeAttr);
419419}
420420
 421IconType HTMLLinkElement::iconType() const
 422{
 423 return m_relAttribute.m_iconType;
 424}
 425
 426String HTMLLinkElement::iconSizes() const
 427{
 428 return m_sizes->toString();
 429}
 430
421431void HTMLLinkElement::addSubresourceAttributeURLs(ListHashSet<KURL>& urls) const
422432{
423433 HTMLElement::addSubresourceAttributeURLs(urls);

Source/WebCore/html/HTMLLinkElement.h

@@public:
5555
5656 String type() const;
5757
 58 IconType iconType() const;
 59
 60 String iconSizes() const;
 61
5862 CSSStyleSheet* sheet() const { return m_sheet.get(); }
5963
6064 bool styleSheetIsLoading() const;

Source/WebCore/loader/icon/IconController.cpp

@@IconURL IconController::iconURL(IconType iconType) const
8282
8383IconURLs IconController::urlsForTypes(int iconTypes)
8484{
 85 // Reset the document list to get rid of any old icons.
 86 m_frame->document()->recalculateIconURLs();
 87
8588 IconURLs iconURLs;
8689 if (m_frame->tree() && m_frame->tree()->parent())
8790 return iconURLs;
8891
 92 // Start by adding the favicon from the current document if we have one, if not, use the default favicon.
8993 if (iconTypes & Favicon && !appendToIconURLs(Favicon, &iconURLs))
9094 iconURLs.append(defaultURL(Favicon));
9195

Source/WebKit/chromium/ChangeLog

 12012-06-13 Pete Williamson <petewil@google.com>
 2
 3 Exposed methods we need for unit testing to get the list of icon URLs
 4 and to re-calculate the list of icon URLs
 5 https://bugs.webkit.org/show_bug.cgi?id=88665
 6
 7 Reviewed by NOBODY (OOPS!).
 8
 9 * public/WebDocument.h:
 10 (WebKit):
 11 (WebDocument):
 12 * src/WebDocument.cpp:
 13 (WebKit):
 14 (WebKit::WebDocument::iconURLs):
 15 (WebKit::WebDocument::recalculateIconURLs):
 16
1172012-06-13 Shawn Singh <shawnsingh@chromium.org>
218
319 [chromium] Implement hit-testing for impl-side input handling in accelerated compositor

Source/WebKit/chromium/public/WebDocument.h

@@class WebNodeCollection;
5454class WebNodeList;
5555class WebString;
5656class WebURL;
 57class WebIconURL;
5758
5859// Provides readonly access to some properties of a DOM document.
5960class WebDocument : public WebNode {

@@public:
103104 WEBKIT_EXPORT WebElement fullScreenElement() const;
104105 WEBKIT_EXPORT WebDOMEvent createEvent(const WebString& eventType);
105106 WEBKIT_EXPORT WebReferrerPolicy referrerPolicy() const;
 107 WEBKIT_EXPORT WebVector<WebIconURL> iconURLs() const;
 108 WEBKIT_EXPORT void recalculateIconURLs();
106109
107110 // Accessibility support. These methods should only be called on the
108111 // top-level document, because one accessibility cache spans all of

Source/WebKit/chromium/src/WebDocument.cpp

5252#include "WebElement.h"
5353#include "WebFormElement.h"
5454#include "WebFrameImpl.h"
 55#include "WebIconURL.h"
5556#include "WebNodeCollection.h"
5657#include "WebNodeList.h"
5758#include "platform/WebURL.h"

@@WebReferrerPolicy WebDocument::referrerPolicy() const
214215 return static_cast<WebReferrerPolicy>(constUnwrap<Document>()->referrerPolicy());
215216}
216217
 218
 219WebVector<WebIconURL> WebDocument::iconURLs() const
 220{
 221 Vector<IconURL> iconURLs = const_cast<Document*>(constUnwrap<Document>())->iconURLs();
 222 size_t sourceLength = iconURLs.size();
 223 Vector<WebIconURL> temp;
 224 temp.reserveCapacity(sourceLength);
 225 // copy the Vector of IconURLs to a WebVector of WebIconURLs
 226 for (size_t i = 0; i < sourceLength; ++i)
 227 temp.append(WebIconURL(iconURLs.at(i)));
 228
 229 return temp;
 230}
 231
 232void WebDocument::recalculateIconURLs()
 233{
 234 const_cast<Document*>(constUnwrap<Document>())->recalculateIconURLs();
 235}
 236
217237WebAccessibilityObject WebDocument::accessibilityObject() const
218238{
219239 const Document* document = constUnwrap<Document>();

Tools/ChangeLog

 12012-06-13 Pete Williamson <petewil@google.com>
 2
 3 Updating the layout test controller and test shell to add the capability
 4 to dump the list of favicons used by a document for unit testing
 5 https://bugs.webkit.org/show_bug.cgi?id=88665
 6
 7 Reviewed by NOBODY (OOPS!).
 8
 9 * DumpRenderTree/LayoutTestController.cpp:
 10 (LayoutTestController::LayoutTestController):
 11 (dumpIconListCallback):
 12 (LayoutTestController::staticFunctions):
 13 * DumpRenderTree/LayoutTestController.h:
 14 (LayoutTestController::dumpIconList):
 15 (LayoutTestController::setDumpIconList):
 16 (LayoutTestController):
 17 * DumpRenderTree/chromium/LayoutTestController.cpp:
 18 (LayoutTestController::LayoutTestController):
 19 (LayoutTestController::dumpIconList):
 20 (LayoutTestController::reset):
 21 * DumpRenderTree/chromium/LayoutTestController.h:
 22 (LayoutTestController):
 23 (LayoutTestController::shouldDumpIconList):
 24 (LayoutTestController::setShouldDumpIconList):
 25 * DumpRenderTree/chromium/TestShell.cpp:
 26 (TestShell::runFileTest):
 27 (TestShell::dump):
 28
1292012-06-13 Dirk Pranke <dpranke@chromium.org>
230
331 new-run-webkit-tests does not support --32-bit like ORWT did

Tools/DumpRenderTree/LayoutTestController.cpp

@@LayoutTestController::LayoutTestController(const std::string& testPathOrURL, con
5757 , m_dumpDatabaseCallbacks(false)
5858 , m_dumpEditingCallbacks(false)
5959 , m_dumpFrameLoadCallbacks(false)
 60 , m_dumpIconList(false)
6061 , m_dumpProgressFinishedCallback(false)
6162 , m_dumpUserGestureInFrameLoadCallbacks(false)
6263 , m_dumpHistoryDelegateCallbacks(false)

@@static JSValueRef dumpFrameLoadCallbacksCallback(JSContextRef context, JSObjectR
210211 return JSValueMakeUndefined(context);
211212}
212213
 214
 215static JSValueRef dumpIconListCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
 216{
 217 LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
 218 controller->setDumpIconList(true);
 219
 220 return JSValueMakeUndefined(context);
 221}
 222
 223
213224static JSValueRef dumpProgressFinishedCallbackCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
214225{
215226 LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));

@@JSStaticFunction* LayoutTestController::staticFunctions()
23022313 { "dumpDatabaseCallbacks", dumpDatabaseCallbacksCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
23032314 { "dumpEditingCallbacks", dumpEditingCallbacksCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
23042315 { "dumpFrameLoadCallbacks", dumpFrameLoadCallbacksCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
 2316 { "dumpIconList", dumpIconListCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
23052317 { "dumpProgressFinishedCallback", dumpProgressFinishedCallbackCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
23062318 { "dumpUserGestureInFrameLoadCallbacks", dumpUserGestureInFrameLoadCallbacksCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
23072319 { "dumpResourceLoadCallbacks", dumpResourceLoadCallbacksCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },

Tools/DumpRenderTree/LayoutTestController.h

@@public:
184184 bool dumpFrameLoadCallbacks() const { return m_dumpFrameLoadCallbacks; }
185185 void setDumpFrameLoadCallbacks(bool dumpFrameLoadCallbacks) { m_dumpFrameLoadCallbacks = dumpFrameLoadCallbacks; }
186186
 187 bool dumpIconList() const { return m_dumpIconList; }
 188 void setDumpIconList(bool dumpIconList) { m_dumpIconList = dumpIconList; }
 189
187190 bool dumpProgressFinishedCallback() const { return m_dumpProgressFinishedCallback; }
188191 void setDumpProgressFinishedCallback(bool dumpProgressFinishedCallback) { m_dumpProgressFinishedCallback = dumpProgressFinishedCallback; }
189192

@@private:
381384 bool m_dumpDatabaseCallbacks;
382385 bool m_dumpEditingCallbacks;
383386 bool m_dumpFrameLoadCallbacks;
 387 bool m_dumpIconList;
384388 bool m_dumpProgressFinishedCallback;
385389 bool m_dumpUserGestureInFrameLoadCallbacks;
386390 bool m_dumpHistoryDelegateCallbacks;

Tools/DumpRenderTree/chromium/LayoutTestController.cpp

@@LayoutTestController::LayoutTestController(TestShell* shell)
138138 bindMethod("dumpChildFrameScrollPositions", &LayoutTestController::dumpChildFrameScrollPositions);
139139 bindMethod("dumpDatabaseCallbacks", &LayoutTestController::dumpDatabaseCallbacks);
140140 bindMethod("dumpEditingCallbacks", &LayoutTestController::dumpEditingCallbacks);
 141 bindMethod("dumpIconList", &LayoutTestController::dumpIconList);
141142 bindMethod("dumpFrameLoadCallbacks", &LayoutTestController::dumpFrameLoadCallbacks);
142143 bindMethod("dumpProgressFinishedCallback", &LayoutTestController::dumpProgressFinishedCallback);
143144 bindMethod("dumpUserGestureInFrameLoadCallbacks", &LayoutTestController::dumpUserGestureInFrameLoadCallbacks);

@@void LayoutTestController::dumpFrameLoadCallbacks(const CppArgumentList&, CppVar
383384 result->setNull();
384385}
385386
 387void LayoutTestController::dumpIconList(const CppArgumentList& arguments, CppVariant* result)
 388{
 389 m_dumpIconList = true;
 390}
 391
386392void LayoutTestController::dumpProgressFinishedCallback(const CppArgumentList&, CppVariant* result)
387393{
388394 m_dumpProgressFinishedCallback = true;

@@void LayoutTestController::reset()
658664 m_dumpCreateView = false;
659665 m_dumpEditingCallbacks = false;
660666 m_dumpFrameLoadCallbacks = false;
 667 m_dumpIconList = false;
661668 m_dumpProgressFinishedCallback = false;
662669 m_dumpUserGestureInFrameLoadCallbacks = false;
663670 m_dumpResourceLoadCallbacks = false;

Tools/DumpRenderTree/chromium/LayoutTestController.h

@@public:
9191 // ignores any that may be present.
9292 void dumpFrameLoadCallbacks(const CppArgumentList&, CppVariant*);
9393
 94 // This function sets a flag that tells the test_shell to print a list of
 95 // Icon URLs for favicons in the HTML head element of the document
 96 void dumpIconList(const CppArgumentList&, CppVariant*);
 97
9498 // This function sets a flag that tells the test_shell to print a line of
9599 // descriptive text for the progress finished callback. It takes no
96100 // arguments, and ignores any that may be present.

@@public:
460464 void setShouldDumpAsAudio(bool dumpAsAudio) { m_dumpAsAudio = dumpAsAudio; }
461465 bool shouldDumpAsText() { return m_dumpAsText; }
462466 void setShouldDumpAsText(bool value) { m_dumpAsText = value; }
 467 bool shouldDumpIconList() { return m_dumpIconList; }
 468 void setShouldDumpIconList(bool value) { m_dumpIconList = value; }
463469 bool shouldDumpEditingCallbacks() { return m_dumpEditingCallbacks; }
464470 bool shouldDumpFrameLoadCallbacks() { return m_dumpFrameLoadCallbacks; }
465471 void setShouldDumpFrameLoadCallbacks(bool value) { m_dumpFrameLoadCallbacks = value; }

@@private:
594600 // text representation of the renderer.
595601 bool m_dumpAsText;
596602
 603 // If true, test_shell will dump the list of favicons in the header
 604 bool m_dumpIconList;
 605
597606 // If true, the test_shell will output a base64 encoded WAVE file.
598607 bool m_dumpAsAudio;
599608

Tools/DumpRenderTree/chromium/TestShell.cpp

4343#include "WebFrame.h"
4444#include "WebHistoryItem.h"
4545#include "WebIDBFactory.h"
 46#include "WebIconURL.h"
4647#include "WebTestingSupport.h"
4748#include "platform/WebThread.h"
4849#include "WebKit.h"

@@void TestShell::runFileTest(const TestParams& params)
260261 m_layoutTestController->setShouldGeneratePixelResults(false);
261262 }
262263
 264 if (testUrl.find("/dumpIconList/") != string::npos
 265 || testUrl.find("\\dumpIconList\\") != string::npos)
 266 m_layoutTestController->setShouldDumpIconList(true);
 267
263268 if (testUrl.find("/inspector/") != string::npos
264269 || testUrl.find("\\inspector\\") != string::npos)
265270 showDevTools();

@@void TestShell::dump()
550555 if (!frame)
551556 return;
552557 bool shouldDumpAsText = m_layoutTestController->shouldDumpAsText();
 558 bool shouldDumpIconList = m_layoutTestController->shouldDumpIconList();
553559 bool shouldDumpAsAudio = m_layoutTestController->shouldDumpAsAudio();
554560 bool shouldGeneratePixelResults = m_layoutTestController->shouldGeneratePixelResults();
555561 bool shouldDumpAsPrinted = m_layoutTestController->isPrinting();

@@void TestShell::dump()
601607 }
602608 if (m_layoutTestController->shouldDumpBackForwardList())
603609 printf("%s", dumpAllBackForwardLists().c_str());
 610 // if the test has asked for a list of Icon URLs, provide it
 611 if (shouldDumpIconList) {
 612 // first recalculate to get the most current list after any DOM manipulations
 613 frame->document().recalculateIconURLs();
 614 WebVector<WebIconURL> iconURLs;
 615 iconURLs = frame->document().iconURLs();
 616 int listSize = iconURLs.size();
 617 for (int index = 0; index < listSize; ++index)
 618 printf("%s\n", iconURLs[index].iconURL().spec().data());
 619 }
604620 }
605621 if (dumpedAnything && m_params.printSeparators)
606622 m_printer->handleTextFooter();