mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-22 07:07:30 +09:00
Revert "Part 1. Move IsLocalRefURL to nsContentUtils to reuse this function. (port-rewrite)"
This reverts commit 19f010c62022e269f99066a8d90e3522fe31adaf.
This commit is contained in:
parent
325afc0ab8
commit
5cc1408b3d
3 changed files with 18 additions and 25 deletions
|
|
@ -9787,19 +9787,3 @@ nsContentUtils::AttemptLargeAllocationLoad(nsIHttpChannel* aChannel)
|
||||||
|
|
||||||
return reloadSucceeded;
|
return reloadSucceeded;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* static */ bool
|
|
||||||
nsContentUtils::IsLocalRefURL(const nsString& aString)
|
|
||||||
{
|
|
||||||
// Find the first non-"C0 controls + space" character.
|
|
||||||
const char16_t* current = aString.get();
|
|
||||||
for (; *current != '\0'; current++) {
|
|
||||||
if (*current > 0x20) {
|
|
||||||
// if the first non-"C0 controls + space" character is '#', this is a
|
|
||||||
// local-ref URL.
|
|
||||||
return *current == '#';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
@ -2730,13 +2730,6 @@ public:
|
||||||
|
|
||||||
static bool AttemptLargeAllocationLoad(nsIHttpChannel* aChannel);
|
static bool AttemptLargeAllocationLoad(nsIHttpChannel* aChannel);
|
||||||
|
|
||||||
/**
|
|
||||||
* Detect whether a string is a (CSS) local-url.
|
|
||||||
* https://drafts.csswg.org/css-values/#local-urls
|
|
||||||
*/
|
|
||||||
static bool
|
|
||||||
IsLocalRefURL(const nsString& aString);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static bool InitializeEventTable();
|
static bool InitializeEventTable();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,22 @@
|
||||||
|
|
||||||
using namespace mozilla;
|
using namespace mozilla;
|
||||||
|
|
||||||
|
static bool
|
||||||
|
IsLocalRefURL(nsStringBuffer* aString)
|
||||||
|
{
|
||||||
|
// Find the first non-"C0 controls + space" character.
|
||||||
|
char16_t* current = static_cast<char16_t*>(aString->Data());
|
||||||
|
for (; *current != '\0'; current++) {
|
||||||
|
if (*current > 0x20) {
|
||||||
|
// if the first non-"C0 controls + space" character is '#', this is a
|
||||||
|
// local-ref URL.
|
||||||
|
return *current == '#';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
nsCSSValue::nsCSSValue(int32_t aValue, nsCSSUnit aUnit)
|
nsCSSValue::nsCSSValue(int32_t aValue, nsCSSUnit aUnit)
|
||||||
: mUnit(aUnit)
|
: mUnit(aUnit)
|
||||||
{
|
{
|
||||||
|
|
@ -2707,7 +2723,7 @@ css::URLValueData::URLValueData(already_AddRefed<PtrHolder<nsIURI>> aURI,
|
||||||
, mReferrer(Move(aReferrer))
|
, mReferrer(Move(aReferrer))
|
||||||
, mOriginPrincipal(Move(aOriginPrincipal))
|
, mOriginPrincipal(Move(aOriginPrincipal))
|
||||||
, mURIResolved(true)
|
, mURIResolved(true)
|
||||||
, mIsLocalRef(nsContentUtils::IsLocalRefURL(aString))
|
, mIsLocalRef(IsLocalRefURL(aString))
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(mString);
|
MOZ_ASSERT(mString);
|
||||||
MOZ_ASSERT(mBaseURI);
|
MOZ_ASSERT(mBaseURI);
|
||||||
|
|
@ -2724,7 +2740,7 @@ css::URLValueData::URLValueData(nsStringBuffer* aString,
|
||||||
, mReferrer(Move(aReferrer))
|
, mReferrer(Move(aReferrer))
|
||||||
, mOriginPrincipal(Move(aOriginPrincipal))
|
, mOriginPrincipal(Move(aOriginPrincipal))
|
||||||
, mURIResolved(false)
|
, mURIResolved(false)
|
||||||
, mIsLocalRef(nsContentUtils::IsLocalRefURL(aString))
|
, mIsLocalRef(IsLocalRefURL(aString))
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(aString);
|
MOZ_ASSERT(aString);
|
||||||
MOZ_ASSERT(mBaseURI);
|
MOZ_ASSERT(mBaseURI);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue