Diff
Modified: trunk/LayoutTests/ChangeLog (221625 => 221626)
--- trunk/LayoutTests/ChangeLog 2017-09-05 18:08:14 UTC (rev 221625)
+++ trunk/LayoutTests/ChangeLog 2017-09-05 18:15:56 UTC (rev 221626)
@@ -1,3 +1,17 @@
+2017-09-05 Matt Lewis <[email protected]>
+
+ Unreviewed, rolling out r221603.
+
+ This caused accessibility/mac/select-element-selection-with-
+ optgroups.html to consistently timeout on macOS
+
+ Reverted changeset:
+
+ "Fix a few minor problems found while working toward removing
+ unneeded calls to updateStyle"
+ https://bugs.webkit.org/show_bug.cgi?id=176279
+ http://trac.webkit.org/changeset/221603
+
2017-09-05 Joseph Pecoraro <[email protected]>
test262: Completion values for control flow do not match the spec
Modified: trunk/LayoutTests/svg/hittest/svg-tooltip.svg (221625 => 221626)
--- trunk/LayoutTests/svg/hittest/svg-tooltip.svg 2017-09-05 18:08:14 UTC (rev 221625)
+++ trunk/LayoutTests/svg/hittest/svg-tooltip.svg 2017-09-05 18:15:56 UTC (rev 221626)
@@ -19,12 +19,9 @@
function testTooltipForElement(element)
{
+ console.assert(window.internals);
console.assert(element.id);
var testCaseName = "<" + element.tagName + ' id="' + element.id + '"' + ">";
- if (!window.internals) {
- log("---- Could not test tooltip for " + testCaseName + "; no window.internals.");
- return;
- }
var tooltip = internals.toolTipFromElement(element);
var expectedTooltip = element.getAttribute("data-expected-tooltip");
if (tooltip == expectedTooltip)
@@ -44,6 +41,9 @@
function runTest()
{
+ if (!window.testRunner || !window.internals)
+ return;
+
testDocumentTitle();
var testCases = document.querySelectorAll(".test-case");
for (var i = 0; i < testCases.length; ++i)
Modified: trunk/Source/WebCore/ChangeLog (221625 => 221626)
--- trunk/Source/WebCore/ChangeLog 2017-09-05 18:08:14 UTC (rev 221625)
+++ trunk/Source/WebCore/ChangeLog 2017-09-05 18:15:56 UTC (rev 221626)
@@ -1,3 +1,17 @@
+2017-09-05 Matt Lewis <[email protected]>
+
+ Unreviewed, rolling out r221603.
+
+ This caused accessibility/mac/select-element-selection-with-
+ optgroups.html to consistently timeout on macOS
+
+ Reverted changeset:
+
+ "Fix a few minor problems found while working toward removing
+ unneeded calls to updateStyle"
+ https://bugs.webkit.org/show_bug.cgi?id=176279
+ http://trac.webkit.org/changeset/221603
+
2017-09-05 Youenn Fablet <[email protected]>
Allow retrieving Cache Storage records for a given URL only
Modified: trunk/Source/WebCore/dom/Document.cpp (221625 => 221626)
--- trunk/Source/WebCore/dom/Document.cpp 2017-09-05 18:08:14 UTC (rev 221625)
+++ trunk/Source/WebCore/dom/Document.cpp 2017-09-05 18:15:56 UTC (rev 221626)
@@ -1542,54 +1542,18 @@
updateTitle({ title, LTR });
}
-void Document::updateTitleElement(Element& changingTitleElement)
+void Document::updateTitleElement(Element* newTitleElement)
{
- auto findHTMLTitle = [] (Document& document) -> Element* {
- return descendantsOfType<HTMLTitleElement>(document).first();
- };
- auto isHTMLTitle = [] (Element& element) {
- return is<HTMLTitleElement>(element);
- };
- auto isHTMLTitleEligible = [] (Element& element) {
- return element.isConnected() && !element.isInShadowTree();
- };
-
- auto findSVGTitle = [] (Document& document) -> Element* {
- return childrenOfType<SVGTitleElement>(*document.documentElement()).first();
- };
- auto isSVGTitle = [] (Element& element) {
- return is<SVGTitleElement>(element);
- };
- auto isSVGTitleEligible = [] (Element& element) {
- return element.parentNode() == element.document().documentElement();
- };
-
- // Most documents use HTML title rules.
- // Documents with SVG document elements use SVG title rules.
- bool useSVGTitle = is<SVGSVGElement>(documentElement());
- auto findTitle = useSVGTitle ? findSVGTitle : findHTMLTitle;
- auto isTitle = useSVGTitle ? isSVGTitle : isHTMLTitle;
- auto isTitleEligible = useSVGTitle ? isSVGTitleEligible : isHTMLTitleEligible;
-
- if (!isTitle(changingTitleElement)) {
- ASSERT(m_titleElement == findTitle(*this));
- return;
- }
-
- Element* newTitleElement;
- if (m_titleElement)
- newTitleElement = findTitle(*this);
+ if (is<SVGSVGElement>(documentElement()))
+ m_titleElement = childrenOfType<SVGTitleElement>(*documentElement()).first();
else {
- // Optimized common case: We have no title element yet.
- // We can figure out which title element should be used without searching.
- newTitleElement = isTitleEligible(changingTitleElement) ? &changingTitleElement : nullptr;
- ASSERT(newTitleElement == findTitle(*this));
+ if (m_titleElement) {
+ if (isHTMLDocument() || isXHTMLDocument())
+ m_titleElement = descendantsOfType<HTMLTitleElement>(*this).first();
+ } else
+ m_titleElement = newTitleElement;
}
- if (m_titleElement == newTitleElement)
- return;
-
- m_titleElement = newTitleElement;
updateTitleFromTitleElement();
}
@@ -1598,7 +1562,7 @@
if (m_titleElement == &titleElement)
return;
- updateTitleElement(titleElement);
+ updateTitleElement(&titleElement);
}
void Document::titleElementRemoved(Element& titleElement)
@@ -1606,7 +1570,7 @@
if (m_titleElement != &titleElement)
return;
- updateTitleElement(titleElement);
+ updateTitleElement(nullptr);
}
void Document::titleElementTextChanged(Element& titleElement)
Modified: trunk/Source/WebCore/dom/Document.h (221625 => 221626)
--- trunk/Source/WebCore/dom/Document.h 2017-09-05 18:08:14 UTC (rev 221625)
+++ trunk/Source/WebCore/dom/Document.h 2017-09-05 18:15:56 UTC (rev 221626)
@@ -1378,7 +1378,7 @@
void detachFromFrame() { observeFrame(nullptr); }
- void updateTitleElement(Element& changingTitleElement);
+ void updateTitleElement(Element* newTitleElement);
void frameDestroyed() final;
void commonTeardown();
Modified: trunk/Source/WebCore/html/HTMLTitleElement.cpp (221625 => 221626)
--- trunk/Source/WebCore/html/HTMLTitleElement.cpp 2017-09-05 18:08:14 UTC (rev 221625)
+++ trunk/Source/WebCore/html/HTMLTitleElement.cpp 2017-09-05 18:15:56 UTC (rev 221626)
@@ -2,7 +2,7 @@
* Copyright (C) 1999 Lars Knoll ([email protected])
* (C) 1999 Antti Koivisto ([email protected])
* (C) 2001 Dirk Mueller ([email protected])
- * Copyright (C) 2003-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2003, 2010 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -53,7 +53,8 @@
Node::InsertionNotificationRequest HTMLTitleElement::insertedInto(ContainerNode& insertionPoint)
{
HTMLElement::insertedInto(insertionPoint);
- document().titleElementAdded(*this);
+ if (isConnected() && !isInShadowTree())
+ document().titleElementAdded(*this);
return InsertionDone;
}
@@ -60,7 +61,8 @@
void HTMLTitleElement::removedFrom(ContainerNode& insertionPoint)
{
HTMLElement::removedFrom(insertionPoint);
- document().titleElementRemoved(*this);
+ if (insertionPoint.isConnected() && !insertionPoint.isInShadowTree())
+ document().titleElementRemoved(*this);
}
void HTMLTitleElement::childrenChanged(const ChildChange& change)
Modified: trunk/Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp (221625 => 221626)
--- trunk/Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp 2017-09-05 18:08:14 UTC (rev 221625)
+++ trunk/Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp 2017-09-05 18:15:56 UTC (rev 221626)
@@ -192,9 +192,29 @@
bool MockRealtimeVideoSource::applySize(const IntSize& size)
{
m_baseFontSize = size.height() * .08;
+ FontCascadeDescription fontDescription;
+ fontDescription.setOneFamily("Courier");
+ fontDescription.setSpecifiedSize(m_baseFontSize);
+ fontDescription.setComputedSize(m_baseFontSize);
+ fontDescription.setWeight(FontSelectionValue(500));
+
+ m_timeFont = FontCascade(fontDescription, 0, 0);
+ m_timeFont.update(nullptr);
+
m_bipBopFontSize = m_baseFontSize * 2.5;
+ fontDescription.setSpecifiedSize(m_bipBopFontSize);
+ fontDescription.setComputedSize(m_bipBopFontSize);
+ m_bipBopFont = FontCascade(fontDescription, 0, 0);
+ m_bipBopFont.update(nullptr);
+
m_statsFontSize = m_baseFontSize * .5;
+ fontDescription.setSpecifiedSize(m_statsFontSize);
+ fontDescription.setComputedSize(m_statsFontSize);
+ m_statsFont = FontCascade(fontDescription, 0, 0);
+ m_statsFont.update(nullptr);
+
m_imageBuffer = nullptr;
+
return true;
}
@@ -293,43 +313,24 @@
unsigned minutes = seconds / 60 % 60;
unsigned hours = minutes / 60 % 60;
- FontCascadeDescription fontDescription;
- fontDescription.setOneFamily("Courier");
- fontDescription.setWeight(FontSelectionValue(500));
-
- fontDescription.setSpecifiedSize(m_baseFontSize);
- fontDescription.setComputedSize(m_baseFontSize);
- FontCascade timeFont { fontDescription, 0, 0 };
- timeFont.update(nullptr);
-
- fontDescription.setSpecifiedSize(m_bipBopFontSize);
- fontDescription.setComputedSize(m_bipBopFontSize);
- FontCascade bipBopFont { fontDescription, 0, 0 };
- bipBopFont.update(nullptr);
-
- fontDescription.setSpecifiedSize(m_statsFontSize);
- fontDescription.setComputedSize(m_statsFontSize);
- FontCascade statsFont { fontDescription, 0, 0 };
- statsFont.update(nullptr);
-
IntSize size = this->size();
FloatPoint timeLocation(size.width() * .05, size.height() * .15);
context.setFillColor(Color::white);
context.setTextDrawingMode(TextModeFill);
String string = String::format("%02u:%02u:%02u.%03u", hours, minutes, seconds, milliseconds % 1000);
- context.drawText(timeFont, TextRun((StringView(string))), timeLocation);
+ context.drawText(m_timeFont, TextRun((StringView(string))), timeLocation);
string = String::format("%06u", m_frameNumber++);
timeLocation.move(0, m_baseFontSize);
- context.drawText(timeFont, TextRun((StringView(string))), timeLocation);
+ context.drawText(m_timeFont, TextRun((StringView(string))), timeLocation);
FloatPoint statsLocation(size.width() * .65, size.height() * .75);
string = String::format("Frame rate: %ffps", frameRate());
- context.drawText(statsFont, TextRun((StringView(string))), statsLocation);
+ context.drawText(m_statsFont, TextRun((StringView(string))), statsLocation);
string = String::format("Size: %u x %u", size.width(), size.height());
statsLocation.move(0, m_statsFontSize);
- context.drawText(statsFont, TextRun((StringView(string))), statsLocation);
+ context.drawText(m_statsFont, TextRun((StringView(string))), statsLocation);
const char* camera;
switch (facingMode()) {
@@ -351,7 +352,7 @@
}
string = String::format("Camera: %s", camera);
statsLocation.move(0, m_statsFontSize);
- context.drawText(statsFont, TextRun((StringView(string))), statsLocation);
+ context.drawText(m_statsFont, TextRun((StringView(string))), statsLocation);
FloatPoint bipBopLocation(size.width() * .6, size.height() * .6);
unsigned frameMod = m_frameNumber % 60;
@@ -358,11 +359,11 @@
if (frameMod <= 15) {
context.setFillColor(Color::cyan);
String bip(ASCIILiteral("Bip"));
- context.drawText(bipBopFont, TextRun(StringView(bip)), bipBopLocation);
+ context.drawText(m_bipBopFont, TextRun(StringView(bip)), bipBopLocation);
} else if (frameMod > 30 && frameMod <= 45) {
context.setFillColor(Color::yellow);
String bop(ASCIILiteral("Bop"));
- context.drawText(bipBopFont, TextRun(StringView(bop)), bipBopLocation);
+ context.drawText(m_bipBopFont, TextRun(StringView(bop)), bipBopLocation);
}
}
Modified: trunk/Source/WebCore/platform/mock/MockRealtimeVideoSource.h (221625 => 221626)
--- trunk/Source/WebCore/platform/mock/MockRealtimeVideoSource.h 2017-09-05 18:08:14 UTC (rev 221625)
+++ trunk/Source/WebCore/platform/mock/MockRealtimeVideoSource.h 2017-09-05 18:15:56 UTC (rev 221626)
@@ -85,8 +85,13 @@
void delaySamples(float) override;
float m_baseFontSize { 0 };
+ FontCascade m_timeFont;
+
float m_bipBopFontSize { 0 };
+ FontCascade m_bipBopFont;
+
float m_statsFontSize { 0 };
+ FontCascade m_statsFont;
mutable std::unique_ptr<ImageBuffer> m_imageBuffer;
Modified: trunk/Source/WebCore/rendering/RenderTreeAsText.cpp (221625 => 221626)
--- trunk/Source/WebCore/rendering/RenderTreeAsText.cpp 2017-09-05 18:08:14 UTC (rev 221625)
+++ trunk/Source/WebCore/rendering/RenderTreeAsText.cpp 2017-09-05 18:15:56 UTC (rev 221626)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -930,25 +930,9 @@
return ts.release();
}
-static void updateLayoutIgnoringPendingStylesheetsIncludingSubframes(Document& document)
-{
- document.updateLayoutIgnorePendingStylesheets();
- auto* frame = document.frame();
- for (auto* subframe = frame; subframe; subframe = subframe->tree().traverseNext(frame)) {
- if (auto* document = subframe->document())
- document->updateLayoutIgnorePendingStylesheets();
- }
-}
-
String externalRepresentation(Frame* frame, RenderAsTextBehavior behavior)
{
- ASSERT(frame);
- ASSERT(frame->document());
-
- if (!(behavior & RenderAsTextDontUpdateLayout))
- updateLayoutIgnoringPendingStylesheetsIncludingSubframes(*frame->document());
-
- auto* renderer = frame->contentRenderer();
+ RenderView* renderer = frame->contentRenderer();
if (!renderer)
return String();
@@ -955,6 +939,8 @@
PrintContext printContext(frame);
if (behavior & RenderAsTextPrintingMode)
printContext.begin(renderer->width());
+ if (!(behavior & RenderAsTextDontUpdateLayout))
+ frame->document()->updateLayout();
return externalRepresentation(*renderer, behavior);
}
@@ -961,18 +947,14 @@
String externalRepresentation(Element* element, RenderAsTextBehavior behavior)
{
- ASSERT(element);
-
- // This function doesn't support printing mode.
+ RenderElement* renderer = element->renderer();
+ if (!is<RenderBox>(renderer))
+ return String();
+ // Doesn't support printing mode.
ASSERT(!(behavior & RenderAsTextPrintingMode));
-
if (!(behavior & RenderAsTextDontUpdateLayout))
- updateLayoutIgnoringPendingStylesheetsIncludingSubframes(element->document());
-
- auto* renderer = element->renderer();
- if (!is<RenderBox>(renderer))
- return String();
-
+ element->document().updateLayout();
+
return externalRepresentation(downcast<RenderBox>(*renderer), behavior | RenderAsTextShowAllLayers);
}
Modified: trunk/Source/WebCore/svg/SVGTitleElement.cpp (221625 => 221626)
--- trunk/Source/WebCore/svg/SVGTitleElement.cpp 2017-09-05 18:08:14 UTC (rev 221625)
+++ trunk/Source/WebCore/svg/SVGTitleElement.cpp 2017-09-05 18:15:56 UTC (rev 221626)
@@ -1,7 +1,7 @@
/*
* Copyright (C) 2004, 2005 Nikolas Zimmermann <[email protected]>
* Copyright (C) 2004, 2005, 2006 Rob Buis <[email protected]>
- * Copyright (C) 2016-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -24,6 +24,7 @@
#include "Document.h"
#include "SVGNames.h"
+#include "Text.h"
namespace WebCore {
@@ -38,17 +39,22 @@
return adoptRef(*new SVGTitleElement(tagName, document));
}
-Node::InsertionNotificationRequest SVGTitleElement::insertedInto(ContainerNode& insertionPoint)
+Node::InsertionNotificationRequest SVGTitleElement::insertedInto(ContainerNode& rootParent)
{
- SVGElement::insertedInto(insertionPoint);
- document().titleElementAdded(*this);
+ SVGElement::insertedInto(rootParent);
+ if (!rootParent.isConnected())
+ return InsertionDone;
+
+ if (firstChild() && document().isSVGDocument())
+ document().titleElementAdded(*this);
return InsertionDone;
}
-void SVGTitleElement::removedFrom(ContainerNode& insertionPoint)
+void SVGTitleElement::removedFrom(ContainerNode& rootParent)
{
- SVGElement::removedFrom(insertionPoint);
- document().titleElementRemoved(*this);
+ SVGElement::removedFrom(rootParent);
+ if (rootParent.isConnected() && document().isSVGDocument())
+ document().titleElementRemoved(*this);
}
void SVGTitleElement::childrenChanged(const ChildChange& change)
Modified: trunk/Source/WebCore/testing/Internals.cpp (221625 => 221626)
--- trunk/Source/WebCore/testing/Internals.cpp 2017-09-05 18:08:14 UTC (rev 221625)
+++ trunk/Source/WebCore/testing/Internals.cpp 2017-09-05 18:15:56 UTC (rev 221626)
@@ -2242,7 +2242,6 @@
if (!document.frame())
return Exception { InvalidAccessError };
- document.updateLayoutIgnorePendingStylesheets();
return document.frame()->layerTreeAsText(toLayerTreeFlags(flags));
}
@@ -2252,8 +2251,6 @@
if (!document || !document->frame())
return Exception { InvalidAccessError };
- element.document().updateLayoutIgnorePendingStylesheets();
-
if (!element.renderer() || !element.renderer()->hasLayer())
return Exception { NotFoundError };
@@ -2319,8 +2316,6 @@
if (!document || !document->renderView())
return Exception { InvalidAccessError };
- element.document().updateLayoutIgnorePendingStylesheets();
-
if (!element.renderer())
return Exception { InvalidAccessError };
@@ -2346,8 +2341,6 @@
if (!document || !document->renderView())
return Exception { InvalidAccessError };
- element.document().updateLayoutIgnorePendingStylesheets();
-
if (!element.renderer())
return Exception { InvalidAccessError };
@@ -2373,8 +2366,6 @@
if (!document || !document->renderView())
return Exception { InvalidAccessError };
- element.document().updateLayoutIgnorePendingStylesheets();
-
if (!element.renderer())
return Exception { InvalidAccessError };
@@ -2401,8 +2392,6 @@
if (!document || !document->renderView())
return Exception { InvalidAccessError };
- element.document().updateLayoutIgnorePendingStylesheets();
-
if (!element.renderer())
return Exception { InvalidAccessError };
@@ -3044,10 +3033,9 @@
bool Internals::isSelectPopupVisible(HTMLSelectElement& element)
{
- element.document().updateLayoutIgnorePendingStylesheets();
-
auto* renderer = element.renderer();
- if (!is<RenderMenuList>(renderer))
+ ASSERT(renderer);
+ if (!is<RenderMenuList>(*renderer))
return false;
#if !PLATFORM(IOS)
@@ -3154,7 +3142,8 @@
ExceptionOr<bool> Internals::isPluginUnavailabilityIndicatorObscured(Element& element)
{
- if (!is<HTMLPlugInElement>(element))
+ auto* renderer = element.renderer();
+ if (!is<HTMLPlugInElement>(element) || !is<RenderEmbeddedObject>(renderer))
return Exception { InvalidAccessError };
return downcast<HTMLPlugInElement>(element).isReplacementObscured();
@@ -3530,7 +3519,7 @@
if (!document || !document->frame())
return Exception { InvalidAccessError };
- document->updateLayoutIgnorePendingStylesheets();
+ document->updateLayout();
return MockPageOverlayClient::singleton().layerTreeAsText(document->frame()->mainFrame(), toLayerTreeFlags(flags));
}
@@ -3673,11 +3662,11 @@
ExceptionOr<String> Internals::scrollSnapOffsets(Element& element)
{
- element.document().updateLayoutIgnorePendingStylesheets();
-
if (!element.renderBox())
return String();
+ element.document().updateLayout();
+
RenderBox& box = *element.renderBox();
ScrollableArea* scrollableArea;
Modified: trunk/Tools/ChangeLog (221625 => 221626)
--- trunk/Tools/ChangeLog 2017-09-05 18:08:14 UTC (rev 221625)
+++ trunk/Tools/ChangeLog 2017-09-05 18:15:56 UTC (rev 221626)
@@ -1,3 +1,17 @@
+2017-09-05 Matt Lewis <[email protected]>
+
+ Unreviewed, rolling out r221603.
+
+ This caused accessibility/mac/select-element-selection-with-
+ optgroups.html to consistently timeout on macOS
+
+ Reverted changeset:
+
+ "Fix a few minor problems found while working toward removing
+ unneeded calls to updateStyle"
+ https://bugs.webkit.org/show_bug.cgi?id=176279
+ http://trac.webkit.org/changeset/221603
+
2017-09-05 Youenn Fablet <[email protected]>
WebKitTestRunner should set the cache storage directory path
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm (221625 => 221626)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm 2017-09-05 18:08:14 UTC (rev 221625)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm 2017-09-05 18:15:56 UTC (rev 221626)
@@ -1415,7 +1415,7 @@
void AccessibilityUIElement::setSelectedChild(AccessibilityUIElement* element) const
{
BEGIN_AX_OBJC_EXCEPTIONS
- NSArray* array = element ? [NSArray array] : [NSArray arrayWithObject:element->platformUIElement()];
+ NSArray* array = [NSArray arrayWithObject:element->platformUIElement()];
[m_element accessibilitySetValue:array forAttribute:NSAccessibilitySelectedChildrenAttribute];
END_AX_OBJC_EXCEPTIONS
}