Diff
Modified: trunk/Source/WebCore/ChangeLog (220811 => 220812)
--- trunk/Source/WebCore/ChangeLog 2017-08-16 22:11:18 UTC (rev 220811)
+++ trunk/Source/WebCore/ChangeLog 2017-08-16 22:12:12 UTC (rev 220812)
@@ -1,3 +1,61 @@
+2017-08-16 Simon Fraser <[email protected]>
+
+ Add a log channel for media queries
+ https://bugs.webkit.org/show_bug.cgi?id=175591
+
+ Reviewed by Zalan Bujtas.
+
+ Add a "MediaQueries" log channel which logs data about media query evaluation.
+
+ * css/MediaList.cpp:
+ (WebCore::MediaQuerySet::MediaQuerySet):
+ (WebCore::operator<<):
+ * css/MediaList.h:
+ * css/MediaQuery.cpp:
+ (WebCore::operator<<):
+ * css/MediaQuery.h:
+ * css/MediaQueryEvaluator.cpp:
+ (WebCore::operator<<):
+ (WebCore::MediaQueryEvaluator::evaluate const):
+ (WebCore::aspectRatioValueAsString):
+ (WebCore::orientationEvaluate):
+ (WebCore::aspectRatioEvaluate):
+ (WebCore::deviceAspectRatioEvaluate):
+ (WebCore::evaluateResolution):
+ (WebCore::deviceHeightEvaluate):
+ (WebCore::deviceWidthEvaluate):
+ (WebCore::heightEvaluate):
+ (WebCore::widthEvaluate):
+ * css/MediaQueryExpression.cpp:
+ (WebCore::operator<<):
+ * css/MediaQueryExpression.h:
+ * css/MediaQueryMatcher.cpp:
+ (WebCore::MediaQueryMatcher::styleResolverChanged):
+ * css/StyleResolver.cpp:
+ (WebCore::StyleResolver::hasMediaQueriesAffectedByViewportChange const):
+ (WebCore::StyleResolver::hasMediaQueriesAffectedByAccessibilitySettingsChange const):
+ * dom/InlineStyleSheetOwner.cpp:
+ (WebCore::InlineStyleSheetOwner::createSheet):
+ * html/HTMLImageElement.cpp:
+ (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
+ * html/HTMLLinkElement.cpp:
+ (WebCore::HTMLLinkElement::process):
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::selectNextSourceChild):
+ * html/HTMLPictureElement.cpp:
+ (WebCore::HTMLPictureElement::viewportChangeAffectedPicture const):
+ * html/parser/HTMLPreloadScanner.cpp:
+ (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
+ * page/FrameView.cpp:
+ (WebCore::FrameView::layout):
+ * platform/Logging.cpp:
+ (WebCore::initializeLogChannelsIfNecessary):
+ * platform/Logging.h:
+ * platform/URL.cpp:
+ (WebCore::isSchemeFirstChar):
+ (WebCore::operator<<):
+ * platform/URL.h:
+
2017-08-16 Sam Weinig <[email protected]>
[WebIDL] Remove the need for JSSubtleCryptoCustom.cpp
Modified: trunk/Source/WebCore/css/MediaList.cpp (220811 => 220812)
--- trunk/Source/WebCore/css/MediaList.cpp 2017-08-16 22:11:18 UTC (rev 220811)
+++ trunk/Source/WebCore/css/MediaList.cpp 2017-08-16 22:12:12 UTC (rev 220812)
@@ -29,6 +29,7 @@
#include "MediaQueryParser.h"
#include <wtf/NeverDestroyed.h>
#include <wtf/text/StringBuilder.h>
+#include <wtf/text/TextStream.h>
namespace WebCore {
@@ -69,7 +70,6 @@
}
MediaQuerySet::MediaQuerySet()
- : m_lastLine(0)
{
}
@@ -277,4 +277,17 @@
#endif
+TextStream& operator<<(TextStream& ts, const MediaQuerySet& querySet)
+{
+ ts << querySet.mediaText();
+ return ts;
}
+
+TextStream& operator<<(TextStream& ts, const MediaList& mediaList)
+{
+ ts << mediaList.mediaText();
+ return ts;
+}
+
+} // namespace WebCore
+
Modified: trunk/Source/WebCore/css/MediaList.h (220811 => 220812)
--- trunk/Source/WebCore/css/MediaList.h 2017-08-16 22:11:18 UTC (rev 220811)
+++ trunk/Source/WebCore/css/MediaList.h 2017-08-16 22:12:12 UTC (rev 220812)
@@ -25,6 +25,10 @@
#include <wtf/Forward.h>
#include <wtf/Vector.h>
+namespace WTF {
+class TextStream;
+}
+
namespace WebCore {
class CSSParser;
@@ -66,7 +70,7 @@
WEBCORE_EXPORT MediaQuerySet(const String& mediaQuery);
MediaQuerySet(const MediaQuerySet&);
- signed m_lastLine;
+ int m_lastLine { 0 };
Vector<MediaQuery> m_queries;
};
@@ -121,4 +125,7 @@
#endif
+WTF::TextStream& operator<<(WTF::TextStream&, const MediaQuerySet&);
+WTF::TextStream& operator<<(WTF::TextStream&, const MediaList&);
+
} // namespace
Modified: trunk/Source/WebCore/css/MediaQuery.cpp (220811 => 220812)
--- trunk/Source/WebCore/css/MediaQuery.cpp 2017-08-16 22:11:18 UTC (rev 220811)
+++ trunk/Source/WebCore/css/MediaQuery.cpp 2017-08-16 22:12:12 UTC (rev 220812)
@@ -30,6 +30,7 @@
#include "MediaQuery.h"
#include <wtf/text/StringBuilder.h>
+#include <wtf/text/TextStream.h>
namespace WebCore {
@@ -106,4 +107,10 @@
return m_serializationCache;
}
+TextStream& operator<<(TextStream& ts, const MediaQuery& query)
+{
+ ts << query.cssText();
+ return ts;
+}
+
} //namespace
Modified: trunk/Source/WebCore/css/MediaQuery.h (220811 => 220812)
--- trunk/Source/WebCore/css/MediaQuery.h 2017-08-16 22:11:18 UTC (rev 220811)
+++ trunk/Source/WebCore/css/MediaQuery.h 2017-08-16 22:12:12 UTC (rev 220812)
@@ -61,4 +61,6 @@
mutable String m_serializationCache;
};
+WTF::TextStream& operator<<(WTF::TextStream&, const MediaQuery&);
+
} // namespace
Modified: trunk/Source/WebCore/css/MediaQueryEvaluator.cpp (220811 => 220812)
--- trunk/Source/WebCore/css/MediaQueryEvaluator.cpp 2017-08-16 22:11:18 UTC (rev 220811)
+++ trunk/Source/WebCore/css/MediaQueryEvaluator.cpp 2017-08-16 22:12:12 UTC (rev 220812)
@@ -34,6 +34,7 @@
#include "CSSToLengthConversionData.h"
#include "CSSValueKeywords.h"
#include "FrameView.h"
+#include "Logging.h"
#include "MainFrame.h"
#include "MediaFeatureNames.h"
#include "MediaList.h"
@@ -47,6 +48,7 @@
#include "StyleResolver.h"
#include "Theme.h"
#include <wtf/HashMap.h>
+#include <wtf/text/TextStream.h>
#if ENABLE(3D_TRANSFORMS)
#include "RenderLayerCompositor.h"
@@ -56,6 +58,16 @@
enum MediaFeaturePrefix { MinPrefix, MaxPrefix, NoPrefix };
+static TextStream& operator<<(TextStream& ts, MediaFeaturePrefix op)
+{
+ switch (op) {
+ case MinPrefix: ts << "min"; break;
+ case MaxPrefix: ts << "max"; break;
+ case NoPrefix: ts << ""; break;
+ }
+ return ts;
+}
+
typedef bool (*MediaQueryFunction)(CSSValue*, const CSSToLengthConversionData&, Frame&, MediaFeaturePrefix);
typedef HashMap<AtomicStringImpl*, MediaQueryFunction> MediaQueryFunctionMap;
@@ -123,9 +135,13 @@
bool MediaQueryEvaluator::evaluate(const MediaQuerySet& querySet, StyleResolver* styleResolver) const
{
+ LOG_WITH_STREAM(MediaQueries, stream << "MediaQueryEvaluator::evaluate on " << (m_frame && m_frame->document() ? m_frame->document()->url().string() : emptyString()));
+
auto& queries = querySet.queryVector();
- if (!queries.size())
+ if (!queries.size()) {
+ LOG_WITH_STREAM(MediaQueries, stream << "MediaQueryEvaluator::evaluate " << querySet << " returning true");
return true; // Empty query list evaluates to true.
+ }
// Iterate over queries, stop if any of them eval to true (OR semantics).
bool result = false;
@@ -155,6 +171,7 @@
result = applyRestrictor(query.restrictor(), false);
}
+ LOG_WITH_STREAM(MediaQueries, stream << "MediaQueryEvaluator::evaluate " << querySet << " returning " << result);
return result;
}
@@ -202,6 +219,17 @@
return false;
}
+#if !LOG_DISABLED
+static String aspectRatioValueAsString(CSSValue* value)
+{
+ if (!is<CSSAspectRatioValue>(value))
+ return emptyString();
+
+ auto& aspectRatio = downcast<CSSAspectRatioValue>(*value);
+ return String::format("%f/%f", aspectRatio.numeratorValue(), aspectRatio.denominatorValue());
+}
+#endif
+
static bool compareAspectRatioValue(CSSValue* value, int width, int height, MediaFeaturePrefix op)
{
if (!is<CSSAspectRatioValue>(value))
@@ -311,9 +339,14 @@
}
auto keyword = downcast<CSSPrimitiveValue>(*value).valueID();
+ bool result;
if (viewSize.width() > viewSize.height()) // Square viewport is portrait.
- return keyword == CSSValueLandscape;
- return keyword == CSSValuePortrait;
+ result = keyword == CSSValueLandscape;
+ else
+ result = keyword == CSSValuePortrait;
+
+ LOG_WITH_STREAM(MediaQueries, stream << " orientationEvaluate: view size " << viewSize.width() << "x" << viewSize.height() << " is " << value->cssText() << ": " << result);
+ return result;
}
static bool aspectRatioEvaluate(CSSValue* value, const CSSToLengthConversionData&, Frame& frame, MediaFeaturePrefix op)
@@ -326,7 +359,9 @@
if (!view)
return true;
auto viewSize = view->layoutSizeForMediaQuery();
- return compareAspectRatioValue(value, viewSize.width(), viewSize.height(), op);
+ bool result = compareAspectRatioValue(value, viewSize.width(), viewSize.height(), op);
+ LOG_WITH_STREAM(MediaQueries, stream << " aspectRatioEvaluate: " << op << " " << aspectRatioValueAsString(value) << " actual view size " << viewSize << ": " << result);
+ return result;
}
static bool deviceAspectRatioEvaluate(CSSValue* value, const CSSToLengthConversionData&, Frame& frame, MediaFeaturePrefix op)
@@ -337,7 +372,9 @@
return true;
auto size = screenRect(frame.mainFrame().view()).size();
- return compareAspectRatioValue(value, size.width(), size.height(), op);
+ bool result = compareAspectRatioValue(value, size.width(), size.height(), op);
+ LOG_WITH_STREAM(MediaQueries, stream << " deviceAspectRatioEvaluate: " << op << " " << aspectRatioValueAsString(value) << " actual screen size " << size << ": " << result);
+ return result;
}
static bool evaluateResolution(CSSValue* value, Frame& frame, MediaFeaturePrefix op)
@@ -370,7 +407,10 @@
return false;
auto& resolution = downcast<CSSPrimitiveValue>(*value);
- return compareValue(deviceScaleFactor, resolution.isNumber() ? resolution.floatValue() : resolution.floatValue(CSSPrimitiveValue::CSS_DPPX), op);
+ float resolutionValue = resolution.isNumber() ? resolution.floatValue() : resolution.floatValue(CSSPrimitiveValue::CSS_DPPX);
+ bool result = compareValue(deviceScaleFactor, resolutionValue, op);
+ LOG_WITH_STREAM(MediaQueries, stream << " evaluateResolution: " << op << " " << resolutionValue << " device scale factor " << deviceScaleFactor << ": " << result);
+ return result;
}
static bool devicePixelRatioEvaluate(CSSValue* value, const CSSToLengthConversionData&, Frame& frame, MediaFeaturePrefix op)
@@ -423,7 +463,12 @@
return true;
int length;
auto height = screenRect(frame.mainFrame().view()).height();
- return computeLength(value, !frame.document()->inQuirksMode(), conversionData, length) && compareValue(height, length, op);
+ if (!computeLength(value, !frame.document()->inQuirksMode(), conversionData, length))
+ return false;
+
+ LOG_WITH_STREAM(MediaQueries, stream << " deviceHeightEvaluate: query " << op << " height " << length << ", actual height " << height << " result: " << compareValue(height, length, op));
+
+ return compareValue(height, length, op);
}
static bool deviceWidthEvaluate(CSSValue* value, const CSSToLengthConversionData& conversionData, Frame& frame, MediaFeaturePrefix op)
@@ -434,7 +479,12 @@
return true;
int length;
auto width = screenRect(frame.mainFrame().view()).width();
- return computeLength(value, !frame.document()->inQuirksMode(), conversionData, length) && compareValue(width, length, op);
+ if (!computeLength(value, !frame.document()->inQuirksMode(), conversionData, length))
+ return false;
+
+ LOG_WITH_STREAM(MediaQueries, stream << " deviceWidthEvaluate: query " << op << " width " << length << ", actual width " << width << " result: " << compareValue(width, length, op));
+
+ return compareValue(width, length, op);
}
static bool heightEvaluate(CSSValue* value, const CSSToLengthConversionData& conversionData, Frame& frame, MediaFeaturePrefix op)
@@ -447,8 +497,14 @@
return height;
if (auto* renderView = frame.document()->renderView())
height = adjustForAbsoluteZoom(height, *renderView);
+
int length;
- return computeLength(value, !frame.document()->inQuirksMode(), conversionData, length) && compareValue(height, length, op);
+ if (!computeLength(value, !frame.document()->inQuirksMode(), conversionData, length))
+ return false;
+
+ LOG_WITH_STREAM(MediaQueries, stream << " heightEvaluate: query " << op << " height " << length << ", actual height " << height << " result: " << compareValue(height, length, op));
+
+ return compareValue(height, length, op);
}
static bool widthEvaluate(CSSValue* value, const CSSToLengthConversionData& conversionData, Frame& frame, MediaFeaturePrefix op)
@@ -461,8 +517,14 @@
return width;
if (auto* renderView = frame.document()->renderView())
width = adjustForAbsoluteZoom(width, *renderView);
+
int length;
- return computeLength(value, !frame.document()->inQuirksMode(), conversionData, length) && compareValue(width, length, op);
+ if (!computeLength(value, !frame.document()->inQuirksMode(), conversionData, length))
+ return false;
+
+ LOG_WITH_STREAM(MediaQueries, stream << " widthEvaluate: query " << op << " width " << length << ", actual width " << width << " result: " << compareValue(width, length, op));
+
+ return compareValue(width, length, op);
}
static bool minColorEvaluate(CSSValue* value, const CSSToLengthConversionData& conversionData, Frame& frame, MediaFeaturePrefix)
Modified: trunk/Source/WebCore/css/MediaQueryExpression.cpp (220811 => 220812)
--- trunk/Source/WebCore/css/MediaQueryExpression.cpp 2017-08-16 22:11:18 UTC (rev 220811)
+++ trunk/Source/WebCore/css/MediaQueryExpression.cpp 2017-08-16 22:12:12 UTC (rev 220812)
@@ -32,6 +32,7 @@
#include "CSSParserToken.h"
#include "CSSPrimitiveValue.h"
#include "MediaFeatureNames.h"
+#include <wtf/text/TextStream.h>
#include <wtf/text/StringBuilder.h>
namespace WebCore {
@@ -225,4 +226,11 @@
return m_serializationCache;
}
+TextStream& operator<<(TextStream& ts, const MediaQueryExpression& _expression_)
+{
+ ts << _expression_.serialize();
+ return ts;
+}
+
+
} // namespace
Modified: trunk/Source/WebCore/css/MediaQueryExpression.h (220811 => 220812)
--- trunk/Source/WebCore/css/MediaQueryExpression.h 2017-08-16 22:11:18 UTC (rev 220811)
+++ trunk/Source/WebCore/css/MediaQueryExpression.h 2017-08-16 22:12:12 UTC (rev 220812)
@@ -31,6 +31,10 @@
#include "CSSValue.h"
#include <memory>
+namespace WTF {
+class TextStream;
+}
+
namespace WebCore {
class MediaQueryExpression {
@@ -75,4 +79,6 @@
return m_isValid;
}
+WTF::TextStream& operator<<(WTF::TextStream&, const MediaQueryExpression&);
+
} // namespace
Modified: trunk/Source/WebCore/css/MediaQueryMatcher.cpp (220811 => 220812)
--- trunk/Source/WebCore/css/MediaQueryMatcher.cpp 2017-08-16 22:11:18 UTC (rev 220811)
+++ trunk/Source/WebCore/css/MediaQueryMatcher.cpp 2017-08-16 22:12:12 UTC (rev 220812)
@@ -23,6 +23,7 @@
#include "Document.h"
#include "Frame.h"
#include "FrameView.h"
+#include "Logging.h"
#include "MediaList.h"
#include "MediaQueryEvaluator.h"
#include "MediaQueryList.h"
@@ -31,6 +32,7 @@
#include "RenderElement.h"
#include "StyleResolver.h"
#include "StyleScope.h"
+#include <wtf/text/TextStream.h>
namespace WebCore {
@@ -118,6 +120,8 @@
if (!style)
return;
+ LOG_WITH_STREAM(MediaQueries, stream << "MediaQueryMatcher::styleResolverChanged " << m_document->url());
+
MediaQueryEvaluator evaluator { mediaType(), *m_document, style.get() };
Vector<Listener> listeners;
listeners.reserveInitialCapacity(m_listeners.size());
Modified: trunk/Source/WebCore/css/StyleResolver.cpp (220811 => 220812)
--- trunk/Source/WebCore/css/StyleResolver.cpp 2017-08-16 22:11:18 UTC (rev 220811)
+++ trunk/Source/WebCore/css/StyleResolver.cpp 2017-08-16 22:12:12 UTC (rev 220812)
@@ -67,6 +67,7 @@
#include "InspectorInstrumentation.h"
#include "KeyframeList.h"
#include "LinkHash.h"
+#include "Logging.h"
#include "MathMLElement.h"
#include "MathMLNames.h"
#include "MediaList.h"
@@ -1872,6 +1873,7 @@
bool StyleResolver::hasMediaQueriesAffectedByViewportChange() const
{
+ LOG(MediaQueries, "StyleResolver::hasMediaQueriesAffectedByViewportChange evaluating queries");
for (auto& result : m_viewportDependentMediaQueryResults) {
if (m_mediaQueryEvaluator.evaluate(result._expression_) != result.result)
return true;
@@ -1886,6 +1888,7 @@
bool StyleResolver::hasMediaQueriesAffectedByAccessibilitySettingsChange() const
{
+ LOG(MediaQueries, "StyleResolver::hasMediaQueriesAffectedByAccessibilitySettingsChange evaluating queries");
for (auto& result : m_accessibilitySettingsDependentMediaQueryResults) {
if (m_mediaQueryEvaluator.evaluate(result._expression_) != result.result)
return true;
Modified: trunk/Source/WebCore/dom/InlineStyleSheetOwner.cpp (220811 => 220812)
--- trunk/Source/WebCore/dom/InlineStyleSheetOwner.cpp 2017-08-16 22:11:18 UTC (rev 220811)
+++ trunk/Source/WebCore/dom/InlineStyleSheetOwner.cpp 2017-08-16 22:12:12 UTC (rev 220812)
@@ -23,6 +23,7 @@
#include "ContentSecurityPolicy.h"
#include "Element.h"
+#include "Logging.h"
#include "MediaList.h"
#include "MediaQueryEvaluator.h"
#include "ScriptableDocumentParser.h"
@@ -174,6 +175,7 @@
MediaQueryEvaluator screenEval(ASCIILiteral("screen"), true);
MediaQueryEvaluator printEval(ASCIILiteral("print"), true);
+ LOG(MediaQueries, "InlineStyleSheetOwner::createSheet evaluating queries");
if (!screenEval.evaluate(*mediaQueries) && !printEval.evaluate(*mediaQueries))
return;
Modified: trunk/Source/WebCore/html/HTMLImageElement.cpp (220811 => 220812)
--- trunk/Source/WebCore/html/HTMLImageElement.cpp 2017-08-16 22:11:18 UTC (rev 220811)
+++ trunk/Source/WebCore/html/HTMLImageElement.cpp 2017-08-16 22:12:12 UTC (rev 220812)
@@ -33,6 +33,7 @@
#include "HTMLPictureElement.h"
#include "HTMLSourceElement.h"
#include "HTMLSrcsetParser.h"
+#include "Logging.h"
#include "MIMETypeRegistry.h"
#include "MediaList.h"
#include "MediaQueryEvaluator.h"
@@ -169,6 +170,7 @@
auto* documentElement = document().documentElement();
MediaQueryEvaluator evaluator { document().printing() ? "print" : "screen", document(), documentElement ? documentElement->computedStyle() : nullptr };
auto* queries = source.parsedMediaAttribute();
+ LOG(MediaQueries, "HTMLImageElement %p bestFitSourceFromPictureElement evaluating media queries", this);
auto evaluation = !queries || evaluator.evaluate(*queries, picture->viewportDependentResults());
if (picture->hasViewportDependentResults())
document().addViewportDependentPicture(*picture);
Modified: trunk/Source/WebCore/html/HTMLLinkElement.cpp (220811 => 220812)
--- trunk/Source/WebCore/html/HTMLLinkElement.cpp 2017-08-16 22:11:18 UTC (rev 220811)
+++ trunk/Source/WebCore/html/HTMLLinkElement.cpp 2017-08-16 22:12:12 UTC (rev 220812)
@@ -44,6 +44,7 @@
#include "HTMLAnchorElement.h"
#include "HTMLNames.h"
#include "HTMLParserIdioms.h"
+#include "Logging.h"
#include "MediaList.h"
#include "MediaQueryEvaluator.h"
#include "MouseEvent.h"
@@ -287,6 +288,7 @@
if (document().hasLivingRenderTree())
documentStyle = Style::resolveForDocument(document());
auto media = MediaQuerySet::create(m_media);
+ LOG(MediaQueries, "HTMLLinkElement::process evaluating queries");
mediaQueryMatches = MediaQueryEvaluator { document().frame()->view()->mediaType(), document(), documentStyle ? &*documentStyle : nullptr }.evaluate(media.get());
}
Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (220811 => 220812)
--- trunk/Source/WebCore/html/HTMLMediaElement.cpp 2017-08-16 22:11:18 UTC (rev 220811)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp 2017-08-16 22:12:12 UTC (rev 220812)
@@ -4296,6 +4296,7 @@
LOG(Media, "HTMLMediaElement::selectNextSourceChild(%p) - 'media' is %s", this, source->attributeWithoutSynchronization(mediaAttr).string().utf8().data());
#endif
auto* renderer = this->renderer();
+ LOG(MediaQueries, "HTMLMediaElement %p selectNextSourceChild evaluating media queries", this);
if (!MediaQueryEvaluator { "screen", document(), renderer ? &renderer->style() : nullptr }.evaluate(*media))
goto CheckAgain;
}
Modified: trunk/Source/WebCore/html/HTMLPictureElement.cpp (220811 => 220812)
--- trunk/Source/WebCore/html/HTMLPictureElement.cpp 2017-08-16 22:11:18 UTC (rev 220811)
+++ trunk/Source/WebCore/html/HTMLPictureElement.cpp 2017-08-16 22:12:12 UTC (rev 220812)
@@ -28,6 +28,7 @@
#include "ElementChildIterator.h"
#include "HTMLImageElement.h"
+#include "Logging.h"
namespace WebCore {
@@ -64,6 +65,7 @@
auto* documentElement = document().documentElement();
MediaQueryEvaluator evaluator { document().printing() ? "print" : "screen", document(), documentElement ? documentElement->computedStyle() : nullptr };
for (auto& result : m_viewportDependentMediaQueryResults) {
+ LOG(MediaQueries, "HTMLPictureElement %p viewportChangeAffectedPicture evaluating media queries", this);
if (evaluator.evaluate(result._expression_) != result.result)
return true;
}
Modified: trunk/Source/WebCore/html/parser/HTMLPreloadScanner.cpp (220811 => 220812)
--- trunk/Source/WebCore/html/parser/HTMLPreloadScanner.cpp 2017-08-16 22:11:18 UTC (rev 220811)
+++ trunk/Source/WebCore/html/parser/HTMLPreloadScanner.cpp 2017-08-16 22:12:12 UTC (rev 220812)
@@ -35,6 +35,7 @@
#include "InputTypeNames.h"
#include "LinkLoader.h"
#include "LinkRelAttribute.h"
+#include "Logging.h"
#include "MediaList.h"
#include "MediaQueryEvaluator.h"
#include "RenderView.h"
@@ -215,6 +216,7 @@
m_mediaAttribute = attributeValue;
auto mediaSet = MediaQuerySet::create(attributeValue);
auto* documentElement = document.documentElement();
+ LOG(MediaQueries, "HTMLPreloadScanner %p processAttribute evaluating media queries", this);
m_mediaMatched = MediaQueryEvaluator { document.printing() ? "print" : "screen", document, documentElement ? documentElement->computedStyle() : nullptr }.evaluate(mediaSet.get());
}
break;
Modified: trunk/Source/WebCore/page/FrameView.cpp (220811 => 220812)
--- trunk/Source/WebCore/page/FrameView.cpp 2017-08-16 22:11:18 UTC (rev 220811)
+++ trunk/Source/WebCore/page/FrameView.cpp 2017-08-16 22:12:12 UTC (rev 220812)
@@ -1316,8 +1316,10 @@
bool inChildFrameLayoutWithFrameFlattening = isInChildFrameWithFrameFlattening();
if (inChildFrameLayoutWithFrameFlattening) {
- if (!m_frameFlatteningViewSizeForMediaQuery)
+ if (!m_frameFlatteningViewSizeForMediaQuery) {
+ LOG_WITH_STREAM(MediaQueries, stream << "FrameView " << this << " snapshotting size " << ScrollView::layoutSize() << " for media queries");
m_frameFlatteningViewSizeForMediaQuery = ScrollView::layoutSize();
+ }
startLayoutAtMainFrameViewIfNeeded(allowSubtree);
RenderElement* root = m_layoutRoot ? m_layoutRoot : frame().document()->renderView();
if (!root || !root->needsLayout())
Modified: trunk/Source/WebCore/platform/Logging.h (220811 => 220812)
--- trunk/Source/WebCore/platform/Logging.h 2017-08-16 22:11:18 UTC (rev 220811)
+++ trunk/Source/WebCore/platform/Logging.h 2017-08-16 22:12:12 UTC (rev 220812)
@@ -62,6 +62,7 @@
M(Loading) \
M(Media) \
M(MediaCaptureSamples) \
+ M(MediaQueries) \
M(MediaSource) \
M(MediaStream) \
M(MediaSourceSamples) \
Modified: trunk/Source/WebCore/platform/URL.cpp (220811 => 220812)
--- trunk/Source/WebCore/platform/URL.cpp 2017-08-16 22:11:18 UTC (rev 220811)
+++ trunk/Source/WebCore/platform/URL.cpp 2017-08-16 22:12:12 UTC (rev 220812)
@@ -41,6 +41,7 @@
#include <wtf/text/CString.h>
#include <wtf/text/StringBuilder.h>
#include <wtf/text/StringHash.h>
+#include <wtf/text/TextStream.h>
// FIXME: This file makes too much use of the + operator on String.
// We either have to optimize that operator so it doesn't involve
@@ -1334,4 +1335,10 @@
return URL(URL(), "file:///" + filePath);
}
+TextStream& operator<<(TextStream& ts, const URL& url)
+{
+ ts << url.string();
+ return ts;
}
+
+} // namespace WebCore
Modified: trunk/Source/WebCore/platform/URL.h (220811 => 220812)
--- trunk/Source/WebCore/platform/URL.h 2017-08-16 22:11:18 UTC (rev 220811)
+++ trunk/Source/WebCore/platform/URL.h 2017-08-16 22:12:12 UTC (rev 220812)
@@ -42,6 +42,10 @@
OBJC_CLASS NSURL;
#endif
+namespace WTF {
+class TextStream;
+}
+
namespace WebCore {
class TextEncoding;
@@ -441,6 +445,8 @@
return m_pathAfterLastSlash;
}
+WTF::TextStream& operator<<(WTF::TextStream&, const URL&);
+
} // namespace WebCore
namespace WTF {