Bug 1262049 part 1: Back out bug 1208344 in its entirety, and mark -webkit-box-orient:vertical reftests as failing (for now). (no review)

This patch backs out changeset range 1f1884449dd4:0b5ed5e4a395 (all of the patches for bug 1208344) -- i.e. it backs out our support for "-webkit-box-orient".  This patch also adds "fails" annotations to two reftests that depend on that feature, to reflect reality that these tests are now expected to fail (for the moment).

MozReview-Commit-ID: F8zGGg8R0Rn
This commit is contained in:
Daniel Holbert 2016-04-20 16:43:24 -07:00
Родитель eb00c5e886
Коммит dfb1c4c768
10 изменённых файлов: 47 добавлений и 274 удалений

Просмотреть файл

@ -17,7 +17,7 @@ fails == webkit-box-anon-flex-items-3.html webkit-box-anon-flex-items-3-ref.html
# Tests for "-webkit-box-align" (cross-axis alignment):
== webkit-box-align-horiz-1a.html webkit-box-align-horiz-1-ref.html
== webkit-box-align-horiz-1b.html webkit-box-align-horiz-1-ref.html
== webkit-box-align-vert-1.html webkit-box-align-vert-1-ref.html
fails == webkit-box-align-vert-1.html webkit-box-align-vert-1-ref.html # bug 1262049
# Tests for "-webkit-box-flex" (flexibility of items)
== webkit-box-flex-1.html webkit-box-flex-1-ref.html
@ -35,4 +35,4 @@ fails == webkit-box-ordinal-group-2.html webkit-box-ordinal-group-2-ref.html
# Tests for "-webkit-box-pack" (main-axis alignment):
== webkit-box-pack-horiz-1a.html webkit-box-pack-horiz-1-ref.html
== webkit-box-pack-horiz-1b.html webkit-box-pack-horiz-1-ref.html
== webkit-box-pack-vert-1.html webkit-box-pack-vert-1-ref.html
fails == webkit-box-pack-vert-1.html webkit-box-pack-vert-1-ref.html # bug 1262049

Просмотреть файл

@ -14,7 +14,6 @@
#include "CSSVariableImageTable.h"
#include "mozilla/css/Declaration.h"
#include "mozilla/css/ImageLoader.h"
#include "mozilla/Maybe.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/WritingModes.h"
#include "nsIDocument.h"
@ -41,50 +40,6 @@ MoveValue(nsCSSValue* aSource, nsCSSValue* aDest)
return changed;
}
/**
* This function maps "-webkit-box-orient" values to "flex-direction" values,
* for a given writing-mode (taken from aRuleData).
*
* Specifically:
* - If aBoxOrientVal is an enumerated value (representing a physical axis),
* then we'll map it to the appropriate logical "flex-direction" value, using
* the writing mode. The converted value will be emplace()'d into in the
* outparam aConvertedValStorage, and we'll return a pointer to that value.
* - Otherwise (e.g. if we have "inherit" or "initial"), we won't do any
* mapping, and we'll directly return the passed-in aBoxOrientVal.
*
* Either way, the idea is that our caller can treat the returned value as if
* it were a value for "flex-direction".
*/
static const nsCSSValue*
ConvertBoxOrientToFlexDirection(const nsCSSValue* aBoxOrientVal,
const nsRuleData* aRuleData,
Maybe<nsCSSValue>& aConvertedValStorage)
{
MOZ_ASSERT(aBoxOrientVal, "expecting a non-null value to convert");
MOZ_ASSERT(aConvertedValStorage.isNothing(),
"expecting outparam for converted-value to be initially empty");
if (aBoxOrientVal->GetUnit() != eCSSUnit_Enumerated) {
// We probably have "inherit" or "initial" -- just return that & have the
// caller directly use it as a "flex-direction" value.
return aBoxOrientVal;
}
// OK, we have an enumerated value -- "horizontal" or "vertical".
WritingMode wm(aRuleData->mStyleContext);
// In a horizontal writing-mode, "horizontal" maps to "row".
// In a vertical writing-mode, "horizontal" maps to "column".
bool isRow = wm.IsVertical() !=
(aBoxOrientVal->GetIntValue() == NS_STYLE_BOX_ORIENT_HORIZONTAL);
aConvertedValStorage.emplace(isRow ? NS_STYLE_FLEX_DIRECTION_ROW :
NS_STYLE_FLEX_DIRECTION_COLUMN,
eCSSUnit_Enumerated);
return aConvertedValStorage.ptr();
}
static bool
ShouldIgnoreColors(nsRuleData *aRuleData)
{
@ -170,84 +125,58 @@ ShouldStartImageLoads(nsRuleData *aRuleData, nsCSSProperty aProperty)
}
static void
MapSinglePropertyInto(nsCSSProperty aSrcProp,
const nsCSSValue* aSrcValue,
nsCSSProperty aTargetProp,
nsCSSValue* aTargetValue,
MapSinglePropertyInto(nsCSSProperty aProp,
const nsCSSValue* aValue,
nsCSSValue* aTarget,
nsRuleData* aRuleData)
{
MOZ_ASSERT(!nsCSSProps::PropHasFlags(aTargetProp, CSS_PROPERTY_LOGICAL),
"Can't map into a logical property");
MOZ_ASSERT(aSrcProp == aTargetProp ||
nsCSSProps::PropHasFlags(aSrcProp, CSS_PROPERTY_LOGICAL),
"Source & target property must be the same, except when we're "
"doing a logical-to-physical property mapping");
MOZ_ASSERT(aSrcValue->GetUnit() != eCSSUnit_Null, "oops");
MOZ_ASSERT(aValue->GetUnit() != eCSSUnit_Null, "oops");
// Handle logical properties that have custom value-mapping behavior:
Maybe<nsCSSValue> convertedVal; // storage for converted value, if needed
bool hasCustomValMapping =
nsCSSProps::PropHasFlags(aSrcProp,
CSS_PROPERTY_LOGICAL_SINGLE_CUSTOM_VALMAPPING);
if (hasCustomValMapping) {
if (aSrcProp == eCSSProperty_webkit_box_orient) {
aSrcValue = ConvertBoxOrientToFlexDirection(aSrcValue, aRuleData,
convertedVal);
}
}
// Although aTargetValue is the nsCSSValue we are going to write into,
// Although aTarget is the nsCSSValue we are going to write into,
// we also look at its value before writing into it. This is done
// when aTargetValue is a token stream value, which is the case when we
// when aTarget is a token stream value, which is the case when we
// have just re-parsed a property that had a variable reference (in
// nsCSSParser::ParsePropertyWithVariableReferences). TryToStartImageLoad
// then records any resulting ImageValue objects in the
// CSSVariableImageTable, to give them the appropriate lifetime.
MOZ_ASSERT(aTargetValue->GetUnit() == eCSSUnit_TokenStream ||
aTargetValue->GetUnit() == eCSSUnit_Null,
"aTargetValue must only be a token stream (when re-parsing "
MOZ_ASSERT(aTarget->GetUnit() == eCSSUnit_TokenStream ||
aTarget->GetUnit() == eCSSUnit_Null,
"aTarget must only be a token stream (when re-parsing "
"properties with variable references) or null");
if (ShouldStartImageLoads(aRuleData, aTargetProp)) {
if (ShouldStartImageLoads(aRuleData, aProp)) {
nsIDocument* doc = aRuleData->mPresContext->Document();
TryToStartImageLoad(*aSrcValue, doc, aRuleData->mStyleContext,
aTargetProp,
aTargetValue->GetUnit() == eCSSUnit_TokenStream);
TryToStartImageLoad(*aValue, doc, aRuleData->mStyleContext,
aProp,
aTarget->GetUnit() == eCSSUnit_TokenStream);
}
*aTargetValue = *aSrcValue;
if (nsCSSProps::PropHasFlags(aTargetProp,
*aTarget = *aValue;
if (nsCSSProps::PropHasFlags(aProp,
CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED) &&
ShouldIgnoreColors(aRuleData))
{
if (aTargetProp == eCSSProperty_background_color) {
if (aProp == eCSSProperty_background_color) {
// Force non-'transparent' background
// colors to the user's default.
if (aTargetValue->IsNonTransparentColor()) {
aTargetValue->SetColorValue(aRuleData->mPresContext->
DefaultBackgroundColor());
if (aTarget->IsNonTransparentColor()) {
aTarget->SetColorValue(aRuleData->mPresContext->
DefaultBackgroundColor());
}
} else {
// Ignore 'color', 'border-*-color', etc.
*aTargetValue = nsCSSValue();
*aTarget = nsCSSValue();
}
}
}
/**
* If aProperty is a logical property, returns the equivalent physical
* If aProperty is a logical property, converts it to the equivalent physical
* property based on writing mode information obtained from aRuleData's
* style context.
*/
static inline nsCSSProperty
EnsurePhysicalProperty(nsCSSProperty aProperty, nsRuleData* aRuleData)
static inline void
EnsurePhysicalProperty(nsCSSProperty& aProperty, nsRuleData* aRuleData)
{
if (!nsCSSProps::PropHasFlags(aProperty, CSS_PROPERTY_LOGICAL)) {
return aProperty;
}
bool isSingleProperty =
nsCSSProps::PropHasFlags(aProperty,
CSS_PROPERTY_LOGICAL_SINGLE_CUSTOM_VALMAPPING);
bool isAxisProperty =
nsCSSProps::PropHasFlags(aProperty, CSS_PROPERTY_LOGICAL_AXIS);
bool isBlock =
@ -255,9 +184,7 @@ EnsurePhysicalProperty(nsCSSProperty aProperty, nsRuleData* aRuleData)
int index;
if (isSingleProperty) {
index = 0; // We always map to the same physical property.
} else if (isAxisProperty) {
if (isAxisProperty) {
LogicalAxis logicalAxis = isBlock ? eLogicalAxisBlock : eLogicalAxisInline;
uint8_t wm = aRuleData->mStyleContext->StyleVisibility()->mWritingMode;
PhysicalAxis axis =
@ -295,10 +222,9 @@ EnsurePhysicalProperty(nsCSSProperty aProperty, nsRuleData* aRuleData)
}
const nsCSSProperty* props = nsCSSProps::LogicalGroup(aProperty);
// Table-length is 1 for single prop, 2 for axis prop, 4 for block prop.
size_t len = isSingleProperty ? 1 : (isAxisProperty ? 2 : 4);
size_t len = isAxisProperty ? 2 : 4;
#ifdef DEBUG
for (size_t i = 0; i < len; i++) {
for (size_t i = 0; i < len; i++) {
MOZ_ASSERT(props[i] != eCSSProperty_UNKNOWN,
"unexpected logical group length");
}
@ -332,7 +258,7 @@ EnsurePhysicalProperty(nsCSSProperty aProperty, nsRuleData* aRuleData)
}
}
return props[index];
aProperty = props[index];
}
void
@ -352,9 +278,10 @@ nsCSSCompressedDataBlock::MapRuleInfoInto(nsRuleData *aRuleData) const
nsCSSProperty iProp = PropertyAtIndex(i);
if (nsCachedStyleData::GetBitForSID(nsCSSProps::kSIDTable[iProp]) &
aRuleData->mSIDs) {
nsCSSProperty physicalProp = EnsurePhysicalProperty(iProp,
aRuleData);
nsCSSValue* target = aRuleData->ValueFor(physicalProp);
if (nsCSSProps::PropHasFlags(iProp, CSS_PROPERTY_LOGICAL)) {
EnsurePhysicalProperty(iProp, aRuleData);
}
nsCSSValue* target = aRuleData->ValueFor(iProp);
if (target->GetUnit() == eCSSUnit_Null) {
const nsCSSValue *val = ValueAtIndex(i);
// In order for variable resolution to have the right information
@ -366,8 +293,7 @@ nsCSSCompressedDataBlock::MapRuleInfoInto(nsRuleData *aRuleData) const
if (val->GetUnit() == eCSSUnit_TokenStream) {
val->GetTokenStreamValue()->mLevel = aRuleData->mLevel;
}
MapSinglePropertyInto(iProp, val, physicalProp, target,
aRuleData);
MapSinglePropertyInto(iProp, val, target, aRuleData);
}
}
}
@ -809,14 +735,17 @@ nsCSSExpandedDataBlock::MapRuleInfoInto(nsCSSProperty aPropID,
const nsCSSValue* src = PropertyAt(aPropID);
MOZ_ASSERT(src->GetUnit() != eCSSUnit_Null);
nsCSSProperty physicalProp = EnsurePhysicalProperty(aPropID, aRuleData);
nsCSSProperty physicalProp = aPropID;
if (nsCSSProps::PropHasFlags(aPropID, CSS_PROPERTY_LOGICAL)) {
EnsurePhysicalProperty(physicalProp, aRuleData);
}
nsCSSValue* dest = aRuleData->ValueFor(physicalProp);
MOZ_ASSERT(dest->GetUnit() == eCSSUnit_TokenStream &&
dest->GetTokenStreamValue()->mPropertyID == aPropID);
CSSVariableImageTable::ReplaceAll(aRuleData->mStyleContext, aPropID, [=] {
MapSinglePropertyInto(aPropID, src, physicalProp, dest, aRuleData);
MapSinglePropertyInto(physicalProp, src, dest, aRuleData);
});
}

Просмотреть файл

@ -1330,22 +1330,6 @@ CSS_PROP_XUL(
kBoxOrientKTable,
CSS_PROP_NO_OFFSET,
eStyleAnimType_None) // XXX bug 3935
/* We treat -webkit-box-orient as a writing-mode-aware logical alias
* for "flex-direction": */
CSS_PROP_LOGICAL(
-webkit-box-orient,
webkit_box_orient,
WebkitBoxOrient,
CSS_PROPERTY_PARSE_VALUE |
CSS_PROPERTY_LOGICAL |
CSS_PROPERTY_LOGICAL_SINGLE_CUSTOM_VALMAPPING,
"layout.css.prefixes.webkit",
VARIANT_HK,
kBoxOrientKTable,
WebkitBoxOrient,
Position,
CSS_PROP_NO_OFFSET,
eStyleAnimType_None)
CSS_PROP_XUL(
-moz-box-pack,
box_pack,

Просмотреть файл

@ -44,17 +44,6 @@
// defined in nCSSProps.cpp named g<name_>LogicalGroupTable
// containing the two physical properties in vertical/horizontal
// order, followed by an nsCSSProperty_UNKNOWN entry.
//
// CSS_PROP_LOGICAL_GROUP_SINGLE(name_)
// Defines a logical property group in which the logical property always
// maps to the same physical property. For such properties, the
// "logicalness" is in the value-mapping, not in the property-mapping. For
// example, the logical property "-webkit-box-orient" is always mapped to
// "flex-direction", but its values ("horizontal", "vertical") map to
// different flex-direction values ("row", "column") depending on the
// writing-mode. A table must be defined in nsCSSProps.cpp named
// g<name_>LogicalGroupTable containing the one physical property,
// followed by an nsCSSProperty_UNKNOWN entry.
CSS_PROP_LOGICAL_GROUP_SHORTHAND(BorderColor)
CSS_PROP_LOGICAL_GROUP_SHORTHAND(BorderStyle)
@ -65,4 +54,3 @@ CSS_PROP_LOGICAL_GROUP_BOX(Offset)
CSS_PROP_LOGICAL_GROUP_SHORTHAND(Padding)
CSS_PROP_LOGICAL_GROUP_AXIS(MinSize)
CSS_PROP_LOGICAL_GROUP_AXIS(Size)
CSS_PROP_LOGICAL_GROUP_SINGLE(WebkitBoxOrient)

Просмотреть файл

@ -103,13 +103,10 @@ enum nsCSSPropertyLogicalGroup {
eCSSPropertyLogicalGroup_##name_,
#define CSS_PROP_LOGICAL_GROUP_BOX(name_) \
eCSSPropertyLogicalGroup_##name_,
#define CSS_PROP_LOGICAL_GROUP_SINGLE(name_) \
eCSSPropertyLogicalGroup_##name_,
#define CSS_PROP_LOGICAL_GROUP_SHORTHAND(name_) \
eCSSPropertyLogicalGroup_##name_,
#include "nsCSSPropLogicalGroupList.h"
#undef CSS_PROP_LOGICAL_GROUP_SHORTHAND
#undef CSS_PROP_LOGICAL_GROUP_SINGLE
#undef CSS_PROP_LOGICAL_GROUP_BOX
#undef CSS_PROP_LOGICAL_GROUP_AXIS
eCSSPropertyLogicalGroup_COUNT

Просмотреть файл

@ -3005,19 +3005,12 @@ static const nsCSSProperty gSizeLogicalGroupTable[] = {
eCSSProperty_UNKNOWN
};
static const nsCSSProperty gWebkitBoxOrientLogicalGroupTable[] = {
eCSSProperty_flex_direction,
eCSSProperty_UNKNOWN
};
const nsCSSProperty* const
nsCSSProps::kLogicalGroupTable[eCSSPropertyLogicalGroup_COUNT] = {
#define CSS_PROP_LOGICAL_GROUP_SHORTHAND(id_) g##id_##SubpropTable,
#define CSS_PROP_LOGICAL_GROUP_AXIS(name_) g##name_##LogicalGroupTable,
#define CSS_PROP_LOGICAL_GROUP_BOX(name_) g##name_##LogicalGroupTable,
#define CSS_PROP_LOGICAL_GROUP_SINGLE(name_) g##name_##LogicalGroupTable,
#include "nsCSSPropLogicalGroupList.h"
#undef CSS_PROP_LOGICAL_GROUP_SINGLE
#undef CSS_PROP_LOGICAL_GROUP_BOX
#undef CSS_PROP_LOGICAL_GROUP_AXIS
#undef CSS_PROP_LOGICAL_GROUP_SHORTHAND
@ -3318,10 +3311,7 @@ nsCSSProps::gPropertyUseCounter[eCSSProperty_COUNT_no_shorthands] = {
"the CSS_PROPERTY_LOGICAL_BLOCK_AXIS flag"); \
static_assert(!((flags_) & CSS_PROPERTY_LOGICAL_END_EDGE), \
"only properties defined with CSS_PROP_LOGICAL can use " \
"the CSS_PROPERTY_LOGICAL_END_EDGE flag"); \
static_assert(!((flags_) & CSS_PROPERTY_LOGICAL_SINGLE_CUSTOM_VALMAPPING),\
"only properties defined with CSS_PROP_LOGICAL can use " \
"the CSS_PROPERTY_LOGICAL_SINGLE_CUSTOM_VALMAPPING flag");
"the CSS_PROPERTY_LOGICAL_END_EDGE flag");
#define CSS_PROP_LOGICAL(name_, id_, method_, flags_, pref_, parsevariant_, \
kwtable_, group_, stylestruct_, \
stylestructoffset_, animtype_) \
@ -3334,21 +3324,7 @@ nsCSSProps::gPropertyUseCounter[eCSSProperty_COUNT_no_shorthands] = {
static_assert(!(((flags_) & CSS_PROPERTY_LOGICAL_AXIS) && \
((flags_) & CSS_PROPERTY_LOGICAL_END_EDGE)), \
"CSS_PROPERTY_LOGICAL_END_EDGE makes no sense when used " \
"with CSS_PROPERTY_LOGICAL_AXIS"); \
/* Make sure CSS_PROPERTY_LOGICAL_SINGLE_CUSTOM_VALMAPPING isn't used */ \
/* with other mutually-exclusive flags: */ \
static_assert(!(((flags_) & CSS_PROPERTY_LOGICAL_AXIS) && \
((flags_) & CSS_PROPERTY_LOGICAL_SINGLE_CUSTOM_VALMAPPING)),\
"CSS_PROPERTY_LOGICAL_SINGLE_CUSTOM_VALMAPPING makes no " \
"sense when used with CSS_PROPERTY_LOGICAL_AXIS"); \
static_assert(!(((flags_) & CSS_PROPERTY_LOGICAL_BLOCK_AXIS) && \
((flags_) & CSS_PROPERTY_LOGICAL_SINGLE_CUSTOM_VALMAPPING)),\
"CSS_PROPERTY_LOGICAL_SINGLE_CUSTOM_VALMAPPING makes no " \
"sense when used with CSS_PROPERTY_LOGICAL_BLOCK_AXIS"); \
static_assert(!(((flags_) & CSS_PROPERTY_LOGICAL_END_EDGE) && \
((flags_) & CSS_PROPERTY_LOGICAL_SINGLE_CUSTOM_VALMAPPING)),\
"CSS_PROPERTY_LOGICAL_SINGLE_CUSTOM_VALMAPPING makes no " \
"sense when used with CSS_PROPERTY_LOGICAL_END_EDGE");
"with CSS_PROPERTY_LOGICAL_AXIS");
#include "nsCSSPropList.h"
#undef CSS_PROP_LOGICAL
#undef CSS_PROP

Просмотреть файл

@ -250,26 +250,20 @@ static_assert((CSS_PROPERTY_PARSE_PROPERTY_MASK &
// margin-block-start or margin-inline-start).
#define CSS_PROPERTY_LOGICAL_END_EDGE (1<<26)
// This property is a logical property which always maps to the same physical
// property, and its values have some custom processing when being mapped to
// the physical property's values. Must not be used in conjunction with
// CSS_PROPERTY_LOGICAL_{AXIS,BLOCK_AXIS,END_EDGE}.
#define CSS_PROPERTY_LOGICAL_SINGLE_CUSTOM_VALMAPPING (1<<27)
// This property can be animated on the compositor.
#define CSS_PROPERTY_CAN_ANIMATE_ON_COMPOSITOR (1<<28)
#define CSS_PROPERTY_CAN_ANIMATE_ON_COMPOSITOR (1<<27)
// This property is an internal property that is not represented
// in the DOM. Properties with this flag must be defined in an #ifndef
// CSS_PROP_LIST_EXCLUDE_INTERNAL section of nsCSSPropList.h.
#define CSS_PROPERTY_INTERNAL (1<<29)
#define CSS_PROPERTY_INTERNAL (1<<28)
// This property has values that can establish a containing block for
// fixed positioned and absolutely positioned elements.
// This should be set for any properties that can cause an element to be
// such a containing block, as implemented in
// nsStyleDisplay::IsFixedPosContainingBlock.
#define CSS_PROPERTY_FIXPOS_CB (1<<30)
#define CSS_PROPERTY_FIXPOS_CB (1<<29)
// This property has values that can establish a containing block for
// absolutely positioned elements.
@ -278,10 +272,7 @@ static_assert((CSS_PROPERTY_PARSE_PROPERTY_MASK &
// nsStyleDisplay::IsAbsPosContainingBlock.
// It does not need to be set for properties that also have
// CSS_PROPERTY_FIXPOS_CB set.
#define CSS_PROPERTY_ABSPOS_CB (1u<<31)
// NOTE: Before adding any new CSS_PROPERTY_* flags here, we'll need to
// upgrade kFlagsTable to 64-bits -- see bug 1231384.
#define CSS_PROPERTY_ABSPOS_CB (1<<30)
/**
* Types of animatable values.
@ -555,11 +546,8 @@ public:
* by the sentinel.
*
* When called with a property that has the CSS_PROPERTY_LOGICAL_AXIS
* flag, the returned array will have two values preceding the sentinel.
* When called with a property that has the
* CSS_PROPERTY_LOGICAL_SINGLE_CUSTOM_VALMAPPING flag, the returned array
* will have one value preceding the sentinel.
* Otherwise it will have four values preceding the sentinel.
* flag, the returned array will have two values preceding the sentinel;
* otherwise it will have four.
*
* (Note that the running time of this function is proportional to the
* number of logical longhand properties that exist. If we start

Просмотреть файл

@ -304,6 +304,5 @@ skip-if = buildapp == 'b2g' || toolkit == 'android' #TIMED_OUT # b2g(bug 870262,
skip-if = buildapp == 'b2g' || toolkit == 'android' #TIMED_OUT # b2g(bug 870262, :visited support) b2g-debug(bug 870262, :visited support) b2g-desktop(bug 870262, :visited support)
[test_visited_reftests.html]
skip-if = buildapp == 'b2g' || toolkit == 'android' #TIMED_OUT # b2g(bug 870262, :visited support) b2g-debug(bug 870262, :visited support) b2g-desktop(bug 870262, :visited support)
[test_webkit_box_orient.html]
[test_webkit_device_pixel_ratio.html]
[test_asyncopen2.html]

Просмотреть файл

@ -4875,25 +4875,6 @@ function logical_box_prop_get_computed(cs, property)
return cs.getPropertyValue(property);
}
// Helper to get computed style of "-webkit-box-orient" from "flex-direction"
// and the "writing-mode".
function webkit_orient_get_computed(cs, property)
{
var writingMode = cs.getPropertyValue("writing-mode") || "horizontal-tb";
var mapping; // map from flex-direction values to -webkit-box-orient values.
if (writingMode == "horizontal-tb") {
// Horizontal writing-mode
mapping = { "row" : "horizontal", "column" : "vertical"};
} else {
// Vertical writing-mode
mapping = { "row" : "vertical", "column" : "horizontal"};
}
var flexDirection = cs.getPropertyValue("flex-direction");
return mapping[flexDirection];
}
// Get the computed value for a property. For shorthands, return the
// computed values of all the subproperties, delimited by " ; ".
function get_computed_value(cs, property)
@ -7209,21 +7190,6 @@ if (IsCSSPropertyPrefEnabled("layout.css.prefixes.webkit")) {
alias_for: "-moz-box-ordinal-group",
subproperties: [ "-moz-box-ordinal-group" ],
};
/* This one is not an alias - it's implemented as a logical property: */
gCSSProperties["-webkit-box-orient"] = {
domProp: "webkitBoxOrient",
inherited: false,
type: CSS_TYPE_LONGHAND,
logical: true,
get_computed: webkit_orient_get_computed,
initial_values: [ "horizontal" ],
other_values: [ "vertical" ],
invalid_values: [
"0", "0px", "auto",
/* Flex-direction values: */
"row", "column", "row-reverse", "column-reverse",
],
};
gCSSProperties["-webkit-box-align"] = {
domProp: "webkitBoxAlign",
inherited: false,

Просмотреть файл

@ -1,54 +0,0 @@
<!DOCTYPE html>
<meta charset=utf-8>
<title>
Test the writing-mode-dependent mapping of '-webkit-box-orient' values to
'flex-direction' values, when emulating -webkit-box styles with modern flexbox
</title>
<link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="testDiv" style="display: none"></div>
<script>
// Mappings from "-webkit-box-orient" values to "flex-direction" values,
// when writing-mode is horizontal:
const horizMapping =
{ "horizontal" : "row",
"vertical" : "column" };
// Same as above, but now when writing-mode is vertical:
const vertMapping =
{ "horizontal" : "column",
"vertical" : "row" };
const div = document.getElementById("testDiv");
// Test the various writing-mode values:
testWM("unset", horizMapping);
testWM("horizontal-tb", horizMapping);
testWM("vertical-lr", vertMapping);
testWM("vertical-rl", vertMapping);
testWM("sideways-lr", vertMapping);
testWM("sideways-rl", vertMapping);
/**
* Main test function:
* @param aWritingMode The writing-mode value to test.
* @param aMapping Mapping from -webkit-box-orient values to equivalent
* flex-direction values, for this writing-mode.
*/
function testWM(aWritingMode, aMapping) {
div.style.writingMode = aWritingMode;
for (var webkitBoxOrientVal in aMapping) {
div.style.webkitBoxOrient = webkitBoxOrientVal;
test(function() {
var expectedFlexDir = aMapping[webkitBoxOrientVal];
var actualFlexDir = window.getComputedStyle(div, "").flexDirection;
assert_equals(actualFlexDir, expectedFlexDir,
"Testing the 'flex-direction' value produced by " +
"'-webkit-box-orient:" + webkitBoxOrientVal + "'");
}, "Testing how '-webkit-box-orient' values influence 'flex-direction' " +
"in presence of 'writing-mode:" + aWritingMode + "'");
}
}
</script>