| Index: Source/core/testing/Internals.cpp
|
| diff --git a/Source/core/testing/Internals.cpp b/Source/core/testing/Internals.cpp
|
| index bad025393980c4db3519338174a074dce763b326..d438771fc80ff3f69537a188dcfad139e8a171f0 100644
|
| --- a/Source/core/testing/Internals.cpp
|
| +++ b/Source/core/testing/Internals.cpp
|
| @@ -45,6 +45,7 @@
|
| #include "core/animation/DocumentTimeline.h"
|
| #include "core/css/StyleSheetContents.h"
|
| #include "core/css/resolver/StyleResolver.h"
|
| +#include "core/css/resolver/StyleResolverStats.h"
|
| #include "core/css/resolver/ViewportStyleResolver.h"
|
| #include "core/dom/ClientRect.h"
|
| #include "core/dom/ClientRectList.h"
|
| @@ -303,6 +304,35 @@ void Internals::crash()
|
| CRASH();
|
| }
|
|
|
| +void Internals::setStyleResolverStatsEnabled(bool enabled)
|
| +{
|
| + Document* document = contextDocument();
|
| + if (enabled)
|
| + document->styleResolver()->enableStats(StyleResolver::ReportSlowStats);
|
| + else
|
| + document->styleResolver()->disableStats();
|
| +}
|
| +
|
| +String Internals::styleResolverStatsReport(ExceptionState& es) const
|
| +{
|
| + Document* document = contextDocument();
|
| + if (!document->styleResolver()->stats()) {
|
| + es.throwDOMException(InvalidStateError, "Style resolver stats not enabled");
|
| + return String();
|
| + }
|
| + return document->styleResolver()->stats()->report();
|
| +}
|
| +
|
| +String Internals::styleResolverStatsTotalsReport(ExceptionState& es) const
|
| +{
|
| + Document* document = contextDocument();
|
| + if (!document->styleResolver()->statsTotals()) {
|
| + es.throwDOMException(InvalidStateError, "Style resolver stats not enabled");
|
| + return String();
|
| + }
|
| + return document->styleResolver()->statsTotals()->report();
|
| +}
|
| +
|
| PassRefPtr<Element> Internals::createContentElement(ExceptionState& es)
|
| {
|
| Document* document = contextDocument();
|
|
|