Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(294)

Unified Diff: Source/core/css/MediaValues.h

Issue 242883002: Remove MediaValues' dependency on RenderStyle (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Modified minimal recalc tests to represent reduced recalc. Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/css/MediaValues.h
diff --git a/Source/core/css/MediaValues.h b/Source/core/css/MediaValues.h
index 60ac92840d56cc6bd2046ba4efa56fb671ad6546..d1159ae6e7378a6619333a3cf60ec97a2b6547be 100644
--- a/Source/core/css/MediaValues.h
+++ b/Source/core/css/MediaValues.h
@@ -12,7 +12,6 @@
namespace WebCore {
class Document;
-class RenderStyle;
class CSSPrimitiveValue;
class MediaValues : public RefCounted<MediaValues> {
@@ -32,8 +31,10 @@ public:
virtual ~MediaValues() { }
+ static PassRefPtr<MediaValues> createDynamicIfFrameExists(LocalFrame*);
virtual PassRefPtr<MediaValues> copy() const = 0;
virtual bool isSafeToSendToAnotherThread() const = 0;
+ static bool computeLength(double value, unsigned short type, unsigned defaultFontSize, unsigned viewportWidth, unsigned viewportHeight, int& result);
virtual bool computeLength(double value, unsigned short type, int& result) const = 0;
virtual int viewportWidth() const = 0;
@@ -53,8 +54,6 @@ public:
virtual bool hasValues() const = 0;
protected:
- static Document* getExecutingDocument(Document&);
-
int calculateViewportWidth(LocalFrame*) const;
int calculateViewportHeight(LocalFrame*) const;
int calculateDeviceWidth(LocalFrame*) const;
@@ -63,16 +62,11 @@ protected:
float calculateDevicePixelRatio(LocalFrame*) const;
int calculateColorBitsPerComponent(LocalFrame*) const;
int calculateMonochromeBitsPerComponent(LocalFrame*) const;
- int calculateDefaultFontSize(RenderStyle*) const;
- int calculateComputedFontSize(RenderStyle*) const;
- bool calculateHasXHeight(RenderStyle*) const;
- double calculateXHeight(RenderStyle*) const;
- double calculateZeroWidth(RenderStyle*) const;
+ int calculateDefaultFontSize(LocalFrame*) const;
bool calculateScanMediaType(LocalFrame*) const;
bool calculateScreenMediaType(LocalFrame*) const;
bool calculatePrintMediaType(LocalFrame*) const;
bool calculateThreeDEnabled(LocalFrame*) const;
- float calculateEffectiveZoom(RenderStyle*) const;
MediaValues::PointerDeviceType calculateLeastCapablePrimaryPointerDeviceType(LocalFrame*) const;
};

Powered by Google App Engine
This is Rietveld 408576698