summaryrefslogtreecommitdiff
path: root/layout
diff options
context:
space:
mode:
authorBrian Smith <brian@dbsoft.org>2022-04-28 20:27:47 -0500
committerBrian Smith <brian@dbsoft.org>2022-04-28 20:27:47 -0500
commitd78e03d528ba9e7395160a23bce23726067600dd (patch)
treee8314f3d55f136a6db6bb9e2a035ae68a04dc3e9 /layout
parentbebeb4e26a35df99e19b6c44fc957ad6c14e9059 (diff)
parent33523f5d5ed0c3b8000aae21a50a56c238422db3 (diff)
downloaduxp-d78e03d528ba9e7395160a23bce23726067600dd.tar.gz
Merge branch 'master' into 1829
* master: No issue - Update README and SECURITY Issue #1885 - Follow-up: Update error message if invalid rootMargin specified. Issue #1879 - Follow-up: Update config/external/nss/target to security/target. Issue #1885 - Allow unitless rootMargin entries for IntersectionObserver. Issue #1879 - Revert changes to cryptox.h Revert "Issue #1879 - spot-fix typo in cryptox.h" Issue #1879 - spot-fix typo in cryptox.h Issue #21 - Change MappedAttrParser to store its nsIPrincipal instead of nsSVGElement Issue #21 - Remove use counters telemetry Issue #1881 - Interpret empty or whitespace root margin string as zero length Issue #1877 - Resolve NIGHTLY_BUILD conditionals. Issue #1880 - Boot Comic Sans out of the font configuration.
Diffstat (limited to 'layout')
-rw-r--r--layout/generic/nsBulletFrame.cpp10
-rw-r--r--layout/style/ImageLoader.cpp23
-rw-r--r--layout/style/ImageLoader.h2
-rw-r--r--layout/style/nsCSSDataBlock.cpp19
-rw-r--r--layout/style/nsCSSDataBlock.h9
-rw-r--r--layout/style/nsCSSParser.cpp42
-rw-r--r--layout/style/nsCSSProps.cpp15
-rw-r--r--layout/style/nsCSSProps.h12
8 files changed, 24 insertions, 108 deletions
diff --git a/layout/generic/nsBulletFrame.cpp b/layout/generic/nsBulletFrame.cpp
index db9a70aff6..dad2230b36 100644
--- a/layout/generic/nsBulletFrame.cpp
+++ b/layout/generic/nsBulletFrame.cpp
@@ -775,16 +775,6 @@ nsBulletFrame::Notify(imgIRequest *aRequest, int32_t aType, const nsIntRect* aDa
InvalidateFrame();
}
- if (aType == imgINotificationObserver::DECODE_COMPLETE) {
- if (nsIDocument* parent = GetOurCurrentDoc()) {
- nsCOMPtr<imgIContainer> container;
- aRequest->GetImage(getter_AddRefs(container));
- if (container) {
- container->PropagateUseCounters(parent);
- }
- }
- }
-
return NS_OK;
}
diff --git a/layout/style/ImageLoader.cpp b/layout/style/ImageLoader.cpp
index a26a1741aa..5d4f628636 100644
--- a/layout/style/ImageLoader.cpp
+++ b/layout/style/ImageLoader.cpp
@@ -15,7 +15,6 @@
#include "FrameLayerBuilder.h"
#include "nsSVGEffects.h"
#include "imgIContainer.h"
-#include "Image.h"
namespace mozilla {
namespace css {
@@ -395,14 +394,6 @@ ImageLoader::Notify(imgIRequest* aRequest, int32_t aType, const nsIntRect* aData
return OnFrameUpdate(aRequest);
}
- if (aType == imgINotificationObserver::DECODE_COMPLETE) {
- nsCOMPtr<imgIContainer> image;
- aRequest->GetImage(getter_AddRefs(image));
- if (image && mDocument) {
- image->PropagateUseCounters(mDocument);
- }
- }
-
return NS_OK;
}
@@ -508,19 +499,5 @@ ImageLoader::UnblockOnload(imgIRequest* aRequest)
return NS_OK;
}
-void
-ImageLoader::FlushUseCounters()
-{
- for (auto iter = mImages.Iter(); !iter.Done(); iter.Next()) {
- nsPtrHashKey<Image>* key = iter.Get();
- ImageLoader::Image* image = key->GetKey();
-
- imgIRequest* request = image->mRequests.GetWeak(mDocument);
-
- nsCOMPtr<imgIContainer> container;
- request->GetImage(getter_AddRefs(container));
- }
-}
-
} // namespace css
} // namespace mozilla
diff --git a/layout/style/ImageLoader.h b/layout/style/ImageLoader.h
index 4e29da5ed4..c7469d570d 100644
--- a/layout/style/ImageLoader.h
+++ b/layout/style/ImageLoader.h
@@ -70,8 +70,6 @@ public:
void DestroyRequest(imgIRequest* aRequest);
- void FlushUseCounters();
-
private:
~ImageLoader() {}
diff --git a/layout/style/nsCSSDataBlock.cpp b/layout/style/nsCSSDataBlock.cpp
index 33c309dd40..c32f436106 100644
--- a/layout/style/nsCSSDataBlock.cpp
+++ b/layout/style/nsCSSDataBlock.cpp
@@ -681,14 +681,12 @@ nsCSSExpandedDataBlock::TransferFromBlock(nsCSSExpandedDataBlock& aFromBlock,
bool aIsImportant,
bool aOverrideImportant,
bool aMustCallValueAppended,
- css::Declaration* aDeclaration,
- nsIDocument* aSheetDocument)
+ css::Declaration* aDeclaration)
{
if (!nsCSSProps::IsShorthand(aPropID)) {
return DoTransferFromBlock(aFromBlock, aPropID,
aIsImportant, aOverrideImportant,
- aMustCallValueAppended, aDeclaration,
- aSheetDocument);
+ aMustCallValueAppended, aDeclaration);
}
// We can pass CSSEnabledState::eIgnore (here, and in ClearProperty
@@ -700,8 +698,7 @@ nsCSSExpandedDataBlock::TransferFromBlock(nsCSSExpandedDataBlock& aFromBlock,
CSSPROPS_FOR_SHORTHAND_SUBPROPERTIES(p, aPropID, aEnabledState) {
changed |= DoTransferFromBlock(aFromBlock, *p,
aIsImportant, aOverrideImportant,
- aMustCallValueAppended, aDeclaration,
- aSheetDocument);
+ aMustCallValueAppended, aDeclaration);
}
return changed;
}
@@ -712,8 +709,7 @@ nsCSSExpandedDataBlock::DoTransferFromBlock(nsCSSExpandedDataBlock& aFromBlock,
bool aIsImportant,
bool aOverrideImportant,
bool aMustCallValueAppended,
- css::Declaration* aDeclaration,
- nsIDocument* aSheetDocument)
+ css::Declaration* aDeclaration)
{
bool changed = false;
MOZ_ASSERT(aFromBlock.HasPropertyBit(aPropID), "oops");
@@ -741,13 +737,6 @@ nsCSSExpandedDataBlock::DoTransferFromBlock(nsCSSExpandedDataBlock& aFromBlock,
aDeclaration->ValueAppended(aPropID);
}
- if (aSheetDocument) {
- UseCounter useCounter = nsCSSProps::UseCounterFor(aPropID);
- if (useCounter != eUseCounter_UNKNOWN) {
- aSheetDocument->SetDocumentAndPageUseCounter(useCounter);
- }
- }
-
SetPropertyBit(aPropID);
aFromBlock.ClearPropertyBit(aPropID);
diff --git a/layout/style/nsCSSDataBlock.h b/layout/style/nsCSSDataBlock.h
index b699c408b9..3d6fd659d8 100644
--- a/layout/style/nsCSSDataBlock.h
+++ b/layout/style/nsCSSDataBlock.h
@@ -20,7 +20,6 @@
struct nsRuleData;
class nsCSSExpandedDataBlock;
-class nsIDocument;
namespace mozilla {
namespace css {
@@ -258,8 +257,6 @@ public:
* Returns true if something changed, false otherwise. Calls
* |ValueAppended| on |aDeclaration| if the property was not
* previously set, or in any case if |aMustCallValueAppended| is true.
- * Calls |SetDocumentAndPageUseCounter| on |aSheetDocument| if it is
- * non-null and |aPropID| has a use counter.
*/
bool TransferFromBlock(nsCSSExpandedDataBlock& aFromBlock,
nsCSSPropertyID aPropID,
@@ -267,8 +264,7 @@ public:
bool aIsImportant,
bool aOverrideImportant,
bool aMustCallValueAppended,
- mozilla::css::Declaration* aDeclaration,
- nsIDocument* aSheetDocument);
+ mozilla::css::Declaration* aDeclaration);
/**
* Copies the values for aPropID into the specified aRuleData object.
@@ -302,8 +298,7 @@ private:
bool aIsImportant,
bool aOverrideImportant,
bool aMustCallValueAppended,
- mozilla::css::Declaration* aDeclaration,
- nsIDocument* aSheetDocument);
+ mozilla::css::Declaration* aDeclaration);
#ifdef DEBUG
void DoAssertInitialState();
diff --git a/layout/style/nsCSSParser.cpp b/layout/style/nsCSSParser.cpp
index 70115d2a4a..6a65f06646 100644
--- a/layout/style/nsCSSParser.cpp
+++ b/layout/style/nsCSSParser.cpp
@@ -67,9 +67,7 @@ static bool sOpentypeSVGEnabled;
static bool sWebkitPrefixedAliasesEnabled;
static bool sWebkitDevicePixelRatioEnabled;
static bool sUnprefixingServiceEnabled;
-#ifdef NIGHTLY_BUILD
static bool sUnprefixingServiceGloballyWhitelisted;
-#endif
static bool sMozGradientsEnabled;
static bool sControlCharVisibility;
@@ -143,8 +141,6 @@ public:
nsresult SetStyleSheet(CSSStyleSheet* aSheet);
- nsIDocument* GetDocument();
-
nsresult SetQuirkMode(bool aQuirkMode);
nsresult SetChildLoader(mozilla::css::Loader* aChildLoader);
@@ -1649,15 +1645,6 @@ CSSParserImpl::SetStyleSheet(CSSStyleSheet* aSheet)
return NS_OK;
}
-nsIDocument*
-CSSParserImpl::GetDocument()
-{
- if (!mSheet) {
- return nullptr;
- }
- return mSheet->GetDocument();
-}
-
nsresult
CSSParserImpl::SetQuirkMode(bool aQuirkMode)
{
@@ -1979,8 +1966,7 @@ CSSParserImpl::ParseTransformProperty(const nsAString& aPropValue,
declaration->ExpandTo(&mData);
changed = mData.TransferFromBlock(mTempData, eCSSProperty_transform,
EnabledState(), false,
- true, false, declaration,
- GetDocument());
+ true, false, declaration);
declaration->CompressFrom(&mData);
}
@@ -2061,8 +2047,7 @@ CSSParserImpl::ParseProperty(const nsCSSPropertyID aPropID,
aDeclaration->ExpandTo(&mData);
*aChanged = mData.TransferFromBlock(mTempData, aPropID,
EnabledState(), aIsImportant,
- true, false, aDeclaration,
- GetDocument());
+ true, false, aDeclaration);
aDeclaration->CompressFrom(&mData);
}
CLEAR_ERROR();
@@ -2302,8 +2287,20 @@ CSSParserImpl::ParseMarginString(const nsSubstring& aBuffer,
nsAutoSuppressErrors suppressErrors(this, aSuppressErrors);
- // Parse a margin, and check that there's nothing else after it.
- bool marginParsed = ParseGroupedBoxProperty(VARIANT_LP, aValue, 0) && !GetToken(true);
+ bool marginParsed = false;
+
+ // Treat margin as zero length if there are no tokens, i.e., the specified
+ // margin string is empty or consists only of whitespace characters.
+ if (!GetToken(true)) {
+ nsCSSRect& zeroRootMargin = aValue.SetRectValue();
+ zeroRootMargin.SetAllSidesTo(nsCSSValue(0.0f, eCSSUnit_Pixel));
+ marginParsed = true;
+ } else {
+ UngetToken();
+ // Parse a margin, and check that there's nothing else after it.
+ marginParsed = ParseGroupedBoxProperty(VARIANT_LPN, aValue, 0) &&
+ !GetToken(true);
+ }
if (aSuppressErrors) {
CLEAR_ERROR();
@@ -7197,13 +7194,12 @@ CSSParserImpl::ShouldUseUnprefixingService() const
return false;
}
-#ifdef NIGHTLY_BUILD
if (sUnprefixingServiceGloballyWhitelisted) {
// Unprefixing is globally whitelisted,
// so no need to check mSheetPrincipal.
return true;
}
-#endif
+
// Unprefixing enabled; see if our principal is whitelisted for unprefixing.
return mSheetPrincipal && mSheetPrincipal->IsOnCSSUnprefixingWhitelist();
}
@@ -7505,7 +7501,7 @@ CSSParserImpl::ParseDeclaration(css::Declaration* aDeclaration,
*aChanged |= mData.TransferFromBlock(mTempData, propID, EnabledState(),
status == ePriority_Important,
false, aMustCallValueAppended,
- aDeclaration, GetDocument());
+ aDeclaration);
}
return true;
@@ -17992,10 +17988,8 @@ nsCSSParser::Startup()
"layout.css.prefixes.device-pixel-ratio-webkit");
Preferences::AddBoolVarCache(&sUnprefixingServiceEnabled,
"layout.css.unprefixing-service.enabled");
-#ifdef NIGHTLY_BUILD
Preferences::AddBoolVarCache(&sUnprefixingServiceGloballyWhitelisted,
"layout.css.unprefixing-service.globally-whitelisted");
-#endif
Preferences::AddBoolVarCache(&sMozGradientsEnabled,
"layout.css.prefixes.gradients");
Preferences::AddBoolVarCache(&sControlCharVisibility,
diff --git a/layout/style/nsCSSProps.cpp b/layout/style/nsCSSProps.cpp
index e3cd802417..da50e3cb4f 100644
--- a/layout/style/nsCSSProps.cpp
+++ b/layout/style/nsCSSProps.cpp
@@ -3421,21 +3421,6 @@ nsCSSProps::gPropertyEnabled[eCSSProperty_COUNT_with_aliases] = {
#undef IS_ENABLED_BY_DEFAULT
};
-#include "../../dom/base/PropertyUseCounterMap.inc"
-
-/* static */ const UseCounter
-nsCSSProps::gPropertyUseCounter[eCSSProperty_COUNT_no_shorthands] = {
- #define CSS_PROP_PUBLIC_OR_PRIVATE(publicname_, privatename_) privatename_
- #define CSS_PROP_LIST_INCLUDE_LOGICAL
- #define CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, \
- kwtable_, stylestruct_, stylestructoffset_, animtype_) \
- static_cast<UseCounter>(USE_COUNTER_FOR_CSS_PROPERTY_##method_),
- #include "nsCSSPropList.h"
- #undef CSS_PROP
- #undef CSS_PROP_LIST_INCLUDE_LOGICAL
- #undef CSS_PROP_PUBLIC_OR_PRIVATE
-};
-
// Check that all logical property flags are used appropriately.
#define CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, \
kwtable_, stylestruct_, stylestructoffset_, animtype_) \
diff --git a/layout/style/nsCSSProps.h b/layout/style/nsCSSProps.h
index cf7ffda78f..567f7f7bfa 100644
--- a/layout/style/nsCSSProps.h
+++ b/layout/style/nsCSSProps.h
@@ -19,7 +19,6 @@
#include "nsStyleStructFwd.h"
#include "nsCSSKeywords.h"
#include "mozilla/CSSEnabledState.h"
-#include "mozilla/UseCounter.h"
#include "mozilla/EnumTypeTraits.h"
// Length of the "--" prefix on custom names (such as custom property names,
@@ -640,19 +639,8 @@ public:
return gPropertyEnabled[aProperty];
}
- // A table for the use counter associated with each CSS property. If a
- // property does not have a use counter defined in UseCounters.conf, then
- // its associated entry is |eUseCounter_UNKNOWN|.
- static const mozilla::UseCounter gPropertyUseCounter[eCSSProperty_COUNT_no_shorthands];
-
public:
- static mozilla::UseCounter UseCounterFor(nsCSSPropertyID aProperty) {
- MOZ_ASSERT(0 <= aProperty && aProperty < eCSSProperty_COUNT_no_shorthands,
- "out of range");
- return gPropertyUseCounter[aProperty];
- }
-
static bool IsEnabled(nsCSSPropertyID aProperty, EnabledState aEnabled)
{
if (IsEnabled(aProperty)) {