Commit Graph

552 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
7a40386fed Bug 1330874: Preserve neutral style changes for stylo. r=heycam
Since we use the presence of a change hint to determine whether we should
recreate a style context, we can't just strip them out on CalcStyleDifference.

MozReview-Commit-ID: GLhbTc2W3d7
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-01-15 16:10:01 +01:00
Xidorn Quan
97d13f46a3 Bug 1303241 part 2 - Make GetVisitedDependentColor use style structs directly. r=dbaron
I think there are three advantages of this change:
1. removes some dependencies from layout / painting code to pre-computed
   value stuff in the style system;
2. makes it easier to audit usage of specific fields in style structs
   (which is probably a side effect of the first one);
3. potentially improves performance since it doesn't go through the
   unnecessary general logic in ExtractComputedValue.

Also, combined with the part before, we get a unified list for visited-
dependent properties so that we can ensure the assertion here and the
style difference calc code are consistent.

MozReview-Commit-ID: 5B9aN7CfRgI

--HG--
extra : rebase_source : ac80eaea2474b9ec4b47b1cc9a5bdd2e61f6ec4d
2016-12-31 00:57:37 +11:00
Xidorn Quan
801cd27579 Bug 1303241 part 1 - Move visited-dependent style fields into a list file. r=dbaron
MozReview-Commit-ID: K4kc8ByNGoT

--HG--
extra : rebase_source : 0225be937ea2706ec43f56211550b966859afc8c
2017-01-05 11:22:36 +11:00
Andrew McCreight
fccb0645ed Bug 1323042 - forbid MOZ_COUNT_{CTOR,DTOR} for nsISupports classes; r=froydnj 2016-12-12 09:27:58 -05:00
Nathan Froyd
826598caba Backout aba6c73511a2 (bug 1307961) for massive test bustage resulting in a CLOSED TREE; r=alltheorange 2016-12-12 08:45:46 -05:00
Andrew McCreight
e31b5489da Bug 1307961 - require consistent bloatview reporting for nsISupports classes; r=froydnj 2016-12-12 07:58:33 -05:00
Daniel Holbert
560110f36c Bug 1321495 part 3: Add needed #includes to various .cpp files in layout/style, to preemptively fix unified-build bustage. r=TYLin
MozReview-Commit-ID: GEjKZqc06FO

--HG--
extra : rebase_source : 3b710c576a590b97251512d875d3365fd6fb0314
2016-12-01 10:40:04 -08:00
Bobby Holley
f8c9d884fc Bug 1317016 - Basic infrastructure for RestyleHint-driven traversal. r=emilio
MozReview-Commit-ID: 7wH5XcILVmX
2016-11-25 10:06:39 -08:00
Cameron McCormack
642cdb8e14 Bug 1288302 - Part 4: Perform final main thread work on style structs sourced from ServoComputedValues. r=xidorn
MozReview-Commit-ID: D6nQQ3yI4sx
2016-11-02 16:58:32 +08:00
Cameron McCormack
13f86cd932 Merge backout. 2016-11-01 08:43:23 +08:00
Cameron McCormack
02f1de5bbd Back out a0488e9c0024..5ebcedea1fa5 (bug 1288302 and bug 1310463) for Talos RSS regressions.
MozReview-Commit-ID: JB5uwDeO0We
2016-11-01 08:42:49 +08:00
Cameron McCormack
2cd316fd59 Bug 1288302 - Part 4: Perform final main thread work on style structs sourced from ServoComputedValues. r=xidorn
MozReview-Commit-ID: D6nQQ3yI4sx
2016-10-20 08:36:23 +08:00
Xidorn Quan
fe470c1653 Bug 1309868 part 3 - Make NonOwningStyleContextSource store const ServoComputedValues. r=heycam
MozReview-Commit-ID: G84fYXLbQyt

--HG--
extra : source : 85ba0fdfc05ec11dd08eba5a1b1f6a9d7e8acd8f
2016-10-18 15:29:03 +11:00
Xidorn Quan
a7771e9c76 Bug 1311598 part 2 - Declare Servo_GetStyle* functions in nsStyleContext.h. r=heycam
MozReview-Commit-ID: 5i3rX4ateH3

--HG--
extra : rebase_source : f541b11b9eeb5b76be99277300faf3cbfc777eca
extra : source : c600b8ff90d4d9f6e5a4aefcc4230842da22615e
2016-10-24 20:16:46 +11:00
Xidorn Quan
e92fe57924 Bug 1266621 part 5 - Convert border-color to store complex color. r=heycam
MozReview-Commit-ID: 19sl9f3EVgt

--HG--
extra : rebase_source : fba71e92cf7d23728a7c963ae12027e7aee7e986
2016-09-27 20:16:35 +10:00
Xidorn Quan
6972756593 Bug 1266621 part 3 - Convert outline-color to store complex color. r=heycam
MozReview-Commit-ID: 70tre2pYqi3

--HG--
extra : rebase_source : 18ff94f359dde9cd174e2991b7dd848686058057
2016-09-27 20:44:19 +10:00
Xidorn Quan
1c2e2c2361 Bug 1266621 part 2 - Convert column-rule-color to store complex color. r=heycam
MozReview-Commit-ID: AB2b5CPABOZ

--HG--
extra : rebase_source : 99766bfc2f7558935fa5adc869fa23844e3b909f
2016-09-27 20:12:08 +10:00
Xidorn Quan
cc1649886e Bug 1266621 part 1 - Convert text-decoration-color to store complex color. r=heycam
MozReview-Commit-ID: LEGICgvgQDY

--HG--
extra : rebase_source : 6c68c6e26648354d4d5515e199fdf07711eca726
2016-09-27 20:19:48 +10:00
Carsten "Tomcat" Book
4f900773f5 merge mozilla-inbound to mozilla-central a=merge 2016-09-21 12:03:31 +02:00
Andrea Marchesini
72d886f7a3 Bug 1301249 - nsIDocument::GetDocumentURI() should be fallible, r=smaug 2016-09-20 14:03:05 +02:00
Xidorn Quan
6b6e2ad7b2 Bug 1299741 part 11 - Change text-{emphasis,fill,stroke}-color to using StyleComplexColor. r=dbaron
MozReview-Commit-ID: 1MlgGAkdPn8

--HG--
extra : rebase_source : 293aa61adaa091bb3d4350a4b86ec9cfbb40eb02
2016-09-16 14:40:45 +10:00
Xidorn Quan
addef001bc Bug 1299741 part 10 - Make nsStyleContext.cpp:ExtractColor return a Maybe so that ExtractColorLenient can reuse that. r=birtles
MozReview-Commit-ID: HtqoWoJW8i6

--HG--
extra : rebase_source : 855783009cb8a8c800504299c53055634dbc66bd
2016-08-31 17:37:34 +10:00
Hiroyuki Ikezoe
447019c813 Bug 1216843 - Part 3: Use nsCSSValue instead of nscolor to store over 1.0 color components as an accumulated value so that we can correctly calculate intermediate values in interpolation. r=dholbert
MozReview-Commit-ID: GYdqYZA4xXf
2016-09-13 11:48:44 +09:00
Manish Goregaokar
aad318e17a Bug 1300337 - Replace None_ variants from nsStyleConsts.h with None; r=heycam,TYLin
MozReview-Commit-ID: CxHzbEzjLxT

--HG--
extra : rebase_source : 232f90b8b107f7fb49f47a29a4e493660b8a7d87
2016-09-04 00:16:58 +05:30
Emilio Cobos Álvarez
619cb14d87 Bug 1299066: Make NS_STYLE_DISPLAY_* an enum class. Prefer indexing instead of linear search in the frame constructor r=heycam,bz
The main renaming was generated with the following python script:

```

import sys
import re

CAMEL_CASE_REGEX = re.compile(r"(^|_|-)([A-Z])([A-Z]+)")
DISPLAY_REGEX = re.compile(r"\bNS_STYLE_DISPLAY_([^M][A-Z_]+)\b")

def to_camel_case(ident):
  return re.sub(CAMEL_CASE_REGEX,
                lambda m: m.group(2) + m.group(3).lower(), ident)

def constant_to_enum(constant):
  return "StyleDisplay::" + to_camel_case(constant) + ("_" if constant == "NONE" else "")

def process_line(line):
  return re.sub(DISPLAY_REGEX,
                lambda m: constant_to_enum(m.group(1)), line)

lines = []
with open(sys.argv[1], "r") as f:
  for line in f:
    lines.append(process_line(line))

with open(sys.argv[1], "w") as f:
  for line in lines:
    f.write(line)
```

And the following shell commands:

```
find . -name '*.cpp' -exec python display.py {} \;
find . -name '*.h' -exec python display.py {} \;
```

MozReview-Commit-ID: 91xYCbLC2Vf
2016-09-01 20:41:17 -07:00
Neerja Pancholi
0ab64cae78 Bug 1295271 - Remove all _moz_ prefixes from all instances of _moz_column r=dbaron
Command used:
find -E ./* -iregex '.*(\.cpp|\.h)' | xargs egrep -l '.*_moz_column.*' | xargs sed -i '' 's/_moz_column/column/g'


MozReview-Commit-ID: CJbSfDfhmle

--HG--
extra : rebase_source : f3989585c0f5ac98ebbcf7c9a729b4c89c5ddeab
2016-08-30 17:21:03 -07:00
L. David Baron
611f172de6 Bug 1251075 - Optimize away nsChangeHint_UpdateContainingBlock in nsStyleContext::CalcStyleDifference when possible. r=bz
MozReview-Commit-ID: 4Owobm1vZLn
2016-08-29 11:43:29 -07:00
Bobby Holley
6ba364070d Bug 1297572 - Prevent HasPseudoElementData from erroneously tracking anonymous boxes. r=heycam
The layout inspector ends up traversing into the root scroll frame in the next patch. If we don't
fix this, we erroneously enter this code here:

http://searchfox.org/mozilla-central/rev/44f6964ba95b8ddd8ebf70c55b34cd2323afeef4/layout/style/nsComputedDOMStyle.cpp#682

in this test:

devtools/client/inspector/markup/test/browser_markup_anonymous_04.js
2016-08-25 21:34:21 -07:00
Jeremy Chen
2cad5e8979 Bug 1296561 - calculate initial-letter's size according to specification. r=jfkthame
MozReview-Commit-ID: AtuY2UHCGaR

--HG--
extra : rebase_source : 2eecaf954695bb96aae1f1ce52a7b3df49e89618
2016-08-23 09:40:14 +08:00
Nathan Froyd
d9759d258f Bug 1295192 - part 1 - remove CPP_THROW_NEW on layout struct operator new overloads that forward to nsPresShell::AllocateByObjectID; r=dholbert
Structs in our style system use an arena-style allocation system,
managed by the presshell to which they belong.  All of the relevant
overloads that forward allocation requests to the presshell declare
themselves as CPP_THROW_NEW, which indicates that they do not throw
exceptions.  The C++ specification states that operator new overloads
that declare themselves to not throw exceptions require a null check on
their return value.  However, the relevant presshell allocation method,
AllocateByObjectID, is infallible and will never return a null pointer.

The callers of all of these methods are therefore doing useless
(compiler-generated) null checks.  Let's get rid of those useless checks
by removing the CPP_THROW_NEW annotations.  This change declares these
methods will return non-null pointers and throw exceptions in case of
errors--but as we don't use exceptions, and AllocateByObjectID will
abort on OOM, everything works out OK.
2016-08-17 15:28:45 -04:00
Jonathan Chan
4b87f11bd9 Bug 1293739 - Part 1: Rename nsCSSProperty to nsCSSPropertyID. r=dholbert
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
2016-08-16 18:37:48 -07:00
Gregory Szorc
1794619188 Backed out changesets dcdb85fc5517, 702bca0deee2, 9cKX8gC1ATA (bug 1293739) for build bustage; a=bustage
The merge from inbound to central conflicted with the merge from
autoland to central, it appears. Per tree rules, the commit from the
autoland repo wins and the inbound commit gets backed out.

CLOSED TREE

--HG--
extra : amend_source : 927e1cdfa8e55ccbd873d404d905caf6871c8c4f
extra : histedit_source : 07095868c3f767258e1d7d2645193bf4811b13bb%2Ca49ae5a28bf6e67298b6208ee9254c25a2539712
2016-08-16 17:50:40 -07:00
Wes Kocher
48b8d407c8 Merge inbound to central, a=merge
a=release to get around the webidl hook for a comment-only change

--HG--
extra : amend_source : f7e57101e1a25d3cf3536a256898ec2a21c54b38
2016-08-16 17:05:30 -07:00
Wes Kocher
57773cd69e Backed out 4 changesets (bug 1295192) for being a possible cause of crashtest assertions CLOSED TREE
Backed out changeset 7f10779fe019 (bug 1295192)
Backed out changeset e683dce4197a (bug 1295192)
Backed out changeset 67d12eaa8074 (bug 1295192)
Backed out changeset 44f143a01f78 (bug 1295192)
2016-08-16 11:22:04 -07:00
Xidorn Quan
ff0f0fef3b Bug 1295111 part 2 - Add static_assert to ensure that is updated properly. r=dbaron
MozReview-Commit-ID: G2RNUcXs4yQ

--HG--
extra : rebase_source : 0ecbe3e09a8783c7149959c3580116d9e3ecd449
2016-08-15 20:52:05 +10:00
Nathan Froyd
fa4f709cfd Bug 1295192 - part 1 - remove CPP_THROW_NEW on layout struct operator new overloads that forward to nsPresShell::AllocateByObjectID; r=dholbert
Structs in our style system use an arena-style allocation system,
managed by the presshell to which they belong.  All of the relevant
overloads that forward allocation requests to the presshell declare
themselves as CPP_THROW_NEW, which indicates that they do not throw
exceptions.  The C++ specification states that operator new overloads
that declare themselves to not throw exceptions require a null check on
their return value.  However, the relevant presshell allocation method,
AllocateByObjectID, is infallible and will never return a null pointer.

The callers of all of these methods are therefore doing useless
(compiler-generated) null checks.  Let's get rid of those useless checks
by removing the CPP_THROW_NEW annotations.  This change declares these
methods will return non-null pointers and throw exceptions in case of
errors--but as we don't use exceptions, and AllocateByObjectID will
abort on OOM, everything works out OK.
2016-08-16 17:05:39 -04:00
Julian Seward
0749ba9357 Bug 1289098 - Fixes to avoid Valgrind false positives with gcc-5.4 -O2 builds. r=dbaron.
--HG--
extra : rebase_source : 489e0686b650f329c41bc5d2c2504ac308b9541d
2016-08-16 11:05:08 +02:00
Jonathan Chan
9c62a2c11c Bug 1293739 - Part 1: Rename nsCSSProperty to nsCSSPropertyID. r=dholbert
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
2016-08-09 16:28:19 -07:00
Bobby Holley
3b101f50f2 Bug 1291885 - Use leak logging in a few more places. r=emilio 2016-08-03 18:31:04 -07:00
Emilio Cobos Álvarez
7f36b64101 Bug 1290335: stylo: Allow processing change hints generated from Servo. r=heycam
MozReview-Commit-ID: Alc0wcXvHcD
2016-08-03 15:11:15 -07:00
Bobby Holley
fe8622a540 Bug 1289622 - Add the ability to store change hints on the style context. r=heycam 2016-07-27 13:35:12 -07:00
Bobby Holley
747712c081 Bug 1289622 - Add a ServoComputedValues* overload for CalcStyleDifference. r=heycam 2016-07-27 13:35:11 -07:00
Bobby Holley
9f75d89883 Bug 1289622 - Delegate CalcStyleDifference to a templated helper. r=heycam 2016-07-27 13:35:09 -07:00
Jeremy Chen
9d8ddf9b2d Bug 1287308 - part1: replace uses of NS_STYLE_HINT_NONE with nsChangeHint(0). r=dbaron
MozReview-Commit-ID: CN66AimiuEu

--HG--
extra : rebase_source : 6caaa30e9afa8645ea31c4918230ba2ec53bc74a
2016-07-17 22:20:21 +08:00
Emilio Cobos Álvarez
e6ed33b04e Bug 1283242: style: Whitespace cleanup and remove dead code. r=bobbyholley+313730
gNewCount and gSharedCount aren't even declared.

--HG--
extra : rebase_source : 3c7d79a360ad6eef2e884de513ee45a289d4cd0a
2016-06-29 11:27:42 +00:00
Cameron McCormack
2a58c3e595 Bug 1277163 - Rename nsStyleContext* argument to Calc(Style)Difference methods to indicate it's the new style. r=dbaron
MozReview-Commit-ID: 9AvGc1tjJpx
2016-06-21 11:47:54 +10:00
Bobby Holley
9c8af73cc2 Bug 1274443 - Avoid calling ApplyStyleFixups for ServoComputedValues. r=heycam 2016-05-24 18:50:28 -07:00
Bobby Holley
e4b157691b Bug 1274443 - Properly cache and flag servo style structs in nsStyleContext::StyleData. r=heycam 2016-05-24 18:50:26 -07:00
Jeremy Chen
685cf4c3d8 Bug 1273766 - part3: purge NS_UpdateHint inline. r=heycam
MozReview-Commit-ID: IIOT9jq8hOl

--HG--
extra : rebase_source : dfb3d874ce4419f32f13e662bd495e97ac9cac10
2016-05-23 11:26:03 +08:00
Jeremy Chen
0f24420a8f Bug 1273766 - part2: purge NS_SubtractHint inline. r=heycam
MozReview-Commit-ID: 1UX1wZJNnat

--HG--
extra : rebase_source : e74d1cf5ca0866897634339a0fe6df65e0d249ae
2016-05-23 11:26:03 +08:00