summaryrefslogtreecommitdiff
path: root/Source/WebCore/css/DeprecatedStyleBuilder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/css/DeprecatedStyleBuilder.cpp')
-rw-r--r--Source/WebCore/css/DeprecatedStyleBuilder.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/WebCore/css/DeprecatedStyleBuilder.cpp b/Source/WebCore/css/DeprecatedStyleBuilder.cpp
index 68bb3bcb7..7c6105285 100644
--- a/Source/WebCore/css/DeprecatedStyleBuilder.cpp
+++ b/Source/WebCore/css/DeprecatedStyleBuilder.cpp
@@ -31,6 +31,7 @@
#include "CSSAspectRatioValue.h"
#include "CSSCalculationValue.h"
#include "CSSCursorImageValue.h"
+#include "CSSPrimitiveValue.h"
#include "CSSPrimitiveValueMappings.h"
#include "CSSToStyleMap.h"
#include "CSSValueList.h"
@@ -612,7 +613,10 @@ public:
if (originalLength >= 1.0)
length = 1.0;
}
-
+ if (primitiveValue->isViewportPercentageHeight())
+ length = styleResolver->document()->renderView()->viewportSize().height() * length / 100.0f;
+ else if (primitiveValue->isViewportPercentageWidth())
+ length = styleResolver->document()->renderView()->viewportSize().width() * length / 100.0f;
} else {
ASSERT_NOT_REACHED();
length = 0;