Commit Graph

52 Commits

Author SHA1 Message Date
John Daggett
fdc20b64e0 Bug 1157064 - implementation of font-display. r=heycam,khuey 2016-01-07 14:03:05 +09:00
John Daggett
7bd20a139a Bug 1224975 - add telemetry for font loading. r=m_kato 2015-11-25 14:48:16 +09:00
Cameron McCormack
b14353f25e Bug 1216043 - Rename nsStyleSheet::sheetType and make it an enum class. r=dbaron
The only substantive change here, apart from a few variables changing in
size from uint16_t to uint8_t, is FontFaceSet's use of SheetType::Unknown
(0xFF) instead of 0 for FontFaceRecords for script-created FontFaces.
2015-10-20 10:16:20 +11:00
John Daggett
76de577551 Bug 543715 p1 - distinguish between italic and oblique. r=jfkthame 2015-10-19 11:16:43 +09:00
Phil Ringnalda
116b1f9821 Back out 2 changesets (bug 543715) because Mulet is why we can't have nice things
Backed out changeset 2d1d8e9b095c (bug 543715)
Backed out changeset bc90276ec090 (bug 543715)
2015-10-18 11:22:22 -07:00
John Daggett
5ef9c45a89 Bug 543715 p1 - distinguish between italic and oblique. r=jfkthame 2015-10-18 22:17:46 +09:00
Nathan Froyd
9c5965b035 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
de8322b95c Bug 1163877 - Part 3: Update state on, and reflow documents for, all FontFaceSets that contain a FontFace whose user font entry updated. r=jdaggett 2015-10-16 17:10:14 +11:00
Cameron McCormack
e5b00ee850 Bug 1193019 - Rename CSSFontFaceLoadEvent to FontFaceSetLoadEvent. r=khuey 2015-08-11 12:19:52 +10:00
Cameron McCormack
dc6459f9c5 Bug 1183484 - Cycle collect FontFaceSetIterator. r=bzbarsky 2015-07-16 17:35:17 +10:00
Birunthan Mohanathas
e52329c788 Bug 1182996 - Fix and add missing namespace comments. rs=ehsan
The bulk of this commit was generated by running:

  run-clang-tidy.py \
    -checks='-*,llvm-namespace-comment' \
    -header-filter=^/.../mozilla-central/.* \
    -fix
2015-07-13 08:25:42 -07:00
Cameron McCormack
3e5c2ac779 Bug 1072102 - Part 1: Implement FontFaceSet load and check. r=jdaggett,bzbarsky 2015-06-27 11:41:10 +10:00
Cameron McCormack
073f606691 Bug 1163879 - Remove FontFaceSet::mUnavailableFontFaces. r=jdaggett 2015-06-27 11:39:54 +10:00
Cameron McCormack
187d7c971c Bug 1161413 - Part 5: Cancel font loads on FontFaceSet destruction. r=jdaggett 2015-06-27 11:39:54 +10:00
Cameron McCormack
c05d48f6d0 Bug 1161413 - Part 1: Create FontFaceSet with a document rather than a pres context. r=jdaggett 2015-06-27 11:39:54 +10:00
Cameron McCormack
d22e480bfb Bug 1162850 - Don't stop looking for style sheet load finishes after the FontFaceSet gets a DOMContentLoaded. r=jdaggett 2015-05-13 15:06:52 +10:00
Cameron McCormack
78ac3925e6 Bug 1163865 - Remove [Throws] from FontFaceSet.delete. r=smaug 2015-05-13 12:24:34 +10:00
Cameron McCormack
eb7769872b Bug 1154148 - Create a FontFaceSet's UserFontSet eagerly. r=jdaggett 2015-05-09 14:46:49 +10:00
Cameron McCormack
ed67351bba Bug 1072101 - Part 5: Remove indexed property access on FontFaceSet. r=peterv 2015-03-31 14:05:33 +11:00
Cameron McCormack
4995d7f612 Bug 1072101 - Part 3: Implement FontFaceSet.forEach. r=peterv 2015-03-31 14:05:33 +11:00
Cameron McCormack
161a8c2a7e Bug 1072101 - Part 2: Implement FontFaceSet.{entries,values}. r=peterv 2015-03-31 14:05:33 +11:00
Cameron McCormack
b7a4daf2fd Bug 1072101 - Part 1: Implement FontFaceSet.size. r=peterv 2015-03-31 14:05:33 +11:00
Andrea Marchesini
b212600c95 Bug 1148527 - Indentation fix after bug 1145631, r=ehsan 2015-03-27 18:52:19 +00:00
Cameron McCormack
1366fc2485 Bug 1145506 - Make FontFace constructor fail on invalid src strings but otherwise create user font entries immediately. r=jdaggett 2015-03-27 21:13:21 +11:00
Cameron McCormack
54f2cbaea6 Bug 1145937 - Don't set FontFaceSet status to Loaded between a font download completion and the document reflow. r=jdaggett 2015-03-27 21:05:22 +11:00
Cameron McCormack
286cfffcba Bug 1144977 - Part 1: Don't include FontFace objects in more than one loadingdone/loadingerror event. r=jdaggett 2015-03-27 21:05:22 +11:00
Cameron McCormack
56f28aad7e Bug 1144450 - Part 4: Replace uses of mReadyIsResolved with mStatus, as they're equivalent. r=jdaggett 2015-03-24 19:34:32 +11:00
Cameron McCormack
8b470d8378 Bug 1144450 - Part 3: Replace uses of mDispatchedLoadingEvent with mStatus, as they're equivalent. r=jdaggett 2015-03-24 19:34:32 +11:00
Ehsan Akhgari
33bb32f549 Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj
This patch was automatically generated using the following script:

function convert() {
echo "Converting $1 to $2..."
find . \
       ! -wholename "*/.git*" \
       ! -wholename "obj-ff-dbg*" \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.c" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert MOZ_OVERRIDE override
convert MOZ_FINAL final
2015-03-21 12:28:04 -04:00
Boris Zbarsky
54c64f20a9 Bug 1117172 part 3. Change the wrappercached WrapObject methods to allow passing in aGivenProto. r=peterv
The only manual changes here are to BindingUtils.h, BindingUtils.cpp,
Codegen.py, Element.cpp, IDBFileRequest.cpp, IDBObjectStore.cpp,
dom/workers/Navigator.cpp, WorkerPrivate.cpp, DeviceStorageRequestChild.cpp,
Notification.cpp, nsGlobalWindow.cpp, MessagePort.cpp, nsJSEnvironment.cpp,
Sandbox.cpp, XPCConvert.cpp, ExportHelpers.cpp, and DataStoreService.cpp.  The
rest of this diff was generated by running the following commands:

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObject\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(Binding(?:_workers)?::Wrap\((?:aCx|cx|aContext|aCtx|js), [^,)]+)\)/\1, aGivenProto)/g'
2015-03-19 10:13:33 -04:00
Ehsan Akhgari
9fa4436b98 Bug 1118426 - Mark virtual overridden functions as MOZ_OVERRIDE in layout/style; r=dbaron 2015-01-06 23:33:51 -05:00
Cameron McCormack
5e52aa2468 Bug 1092570 - Avoid exposing FontFace(Set) constructors when the Font Loading API pref is not set. r=bzbarsky 2014-11-11 14:53:55 +11:00
John Daggett
6ff4a89a00 Bug 1079422 - eliminate the ptr to FontFace within @font-face rules. r=heycam 2014-10-09 16:03:56 +09:00
John Daggett
c81b96f1eb Bug 1079422 - backout changeset 7fceb8bf84d2. r=heycam 2014-10-09 16:03:28 +09:00
Ehsan Akhgari
d4770c5e54 Bug 1079324 - Fix some more bad implicit constructors in layout; r=dholbert 2014-09-24 09:16:53 -04:00
Cameron McCormack
fbde91a62d Bug 1077746 - Move FontFace pointer from nsCSSFontFaceRule to a table on FontFaceSet. r=jdaggett 2014-10-06 15:29:35 +11:00
Cameron McCormack
59693e845e Bug 1028497 - Part 27: Rename some things. r=jdaggett 2014-10-02 12:32:10 +10:00
Cameron McCormack
df92baa4c2 Bug 1028497 - Part 24: Implement FontFaceSet.{ready,status} and dispatch events. r=jdaggett,bzbarsky 2014-10-02 12:32:09 +10:00
Cameron McCormack
4c1b32886a 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
cf813511c5 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
0142b816a6 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
4ddb800587 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
fccff046d0 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
31eedc22b4 Bug 1028497 - Part 15.1: Store user font entries in FontFace objects. r=jdaggett 2014-10-02 12:32:08 +10:00
Cameron McCormack
d42d427d94 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
05b2c9ef9c 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
21a470ab25 Bug 1028497 - Part 13: Implement FontFace.load(). r=jdaggett 2014-10-02 12:32:07 +10:00
Cameron McCormack
1449ebdb0a 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
3691030343 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
7b8f969720 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