Ignore:
Timestamp:
Sep 12, 2013, 9:44:22 AM (12 years ago)
Author:
[email protected]
Message:

CSS Unit vw in border-width maps to 0px.
https://bugs.webkit.org/show_bug.cgi?id=109229

Patch by Gurpreet Kaur <[email protected]> on 2013-09-12
Reviewed by Darin Adler.

Source/WebCore:

Border and outline properties were not applied incase
its values were given in vh/vw units.

Tests: fast/css/viewport-height-border.html

fast/css/viewport-height-outline.html
fast/css/viewport-width-border.html
fast/css/viewport-width-outline.html

  • css/CSSPrimitiveValue.cpp:

(WebCore::CSSPrimitiveValue::computeLengthDouble):
Added case CSS_VH and CSS_VW.

  • css/CSSPrimitiveValue.h:

(WebCore::CSSPrimitiveValue::isViewportPercentageWidth):
(WebCore::CSSPrimitiveValue::isViewportPercentageHeight):
Added APIs to check the unit type(CSS_VW and CSS_VH).

  • css/DeprecatedStyleBuilder.cpp:

(WebCore::ApplyPropertyComputeLength::applyValue):
Calculating the border values which has been specified
in vh/vw units.The vh/vw units are calcultated as percent
of viewport height and viewport width respectively.

LayoutTests:

  • fast/css/viewport-height-border-expected.txt: Added.
  • fast/css/viewport-height-border.html: Added.
  • fast/css/viewport-height-outline-expected.txt: Added.
  • fast/css/viewport-height-outline.html: Added.
  • fast/css/viewport-width-border-expected.txt: Added.
  • fast/css/viewport-width-border.html: Added.
  • fast/css/viewport-width-outline-expected.txt: Added.
  • fast/css/viewport-width-outline.html: Added.

Added new tests for verifying that border and outline properties are
applied when its values are given in vh/vw units.

  • resources/js-test-pre.js:

(shouldNotBeEqualToString):
Added this API so that can compare two strings.Similiar to
shouldBeEqualToString.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp

    r155496 r155624  
    3232#include "CSSCalculationValue.h"
    3333#include "CSSCursorImageValue.h"
     34#include "CSSPrimitiveValue.h"
    3435#include "CSSPrimitiveValueMappings.h"
    3536#include "CSSToStyleMap.h"
     
    615616                    length = 1.0;
    616617            }
    617 
     618            if (primitiveValue->isViewportPercentageHeight())
     619                length = styleResolver->document().renderView()->viewportSize().height() * length / 100.0f;
     620            else if (primitiveValue->isViewportPercentageWidth())
     621                length = styleResolver->document().renderView()->viewportSize().width() * length / 100.0f;
    618622        } else {
    619623            ASSERT_NOT_REACHED();
Note: See TracChangeset for help on using the changeset viewer.