Commit Graph

501 Commits

Author SHA1 Message Date
Jeremy Chen
753e4f7268 Bug 1248708 - Part1: parse and compute -webkit-text-stroke property. r=heycam 2016-04-23 01:40:39 +08:00
Xidorn Quan
60633d5469 Bug 1260543 - Treat currentcolor as computed value which is not interpolatable with actual color for text-emphasis-color and -webkit-text-fill-color. r=birtles
MozReview-Commit-ID: GUXEDHxOdNC
2016-04-08 13:43:09 +10:00
Cameron McCormack
f53f4c30de Bug 1266324 - Rename style const macro for unicode-bidi:bidi-override to be consistent with other style consts. r=jfkthame 2016-04-22 10:37:21 +10:00
Xidorn Quan
5742e29b02 Bug 1097499 part 4 - Adjust computed value of writing-mode on text frames when text-combine-upright is used. r=heycam
MozReview-Commit-ID: KNRe0ZpzxGr
2016-04-22 09:18:41 +10:00
Xidorn Quan
15df861e15 Bug 1097499 part 3 - Add a separate anonbox for text nodes. r=heycam
MozReview-Commit-ID: 1GfoFEGhyka
2016-04-22 09:18:41 +10:00
Xidorn Quan
3dc0ea538e Bug 1097499 part 2 - Add a macro to simplify usage of nsStyleContext::GetUniqueStyleData. r=heycam
MozReview-Commit-ID: IS8KUbkXp8m
2016-04-22 09:18:41 +10:00
Bobby Holley
5ab15fd62b Bug 1258017 - Cleanup fixes for trunk. r=me 2016-04-21 13:56:40 -07:00
Cameron McCormack
4496226b12 Bug 1261754 - Part 8: Move box-shadow from nsStyleBorder to a new nsStyleEffects struct. r=dholbert 2016-04-12 15:52:42 +10:00
Cameron McCormack
0739b68747 Bug 1261754 - Part 3: Move quotes from nsStyleQuotes to nsStyleList and delete nsStyleQuotes. r=dholbert 2016-04-12 15:52:40 +10:00
Cameron McCormack
b45af596f7 Bug 1261265 - Fix nsStyleContext::MoveTo flag assertions to allow mismatch on parents if bit is set on child. r=dholbert 2016-04-11 16:22:05 +10:00
Bobby Holley
f7d00ff7ed Bug 1261552 - Introduce StyleStructContext, and make all style struct constructors take it. r=heycam 2016-04-04 23:14:29 -07:00
Bobby Holley
b7037d0db8 Bug 1260310 - Generalize nsStyleContext to support resolving styles from either nsRuleNode or ServoComputedValues. r=heycam 2016-03-29 22:16:35 -07:00
Bobby Holley
cbcd56169e Bug 1258017 - Redesign and simplify rule tree GC. r=dbaron
The basic idea here is as follows:
* Rule nodes are reference-counted, but releasing them adds them to a linked
  list rather than freeing them. This allows for the reuse that motivated the
  original GC scheme.
* We get rid of the marking, and instead rely on the reference count.
* Sweeping no longer requires a complicated traversal. We just pop items
  off the free list until it's empty. When a child is destroyed, its parent
  may go onto the free list.
* We remove special handling for the root node, and use a regular reference-counted
  edge from the style set.
* The free list automatically asserts that it's empty (meaning all nodes have been
  freed) in its destructor, which runs when the style set is destroyed.
* We get rid of the list of style context roots on the style set. We still need
  a count though, because of the HasCachedStyleData check.
2016-03-28 08:59:22 -07:00
Bobby Holley
abcb3eed96 Bug 1258017 - Use a RefPtr to hold onto the parent style context. r=dbaron 2016-03-28 08:59:21 -07:00
Jeremy Chen
f9662ce154 Bug 1247777 - Part1: parse and compute -webkit-text-fill-color property. r=heycam 2016-03-25 15:54:49 +08:00
Daniel Holbert
22b6cb5f0f Bug 1236400 part 1: Add internal enum values to represent "display: -webkit-box" & "display: -webkit-inline-box". r=mats
These new enum values are added with same behavior as their modern flexbox
equivalents -- they're hooked up to NS_NewFlexContainerFrame, and they're
listed alongside the modern flexbox enums in 'switch' & 'if' statements.

There's one exception, which I call out with a comment at the end of the patch:
we don't treat -webkit-box the same as flexbox in IsFlexOrGridDisplayType(),
because that method is used to determine whether we should blockify
inline-level children of a flex/grid container, and we don't want to blockify
any children of a -webkit-box. (Instead, we want to wrap them in an anonymous
flex item. That happens in the next patch.)

MozReview-Commit-ID: 9BB4Ib2KpvE
2016-03-24 09:55:11 -07:00
Mats Palmgren
8160b06a28 Bug 1258147 - Pierce through display:contents style context ancestors when looking for CB context to compare our writing-mode to. r=jfkthame 2016-03-21 16:56:07 +01:00
L. David Baron
2237c3ffb9 Bug 1256500 - Root style contexts before calling ApplyStyleFixups. r=heycam
MozReview-Commit-ID: 8P4AyTCvhmW
2016-03-14 20:26:53 -07:00
L. David Baron
80dfd686b3 Bug 1142531: Check more bits in nsStyleContext::MoveTo assertion. r=heycam
MozReview-Commit-ID: 455suOkmdj7
2016-03-14 10:27:05 -07:00
Mats Palmgren
8eb8993890 Bug 1185140 - [css-grid][flexbox] Make grid/flex item blockification happen before creating table pseudos, per the latest specs. r=dholbert
CSSWG resolution:
https://lists.w3.org/Archives/Public/www-style/2015Sep/0038.html
2016-03-03 19:37:58 +01:00
Cameron McCormack
8a879b8032 Bug 1244068 - Part 4: Use StyleSetHandle instead of concrete style set class in most places. r=dholbert 2016-02-24 18:01:11 +11:00
Boris Chiou
865378aff1 Bug 1244049 - Part 4: Define CSSPseudoElementTypeBase. r=dbaron
In order to convert CSSPseudoElementType into its underlying type easier,
we define CSSPseudoElementTypeBase. However, keep using uint8_t directly for
forward declarations.
2016-02-18 19:18:00 +01:00
Boris Chiou
32cdf253b7 Bug 1244049 - Part 2: Replace nsCSSPseudoElements::Type with CSSPseudoElementType. r=dbaron
Also, try to use forward declaraions for CSSPseudoElementType;
2016-02-17 21:37:00 +01:00
Boris Chiou
16edfa82cd Bug 1244049 - Part 1: Define scoped enum for CSSPseudoElement type. r=dbaron 2016-02-16 23:07:00 +01:00
Xidorn Quan
3552dbe981 Bug 1233135 - Do not touch display value of anonymous box for ruby. r=dbaron 2016-01-26 20:31:45 +11:00
Xidorn Quan
70986ff249 Bug 1230408 - Move suppress line break check out from control of SkipParentDisplayBasedStyleFixup. r=dbaron
The flag SkipParentDisplayBasedStyleFixup is for flex/grid fixup, and it is set
for all pseudo elements other than before/after. This is not desirable for ruby
case.

Moving the code out also means elements will inherit the suppress flag directly
from "display: contents" parent (instead of the container), which is fine since
the parent should have had its flag set properly as well.
2016-01-08 14:34:08 +11:00
L. David Baron
97c81bb98b Bug 1228877 - Make nsStyleContext::HasChildThatUsesGrandancestorStyle by setting bit on grandchild's parent instead of grandchild. r=xidorn 2015-11-30 16:16:46 -08:00
L. David Baron
3e80b3d966 Bug 196292 - Make table inside align=left reset alignment just like for align=center and align=right. r=bz
Without the patch, cell-align-stopped-at-table-1-standards.html fails
because the th in the align=left cell is left-aligned rather than
centered.
2015-11-30 15:31:30 -08:00
Carsten "Tomcat" Book
7407fb5421 Backed out changeset 4a3c509bcb25 (bug 1228877) 2015-11-30 12:10:32 +01:00
L. David Baron
f8301e2e73 Bug 1228877 - Make nsStyleContext::HasChildThatUsesGrandancestorStyle by setting bit on grandchild's parent instead of grandchild. r=xidorn 2015-11-29 23:15:37 -08:00
Xidorn Quan
0856abb2ea Bug 1040668 part 2 - Parse and compute text emphasis properties. r=dbaron 2015-11-28 11:56:33 +11:00
Mats Palmgren
f350cae30f Bug 1227917 - Update |disp| after we've (potentially) cloned the Display struct so that subsequent tests of 'display' use the new value. r=jfkthame 2015-11-25 04:27:00 +01:00
L. David Baron
7ef7c5f697 Bug 1216431 patch 7 - Back out bug 1209603 patch 6. r=heycam
This backs out all of the patch except that it retains some of the
comment changes for nsStyleContext::mBits.
2015-10-23 08:57:36 +09:00
L. David Baron
831fc09979 Bug 1216431 patch 2 - Pass nsStyleVisibility to nsStylePosition::CalcDifference to avoid computing new nsStyleVisibility during nsStyleContext::CalcStyleDifference. r=heycam
This is needed to avoid hitting the assertion:
Assertion failure: !!(structsFound & (1 << uint64_t(eStyleStruct_Visibility))) == !!PeekStyleVisibility() (PeekStyleData results must not change in the middle of difference calculation.), at ./nsStyleStructList.h:62
once exact PeekStyleData is backed out in the later patches.

Without this patch, we can compute a new nsStyleVisibility struct inside
of nsStylePosition::CalcDifference.  This patch ensures we use
PeekStyleVisibility() instead of StyleVisibility().
2015-10-23 08:57:35 +09:00
L. David Baron
ce8e82dd85 Bug 1209603 patch 11 - Assert that PeekStyle* results don't change during difference computation. r=heycam
This assertion catches the condition that led to the bug.

I confirmed that without patch 10 on this bug, the assert fires on the
reftest added in patch 4, but does not fire on slight modifications of
that testcase that don't show the bug.
2015-10-19 20:42:29 -07:00
L. David Baron
05301ec608 Bug 1209603 patch 9 - Cache inherited style structs on the style context when we found already-cached data in the rule tree. r=heycam
This means we obey the invariant that if we've requested an inherited
struct on a context, that struct will be cached on the style context.  I
believe bug 527977 intended to do make us obey this invariant, but it
missed the case where nsRuleNode::GetStyle* found cached data already on
the rule node, and the case where nsRuleNode::WalkRuleTree found a
usable struct higher in the rule tree.

Without this change, patch 10 will not function correctly for inherited
structs when we encounter this case, and will cause assertions in
dom/base/test/test_bug560780.html due to triggering style change hints
on text nodes that inherited a color struct from a parent on whose rule
node the struct was stored.  (It may also have caused some of the other
test failures.)

This should be a clear performance improvement, since the path that's
being slowed down by the added work in this patch will, with the patch,
now only execute once because of that work.
2015-10-19 20:42:29 -07:00
L. David Baron
e3b828dd57 Bug 1209603 patch 6b - Rename nsStyleContext::HasCachedInheritedStyleData to HasCachedDependentStyleData. r=heycam 2015-10-19 20:42:28 -07:00
L. David Baron
db0eccb0ed Bug 1209603 patch 6 - Prepare to use a different meaning of mBits when cached style data pointer is null. r=heycam
We currently only use the style struct bits in mBits when the style
context has the relevant struct cached.  The bit being set indicates
whether or not the context owns the struct.

This patch conditions the necessary tests on a cached struct being
present so that we can use (for reset structs, i.e., those with
non-inherited properties) mBits to mean something different when the
cached storage is null.
2015-10-19 20:42:28 -07:00
L. David Baron
7c87b0f1ff Bug 1209603 patch 5 - Move inline method nsStyleContext::GetCachedStyleData into header file, and make it public. r=heycam
Moving it to the header allows its use by another method in the header
file, in patch 6.

Making it public allows its use in assertions in nsRuleNode in patch 7.
2015-10-19 20:42:28 -07:00
Nathan Froyd
4e6d8f6705 Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat
The bulk of this commit was generated with a script, executed at the top
level of a typical source code checkout.  The only non-machine-generated
part was modifying MFBT's moz.build to reflect the new naming.

CLOSED TREE makes big refactorings like this a piece of cake.

 # The main substitution.
find . -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
    xargs perl -p -i -e '
 s/nsRefPtr\.h/RefPtr\.h/g; # handle includes
 s/nsRefPtr ?</RefPtr</g;   # handle declarations and variables
'

 # Handle a special friend declaration in gfx/layers/AtomicRefCountedWithFinalize.h.
perl -p -i -e 's/::nsRefPtr;/::RefPtr;/' gfx/layers/AtomicRefCountedWithFinalize.h

 # Handle nsRefPtr.h itself, a couple places that define constructors
 # from nsRefPtr, and code generators specially.  We do this here, rather
 # than indiscriminantly s/nsRefPtr/RefPtr/, because that would rename
 # things like nsRefPtrHashtable.
perl -p -i -e 's/nsRefPtr/RefPtr/g' \
     mfbt/nsRefPtr.h \
     xpcom/glue/nsCOMPtr.h \
     xpcom/base/OwningNonNull.h \
     ipc/ipdl/ipdl/lower.py \
     ipc/ipdl/ipdl/builtin.py \
     dom/bindings/Codegen.py \
     python/lldbutils/lldbutils/utils.py

 # In our indiscriminate substitution above, we renamed
 # nsRefPtrGetterAddRefs, the class behind getter_AddRefs.  Fix that up.
find . -name '*.cpp' -o -name '*.h' -o -name '*.idl' | \
    xargs perl -p -i -e 's/nsRefPtrGetterAddRefs/RefPtrGetterAddRefs/g'

if [ -d .git ]; then
    git mv mfbt/nsRefPtr.h mfbt/RefPtr.h
else
    hg mv mfbt/nsRefPtr.h mfbt/RefPtr.h
fi
2015-10-18 01:24:48 -04:00
Cameron McCormack
02af9911ab Bug 1203766 - Part 3: Add ArenaRefPtr support to nsStyleContext. r=bzbarsky 2015-09-17 12:08:20 +10:00
Cameron McCormack
2092fefbc0 Bug 1203766 - Part 1: Generate nsPresArena::ObjectIDs with a preprocessor-included file. r=bzbarsky 2015-09-17 12:08:19 +10:00
Jonathan Kew
a3c9aff814 Bug 1188061 - Pass the style context to nsStylePosition::CalcDifference so that it can take account of writing-mode where necessary. r=dbaron 2015-09-09 12:22:02 +01:00
Cameron McCormack
b73cb02f51 Bug 1180120 - Part 6: Replace HasSameCachedStyleData call with samePointerStructs bit tests. r=dbaron 2015-08-29 06:13:47 +10:00
Cameron McCormack
1e174425a6 Bug 1180120 - Part 4: Add an outparam to CalcStyleDifference to indicate which struct pointers were identical. r=dbaron 2015-08-29 06:13:47 +10:00
Cameron McCormack
a48f1c4303 Bug 1180120 - Part 2: Move style-if-visited as well in nsStyleContext::Move (and assert that its parent is the same as the non-visited-style parent). r=dbaron 2015-08-29 06:13:47 +10:00
Cameron McCormack
94ce92f8b1 Bug 1180120 - Part 1: Record on style contexts that reset style is explicitly inherited. r=dbaron 2015-08-29 06:13:47 +10:00
Seth Fowler
9e1c1d7b72 Bug 1181907 (Part 3) - Add CSSVariableImageTable and use it to store ImageValues generated by CSS variables. r=heycam 2015-08-26 18:19:38 -07:00
Jonathan Kew
70d4cbfc18 Bug 1196887 - Compare the writing-mode property, not only whether it is horizontal or vertical, when deciding whether to compute display:inline as inline-block. r=dholbert 2015-08-21 09:55:43 +01:00
L. David Baron
602fc5dd3d Bug 1169440 patch 2 - Rename style struct MaxDifferenceNeverInherited to DifferenceAlwaysHandledForDescendants. r=heycam
This was added in bug 897763, but the current name no longer makes sense
in the context of the renaming in 2d8810ba0412 (bug 779968, patch 4).

(I think the old name was also missing a negation -- it meant hints that
were never *non*-inherited.)
2015-06-20 21:54:15 -07:00