So that they can be put inside anonymous structs and unions.
MozReview-Commit-ID: 8OMxkSZJEOz
--HG--
extra : rebase_source : 9626d350649f4ba6dba597e3df05fe1829307610
This is a complete rewrite of the original part 8. Instead of storing
the ratio in mValueExtra, all values are stored in a struct in heap,
so that we support range outside [0.0, 1.0] in computation.
MozReview-Commit-ID: 7xUZSgQE5vA
--HG--
extra : rebase_source : 722d2aee06e59cdf061d0daae43d8dbc0a9641b4
This struct will be used as part of the storage type of ComplexColor in
nsCSSValue. Also this will be used to help unifying color calculation in
StyleAnimationValue.
MozReview-Commit-ID: C5UUI5DNnRM
--HG--
extra : rebase_source : b76c7d39ca21e4316a09524bbbc918a12ab81194
With this change, we could share this EnumTypeTraits between files easily.
MozReview-Commit-ID: 9Q2augati7l
--HG--
extra : rebase_source : b7d9fc95d9d7722ba3eb99ec9798a64ebdbeb484
nsCSSValue::GetColorValue() for eCSSUnit_PercentageRGBAColor/eCSSUnit_PercentageRGBColor
returns a clamped value, nsCSSValueFloatColor::Comp1()/Comp2()/Comp3()/Alpha()
returns a raw value instead.
This patch is generated by the following commands (note: if you're running
using OS X's sed, which accepts slightly different flags, you'll have to
specify an actual backup suffix in -i, or use gsed from Homebrew):
hg stat -c \
| cut -c 3- \
| tr '\n' '\0' \
| xargs -0 -P 8 gsed --follow-symlinks 's/\bnsCSSProperty\b/nsCSSPropertyID/g' -i''
Then:
hg mv layout/style/nsCSSProperty.h layout/style/nsCSSPropertyID.h
... and finally, manually renaming nsCSSProperty in the include guard in
nsCSSProperty.h.
MozReview-Commit-ID: ZV6jyvmLfA
--HG--
rename : layout/style/nsCSSProperty.h => layout/style/nsCSSPropertyID.h
To avoid calculate +/-infinite function value, we clamp it in the parser level.
Also, we use EnsureNotNan while calculating the interpolation for translate
function, so it's also better to do EnsureNotNan before call SetFloatValue()
while calculating the interpolation for rotate (AddCSSValueAngle) and scale
functions.
MozReview-Commit-ID: 1k19ytyNG1N
--HG--
extra : rebase_source : 73f152b52e067d52a1925215ad78a4c5cc736fd7
This adds support for #rgba and #rrggbbaa colors to CSS. This feature
is specified in https://drafts.csswg.org/css-color-4/#hex-notation .
This adds new types to nsCSSValue so that we can serialize the syntax
that was specified, as we do for other distinctions in how colors are
specified.
It does not change the behavior of the hashless color quirk, which
continues to support only 3 and 6 digit colors as specified in
https://quirks.spec.whatwg.org/#the-hashless-hex-color-quirk (step 4).
This changes property_database.js to remove various uses of 4 and 8
digit colors as invalid values. It then adds them in slightly fewer
places as valid values, but more thoroughly testing both initial and
non-initial values on 'color'.
It marks two canvas tests explicitly testing this feature as no longer
known to fail by removing their .ini files.
Finally, it adjusts the web platform test testing the hashless color
quirk to no longer treat 4 and 8 digit colors with hashes as invalid
values. Removing the relevant test items seems like the right thing
since they're in a section where 3 and 6 digit colors were skipped but
other lengths were tested. Modifying this imported test is OK since:
<jgraham> dbaron: Commit the change you want to m-c, it is
(semi-)automatically upstreamed every so often (typically
about once a week)
MozReview-Commit-ID: IFq4HxaRkil
When we go to switch CSS Animations over to using
KeyframeEffectReadOnly::SetFrames we will need a way to represent any filled-in
from/to values as nsCSSValue objects. These objects are built from the current
computed style. We currently use StyleAnimationValue::ExtractComputedValue for
this which returns a StyleAnimationValue. In order to convert this to an
nsCSSValue we can use StyleAnimationValue::UncomputeValue. However, in some
cases, the nsCSSValue objects returned by that method are dependent on the
passed-in StyleAnimationValue object.
This patch adds an overload to UncomputeValue that takes an rvalue
StyleAnimationValue reference and produces an nsCSSValue that is independent
of the StyleAnimationValue through a combination of copying data and
transferring ownership of data.
This patch also adjusts the return value for the case of filter and shadow
lists when the list is empty so that we return a none value in this case.
These are the only list types which are allowed to have a null list value.
Not only does this produce the correct result when these values are serialized
(the initial value for 'filter', 'text-shadow', and 'box-shadow' is 'none') it
also means that UncomputeValue should never return an nsCSSValue whose unit is
null which is important because when we later pass that value to BuildStyleRule
it will treat a null nsCSSValue as an error case (specifically, "longhand failed
to parse").
MozReview-Commit-ID: 4RoCn39ntiJ
The only substantive change here, apart from a few variables changing in
size from uint16_t to uint8_t, is FontFaceSet's use of SheetType::Unknown
(0xFF) instead of 0 for FontFaceRecords for script-created FontFaces.