This lifts a bunch of string conversions higher up the stack, but allows
us to make the servo code use utf-8 unconditionally, and seemed faster
in my benchmarking (see comment 0).
It should also make a bunch of attribute setters faster too (like
setting .cssText), now that we use UTF8String for them (we couldn't
because we couldn't specify different string types for the getter and
setters).
Differential Revision: https://phabricator.services.mozilla.com/D99590
And add an assertion for this to fail earlier (in debug builds at
least).
The issue is that in paginated mode canvas frames (which are not
associated to a node) might overflow their page content frame.
Differential Revision: https://phabricator.services.mozilla.com/D99630
Which allows to run CSS.supports in chrome/user-agent context. We should
probably add a couple more tweaks for stuff like quirks or what not (the
`ParsingMode` enum), but that seem lower priority.
I only added the one-value version of CSS.supports because it should be enough
and supporting the two value version required a bit of awkward code due to when
we parse the CSS property name right now.
Differential Revision: https://phabricator.services.mozilla.com/D92585
Changes to nsIScrollableFrame.h cause the world to rebuild which I find annoying.
This removes the inclusion into Element.h which is responsible for the
world-rebuilding and is relatively easy to eliminate. A bunch of usages of
nsIScrollableFrame get moved from .h files into .cpp files and I include the
header into .cpp files as needed.
Differential Revision: https://phabricator.services.mozilla.com/D90735
This requires using the same Element::GetScrollFrame logic used in the new
Element::HasVisibleScrollbars method. This also makes GetScrollFrame public,
so that InspectorUtils can use it.
Differential Revision: https://phabricator.services.mozilla.com/D88505
Instead of creating an element, flushing styles and getting the computed
value back just to receive, use the existing InspectorUtils.colorToRGBA.
With some refactoring, we can completely get rid of parsing rgba strings
in LightWeightThemeConsumer too, as a benefit. This should be much
faster.
This patch tweaks the InspectorUtils API to allow taking a document, so
that system colors keep working. We could probably get away without
supporting system colors, but it'd technically be a regression, and
since we want this patch to be uplifted, and it's easy, let's avoid
breaking changes.
Differential Revision: https://phabricator.services.mozilla.com/D88200
Instead of creating an element, flushing styles and getting the computed
value back just to receive, use the existing InspectorUtils.colorToRGBA.
With some refactoring, we can completely get rid of parsing rgba strings
in LightWeightThemeConsumer too, as a benefit. This should be much
faster.
This patch tweaks the InspectorUtils API to allow taking a document, so
that system colors keep working. We could probably get away without
supporting system colors, but it'd technically be a regression, and
since we want this patch to be uplifted, and it's easy, let's avoid
breaking changes.
Differential Revision: https://phabricator.services.mozilla.com/D88200
I'm about to introduce the concept of "Loader principal" (as in "the
principal of the CSS loader"), and SheetLoadData already has an
mLoaderPrincipal.
However SheetLoadData's principal is just the triggering principal (the
principal that initiated the load). So name it that with consistency
with SheetInfo::mTriggeringPrincipal etc.
Differential Revision: https://phabricator.services.mozilla.com/D77613
Which is the spec term. nsIStyleSheetLinkingElement is even more
confusing since it may not be an element at all (see: processing
instructions).
Differential Revision: https://phabricator.services.mozilla.com/D76071
This also fixes some other bits, like mAdoptedStyleSheets.ElementAt(0) (which
really should be "the first applicable adopted stylesheet") and so on. Added a
test for that.
The new invariant also implies that a DocumentOrShadowRoot can't appear twice in
StyleSheet::mAdopters.
Also clears adopted stylesheets in Document::ResetStylesheetsToURI, as it's the
right thing to do (if you hit that code path with constructable sheets you'd end
up asserting, as we'd call FillStyleSetDocumentSheets after and find sheets in
there). I don't quite have a test-case for that though.
Differential Revision: https://phabricator.services.mozilla.com/D64151
--HG--
extra : moz-landing-system : lando
This also fixes some other bits, like mAdoptedStyleSheets.ElementAt(0) (which
really should be "the first applicable adopted stylesheet") and so on. Added a
test for that.
The new invariant also implies that a DocumentOrShadowRoot can't appear twice in
StyleSheet::mAdopters.
Also clears adopted stylesheets in Document::ResetStylesheetsToURI, as it's the
right thing to do (if you hit that code path with constructable sheets you'd end
up asserting, as we'd call FillStyleSetDocumentSheets after and find sheets in
there). I don't quite have a test-case for that though.
Differential Revision: https://phabricator.services.mozilla.com/D64151
--HG--
extra : moz-landing-system : lando
redundant return statement for GetCSSValuesForProperty in InspectorUtils.cpp removed
Differential Revision: https://phabricator.services.mozilla.com/D61954
--HG--
extra : moz-landing-system : lando
Now that we have UTF8String in the WebIDL, we can remove quite a few of the
conversions. Do that, and lift the remaining string conversions up as needed.
Also deindent Servo_ComputeColor while touching it.
Most of the remaining copies are because either bug 1606994, or because they're
WebIDL attributes that we still need to serialize back as UTF-16 (bug 1606995).
Differential Revision: https://phabricator.services.mozilla.com/D58687
--HG--
extra : moz-landing-system : lando
The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.
find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
if [ -n "$interfaces" ]; then
if [[ "$interfaces" == *$'\n'* ]]; then
regexp="\("
for i in $interfaces; do regexp="$regexp$i\|"; done
regexp="${regexp%%\\\|}\)"
else
regexp="$interfaces"
fi
interface=$(basename "$path")
rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
if [ $hits -eq 0 ]; then
echo "Removing ${interface} from ${path2}"
grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
mv -f "$path2".tmp "$path2"
fi
done
fi
done
Differential Revision: https://phabricator.services.mozilla.com/D55443
--HG--
extra : moz-landing-system : lando
We need to ensure we have a unique inner so that ruleLists and such have the
right pointer identity (we could do better, really, but it's harder).
But as long as the CSSOM hasn't modified them there should be no reason not to
use the cache. We can do a deep clone synchronously instead of refetching /
reparsing.
This is important because, as of right now, just using the inspector makes the
stylesheets unique, which is unfortunate.
We'll still have the modified rule bit for sheets with @import, because our
notification system for @import is silly, and on parents of imported sheets.
Fixing those are future improvements, but I see no reason not to land this.
Differential Revision: https://phabricator.services.mozilla.com/D55163
--HG--
extra : moz-landing-system : lando
This was generated with:
```
rg -l -g '*.{cpp,h}' MOZ_XBL . | while read FILE ; do
echo $FILE
unifdef -m -UMOZ_XBL $FILE
done
```
After this, I manually removed the directive in nsContentUtils.cpp due to:
unifdef: ./dom/base/nsContentUtils.cpp: 4630: Unterminated string literal
unifdef: Output may be truncated
Differential Revision: https://phabricator.services.mozilla.com/D51337
--HG--
extra : moz-landing-system : lando
When XBL is disabled, no code in dom/xbl will be built. Also, adds ifdefs
to remove any of the XBL related code elsewhere. There's definitely more
that can be done here, but I think it's better to wait to do the rest of
the cleanup when we actually remove the code.
Depends on D45612
Differential Revision: https://phabricator.services.mozilla.com/D45613
--HG--
extra : moz-landing-system : lando
And also this patch moves some related methods which use the inline methods
and member variables used only by them.
Differential Revision: https://phabricator.services.mozilla.com/D29201
--HG--
rename : layout/base/nsIPresShellInlines.h => layout/base/PresShellInlines.h
extra : moz-landing-system : lando
Per the discussion in:
https://groups.google.com/d/msg/mozilla.dev.platform/P79pwa9z5m8/iPYPAWPHCAAJ
They should be CamelCase, and that's what most of them already do. This converts
the rest, which are a few.
For the ones that already used `e` or `k` prefixes, I've mostly done:
for file in $(rg Type::e layout | cut -d : -f 1 | sort | uniq); do sed -i 's#Type::e#Type::#g' $file; done
For the ones that used uppercase, I've removed the prefix if it was already in
the type name, and turn them into CamelCase.
Depends on D28680
Differential Revision: https://phabricator.services.mozilla.com/D28681
--HG--
extra : moz-landing-system : lando
Just one set of stylesheets is enough. While at it, unify SheetType and Origin.
Differential Revision: https://phabricator.services.mozilla.com/D27564
--HG--
extra : moz-landing-system : lando
This is the last step to be able to call matchMedia on display: none iframes.
This is green, except for some startup preference query tests that I'm going to
address in a blocking bug (making LangGroupFontPrefs global, basically).
The setup is similar to the ShadowRoot one, except we don't eagerly keep the
StyleSet around up-to-date, we only fill it if it ever had a pres context.
Differential Revision: https://phabricator.services.mozilla.com/D23903
--HG--
extra : moz-landing-system : lando
This makes `Document::GetShell()` return `PresShell*` instead of `nsIPresShell`.
Additonally, "shell" is unclear ("docshell" vs. "presshell"). Therefore, this
also renames `Document::GetShell()` to `Document::GetPresShell()`.
Similarly, some other method names of `Document` are also renamed from
`*Shell*` to `*PresShell*`.
Differential Revision: https://phabricator.services.mozilla.com/D25338
--HG--
extra : moz-landing-system : lando
This makes `Document::GetShell()` return `PresShell*` instead of `nsIPresShell`.
Additonally, "shell" is unclear ("docshell" vs. "presshell"). Therefore, this
also renames `Document::GetShell()` to `Document::GetPresShell()`.
Similarly, some other method names of `Document` are also renamed from
`*Shell*` to `*PresShell*`.
Differential Revision: https://phabricator.services.mozilla.com/D25338
--HG--
extra : moz-landing-system : lando