Граф коммитов

409 Коммитов

Автор SHA1 Сообщение Дата
Cameron McCormack c3dee3558d Bug 1072724 - Support showing more information about style structs in restyle logs. r=dbaron
The MOZ_DEBUG_RESTYLE_STRUCTS environment variable can be set to a comma-
separated list of style struct names.  When restyle logging is enabled,
this will cause the style context tree -- showing cached style struct
pointers for those structs specified -- to be logged before each
individual restyle is processed.  It will also show the struct pointer
values involved when swapping structs between style contexts.

For example, set MOZ_DEBUG_RESTYLE_STRUCTS=Font,UserInterface to show
the cached nsStyleFont and nsStyleUserInterface pointers on the style
contexts involved in the restyle process.
2014-10-01 09:13:57 +10:00
Cameron McCormack f5e6faa47e Bug 979133 - Add facility to log the restyle process. r=dbaron
Set the MOZ_DEBUG_RESTYLE environment variable and every restyle will have
detailed logging printed to stderr. By default, restyles for animations are
not logged; you can include them by also setting MOZ_DEBUG_RESTYLE_ANIMATIONS.

If you wish to limit restyle logging to a particular change, you can call
nsPresContext::StartRestyleLogging() and nsPresContext::StopRestyleLogging()
at appropriate points. (You might want to add a couple of helper methods
temporarily on nsIDocument and then expose them to your page with Web IDL
to make them easier to call.) You do not need to have set MOZ_DEBUG_RESTYLE
for this to work.
2014-09-25 15:45:36 +10:00
Phil Ringnalda 340fd10e38 Back out c0c410aed86f (bug 979133) for -wError bustage
CLOSED TREE
2014-09-24 21:06:22 -07:00
Cameron McCormack 2a28d6d5eb Bug 979133 - Add facility to log the restyle process. r=dbaron
Set the MOZ_DEBUG_RESTYLE environment variable and every restyle will have
detailed logging printed to stderr.  By default, restyles for animations are
not logged; you can include them by also setting MOZ_DEBUG_RESTYLE_ANIMATIONS.

If you wish to limit restyle logging to a particular change, you can call
nsPresContext::StartRestyleLogging() and nsPresContext::StopRestyleLogging()
at appropriate points.  (You might want to add a couple of helper methods
temporarily on nsIDocument and then expose them to your page with Web IDL
to make them easier to call.)  You do not need to have set MOZ_DEBUG_RESTYLE
for this to work.
2014-09-25 13:13:14 +10:00
L. David Baron 657fde68cc Bug 575675 - Remove assertion about aRelevantLinkVisited that isn't needed, and assumes that all link elements are styled with a style sheet that has :visited rules. r=bzbarsky 2014-09-13 06:17:37 -07:00
Cameron McCormack a60c564803 Bug 931668 - Part 22: Clear cached structs on descendants of an old style context that had structs swapped, if it is staying around. r=dbaron
--HG--
extra : rebase_source : aa23c06a20214c72d971ab059ef4833846c769fb
2014-09-05 13:48:47 +10:00
Cameron McCormack 7f9178272f Bug 931668 - Part 20.2: Don't call AssertStructsNotUsedElsewhere on style contexts for :before/:after frames that are going away. r=dbaron
--HG--
extra : rebase_source : 7ff96443db553d564897d42870b81e10c2a78b53
2014-09-05 13:48:47 +10:00
Cameron McCormack baa35dd12a Bug 931668 - Part 18: Add a function to swap style structs between style contexts. r=dbaron
--HG--
extra : rebase_source : 4d32ed1f140db975b2fffe76ac6bd793287c916c
2014-09-05 13:48:46 +10:00
Cameron McCormack dde9a37df1 Bug 931668 - Part 14: Add functions to move style contexts to a new parent. r=dbaron
--HG--
extra : rebase_source : 90affb5987ab33e948366840dd3cc5a6d7ea1fd9
2014-09-05 13:48:45 +10:00
Cameron McCormack 3a5a6b0f08 Bug 931668 - Part 13 (no part 12): Add expensive (commented out) debug checks that destroyed style structs aren't still used in the style context tree. r=dbaron
--HG--
extra : rebase_source : 84217c186a6cced3ea5bac22590ecd4ddb0d7a5d
2014-09-05 13:48:45 +10:00
Cameron McCormack 5cf22e3dc6 Bug 931668 - Part 9 (no part 8): Make nsStyleContext::CalcStyleDifference compare all structs and return a bitfield of which changed. r=dbaron
--HG--
extra : rebase_source : 817e73531548183645c94ece67ad6a87c5de36c6
2014-09-05 13:48:44 +10:00
Cameron McCormack a06cce0a30 Bug 931668 - Part 7: Add helper functions looking at cached struct pointer values on style contexts. r=dbaron
Two functions are added:

  * HasSameCachedStyleData, which compares a style struct pointer in two
    style contexts, and
  * HasCachedInheritedStyleData, which checks to see if the bit in mBits
    is set.

--HG--
extra : rebase_source : 92f9a42b15fc5537044b033eb960e564196850de
2014-09-05 13:48:44 +10:00
Cameron McCormack 21b2105ad2 Bug 931668 - Part 6: Add helper function to check if a style context has any children with the NS_STYLE_USES_GRANDANCESTOR_STYLE bit. r=dbaron
--HG--
extra : rebase_source : d0d5ea22e06509b3638d860f85a21506da7382fa
2014-09-05 13:48:44 +10:00
Cameron McCormack c0014b4555 Bug 931668 - Part 5 (no part 4): Record whether a style context is shared. r=dbaron
--HG--
extra : rebase_source : f000e310e7f429cc7656a9f375312ddf8e162c7a
2014-09-05 13:48:44 +10:00
Cameron McCormack 7b5397f5e7 Bug 931668 - Part 1: Add a change hint that represents a style data change that requires no processing. r=dbaron
--HG--
extra : rebase_source : 9035e376bfc53a18d6499407ad5958706aefcb7a
2014-09-05 13:48:43 +10:00
Susanna Bowen 2b29530598 Bug 1021952 - Ensure that direct children of ruby elements are inline. r=bz 2014-07-22 19:08:13 -07:00
Brian Birtles 6bc9caf270 Bug 1010067 part 2 - Rename nsStyleAnimation.{h,cpp} to StyleAnimationValue.{h,cpp}; r=dbaron
--HG--
rename : layout/style/nsStyleAnimation.cpp => layout/style/StyleAnimationValue.cpp
rename : layout/style/nsStyleAnimation.h => layout/style/StyleAnimationValue.h
2014-06-24 15:29:54 +09:00
Brian Birtles 65c7f861cb Bug 1010067 part 1 - Rename nsStyleAnimation::Value to mozilla::StyleAnimationValue; r=dbaron
This patch also moves the static methods defined on nsStyleAnimation so that
they are part of StyleAnimationValue class.

Renaming nsStyleAnimation.h to StyleAnimationValue.h is performed in a separate
patch to simplify the diff (since some tools may not handle file renames
elegantly).
2014-06-24 15:29:54 +09:00
Cameron McCormack ab79bfe830 Bug 1026345 - Remove the now unused nsStyleContext allocation functions. r=dbaron 2014-06-19 13:19:11 +10:00
Susanna Bowen 64b0116f8b Bug 1025308 - Rename the variables associated with skipping style fixups for children element's based on parent display value. r=mats 2014-06-16 09:55:00 -04:00
Victor Porof 9ce7e9c089 Bug 1007203 - Always add categories when pushing to the pseudostack, r=djvj 2014-05-23 17:12:29 -04:00
Mats Palmgren 4933aef60a Bug 1000376 - part 3, s/FlexItemStyleFixup/FlexOrGridItemStyleFixup/ and corresponding comment changes. r=dholbert 2014-05-03 13:42:33 +00:00
Simon Sapin 4ada4b1b26 Bug 975501 part 2: Add display:{inline-,}grid behind a pref, and a stub nsGridContainerFrame. r=dholbert 2014-02-26 23:45:29 -08:00
Daniel Holbert 7772871b39 Bug 969460 part 2: Use EnsureBlockDisplay to determine the 'display' of the root node, and let nsCSSFrameConstructor::ConstructDocElementFrame create flex containers. r=bz 2014-02-15 10:42:37 -08:00
Cameron McCormack b90dc73fc5 Bug 897763 - Take into account nsChangeHint_{NeedReflow,ClearAncestorIntrinsics} never being inherited for difference calculations on certain style structs. r=dbaron 2014-01-03 13:39:54 +11:00
Cameron McCormack 4daf822cec Bug 773296 - Part 19: Compare style structs even for the same rule node when variables have changed. r=dbaron
This makes updates work correctly when variable values change.
Rather than handling nsStyleVariables with a DO_STRUCT_DIFFERENCE,
we explicitly compare the two nsStyleVariables objects in
nsStyleContext::CalcStyleDifference before looking at the other
style structs.  This is because we need to force those other
style structs to be compared if variable values are changing.
nsStyleVariables::CalcDifference still returns 0, since the change in
variable values themselves doesn't require any updates.
2013-12-12 13:09:45 +11:00
Cameron McCormack 81af48d662 Bug 773296 - Part 4: Add style struct to store CSS variables. r=dbaron
This adds an nsStyleVariables on which computed variable values
will be stored.  We don't actually have any properties assigned to
nsStyleVariables; eCSSPropertyExtra_Variables which we added earlier
isn't a real property.  To avoid compiler errors for gVariableFlags
being a zero length array, we stick a dummy entry in there.

nsRuleNode::ComputeVariablesData does nothing for the moment.

nsStyleVariable nsChangeHint calculations always return 0, as later
we will compare the actual properties that reference variables to
see what changes are required for them.
2013-12-12 13:09:40 +11:00
Cameron McCormack dd8ce60c6d Bug 773296 - Part 3: Allow more than 27 style structs. r=dbaron
This bumps up nsStyleContext::mBits to a uint64_t so that it can fit
another style struct.  If we're going to need to keep at least 27 style
structs, it might be better to split mBits up into two uint32_ts: one
for the flags and one for the style struct bits.
2013-12-12 13:09:40 +11:00
Cameron McCormack 9d27abea6f Comment typo fix; no bug. (DONTBUILD)
--HG--
extra : rebase_source : 9b2e37ed8770288e3d83e3ac1d9b6290eb5d35cd
2013-11-07 15:33:26 +11:00
Ehsan Akhgari 2824b29025 Bug 895322 - Part 1: Replace the usages of MOZ_STATIC_ASSERT with C++11 static_assert; r=Waldo
This patch was mostly generated by running the following scripts on the codebase, with some
manual changes made afterwards:

# static_assert.sh
#!/bin/bash
# Command to convert an NSPR integer type to the equivalent standard integer type

function convert() {
echo "Converting $1 to $2..."
find . ! -wholename "*nsprpub*" \
       ! -wholename "*security/nss*" \
       ! -wholename "*/.hg*" \
       ! -wholename "obj-ff-dbg*" \
       ! -name nsXPCOMCID.h \
       ! -name prtypes.h \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.cc" \
         -o -iname "*.mm" \) | \
    xargs -n 1 `dirname $0`/assert_replacer.py #sed -i -e "s/\b$1\b/$2/g"
}

convert MOZ_STATIC_ASSERT static_assert
hg rev --no-backup mfbt/Assertions.h \
                   media/webrtc/signaling/src/sipcc/core/includes/ccapi.h \
                   modules/libmar/src/mar_private.h \
                   modules/libmar/src/mar.h


# assert_replacer.py
#!/usr/bin/python

import sys
import re

pattern = re.compile(r"\bMOZ_STATIC_ASSERT\b")

def replaceInPlace(fname):
  print fname
  f = open(fname, "rw+")
  lines = f.readlines()
  for i in range(0, len(lines)):
    while True:
      index = re.search(pattern, lines[i])
      if index != None:
        index = index.start()
        lines[i] = lines[i][0:index] + "static_assert" + lines[i][index+len("MOZ_STATIC_ASSERT"):]
        for j in range(i + 1, len(lines)):
          if lines[j].find("                 ", index) == index:
            lines[j] = lines[j][0:index] + lines[j][index+4:]
          else:
            break
      else:
        break
  f.seek(0, 0)
  f.truncate()
  f.write("".join(lines))
  f.close()

argc = len(sys.argv)
for i in range(1, argc):
  replaceInPlace(sys.argv[i])

--HG--
extra : rebase_source : 4b4a4047d82f2c205b9fad8d56dfc3f1afc0b045
2013-07-18 13:59:53 -04:00
Cameron McCormack 7ab546eefe Bug 876127 - Assert if we do not look at all style structs in nsStyleContext::CalcStyleDifference. r=dbaron 2013-05-27 16:48:19 +10:00
Daniel Holbert 9ed3dd5f4a Bug 864553 part 1: Remove ifdefs for MOZ_FLEXBOX and configure.in MOZ_FLEXBOX chunk. r=dbaron 2013-05-22 11:44:25 +08:00
Jeff Muizelaar d4f0597124 Bug 868557. Explicitly unalias list in nsStyleContext::AddChild() r=dbaron
Clang and GCC probably MSVC are not able to unalias list because they don't
realize that mEmptyChild and mChild can't alias mNextSibling and mPrevSibling.
If we explicitly dereference list we get better code, saving 3 instructions
with clang.
2013-05-06 11:05:44 -04:00
Aryeh Gregor f0404a303a Bug 859817 - Remove implicit conversions from raw pointer to already_AddRefed; r=Ms2ger 2013-04-22 14:15:59 +03:00
Benoit Girard 042e2c83ad Bug 851611 - Part 3: Rename headers. r=jrmuizel
--HG--
rename : tools/profiler/sampler.h => tools/profiler/GeckoProfiler.h
rename : tools/profiler/sps_sampler.h => tools/profiler/GeckoProfilerImpl.h
extra : rebase_source : 6ea7c660764a4390cdd8dd91561fff1d7bad6035
2013-03-18 15:25:50 +01:00
Benoit Girard c47f308258 Bug 851611 - Part 2: Update profiler calls. r=jrmuizel
--HG--
extra : rebase_source : f76accc3d3dd86c75cb3e9750734f23ec9c29941
2013-03-16 00:47:02 -04:00
Ed Morley ab0833645c Backed out changeset c75481a07302 (bug 851611) 2013-03-18 14:10:35 +00:00
Ed Morley 3091d3e2b6 Backed out changeset d195190adc48 (bug 851611)
--HG--
rename : tools/profiler/GeckoProfiler.h => tools/profiler/sampler.h
rename : tools/profiler/GeckoProfilerImpl.h => tools/profiler/sps_sampler.h
2013-03-18 14:10:30 +00:00
Benoit Girard b03f14270d Bug 851611 - Part 3: Rename headers. r=jrmuizel
--HG--
rename : tools/profiler/sampler.h => tools/profiler/GeckoProfiler.h
rename : tools/profiler/sps_sampler.h => tools/profiler/GeckoProfilerImpl.h
extra : rebase_source : 552fe1d3ff61d15b264aaf86f7c8cb4f4eff69d1
2013-03-18 14:41:02 +01:00
Benoit Girard 919018414b Bug 851611 - Part 2: Update profiler calls. r=jrmuizel
--HG--
extra : rebase_source : 3032aaf7e50cdf9c350da688ec34e50a695fc7ca
2013-03-16 00:47:02 -04:00
David Zbarsky 3250bd906e [Bug 847110] Fix up includes in layout/style r=dbaron 2013-03-02 19:31:48 -05:00
Daniel Holbert b663c565e3 Bug 812822 part 1: Add flag 'eSkipFlexItemStyleFixup' to let our nsStyleContext creation functions skip the flex-item-specific chunk of ApplyStyleFixups(). r=bz 2013-02-20 23:34:58 -08:00
L. David Baron 309d5f8f42 Bug 781360 patch 4: Remove the Get from nsStyleContext::GetStyleData and nsIFrame::GetStyleDataExternal, which never return null. r=dholbert 2013-02-16 13:51:03 -08:00
L. David Baron c5b9eee040 Bug 781360 patch 3: Rename {nsIFrame,nsStyleContext,nsComputedDOMStyle}::GetStyle* to Style*, since they can never return null. r=dholbert
Except for the changes in:
  layout/generic/nsIFrame.h (part)
  layout/style/nsComputedDOMStyle.h (all)
  layout/style/nsRuleNode.cpp (part)
  layout/style/nsStyleContext.cpp (part)
  layout/style/nsStyleContext.h (part)
(see patch 3b in the bug), this patch was written with the sed script:
s/\<GetStyle\(Font\|Color\|List\|Text\|Visibility\|Quotes\|UserInterface\|TableBorder\|SVG\|Background\|Position\|TextReset\|Display\|Content\|UIReset\|Table\|Margin\|Padding\|Border\|Outline\|XUL\|SVGReset\|Column\)\>/Style\1/g
2013-02-16 13:51:02 -08:00
L. David Baron 59101dc21e Bug 781360 patch 2: Rename nsRuleNode::GetPresContext to PresContext, since it can never return null. r=dholbert 2013-02-16 13:04:54 -08:00
L. David Baron 0836abe85d Bug 781360 patch 1: Rename nsStyleContext::GetRuleNode to RuleNode, since it can never return null. r=dholbert
This makes it conform to our convention that getters returning pointers
that can never be null do not begin with "Get".

nsStyleContext's rule node is never null because we require a rule node
in order to construct a style context.
2013-02-16 13:04:53 -08:00
Jeff Walden 120886ca73 Bug 820570 - Move mozilla::DebugOnly into DebugOnly.h to pare down the grab-baggish Util.h. r=Ms2ger 2012-12-14 18:58:45 -05:00
L. David Baron 8ebe785103 Bug 809533, patch 3: Stop handling allocation failures in the style system that no longer need to be handled. r=bzbarsky 2012-11-09 10:30:28 -08:00
L. David Baron 559e6b289a Bug 572200, part 1: Make rule nodes know whether they're used directly by a style context. r=bzbarsky 2012-11-07 11:55:53 -08:00
Daniel Holbert b4b593c4d3 Bug 783415 part 1: Make "display" value of flex items compute to their blockified forms. r=dbaron 2012-11-07 11:28:59 -08:00