Commit 79cd1eee authored by Oriol Brufau's avatar Oriol Brufau Committed by Commit Bot

[css-logical] Fix computed style of logical size properties

Unlike 'width' and 'height', 'inline-size' and 'block-size' were not
considered to be layout dependent, and thus getComputedStyle could
provide a wrong value.

BUG=849855

TEST=external/wpt/css/css-logical/logical-box-size.html

The test still has some failures because sideways writing modes have not
been implemented yet (http://crbug.com/680331).

Change-Id: I4ee8ed8b2cd575fb3ddd5226b23c6a4bb843b81f
Reviewed-on: https://chromium-review.googlesource.com/1114966
Commit-Queue: Oriol Brufau <obrufau@igalia.com>
Reviewed-by: default avatarRune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#570527}
parent 2f57a961
...@@ -4035,6 +4035,7 @@ ...@@ -4035,6 +4035,7 @@
{ {
name: "inline-size", name: "inline-size",
property_methods: ["ParseSingleValue"], property_methods: ["ParseSingleValue"],
layout_dependent: true,
direction_aware_options: { direction_aware_options: {
logical_side: "width", logical_side: "width",
shorthand_for_physical_side: "CSSProperty", shorthand_for_physical_side: "CSSProperty",
...@@ -4045,6 +4046,7 @@ ...@@ -4045,6 +4046,7 @@
{ {
name: "block-size", name: "block-size",
property_methods: ["ParseSingleValue"], property_methods: ["ParseSingleValue"],
layout_dependent: true,
direction_aware_options: { direction_aware_options: {
logical_side: "height", logical_side: "height",
shorthand_for_physical_side: "CSSProperty", shorthand_for_physical_side: "CSSProperty",
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include "third_party/blink/renderer/core/css/parser/css_property_parser_helpers.h" #include "third_party/blink/renderer/core/css/parser/css_property_parser_helpers.h"
#include "third_party/blink/renderer/core/css/properties/css_parsing_utils.h" #include "third_party/blink/renderer/core/css/properties/css_parsing_utils.h"
#include "third_party/blink/renderer/core/layout/layout_object.h"
namespace blink { namespace blink {
namespace CSSLonghand { namespace CSSLonghand {
...@@ -17,5 +18,10 @@ const CSSValue* BlockSize::ParseSingleValue( ...@@ -17,5 +18,10 @@ const CSSValue* BlockSize::ParseSingleValue(
return CSSParsingUtils::ConsumeWidthOrHeight(range, context); return CSSParsingUtils::ConsumeWidthOrHeight(range, context);
} }
bool BlockSize::IsLayoutDependent(const ComputedStyle* style,
LayoutObject* layout_object) const {
return layout_object && layout_object->IsBox();
}
} // namespace CSSLonghand } // namespace CSSLonghand
} // namespace blink } // namespace blink
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include "third_party/blink/renderer/core/css/parser/css_property_parser_helpers.h" #include "third_party/blink/renderer/core/css/parser/css_property_parser_helpers.h"
#include "third_party/blink/renderer/core/css/properties/css_parsing_utils.h" #include "third_party/blink/renderer/core/css/properties/css_parsing_utils.h"
#include "third_party/blink/renderer/core/layout/layout_object.h"
namespace blink { namespace blink {
namespace CSSLonghand { namespace CSSLonghand {
...@@ -17,5 +18,10 @@ const CSSValue* InlineSize::ParseSingleValue( ...@@ -17,5 +18,10 @@ const CSSValue* InlineSize::ParseSingleValue(
return CSSParsingUtils::ConsumeWidthOrHeight(range, context); return CSSParsingUtils::ConsumeWidthOrHeight(range, context);
} }
bool InlineSize::IsLayoutDependent(const ComputedStyle* style,
LayoutObject* layout_object) const {
return layout_object && layout_object->IsBox();
}
} // namespace CSSLonghand } // namespace CSSLonghand
} // namespace blink } // namespace blink
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment