Commit Graph
476 Commits
Author SHA1 Message Date
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
Mats Palmgren 29ea64f952 Bug 817406 part 1 - Let ApplyStyleFixups propogate 'direction' to the viewport. r=bz,heycam 2015-05-27 22:18:36 +00:00
Phil Ringnalda 8d133af525 Back out 2 changesets (bug 817406) for b2g reftest-7 bustage
CLOSED TREE

Backed out changeset 1499a08f564a (bug 817406)
Backed out changeset d2f3cb3c0233 (bug 817406)
2015-05-27 19:11:54 -07:00
Kang-Hao (Kenny) Lu 785ae1714b Bug 817406 (part 1) - Let ApplyStyleFixups propogate 'direction' to the viewport. r=bz,heycam 2015-05-27 22:18:36 +00:00
Xidorn Quan 166f3b8ee1 Backout df7c88910f47 (bug 1149009) for new patch. 2015-05-04 09:52:53 +12:00
Cameron McCormack 451d0971f1 Bug 1157097 - Don't share a style context that will have its cached style data cleared. r=dbaron 2015-04-29 14:47:15 +10:00
Xidorn Quan 620ba06ad6 Bug 1157011 - Check line break suppression of BR frame from its parent frame. r=dholbert 2015-04-23 13:32:53 +12:00
Xidorn Quan 081671c691 Bug 1149009 - Fix line break suppression on whitespace not contained but wrapped in ruby boxes. r=dbaron 2015-04-20 15:04:09 +12:00
Cameron McCormack 8831bbdf85 Bug 1154149 - Remove nsPresContext arguments from a bunch of nsStyleSet methods. r=dbaron 2015-04-17 11:09:59 +10:00
Xidorn Quan f6eafdd98a Bug 1141931 part 1 - Compute unicode-bidi property to proper values for ruby boxes. r=heycam 2015-04-08 11:22:34 +12:00
Wes Kocher 95d8beba17 Backed out 10 changesets (bug 1141931) for mochitest-5 failures CLOSED TREE
Backed out changeset c90940067de6 (bug 1141931)
Backed out changeset 96b48288abab (bug 1141931)
Backed out changeset 87281c7ded34 (bug 1141931)
Backed out changeset 6a914ba0b8ec (bug 1141931)
Backed out changeset 9cfea55b5e95 (bug 1141931)
Backed out changeset f432612b6475 (bug 1141931)
Backed out changeset 48cf9568a4b1 (bug 1141931)
Backed out changeset f1ab848b3fa6 (bug 1141931)
Backed out changeset 8a3c71a3b525 (bug 1141931)
Backed out changeset 119d3c0fd0f6 (bug 1141931)
2015-04-07 14:23:57 -07:00
Xidorn Quan d7245a0b2a Bug 1141931 part 1 - Compute unicode-bidi property to proper values for ruby boxes. r=heycam 2015-04-08 08:40:31 +12:00
Jonathan Kew 9425040943 Bug 1134849 - For display:inline elements whose writing mode is orthogonal to their parent's, the computed value should become inline-block. r=dbaron 2015-03-20 08:12:49 +00:00
Kartikaya Gupta 9bac07c5c8 Bug 962594 - Don't build CSS animations for elements that are in a display:none subtree. r=heycam 2015-03-15 20:28:49 -04:00
Xidorn Quan 8a816a119b Bug 1141919 - Fix incomplete line break suppression in ruby. r=dbaron 2015-03-14 16:29:06 +11:00
Xidorn Quan 63683132d2 Bug 1140264 part 3 - Rename IsInlineDescendantOfRuby to ShouldSuppressLineBreak and exclude rbc/rtc from it. r=dbaron 2015-03-11 10:28:21 +11:00
Mats Palmgren e74c8d0d9e Bug 1140198 - display:contents on the root element (but not else-where) should compute to 'block'. r=roc 2015-03-07 14:35:02 +00:00
Cameron McCormack d94f438bcd Bug 1139723 - Turn on expensive style struct assertions for 1136010-1.html, and fix pref name typo. r=dbaron 2015-03-05 14:46:18 +11:00
Cameron McCormack 08a3db8571 Bug 1139272 - Allow expensive style context assertions to be enabled with a pref. r=dbaron 2015-03-05 12:48:45 +11:00
Xidorn Quan aed9d1d538 Bug 1135954 part 2 - Make GetUniqueStyleData private and remove no longer used unique cases. r=heycam 2015-02-26 16:18:15 +11:00
Xidorn Quan 62d217fa6d Bug 1135954 part 1 - Create empty border/padding style struct for rbc/rtc. r=heycam 2015-02-26 16:18:15 +11:00
Cameron McCormack 3981abdd93 Bug 1127198 - Part 2: Assert if we clear cached structs on a style context still used by a frame. r=dbaron 2015-02-18 09:28:53 +11:00
Cameron McCormack 09fd736766 Bug 1127198 - Part 1: Add a DEBUG-only count of frames that use a style context. r=dbaron 2015-02-18 09:28:53 +11:00
Nicholas Nethercote 0247de46d8 Bug 1127201 (attempt 2, part 1) - Replace most NS_ABORT_IF_FALSE calls with MOZ_ASSERT. r=Waldo. 2015-02-09 14:34:50 -08:00
Xidorn Quan 4aca1a3913 Bug 1122781 part 4 - Add runtime dependency check of style structs. r=dbaron
This patch adds a mechanism to check struct computation against a known set of non-cyclic dependencies.

The checks are only done when we get a struct on a context during computation of a struct on the same context.
2015-02-07 13:25:21 +11:00
Xidorn Quan 44edc32f91 Bug 1122781 part 3 - Restyle member initializer list of nsStyleContext. r=dbaron 2015-02-07 13:25:21 +11:00