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

7072 Коммитов

Автор SHA1 Сообщение Дата
Cameron McCormack 99cf7a99ec Bug 1028497 - Part 23: Implement FontFaceSet.{add,clear,delete,has}. r=jdaggett
Implementing Add, Delete and Clear involves shuffling FontFace objects
between mOtherFaces and mUnavailableFaces.
2014-10-02 12:32:09 +10:00
Cameron McCormack ef23ddf3cf Bug 1028497 - Part 22: Make FontFace.load() work for unconnected FontFace objects. r=jdaggett
The same DoLoad() call works with both CSS-connected and unconnected
FontFaces.
2014-10-02 12:32:09 +10:00
Cameron McCormack 41fa46909a Bug 1028497 - Part 21: Implement the FontFace constructor's parsing of descriptors. r=bzbarsky,jdaggett
This implements the bulk of the FontFace JS constructor, which parses
the descriptors passed in. We need a notion now of whether a FontFace is
"initialized", since the spec requires us to go through the event loop
before parsing the 'src' descriptor. So a couple of places now have to
check whether the FontFace is fully initialized, and we have a method to
inform the FontFaceSet when a FontFace becomes initialized, in case we
added it to the FontFaceSet before it was initialized (easy to do with
|document.fonts.add(new FontFace(...))|.
2014-10-02 12:32:09 +10:00
Cameron McCormack 6ef64c89d8 Bug 1028497 - Part 20: Add storage for unconnected FontFace objects and create user font entries for them. r=jdaggett,bzbarsky
We add a third array on FontFaceSet, mOtherFaces, which stores
unconnected FontFace objects that have been added to the FontFaceSet. We
reflect them in the indexed properties and also create user font entries
for them.

Part 23 will actually allow us to add some of these FontFaces to
mOtherFaces.
2014-10-02 12:32:08 +10:00
Cameron McCormack bd55fd92ea Bug 1028497 - Part 19: Support disconnecting FontFaces that reflect @font-face rules. r=jdaggett,bzbarsky
This adds support for a CSS-connected FontFace to be disconnected from
its rule. This causes it to get its own copy of the descriptors on the
nsCSSFontFaceStyleDecl, and for the pointers between the FontFace and
the nsCSSFontFaceRule to be nulled out.

We start tracking now whether a given FontFace is in the FontFaceSet
(in the sense that it will appear on the DOM FontFaceSet object if we
inspect it with script). All FontFace objects created though, whether
they are currently "in" the FontFaceSet or not, are still tracked by the
FontFaceSet. We use the new mUnavailableFaces array on the FontFaceSet
for that.

We need to track these FontFaces that aren't in the FontFaceSet as
that's where we store their user font entry -- important if we call
load() on a FontFace before adding it to the FontFaceSet.
2014-10-02 12:32:08 +10:00
Cameron McCormack f4852c403a Bug 1028497 - Part 18: Create user font entries from FontFaces rather than nsCSSFontFaceRules. r=jdaggett
This changes InsertRule, which looked at the descriptors on an
nsCSSFontFaceRule to create a user font entry and add it to a family,
into InsertConnectedFontFace, which can do the same but for the FontFace
that reflects the rule.
2014-10-02 12:32:08 +10:00
Cameron McCormack b4bf68ac33 Bug 1028497 - Part 17: Factor out FontFace family-name getting. r=jdaggett 2014-10-02 12:32:08 +10:00
Cameron McCormack e2ac89aaed Bug 1028497 - Part 15.1: Store user font entries in FontFace objects. r=jdaggett 2014-10-02 12:32:08 +10:00
Cameron McCormack 373e1d82e3 Bug 1028497 - Part 15: Store FontFace objects on the FontFaceSet rather than nsCSSFontFaceRules. r=jdaggett,bzbarsky
Here we change FontFaceSet's records array to associate gfxUserFontEntry
pointers with FontFace pointers, rather than with nsCSSFontFaceRule
pointers.  This will make it more uniform to handle both CSS-connected
and unconnected FontFace objects when rebuilding the user font entries
under UpdateRules.
2014-10-02 12:32:07 +10:00
Cameron McCormack d045185df5 Bug 1028497 - Part 14: Rename some methods to talk about UserFontEntry instead of FontFace. r=jdaggett
How that we have a class named "FontFace", it's a bit confusing for some
of the gfxUserFontSet methods to have "FontFace" in their names, so I'm
renaming them to mention "UserFontEntry" instead.
2014-10-02 12:32:07 +10:00
Cameron McCormack 2ec90e70e6 Bug 1028497 - Part 13: Implement FontFace.load(). r=jdaggett 2014-10-02 12:32:07 +10:00
Cameron McCormack 45d38e257f Bug 1028497 - Part 12: Implement FontFace.loaded. r=jdaggett,bzbarsky 2014-10-02 12:32:07 +10:00
Cameron McCormack dda44dce90 Bug 1028497 - Part 11: Implement FontFace descriptor setters. r=jdaggett
These set the descriptors, but don't cause anything to update, just
like setting descriptors on an @font-face rule's style declaration
doesn't do anything yet.
2014-10-02 12:32:07 +10:00
Cameron McCormack 9eb134dd49 Bug 1028497 - Part 10: Implement FontFace descriptor getters. r=jdaggett
We add an mDescriptors that will be used to store the descriptor values
of an unconnected FontFace object.  For CSS-connected FontFace objects,
the descriptors are stored in the nsCSSFontFaceRule::mDecl.mDescriptors.
(Both of these use the same type, though, CSSFontFaceDescriptors.)

Ideally we could have the descriptors always stored on the FontFace,
and for the nsCSSFontFaceStyleDecl go and fetch them from the FontFace,
but it turned out to be impossible to ensure that a FontFace could be
created whenever a nsCSSFontFaceStyleDecl was cloned, since it needs
access to the window object to create the FontFace's promise objects!
2014-10-02 12:32:07 +10:00
Cameron McCormack f5bcec5617 Bug 1028497 - Part 9: Implement FontFace.status. r=jdaggett
We make gfxUserFontEntry::SetLoadState virtual so that we can hook into
changes and update FontFace::mStatus.  We can't just reflect the
gfxUserFontEntry's value in FontFace::Status() since the spec has
requirements about when exactly the status is set.
2014-10-02 12:32:06 +10:00
Cameron McCormack 8b8c2e4e1e Bug 1028497 - Part 8: Implement Length and array access on FontFaceSet. r=jfkthame
This is a temporary measure until we support iterators on the
FontFaceSet; the spec does not expose FontFaces as indexed properties on
the FontFaceSet.
2014-10-02 12:32:06 +10:00
Cameron McCormack 27963db6e6 Bug 1028497 - Part 7: Add ability to create a FontFace for a @font-face rule; store it on the nsCSSFontFaceRule. r=jdaggett,bzbarsky
Every nsCSSFontFaceRule that is used will get a FontFace object to
reflect it in the FontFaceSet.  Here we add storage on the
nsCSSFontFaceRule for its FontFace, although it will be the
FontFaceSet's responsibility to set it.  We also add a static
constructor function on FontFace to create one that reflects a rule.
2014-10-02 12:32:06 +10:00
Cameron McCormack 4649da6d47 Bug 1028497 - Part 6: Have a FontFace::Entry class extending gfxUserFontEntry that can inform the FontFaceSet about loading. r=jdaggett
We can't make FontFace inherit from gfxUserFontEntry, since the former
is cycle collected.  So instead, we have a small class that inherits
from it that will override its virtual methods and forward things on to
the FontFace object.

We make gfxUserFontSet::CreateFontFace virtual so we can override it to
produce instances of our gfxUserFontEntry subclass.
2014-10-02 12:32:06 +10:00
Cameron McCormack f5f01b6fc2 Bug 1028497 - Part 4: Move the nsUserFontSet object into FontFaceSet. r=jdaggett
This (a) moves ownership of the gfxUserFontSet into FontFaceSet, (b) moves
nearly all of the functionality of nsUserFontSet into FontFaceSet, and (c)
adds a class that inherits from gfxUserFontSet so that we can override some
of its virtual functions and delegate them to the FontFaceSet.
2014-10-02 12:32:05 +10:00
Cameron McCormack 0634734915 Bug 1028497 - Part 3: Add skeleton implementations of CSSFontFaceLoadEvent, FontFace, FontFaceSet and FontFaceSource. r=jdaggett 2014-10-02 12:32:05 +10:00
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
Jonathan Kew 4a06c41b0a Bug 1065002 pt 2 - Add an orientation field to nsFontMetrics. r=jdaggett 2014-09-30 07:38:35 +01:00
Jonathan Kew c5e1a54d59 Bug 1065002 pt 1.3 - Add an Orientation parameter to gfxFont::GetMetrics and dispatch to horizontal or vertical as needed. r=jdaggett 2014-09-30 07:38:26 +01:00
Robert Longson 1722ba86eb Bug 1073924 - Hovering over links in SVG does not cause cursor to change. r=jwatt 2014-09-29 09:20:22 +01:00
Dirk Schulze a028173cff Bug 1072894 - Implement polygon() parsing for clip-path. r=heycam 2014-09-28 01:56:00 +02:00
Xidorn Quan f69d6b2935 Bug 966168 - Implement symbols() CSS function. r=dbaron 2014-09-25 02:19:00 +02:00
Phil Ringnalda 6eb3e94389 Back out 693507b38116 (bug 1041180) since it doesn't like compiling without its friend
CLOSED TREE
2014-09-25 21:18:01 -07:00
Christoph Kerschbaumer fd3d3cc25b Bug 1041180: Remove deprecated nsIChannelPolicy (r=sstamm,jduell,jst) 2014-09-25 16:10:28 -07:00
Carsten "Tomcat" Book 84fa1ee595 Backed out changeset d53b25dcf2d7 (bug 966168) for causing bustage 2014-09-25 09:40:40 +02:00
Xidorn Quan e94396781f Bug 966168 - Implement symbols() CSS function. r=dbaron 2014-09-24 15:32:00 +02: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
Brian Birtles 9f07908ee4 Bug 1039924 part 6 - Use StickyTimeDuration for timing calculations; r=dholbert
This patch takes the StickyTimeDuration defined in the previous patch and
uses it within the calculation of animation timing for parameters that are
expected to be +/- Forever.
2014-09-25 14:25:50 +09:00
Phil Ringnalda 340fd10e38 Back out c0c410aed86f (bug 979133) for -wError bustage
CLOSED TREE
2014-09-24 21:06:22 -07:00
John Daggett b0dafb656a Bug 998869 part 5 - lazily load userfonts (non-linux). r=jfkthame 2014-09-25 12:16:54 +09:00
John Daggett 245a756e02 Bug 998869 part 3 - rename userfont class methods. r=heycam 2014-09-25 12:16:53 +09:00
John Daggett 3570b54018 Bug 998869 part 2 - switch to GetFontAt(0) to GetFirstValidFont(). r=jfkthame 2014-09-25 12:16:53 +09: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
Cameron McCormack b8acc4b4aa Bug 1070316 - Factor out descriptor storage from nsCSSFontFaceStyleDecl. r=dbaron 2014-09-25 09:25:40 +10:00
Rik Cabanier 4568f07033 Bug 1072100 - mix-blend-mode doesn't work when set in JS. r=dbaron 2014-09-24 09:48:00 -04:00
Carsten "Tomcat" Book 76043a5642 Backed out changeset 4bb508b6f0c5 (bug 1041180) for XPCshell test failures 2014-09-24 13:13:20 +02:00
Christoph Kerschbaumer a2ecbd83dc Bug 1041180: Remove deprecated nsIChannelPolicy (r=sstamm,jduell,jst) 2014-09-24 01:01:07 -07:00
Tim Nguyen 0542a29160 Bug 1070657 - Simplify input[type=range] pseudo element CSS. r=dholbert 2014-09-23 11:37:00 +02:00
Cameron McCormack be83e5638c Bug 1070260 - Add public nsCSSParser function for parsing @font-face descriptors. r=jdaggett 2014-09-24 15:49:02 +10:00
Wes Kocher ff7c6d21cd Backed out 2 changesets (bug 1041180) for build bustage on a CLOSED TREE
Backed out changeset 1cfb645267a4 (bug 1041180)
Backed out changeset afc9903ff28f (bug 1041180)
2014-09-23 16:26:49 -07:00
Christoph Kerschbaumer bc20780b98 Bug 1041180: Remove deprecated nsIChannelPolicy (r=sstamm,jduell,jst) 2014-09-23 09:46:54 -07:00
Daniel Holbert e0b9e676dc Bug 1066089: add crashtest. (test-only) 2014-09-23 14:12:54 -07:00
Christoph Kerschbaumer 5d3cd90979 Bug 1038756: Callsites creating a channel in /layout/style/ (r=dbaron) 2014-09-21 09:41:26 -07:00
Xidorn Quan 974eae2d01 Bug 1069716 - Fix deficient CalcDifference of nsStyleList. r=heycam 2014-09-20 03:43:00 +02:00
Cameron McCormack cbc918194a Bug 1069761 - Move AppendSerializedFontSrc to nsStyleUtil. r=jdaggett 2014-09-22 10:32:58 +10:00
Boris Zbarsky bc34b41022 Bug 958887 part 4. Generate property accessors on the CSS2Properties interface for the dashed-named CSS properties and float that use their actual property names. r=peterv 2014-09-19 22:58:27 -04:00