Commit Graph

114 Commits

Author SHA1 Message Date
Iris Hsiao
e816fa3003 Backed out changeset aa46d54ab74b (bug 1321754) for stylo test failures 2017-04-05 16:56:36 +08:00
Ting-Yu Lin
a12a6cc79c Bug 1321754 - Add an enum value to SheetParsingMode for agent sheets that use no unsafe rules. r=heycam
scrollbars.css is the only sheet which is parsed as author level, but later
added as agent level in [1]. Add a new enum value so that it can be parsed
as author level in gecko (nsCSSParser::AgentRulesEnabled() will exclude it),
but servo can recognize it as agent level sheet when the sheet is created.

Delete UserRulesEnabled() because no one uses it.

[1] http://searchfox.org/mozilla-central/rev/7419b368156a6efa24777b21b0e5706be89a9c2f/layout/base/nsDocumentViewer.cpp#2326

MozReview-Commit-ID: 2lrV4ogfnHM
2017-03-28 18:06:26 +08:00
Xidorn Quan
6eb87266b6 Bug 1345696 part 1 - Lots of fixup for the next patch. r=heycam
The next patch moves nsCSSFontFaceRule into a separate header, which
somehow affects lots of header dependencies. I'm not completely sure
why this happens, though.

MozReview-Commit-ID: KuXbsaX0NUd
2017-03-28 20:05:12 +11:00
Jonathan Watt
ab5c7759e9 Bug 1350734 - Have nsLayoutStylesheetCache load xul.css lazily in the content process. r=heycam
MozReview-Commit-ID: 5gKiJT1rdSY
2017-03-07 11:43:16 +00:00
Ting-Yu Lin
900bd55b15 Bug 1338446 Part 3 - Label SheetLoadData in Loader::PostLoadEvent. r=heycam
When constructing a Loader without passing a document, we added a DocGroup
parameter so that we could still use it to dispatch events to the DocGroup.

Delete NS_ENSURE_TRUE because new() is infallable.

Use another runnable pointer for calling dispatching because forget() will
nuke the pointer and we need to use evt afterwards.

MozReview-Commit-ID: Ce2K6j4pUhA
2017-03-13 17:00:57 +08:00
Tom Tromey
e90d95a3f9 Bug 1060419 - make AppendPrintf and nsPrintfCString use Printf.h, r=froydnj
MozReview-Commit-ID: 2E8FoiNxU8L
2016-12-14 09:32:21 -07:00
Thomas Nguyen
82e1caab63 Bug 1304623 - Create a pref to control the default referrer policy - part 3. r=bkelly
MozReview-Commit-ID: 1A6IHPeNYBQ
2017-01-05 11:29:56 +08:00
Emilio Cobos Álvarez
6d7b2e91b9 Bug 1304792: stylo: Implement @import. r=heycam
MozReview-Commit-ID: Hw1V66JxIBD
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2016-12-30 16:30:41 +01:00
Wei-Cheng Pan
a76374bf51 Bug 1323946 - Use MOZ_MUST_USE for netwerk/protocol/res r=valentin
MozReview-Commit-ID: 7tcOml6jKdj
2016-11-04 18:13:13 +08:00
Wei-Cheng Pan
9d09c89b08 Bug 1320651 - Only crash for real builtin sheet error. r=bz 2016-12-06 18:25:00 +01:00
Thomas Wisniewski
154e6ec149 Bug 140562 - Part 2: Remove the 2px extra padding on buttons for a prospective -moz-focus-inner ring, and just size that ring the same as the content frame (inflated by its CSS padding). r=dbaron 2016-12-02 01:11:48 -05:00
Wei-Cheng Pan
752f56bd29 Bug 1046166 - Send userContent.css URL to content processes. r=dbaron,haik
MozReview-Commit-ID: 4NTxwYeFGSU
2016-07-21 18:57:35 +08:00
Ting-Yu Lin
2cbd3d4835 Bug 1271549 - Remove details and summary preference. r=bz
Bug 1259889 Part 2 [1] cannot be reverted cleanly, so I manually undo those
changes in this patch. That is, remove the ability for html.css to
invalidate dynamically since it was added specifically for details element.

Although reftest-stylo.list explicit mentions "DO NOT EDIT!", but I still
remove details pref from the file, since it doesn't harm to edit it anyway.

[1] https://hg.mozilla.org/mozilla-central/rev/30aaf3805b56

MozReview-Commit-ID: FsyTGQTxujh
2016-11-16 14:02:58 +08:00
Xidorn Quan
7d6c4129ab Bug 1304302 part 10 - Replace all uses of StyleSheetHandle. r=heycam
This commit is generated by the following commands with some minor
manual adjustment:

find . \( -name '*.h' -or -name '*.cpp' \) -not -path './layout/style/StyleSheet*' -exec sed -i -b \
  -e '/^\(#include\|using\)/s/StyleSheetHandle/StyleSheet/g' \
  -e 's/\(mozilla::\)\?StyleSheetHandle::RefPtr/RefPtr<\1StyleSheet>/g' \
  -e 's/StyleSheetHandle()/nullptr/g' \
  -e 's/->AsStyleSheet()//g' \
  -e 's/StyleSheetHandle/StyleSheet*/g' {} +
sed -i -b 's/sheet->AsVoidPtr()/sheet.get()/' layout/style/Loader.cpp
sed -i -b 's/AsHandle()/this/' layout/style/StyleSheet.cpp

MozReview-Commit-ID: 7abdvlKHukd
2016-09-26 22:03:25 +10:00
Xidorn Quan
7ba350b0a6 Bug 1304302 part 8 - Change include of {CSS,Servo}StyleSheet.h to StyleSheetInlines.h. r=heycam
It is a preparation for later patch which moves functions from those
classes into StyleSheet. Some of the functions are better defined in
StyleSheetInlines.h.

This commit is generated by the following command:

find . \( -name '*.h' -or -name '*.cpp' \) -not -name '*StyleSheet*' -exec sed -i -b \
  -e '/^#include/ s_/\(CSS\|Servo\)StyleSheet\.h_/StyleSheetInlines.h_' \
  -e '1,\_^#include "mozilla/StyleSheetInlines.h"_ ! { \_^#include "mozilla/StyleSheetInlines.h"_d }' {} +

MozReview-Commit-ID: 54H5x27Pmso
2016-09-26 22:03:25 +10:00
Nicholas Nethercote
c57fffaa55 Bug 1297300 - Add missing checks to GetSpec() calls in layout/. r=dholbert,heycam. 2016-08-31 20:10:10 +10:00
Nicholas Nethercote
62b6b0fce6 Bug 1297961 (part 1) - Introduce nsURI::GetSpecOrDefault(). r=hurley.
This function is an infallible alternative to nsIURI::GetSpec(). It's useful
when it's appropriate to handle a GetSpec() failure with a failure string, e.g.
for log/warning/error messages. It allows code like this:

  nsAutoCString spec;
  uri->GetSpec(spec);
  printf("uri: %s", spec.get());

to be changed to this:

  printf("uri: %s", uri->GetSpecOrDefault().get());

This introduces a slight behavioural change. Previously, if GetSpec() failed,
an empty string would be used here. Now, "[nsIURI::GetSpec failed]" will be
produced instead. In most cases this failure string will make for a clearer
log/warning/error message than the empty string.
* * *
Bug 1297961 (part 1b) - More GetSpecOrDefault() additions. r=hurley.

I will fold this into part 1 before landing.
2016-08-26 16:02:31 +10:00
Nicholas Nethercote
1009bf0056 Bug 1297658 - Avoid unnecessary checking in memory reporters. r=erahm.
This patch removes checking of all the callback calls in memory reporter
CollectReport() functions, because it's not useful.

The patch also does some associated clean-up.

- Replaces some uses of nsIMemoryReporterCallback with the preferred
  nsIHandleReportCallback typedef.

- Replaces aCallback/aCb/aClosure with aHandleRepor/aData for CollectReports()
  parameter names, for consistency.

- Adds MOZ_MUST_USE/[must_use] in a few places in nsIMemoryReporter.idl.

- Uses the MOZ_COLLECT_REPORT macro in all suitable places.

Overall the patch reduces code size by ~300 lines and reduces the size of
libxul by about 37 KiB on my Linux64 builds.
2016-08-24 15:23:45 +10:00
Sebastian Hengst
a120adeb93 Backed out changeset d1d614497fbf (bug 1046166) on request of developer for crashes. r=backout a=backout
MozReview-Commit-ID: IHG3TraKy6n
2016-08-19 12:35:34 +02:00
Wei-Cheng Pan
e832cd2ba9 Bug 1046166 - Send userContent.css URL to content processes. r=dbaron
MozReview-Commit-ID: 4NTxwYeFGSU
2016-07-21 18:57:35 +08:00
Bobby Holley
3eac0e7c8d Bug 1291390 - Make parsing mode an immutable property of the StyleSheet. r=heycam 2016-08-03 10:26:14 -07:00
Bobby Holley
6edd59aa3d Bug 1291390 - Use the parsing mode from the stylesheet when building preferences stylesheet. r=heycam
In practice this will be the 'agent' level rather than the 'author' level, given
the SetParsingMode call immediately after creating the stylesheet. This change
aligns behavior with CSSStyleSheet::ReparseSheet.
2016-08-03 10:26:14 -07:00
Thomas Wisniewski
dec381fbce Bug 843579 - Unprefix -moz-any-link. r=bz 2016-07-19 23:13:13 -04:00
Cameron McCormack
c518a30799 Bug 1247150 - Consistently use StyleSheetHandle::RefPtr* for outparams in nsLayoutStylesheetCache. r=dholbert 2016-04-14 09:55:47 +10:00
Ting-Yu Lin
f34e7767d9 Bug 1259889 Part 2 - Load html.css lazily for pref changes. r=heycam
We need to re-evaluate html.css whenever "dom.details_element.enabled"
is changed to make the disclosure triangle for summary elements show up.
Reftests for details and summary will need the a live pref to work.

MozReview-Commit-ID: 9SN1fQBuwA7
2016-04-01 21:11:11 +08:00
Bobby Holley
0a533d159f Bug 1252611 - Hoist IsComplete/SetComplete into StyleSheet. r=dholbert 2016-03-10 22:18:59 -08:00
Daniel Holbert
19937508b5 Bug 1251848: Check StyleSheetHandles for being null-flavored before derefing them, in assertions within nsLayoutStylesheetCache::InvalidateSheet. r=bholley 2016-02-29 18:57:05 -08:00
Cameron McCormack
d68fc2aacd Bug 1250788 - Part 6: Create ServoStyleSheets for the pref style sheet. r=bholley 2016-02-26 12:51:02 +11:00
Cameron McCormack
1b2002825d Bug 1250379 - Create css::Loaders for specific style backend types. r=dholbert 2016-02-24 18:01:12 +11:00
Cameron McCormack
c0e9a631c2 Bug 1244074 - Part 4: Use StyleSheetHandle instead of concrete style sheet class in most places. r=dholbert 2016-02-24 18:01:12 +11:00
Tom Tromey
6078f07937 Bug 1239336 - set parsing mode on about:PreferenceStyleSheet; r=heycam,bgrins 2016-01-20 13:35:13 -07:00
Mats Palmgren
5efc32d471 Bug 1239496 - Load the UA sheet lazily so we can invalidate it for pref changes. Make it depend on the "layout.css.grid.enabled" pref. r=heycam 2016-01-14 23:11:44 +01:00
Cameron McCormack
da20e1dace Bug 1234773 - Followup assertion. 2016-01-04 10:25:28 +11:00
Cameron McCormack
25c0b14610 Bug 1234773 - Build and parse preference style sheet as a single string. r=dholbert 2016-01-04 09:26:59 +11:00
Cameron McCormack
e40c4b9ce5 Bug 1234758 - Fix errors in preference style sheet focus ring rules. r=dholbert 2016-01-04 09:26:58 +11:00
Cameron McCormack
cccb81df88 Bug 1229567 - Back out bug 1194856 data: URL hack. r=dholbert 2016-01-04 09:26:58 +11:00
Xidorn Quan
26b55a6312 Bug 1202940 part 1 - Move html.css and ua.css back to be loaded in constructor of nsLayoutStylesheetCache. r=dbaron
DependentPrefChanged and InvalidateSheet are no longer used anywhere, but it is
probably better to keep them as-is, since we may need them again in the future.
2015-12-01 09:39:37 +11:00
Cameron McCormack
f7e0168a64 Bug 1225004 - Record reason for NS_ERROR_FILE_CORRUPTED in nsLayoutStylesheetCache::LoadSheet in crash reports. r=roc 2015-11-16 19:18:45 +11:00
Wes Kocher
fb3bcf9f8f Backed out changeset 4efb6cc4fd5d (bug 1225004) for build bustage CLOSED TREE 2015-11-16 14:51:17 -08:00
Cameron McCormack
6f779c4392 Bug 1225004 - Record reason for NS_ERROR_FILE_CORRUPTED in nsLayoutStylesheetCache::LoadSheet in crash reports. r=roc 2015-11-16 19:18:45 +11:00
Nigel Babu
41531a0a2b Backed out changeset 6d47b0590988 (bug 1225004) for ASAN build bustage on a CLOSED TREE 2015-11-16 14:46:58 +05:30
Cameron McCormack
cec3ef3221 Bug 1225004 - Record reason for NS_ERROR_FILE_CORRUPTED in nsLayoutStylesheetCache::LoadSheet in crash reports. r=roc 2015-11-16 19:18:45 +11: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
Zack Weinberg
d29e401400 Bug 1035091 part 1: change CSS parser and loader APIs to distinguish UA, user, and author sheets instead of just UA vs everyone else. r=heycam 2015-10-13 17:43:16 -04:00
Cameron McCormack
419dd445d9 Bug 1194856 - Add crash report annotations just before crashing in ErrorLoadingBuiltinSheet. r=bsmedberg 2015-10-13 09:03:56 +11:00
Xidorn Quan
baa7270885 Bug 1126230 part 9 - Remove fullscreen override and related test. r=dbaron 2015-10-07 14:04:32 +11:00
Nigel Babu
b3962e0c30 Backed out 9 changesets (bug 1126230) for Mulet Gij(25) and M(5) failures
Backed out changeset 8a9d8a556183 (bug 1126230)
Backed out changeset 441b55f015c2 (bug 1126230)
Backed out changeset 7bfa2a2d4e29 (bug 1126230)
Backed out changeset b55511536c65 (bug 1126230)
Backed out changeset ada76e419aac (bug 1126230)
Backed out changeset 745d659bef49 (bug 1126230)
Backed out changeset 7c303cc4c30b (bug 1126230)
Backed out changeset 8bf708acbad4 (bug 1126230)
Backed out changeset 590404aac357 (bug 1126230)
2015-10-02 13:39:20 +05:30
Xidorn Quan
882f51c317 Bug 1126230 part 8 - Remove fullscreen override and related test. r=dbaron 2015-10-02 16:34:09 +10:00
Cameron McCormack
655bf4dde3 Bug 1194856 - Load noscript.css and noframes.css from data: URLs in release builds. r=dbaron 2015-09-10 13:24:12 +10:00
Wes Kocher
02052d2865 Backed out 2 changesets (bug 1035091)
a=backout

Backed out changeset 1fc07bdd9aa8 (bug 1035091)
Backed out changeset f6e98029d1cb (bug 1035091)
2015-09-03 11:41:39 -07:00