Commit Graph

900 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
553bdcbf4a Bug 1359779: Also look at pseudo frames in nsComputedDOMStyle::DoGetStyleContextNoFlush. r=heycam
MozReview-Commit-ID: IvAehgyv18T
2017-04-26 13:54:44 +02:00
Brian Birtles
4fe0c1c856 Bug 1355348 - Convert stylo assert in nsComputedDOMStyle::DoGetStyleContextNoFlush to a warning; r=hiro
This allows us to run SMIL tests that include a combination of additive and
non-additive animation.

MozReview-Commit-ID: 2uVN184h7Ge
2017-04-26 13:00:12 +09:00
Emilio Cobos Álvarez
eca214dbd7 Bug 1355351: Look for the frame for ::before and ::after pseudos. r=heycam
MozReview-Commit-ID: 7Hm2IGsl323
2017-04-16 22:59:29 +02:00
Daniel Holbert
a8a2232acc Bug 1357117 part 3: Serialize -webkit-linear-gradient() expressions using the (less-expressive) -webkit-linear-gradient syntax, instead of -moz-linear-gradient. r=heycam
Specifically:
* This patch uses a flag added in a prior patch to let us use the author's
  chosen prefix (-webkit or -moz) when serializing.  (We treat the -moz version
  as a special case, because that makes it more straightforward to unsupport
  -moz if/when we can.)
* This patch makes us share the linear-gradient() side-or-corner serialization
  codepath when serializing points for -webkit-linear-gradient. (The
  alternative is the -moz-linear-gradient codepath, which defaults to
  serializing with percent values 0%/100% for sides & corners -- and raw
  percentages are invalid in -webkit-linear-gradient(), so we can't share that
  codepath.) Notably, we have to skip the "to " token that the
  linear-gradient() codepath would normally print out -- that was a late
  addition to the spec and so it only exists in the unprefixed modern syntax.
  (Instead, -webkit-linear-gradient syntax is implicitly "from" the given
  point).


MozReview-Commit-ID: 9Oqo8nG1XDU
2017-04-25 11:48:41 -07:00
Daniel Holbert
d078e2e1d1 Bug 1357117 part 1: Change linear-gradient serialization code to group space separator with the "to" token. r=heycam
This patch doesn't change our behavior -- we'll still produce the same serialization that we would've before.

MOTIVATION: A later patch will make us share this codepath to serialize into
-webkit-linear-gradient() syntax.  That syntax uses the same representation for
points as unprefixed modern linear-gradient() (with box-side-or-corner keywords
"top", "right", etc.), but it does *not* use the word "to".  So we'd like to
allow "to"-and-its-subsequent-space-character to be optional. Hence, this patch
groups the space together with "to", rather than as a prefix on the next token,
so that we can skip right to printing the point (without a leading space)
when we add support for -webkit-linear-gradient() serialization.

MozReview-Commit-ID: 5fCzx4NmpcC
2017-04-25 11:48:37 -07:00
Daisuke Akatsuka
4e8abff7f9 Bug 1210796 - Part 1a: Add GetUnanimatedComputedStyle into nsIDOMWindowUtils to use in animationinspector of devtools. r=birtles,heycam
In this patch, we implement nsIDOMWindowUtils::GetUnanimatedComputedStyle
which returns computed value of given CSS property without animation rule.  This
method is used from the DevTools animation inspector to fill in keyframe values
when the property value is null (indicating that the underlying/base value is
being used).

In order to implement this, we extend nsComputedDOMStyle constructor to fetch
the computed style minus animation style (i.e. the base style). This is somewhat
complicated by the fact that for discrete animation.
StyleAnimationValue::ExtractComputedValue may return ‘unset’, ‘initial’ or
‘inherit’. For example, if the author uses the 'unset' 'initial' or 'inherit'
keyword for a discrete property (e.g. 'align-content’), ExtractComputedValue
returns the keywords as-is. Furthermore, if the user does not set any specific
keyword, ExtractComputedValue returns ‘unset’.  We use this new
nsComputedDOMStyle mechanism to resolve these keywords into a valid keyword for
computed style in the same way as other properties (e.g. ‘opacity’).

MozReview-Commit-ID: HffJ9SCDf2k
2017-04-18 12:15:47 +09:00
Hiroyuki Ikezoe
de5ee3a9e0 Bug 1324700 - Add ResolveServoTransientStyle to get servo's computed values instead of nsStyleContext. r=heycam
Also this patch add nsIAtom as an argument to ResolveTransientStyle() to call
the new function ResolveServoTransientStyle easier. The only call site of the
ResolveTransientStyle() has already nsIAtom* there.

MozReview-Commit-ID: IwxqZbaCSpB
2017-04-15 07:37:34 +09:00
Xidorn Quan
965dabfa7a Bug 1355683 - Remove Window.getDefaultComputedStyle. r=bz
MozReview-Commit-ID: A2IwfiJiPL
2017-04-13 16:50:37 +08:00
Xidorn Quan
0f2df09dac Bug 1355734 - Remove text-decoration-line: -moz-anchor-decoration. r=heycam,masayuki
MozReview-Commit-ID: 4TmVncV1K5G
2017-04-13 16:17:03 +08:00
Nazım Can Altınova
b416f7e28d Bug 1341761 - Convert nsStyleImage::mElementId to use nsIAtom. r=xidorn
MozReview-Commit-ID: 9YcbhMmXYoi
2017-04-09 16:44:36 +03:00
Ting-Yu Lin
1f30e57fa0 Bug 1351205 - Skip debug check for Stylo in nsComputedDOMStyle::UpdateCurrentStyleSources(). r=heycam
The debug code calls nsStyleContext::GetParent(), which is invalid in stylo.
Let's skip it.

MozReview-Commit-ID: 5opMaSuyoNr
2017-03-28 16:08:07 +08:00
cku
821fbb7591 Bug 1352096 - Part 2. Remove Layer::mSourceURI. r=heycam
Now, remove Layer::mSourceURI, there are several benefit of doing this:
1. Reduce the size of nsStyleImage::Layer.
2. By storing style image and url information in nsStyleImage, we can remove
many verbose comments. That is becasue there is no need to explain why we use
mSourceURI here, or why we use nsStyleImage there anymore.
3. Since all inforamtion is stored in on place, nsStyleImage, we can setup image
request or URLs by one single Gecko_SetUrlImageValue call.

MozReview-Commit-ID: 7aTQobddTB1
2017-03-31 01:50:21 +08:00
Xidorn Quan
c61841a1ad Bug 1343964 part 7 - Use URLExtraData for declaration modification directly for Servo backend. r=heycam
MozReview-Commit-ID: 78JRYKk9hgV
2017-04-04 16:09:20 +10:00
Carsten "Tomcat" Book
f00871f796 merge mozilla-inbound to mozilla-central a=merge 2017-04-06 12:50:50 +02:00
Hiroyuki Ikezoe
2aaa9d1814 Bug 1311257 - Update comment refering to bug 1311257. r=birtles
MozReview-Commit-ID: EM1dYILDlzS
2017-04-06 11:51:29 +09:00
Brian Birtles
74dd2a26b3 Bug 1315874 - Tweak some line wrapping in DoGetStyleContextNoFlush; r=heycam
In ensuring that this method does *not* re-use the existing style context if
aStyleType != eAll, I found it easy to miss this check in the multi-condition if
statement due to the way some, but not all, of the conditions are on one line.
I think this would be a little easier to read if this multi-line condition used
one line per condition.

MozReview-Commit-ID: 4UOAGhAndIV
2017-04-03 16:49:10 +09:00
Brian Birtles
dfa0ce70c5 Bug 1315874 - Drop animation styles if we re-use an existing style context in DoGetStyleContextNoFlush for non-animation style; r=heycam
MozReview-Commit-ID: GrB8A8bVLiX
2017-04-03 16:49:10 +09:00
Brian Birtles
7eef79dbda Bug 1315874 - Make GetStyleContextWithoutAnimation not flush; r=heycam
There are currently no call sites of GetStyleContextWithoutAnimation
but there are a couple of places (including this patch series) where we would
like to use such a method, but without the flushing behavior.

This patch drops the flushing from GetStyleContextWithoutAnimation and
renames it to GetUnanimatedStyleContextNoFlush. It also makes a few other minor
tweaks:

* Adds the aStyleType parameter for consistency with GetStyleContextNoFlush and
  GetStyleContext
* Moves the implementation of this method and GetStyleContextNoFlush to the
  header file since they simply wrap DoGetStyleContextNoFlush.
* Changes the order of these declarations so that the more specialized method
  comes later.
* Drops the comment describing the method since both the method name and the
  inline definition should now make it obvious what it is doing.

(Actually making this method not return animation styles when it re-uses an
existing style context will happen in the next patch.)

MozReview-Commit-ID: JYeim4A9Imr
2017-04-03 16:49:09 +09:00
Brian Birtles
4de61d72aa Bug 1315874 - Drop 'ForElement' from GetStyleContextForElementXXX methods; r=heycam
In the next patch we want to add a method called
GetUnanimatedStyleContextForElementNoFlush but that's much too long. Instead it
seems better to just drop 'ForElement' from all these methods since it should be
fairly obvious we are getting the style context for an element given that the
first argument is an element.

MozReview-Commit-ID: JQKaEuCKV2F
2017-04-05 14:39:23 +09:00
Bobby Holley
b86b97cc10 Bug 1350244 - Back out bug 1348606 part 5 (Use a threadsafe array for counters). r=me
This reverts commit 07301f1c3f71b36dbe2345e8faa9bc6d643cfc97.

MozReview-Commit-ID: 8tLjUhki2C1
2017-03-29 11:05:17 -07:00
Jan Henning
7ce23f0b71 Bug 1328868 - Part 2 - Apply the system font scale as an additional text zoom factor to all pages that are not font inflated. r=tnikkel
We want to use a similar model as Chrome on Android does for scaling our display of web content, that is use font inflation for desktop pages and plain text zooming for everything else.

Since we don't want to simply clobber any text zoom that might have been set by the user/front-end code, we allow setting and storing the system font scale separately on the PresContext. We then calculate the effective text zoom value as the product of the system font scale and the current text zoom value.

Any function that is using the PresContext's TextZoom value for layouting/rendering is switched over to this new EffectiveTextZoom value, whereas functions that are interested in the text zoom as actually set by the user/front-end (e.g. the nsDocumentViewer, or the code responsible for copying text and full zoom settings into the new PresContext on page navigation) continue using the plain TextZoom value.

As long as font inflation is enabled in principle (e.g. font.size.inflation.minTwips != 0), every page starts out as eligible for font inflation until the relevant meta viewport tags marking the page as "mobile friendly" have been detected. Since the PresShell caches the font inflation state and only recalculates it when necessary, we make use of that and set the PresContext's system font scale as necessary whenever the font inflation state has been refreshed.

MozReview-Commit-ID: 2InyE04wKAW
2017-02-25 13:22:52 +01:00
Ting-Yu Lin
6b854b6f48 Bug 1322570 Part 2 - Resolve {align,justify}-self using StyleContext from alignment container frame in ReflowInput::InitConstraints(). r=dholbert
Per bug 1322570 comment 46, it's not easy to replace ComputedJustifyItems()
and UsedJustifySelf()'s internal nsStyleContext::GetParent() without
correctness penalty, so we use GetParentAllowServo() for now.

Also, fix the reftest.list added in bug 1334403 which incorrectly wrote test
page as reference page.

MozReview-Commit-ID: 6kAAWSFojd5
2017-03-20 14:12:08 +08:00
Mats Palmgren
8297bf43a1 Bug 1333482 part 1 - [css-ui] Introduce the 'appearance: auto | none' property. r=dholbert
MozReview-Commit-ID: 3itCDTKuYQ9
2017-03-23 22:11:17 -07:00
Bobby Holley
c374cf6caa Bug 1348606 - Use a threadsafe array for counters. r=xidorn
MozReview-Commit-ID: KgTgcD5mGqr
2017-03-23 10:56:49 -07:00
Jeremy Chen
38e7820d15 Bug 1347819 - change nsFont::languageOverride to store uint32_t directly. r=jfkthame
Since font-language-override can only have a single three-letter tag, and it is
eventually converted to uint32_t while creating gfxFontStyle, we should be able
to move the conversion ahead, to an earlier stage.

In this patch, we move the ParseFontLanguageOverride to nsRuleNode, so we could
do the nsString-to-uint32_t conversion during computing time.

MozReview-Commit-ID: LA4Bv3wV7K
2017-03-23 21:59:55 +08:00
Cameron McCormack
0344da46e0 Bug 1330843 - Allow JS to create NAC pseudo-elements. r=bholley
MozReview-Commit-ID: 2aBPoCOsT6R
2017-03-17 15:30:34 +08:00
cku
14c0f9ceb9 Bug 1340044 - Part 2. Rename value in StyleGeometryBox. r=heycam
This change is to use gecko_enum_prefix in helpers.mako.rs, so that we do not
need to manually write code for nsStyleDisplay::mTransformBox.

MozReview-Commit-ID: 7UAL0iUcSIO
2017-03-16 15:18:10 +08:00
Xidorn Quan
eeb451c4a2 Bug 1345804 part 3 - Change will-change to store nsIAtom rather than nsString. r=heycam
MozReview-Commit-ID: 5ISVZwKw6LI
2017-03-10 12:26:53 +11:00
cku
07333a0c53 Bug 1345739 - Implement nsStyleImageRequest::GetImageURI. r=heycam
MozReview-Commit-ID: Jqhio1RaqG1
2017-03-09 13:03:32 +08:00
Boris Chiou
c7d71d646d Bug 1248340 - Part 4: Implement Frames in the style system. r=dholbert
Use eCSSUnit_Function to store the frames timing function. Also, add one more
css keyword: frames.
The following changes are included in this:
1. Parser changes.
2. Serialization.
3. Computation in nsRuleNode.
4. Invalid and other values in property_database.js

MozReview-Commit-ID: 887QcXHQ2pU
2017-02-24 14:50:08 +08:00
Boris Chiou
2e08ec42b1 Bug 1248340 - Part 1: Add the type of Frames in nsTimingFunction. r=birtles
MozReview-Commit-ID: GPn8D9gwjqa
2017-02-24 14:34:08 +08:00
Neerja Pancholi
5fddb99f6b Bug 1339298 - Add boilerplate code for CSS3 multicol column-span parsing and define pref 'layout.css.column-span.enabled' to toggle it. r=dholbert
MozReview-Commit-ID: 6aSlRhcKm8i
2017-02-13 16:57:33 -08:00
jeremychen@mozilla.com
8e500e1044 Bug 276079 - parse and compute CSS text-justify property. r=xidorn
MozReview-Commit-ID: K3bh0H2SPnE
2017-03-01 20:58:25 +08:00
Neerja Pancholi
55ce6ad5a8 Bug 1339619 - Refactor parsing code for '-moz-text-size-adjust' to use the (more conventional) keyword table approach to calculate computed style. r=dholbert
MozReview-Commit-ID: 2mawqnlUh8t
2017-02-16 13:27:16 -08:00
cku
1819876e04 Bug 1336905 - Part 1. Remove StyleShapeSource's template argument. r=heycam,TYLin
MozReview-Commit-ID: FHTwGyXHsce
2017-02-21 23:26:17 +08:00
Xidorn Quan
57b3c7d52d Bug 1339394 - Don't serialize transparent color to transparent keyword when not necessary. r=heycam,jaws
MozReview-Commit-ID: 59cmaCoFJMR
2017-02-16 10:26:13 +11:00
Cameron McCormack
87f3ad6dfb Bug 1297899 - Part 6: Move RestyleManagerHandle functionality into RestyleManager. r=bholley
MozReview-Commit-ID: 7lsti0bGzNr
2017-02-13 11:21:33 +08:00
Cameron McCormack
34c943ee6e Bug 1297899 - Part 3: Rename RestyleManager to GeckoRestyleManager and RestyleManagerBase to RestyleManager. r=bholley
MozReview-Commit-ID: fFTZKwmGJm
2017-02-13 11:21:32 +08:00
Cameron McCormack
61f5edfdb9 Bug 1297899 - Part 1: Rename RestyleManager.{h,cpp} to GeckoRestyleManager.{h,cpp}. r=bholley
MozReview-Commit-ID: 1v0ufuGFtiD
2017-02-13 11:21:30 +08:00
Iris Hsiao
97929fe90a Backed out changeset ae26b4e4d59b (bug 1339394) for developer's request 2017-02-15 13:10:35 +08:00
Xidorn Quan
5444bad47a Bug 1339394 - Don't serialize transparent color to transparent keyword when not necessary. r=heycam
MozReview-Commit-ID: 59cmaCoFJMR
2017-02-14 22:43:32 +11:00
Xidorn Quan
4cdc3377d9 Bug 1339341- Downgrade several stylo errors to warnings. r=heycam
MozReview-Commit-ID: 2Sa8dS8uSo5
2017-02-14 18:26:10 +11:00
Carsten "Tomcat" Book
1bff0b1adf Backed out changeset fb3c04effbd1 (bug 1336905) for bustage in stylo builds 2017-02-14 11:07:17 +01:00
cku
b2b713cfd2 Bug 1336905 - Part 1. Remove StyleShapeSource's template argument. r=heycam,TYLin
MozReview-Commit-ID: FHTwGyXHsce
2017-02-06 15:50:22 +08:00
Daniel Holbert
6153419a43 Bug 1336223 part 3: Add a missing #include to nsComputedDOMStyle.cpp. r=xidorn
MozReview-Commit-ID: ERFagYJrxeA
2017-02-02 15:18:38 -08:00
Boris Zbarsky
33b60b6ff4 Bug 1332322 part 2. Rename nsWrapperCache::IsBlack to nsWrapperCache::HasKnownLiveWrapper. r=mccr8 2017-01-24 20:38:58 -05:00
Hiroyuki Ikezoe
37e7acf754 Bug 1330190 - Part 4: Resolve styles without animations in case of GetStyleContextForElementWithoutAnimation(). r=heycam
Now we skip nsAnimationManager::UpdateAnimations() and
EffectCompositor::UpdateEffectProperties() in case of
GetStyleContextForElementWithoutAnimation().

MozReview-Commit-ID: 4rF6n3XtMQq
2017-01-16 17:41:20 +09:00
Hiroyuki Ikezoe
6f69d969b2 Bug 1330190 - Part 1: Add nsComputedDOMStyle::GetStyleContextForElementWithoutAnimation. r=heycam
We need another variant of GetStyleContextForElement() that does not consider
animation rules at all to get the base styles of the target element (i.e.
styles without animations).
In subsequent patches we also skip nsAnimationManager::UpdateAnimations() and
EffectCompositor::UpdateEffectProperties() to avoid (indirect) recursive calls
for resolving style of the same element.

MozReview-Commit-ID: G5olgXIMtvY
2017-01-16 16:57:09 +09:00
Bobby Holley
0aaca3b258 Bug 1325734 - Simplify ElementData and eliminate the concept of consuming styles. r=emilio 2017-01-09 11:50:16 -08:00
Cameron McCormack
b0bc3dd2b1 Bug 1315155 - Part 1: Encapsulate nsStyleContentData. r=xidorn
MozReview-Commit-ID: LfEMxyM5meF
2016-10-20 10:22:46 +08:00