Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (282241 => 282242)
--- trunk/Source/_javascript_Core/ChangeLog 2021-09-09 22:24:42 UTC (rev 282241)
+++ trunk/Source/_javascript_Core/ChangeLog 2021-09-09 23:39:40 UTC (rev 282242)
@@ -1,3 +1,16 @@
+2021-09-09 Darin Adler <[email protected]>
+
+ Improve performance by using StringView, not "const StringView&"
+ https://bugs.webkit.org/show_bug.cgi?id=229834
+
+ Reviewed by Anders Carlsson.
+
+ * parser/Lexer.h:
+ * runtime/IntlDateTimeFormat.cpp:
+ (JSC::IntlDateTimeFormat::setFormatsFromPattern):
+ * runtime/IntlDateTimeFormat.h:
+ Use StringView, not const StringView&.
+
2021-09-09 Yusuke Suzuki <[email protected]>
[JSC] Optimize op_get_property_enumerator further
Modified: trunk/Source/_javascript_Core/parser/Lexer.h (282241 => 282242)
--- trunk/Source/_javascript_Core/parser/Lexer.h 2021-09-09 22:24:42 UTC (rev 282241)
+++ trunk/Source/_javascript_Core/parser/Lexer.h 2021-09-09 23:39:40 UTC (rev 282242)
@@ -150,7 +150,7 @@
String invalidCharacterMessage() const;
ALWAYS_INLINE const T* currentSourcePtr() const;
- ALWAYS_INLINE void setCodeStart(const StringView&);
+ ALWAYS_INLINE void setCodeStart(StringView);
ALWAYS_INLINE const Identifier* makeIdentifier(const LChar* characters, size_t length);
ALWAYS_INLINE const Identifier* makeIdentifier(const UChar* characters, size_t length);
@@ -304,7 +304,7 @@
}
template <>
-ALWAYS_INLINE void Lexer<LChar>::setCodeStart(const StringView& sourceString)
+ALWAYS_INLINE void Lexer<LChar>::setCodeStart(StringView sourceString)
{
ASSERT(sourceString.is8Bit());
m_codeStart = sourceString.characters8();
@@ -311,7 +311,7 @@
}
template <>
-ALWAYS_INLINE void Lexer<UChar>::setCodeStart(const StringView& sourceString)
+ALWAYS_INLINE void Lexer<UChar>::setCodeStart(StringView sourceString)
{
ASSERT(!sourceString.is8Bit());
m_codeStart = sourceString.characters16();
Modified: trunk/Source/_javascript_Core/runtime/IntlDateTimeFormat.cpp (282241 => 282242)
--- trunk/Source/_javascript_Core/runtime/IntlDateTimeFormat.cpp 2021-09-09 22:24:42 UTC (rev 282241)
+++ trunk/Source/_javascript_Core/runtime/IntlDateTimeFormat.cpp 2021-09-09 23:39:40 UTC (rev 282242)
@@ -327,7 +327,7 @@
return length - 1;
}
-void IntlDateTimeFormat::setFormatsFromPattern(const StringView& pattern)
+void IntlDateTimeFormat::setFormatsFromPattern(StringView pattern)
{
// Get all symbols from the pattern, and set format fields accordingly.
// http://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
Modified: trunk/Source/_javascript_Core/runtime/IntlDateTimeFormat.h (282241 => 282242)
--- trunk/Source/_javascript_Core/runtime/IntlDateTimeFormat.h 2021-09-09 22:24:42 UTC (rev 282241)
+++ trunk/Source/_javascript_Core/runtime/IntlDateTimeFormat.h 2021-09-09 23:39:40 UTC (rev 282242)
@@ -107,7 +107,7 @@
enum class TimeZoneName : uint8_t { None, Short, Long, ShortOffset, LongOffset, ShortGeneric, LongGeneric };
enum class DateTimeStyle : uint8_t { None, Full, Long, Medium, Short };
- void setFormatsFromPattern(const StringView&);
+ void setFormatsFromPattern(StringView);
static ASCIILiteral hourCycleString(HourCycle);
static ASCIILiteral weekdayString(Weekday);
static ASCIILiteral eraString(Era);
Modified: trunk/Source/WTF/ChangeLog (282241 => 282242)
--- trunk/Source/WTF/ChangeLog 2021-09-09 22:24:42 UTC (rev 282241)
+++ trunk/Source/WTF/ChangeLog 2021-09-09 23:39:40 UTC (rev 282242)
@@ -1,3 +1,32 @@
+2021-09-09 Darin Adler <[email protected]>
+
+ Improve performance by using StringView, not "const StringView&"
+ https://bugs.webkit.org/show_bug.cgi?id=229834
+
+ Reviewed by Anders Carlsson.
+
+ Since StringView is a small structure that fits into two registers, it's not
+ good to pass a pointer to it; better performance to pass it by value. Note
+ that this is for release builds, not debug builds where StringView has
+ significant additional overhead when copying.
+
+ * wtf/PrintStream.cpp:
+ (WTF::printInternal):
+ * wtf/PrintStream.h:
+ * wtf/text/StringConcatenate.h:
+ * wtf/text/StringView.cpp:
+ (WTF::StringView::containsIgnoringASCIICase const):
+ (WTF::StringView::findIgnoringASCIICase const):
+ (WTF::StringView::startsWith const):
+ (WTF::StringView::startsWithIgnoringASCIICase const):
+ (WTF::StringView::endsWith const):
+ (WTF::StringView::endsWithIgnoringASCIICase const):
+ (WTF::StringView::GraphemeClusters::Iterator::Impl::Impl):
+ (WTF::StringView::GraphemeClusters::Iterator::Iterator):
+ * wtf/text/StringView.h:
+ * wtf/text/WTFString.h:
+ Use StringView, not const StringView&.
+
2021-09-09 Alex Christensen <[email protected]>
Add PrivateClickMeasurement daemon
Modified: trunk/Source/WTF/wtf/PrintStream.cpp (282241 => 282242)
--- trunk/Source/WTF/wtf/PrintStream.cpp 2021-09-09 22:24:42 UTC (rev 282241)
+++ trunk/Source/WTF/wtf/PrintStream.cpp 2021-09-09 23:39:40 UTC (rev 282242)
@@ -89,7 +89,7 @@
printInternal(out, expectedCString.value());
}
-void printInternal(PrintStream& out, const StringView& string)
+void printInternal(PrintStream& out, StringView string)
{
printExpectedCStringHelper(out, "StringView", string.tryGetUtf8());
}
Modified: trunk/Source/WTF/wtf/PrintStream.h (282241 => 282242)
--- trunk/Source/WTF/wtf/PrintStream.h 2021-09-09 22:24:42 UTC (rev 282241)
+++ trunk/Source/WTF/wtf/PrintStream.h 2021-09-09 23:39:40 UTC (rev 282242)
@@ -94,7 +94,7 @@
};
WTF_EXPORT_PRIVATE void printInternal(PrintStream&, const char*);
-WTF_EXPORT_PRIVATE void printInternal(PrintStream&, const StringView&);
+WTF_EXPORT_PRIVATE void printInternal(PrintStream&, StringView);
WTF_EXPORT_PRIVATE void printInternal(PrintStream&, const CString&);
WTF_EXPORT_PRIVATE void printInternal(PrintStream&, const String&);
WTF_EXPORT_PRIVATE void printInternal(PrintStream&, const StringImpl*);
Modified: trunk/Source/WTF/wtf/text/StringConcatenate.h (282241 => 282242)
--- trunk/Source/WTF/wtf/text/StringConcatenate.h 2021-09-09 22:24:42 UTC (rev 282241)
+++ trunk/Source/WTF/wtf/text/StringConcatenate.h 2021-09-09 23:39:40 UTC (rev 282242)
@@ -377,12 +377,12 @@
StringView string;
};
-inline ASCIICaseConverter lowercase(const StringView& stringView)
+inline ASCIICaseConverter lowercase(StringView stringView)
{
return { StringView::CaseConvertType::Lower, stringView };
}
-inline ASCIICaseConverter uppercase(const StringView& stringView)
+inline ASCIICaseConverter uppercase(StringView stringView)
{
return { StringView::CaseConvertType::Upper, stringView };
}
Modified: trunk/Source/WTF/wtf/text/StringView.cpp (282241 => 282242)
--- trunk/Source/WTF/wtf/text/StringView.cpp 2021-09-09 22:24:42 UTC (rev 282241)
+++ trunk/Source/WTF/wtf/text/StringView.cpp 2021-09-09 23:39:40 UTC (rev 282242)
@@ -38,22 +38,22 @@
namespace WTF {
-bool StringView::containsIgnoringASCIICase(const StringView& matchString) const
+bool StringView::containsIgnoringASCIICase(StringView matchString) const
{
return findIgnoringASCIICase(matchString) != notFound;
}
-bool StringView::containsIgnoringASCIICase(const StringView& matchString, unsigned startOffset) const
+bool StringView::containsIgnoringASCIICase(StringView matchString, unsigned startOffset) const
{
return findIgnoringASCIICase(matchString, startOffset) != notFound;
}
-size_t StringView::findIgnoringASCIICase(const StringView& matchString) const
+size_t StringView::findIgnoringASCIICase(StringView matchString) const
{
return ::WTF::findIgnoringASCIICase(*this, matchString, 0);
}
-size_t StringView::findIgnoringASCIICase(const StringView& matchString, unsigned startOffset) const
+size_t StringView::findIgnoringASCIICase(StringView matchString, unsigned startOffset) const
{
return ::WTF::findIgnoringASCIICase(*this, matchString, startOffset);
}
@@ -63,12 +63,12 @@
return m_length && (*this)[0] == character;
}
-bool StringView::startsWith(const StringView& prefix) const
+bool StringView::startsWith(StringView prefix) const
{
return ::WTF::startsWith(*this, prefix);
}
-bool StringView::startsWithIgnoringASCIICase(const StringView& prefix) const
+bool StringView::startsWithIgnoringASCIICase(StringView prefix) const
{
return ::WTF::startsWithIgnoringASCIICase(*this, prefix);
}
@@ -78,12 +78,12 @@
return m_length && (*this)[m_length - 1] == character;
}
-bool StringView::endsWith(const StringView& suffix) const
+bool StringView::endsWith(StringView suffix) const
{
return ::WTF::endsWith(*this, suffix);
}
-bool StringView::endsWithIgnoringASCIICase(const StringView& suffix) const
+bool StringView::endsWithIgnoringASCIICase(StringView suffix) const
{
return ::WTF::endsWithIgnoringASCIICase(*this, suffix);
}
@@ -124,7 +124,8 @@
auto StringView::SplitResult::Iterator::operator++() -> Iterator&
{
- ASSERT(m_position <= m_result.m_string.length() && !m_isDone);
+ ASSERT(m_position <= m_result.m_string.length());
+ ASSERT(!m_isDone);
m_position += m_length;
if (m_position < m_result.m_string.length()) {
++m_position;
@@ -137,7 +138,7 @@
class StringView::GraphemeClusters::Iterator::Impl {
WTF_MAKE_FAST_ALLOCATED;
public:
- Impl(const StringView& stringView, std::optional<NonSharedCharacterBreakIterator>&& iterator, unsigned index)
+ Impl(StringView stringView, std::optional<NonSharedCharacterBreakIterator>&& iterator, unsigned index)
: m_stringView(stringView)
, m_iterator(WTFMove(iterator))
, m_index(index)
@@ -161,7 +162,8 @@
bool operator==(const Impl& other) const
{
- ASSERT(&m_stringView == &other.m_stringView);
+ ASSERT(m_stringView.m_characters == other.m_stringView.m_characters);
+ ASSERT(m_stringView.m_length == other.m_stringView.m_length);
auto result = m_index == other.m_index;
ASSERT(!result || m_indexEnd == other.m_indexEnd);
return result;
@@ -177,13 +179,13 @@
}
private:
- const StringView& m_stringView;
+ StringView m_stringView;
std::optional<NonSharedCharacterBreakIterator> m_iterator;
unsigned m_index;
unsigned m_indexEnd;
};
-StringView::GraphemeClusters::Iterator::Iterator(const StringView& stringView, unsigned index)
+StringView::GraphemeClusters::Iterator::Iterator(StringView stringView, unsigned index)
: m_impl(makeUnique<Impl>(stringView, stringView.isNull() ? std::nullopt : std::optional<NonSharedCharacterBreakIterator>(NonSharedCharacterBreakIterator(stringView)), index))
{
}
Modified: trunk/Source/WTF/wtf/text/StringView.h (282241 => 282242)
--- trunk/Source/WTF/wtf/text/StringView.h 2021-09-09 22:24:42 UTC (rev 282241)
+++ trunk/Source/WTF/wtf/text/StringView.h 2021-09-09 23:39:40 UTC (rev 282242)
@@ -143,8 +143,8 @@
size_t reverseFind(UChar, unsigned index = std::numeric_limits<unsigned>::max()) const;
- WTF_EXPORT_PRIVATE size_t findIgnoringASCIICase(const StringView&) const;
- WTF_EXPORT_PRIVATE size_t findIgnoringASCIICase(const StringView&, unsigned startOffset) const;
+ WTF_EXPORT_PRIVATE size_t findIgnoringASCIICase(StringView) const;
+ WTF_EXPORT_PRIVATE size_t findIgnoringASCIICase(StringView, unsigned startOffset) const;
WTF_EXPORT_PRIVATE String convertToASCIILowercase() const;
WTF_EXPORT_PRIVATE String convertToASCIIUppercase() const;
@@ -155,18 +155,18 @@
bool contains(StringView string) const { return find(string, 0) != notFound; }
WTF_EXPORT_PRIVATE bool contains(const char*) const;
- WTF_EXPORT_PRIVATE bool containsIgnoringASCIICase(const StringView&) const;
- WTF_EXPORT_PRIVATE bool containsIgnoringASCIICase(const StringView&, unsigned startOffset) const;
+ WTF_EXPORT_PRIVATE bool containsIgnoringASCIICase(StringView) const;
+ WTF_EXPORT_PRIVATE bool containsIgnoringASCIICase(StringView, unsigned startOffset) const;
template<bool isSpecialCharacter(UChar)> bool isAllSpecialCharacters() const;
WTF_EXPORT_PRIVATE bool startsWith(UChar) const;
- WTF_EXPORT_PRIVATE bool startsWith(const StringView&) const;
- WTF_EXPORT_PRIVATE bool startsWithIgnoringASCIICase(const StringView&) const;
+ WTF_EXPORT_PRIVATE bool startsWith(StringView) const;
+ WTF_EXPORT_PRIVATE bool startsWithIgnoringASCIICase(StringView) const;
WTF_EXPORT_PRIVATE bool endsWith(UChar) const;
- WTF_EXPORT_PRIVATE bool endsWith(const StringView&) const;
- WTF_EXPORT_PRIVATE bool endsWithIgnoringASCIICase(const StringView&) const;
+ WTF_EXPORT_PRIVATE bool endsWith(StringView) const;
+ WTF_EXPORT_PRIVATE bool endsWithIgnoringASCIICase(StringView) const;
float toFloat(bool& isValid) const;
@@ -434,7 +434,7 @@
class StringView::UpconvertedCharacters {
WTF_MAKE_FAST_ALLOCATED;
public:
- explicit UpconvertedCharacters(const StringView&);
+ explicit UpconvertedCharacters(StringView);
operator const UChar*() const { return m_characters; }
const UChar* get() const { return m_characters; }
private:
@@ -539,7 +539,7 @@
StringImpl::copyCharacters(destination, characters16(), m_length);
}
-inline StringView::UpconvertedCharacters::UpconvertedCharacters(const StringView& string)
+inline StringView::UpconvertedCharacters::UpconvertedCharacters(StringView string)
{
if (!string.is8Bit()) {
m_characters = string.characters16();
@@ -693,7 +693,7 @@
class StringView::GraphemeClusters {
WTF_MAKE_FAST_ALLOCATED;
public:
- explicit GraphemeClusters(const StringView&);
+ explicit GraphemeClusters(StringView);
class Iterator;
Iterator begin() const;
@@ -706,7 +706,7 @@
class StringView::CodePoints {
WTF_MAKE_FAST_ALLOCATED;
public:
- explicit CodePoints(const StringView&);
+ explicit CodePoints(StringView);
class Iterator;
Iterator begin() const;
@@ -719,7 +719,7 @@
class StringView::CodeUnits {
WTF_MAKE_FAST_ALLOCATED;
public:
- explicit CodeUnits(const StringView&);
+ explicit CodeUnits(StringView);
class Iterator;
Iterator begin() const;
@@ -764,7 +764,7 @@
WTF_MAKE_FAST_ALLOCATED;
public:
Iterator() = delete;
- WTF_EXPORT_PRIVATE Iterator(const StringView&, unsigned index);
+ WTF_EXPORT_PRIVATE Iterator(StringView, unsigned index);
WTF_EXPORT_PRIVATE ~Iterator();
Iterator(const Iterator&) = delete;
@@ -787,7 +787,7 @@
class StringView::CodePoints::Iterator {
WTF_MAKE_FAST_ALLOCATED;
public:
- Iterator(const StringView&, unsigned index);
+ Iterator(StringView, unsigned index);
UChar32 operator*() const;
Iterator& operator++();
@@ -807,7 +807,7 @@
class StringView::CodeUnits::Iterator {
WTF_MAKE_FAST_ALLOCATED;
public:
- Iterator(const StringView&, unsigned index);
+ Iterator(StringView, unsigned index);
UChar operator*() const;
Iterator& operator++();
@@ -816,7 +816,7 @@
bool operator!=(const Iterator&) const;
private:
- const StringView& m_stringView;
+ StringView m_stringView;
unsigned m_index;
};
@@ -835,7 +835,7 @@
return CodeUnits(*this);
}
-inline StringView::GraphemeClusters::GraphemeClusters(const StringView& stringView)
+inline StringView::GraphemeClusters::GraphemeClusters(StringView stringView)
: m_stringView(stringView)
{
}
@@ -850,12 +850,12 @@
return Iterator(m_stringView, m_stringView.length());
}
-inline StringView::CodePoints::CodePoints(const StringView& stringView)
+inline StringView::CodePoints::CodePoints(StringView stringView)
: m_stringView(stringView)
{
}
-inline StringView::CodePoints::Iterator::Iterator(const StringView& stringView, unsigned index)
+inline StringView::CodePoints::Iterator::Iterator(StringView stringView, unsigned index)
: m_is8Bit(stringView.is8Bit())
#if CHECK_STRINGVIEW_LIFETIME
, m_stringView(stringView)
@@ -928,12 +928,12 @@
return Iterator(m_stringView, m_stringView.length());
}
-inline StringView::CodeUnits::CodeUnits(const StringView& stringView)
+inline StringView::CodeUnits::CodeUnits(StringView stringView)
: m_stringView(stringView)
{
}
-inline StringView::CodeUnits::Iterator::Iterator(const StringView& stringView, unsigned index)
+inline StringView::CodeUnits::Iterator::Iterator(StringView stringView, unsigned index)
: m_stringView(stringView)
, m_index(index)
{
@@ -952,7 +952,8 @@
inline bool StringView::CodeUnits::Iterator::operator==(const Iterator& other) const
{
- ASSERT(&m_stringView == &other.m_stringView);
+ ASSERT(m_stringView.m_characters == other.m_stringView.m_characters);
+ ASSERT(m_stringView.m_length == other.m_stringView.m_length);
return m_index == other.m_index;
}
@@ -1014,7 +1015,8 @@
inline StringView StringView::SplitResult::Iterator::operator*() const
{
- ASSERT(m_position <= m_result.m_string.length() && !m_isDone);
+ ASSERT(m_position <= m_result.m_string.length());
+ ASSERT(!m_isDone);
return m_result.m_string.substring(m_position, m_length);
}
Modified: trunk/Source/WTF/wtf/text/WTFString.h (282241 => 282242)
--- trunk/Source/WTF/wtf/text/WTFString.h 2021-09-09 22:24:42 UTC (rev 282241)
+++ trunk/Source/WTF/wtf/text/WTFString.h 2021-09-09 23:39:40 UTC (rev 282242)
@@ -246,7 +246,7 @@
static String createUninitialized(unsigned length, UChar*& data) { return StringImpl::createUninitialized(length, data); }
static String createUninitialized(unsigned length, LChar*& data) { return StringImpl::createUninitialized(length, data); }
- using SplitFunctor = WTF::Function<void(const StringView&)>;
+ using SplitFunctor = WTF::Function<void(StringView)>;
WTF_EXPORT_PRIVATE void split(UChar separator, const SplitFunctor&) const;
WTF_EXPORT_PRIVATE Vector<String> split(UChar separator) const;
Modified: trunk/Source/WebCore/ChangeLog (282241 => 282242)
--- trunk/Source/WebCore/ChangeLog 2021-09-09 22:24:42 UTC (rev 282241)
+++ trunk/Source/WebCore/ChangeLog 2021-09-09 23:39:40 UTC (rev 282242)
@@ -1,3 +1,59 @@
+2021-09-09 Darin Adler <[email protected]>
+
+ Improve performance by using StringView, not "const StringView&"
+ https://bugs.webkit.org/show_bug.cgi?id=229834
+
+ Reviewed by Anders Carlsson.
+
+ * html/BaseDateAndTimeInputType.h:
+ * html/DateInputType.cpp:
+ (WebCore::DateInputType::parseToDateComponents const):
+ * html/DateInputType.h:
+ * html/DateTimeLocalInputType.cpp:
+ (WebCore::DateTimeLocalInputType::parseToDateComponents const):
+ * html/DateTimeLocalInputType.h:
+ * html/MonthInputType.cpp:
+ (WebCore::MonthInputType::parseToDateComponents const):
+ * html/MonthInputType.h:
+ * html/TimeInputType.cpp:
+ (WebCore::TimeInputType::parseToDateComponents const):
+ * html/TimeInputType.h:
+ * html/WeekInputType.cpp:
+ (WebCore::WeekInputType::parseToDateComponents const):
+ * html/WeekInputType.h:
+ * html/parser/HTMLParserIdioms.cpp:
+ (WebCore::parseMetaHTTPEquivRefresh):
+ * html/parser/HTMLParserIdioms.h:
+ * html/parser/HTMLSrcsetParser.h:
+ * layout/formattingContexts/inline/InlineTextItem.cpp:
+ (WebCore::Layout::moveToNextNonWhitespacePosition):
+ * layout/layouttree/LayoutTreeBuilder.cpp:
+ (WebCore::Layout::canUseSimplifiedTextMeasuring):
+ * mathml/MathMLPresentationElement.cpp:
+ (WebCore::MathMLPresentationElement::parseNumberAndUnit):
+ (WebCore::MathMLPresentationElement::parseNamedSpace):
+ * mathml/MathMLPresentationElement.h:
+ * page/Quirks.cpp:
+ (WebCore::shouldSuppressAutocorrectionAndAutocaptializationInHiddenEditableAreasForHost):
+ * platform/graphics/FontCascade.cpp:
+ (WebCore::FontCascade::expansionOpportunityCount):
+ (WebCore::FontCascade::leftExpansionOpportunity):
+ (WebCore::FontCascade::rightExpansionOpportunity):
+ * platform/graphics/FontCascade.h:
+ * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+ (WebCore::conformFragmentIdentifierForURL):
+ * rendering/LegacyLineLayout.cpp:
+ (WebCore::LegacyLineLayout::computeInlineDirectionPositionsForSegment):
+ * svg/SVGParserUtilities.cpp:
+ (WebCore::parseNumber):
+ (WebCore::parseNumberOptionalNumber):
+ (WebCore::parsePoint):
+ (WebCore::parseRect):
+ (WebCore::parseGlyphName):
+ (WebCore::parseKerningUnicodeString):
+ * svg/SVGParserUtilities.h:
+ Use StringView, not const StringView&.
+
2021-09-09 Chris Dumez <[email protected]>
Potential crash under CachedRawResource::didAddClient()
Modified: trunk/Source/WebCore/html/BaseDateAndTimeInputType.h (282241 => 282242)
--- trunk/Source/WebCore/html/BaseDateAndTimeInputType.h 2021-09-09 22:24:42 UTC (rev 282241)
+++ trunk/Source/WebCore/html/BaseDateAndTimeInputType.h 2021-09-09 23:39:40 UTC (rev 282242)
@@ -92,7 +92,7 @@
OptionSet<DateTimeFormatValidationResults> m_results;
};
- virtual std::optional<DateComponents> parseToDateComponents(const StringView&) const = 0;
+ virtual std::optional<DateComponents> parseToDateComponents(StringView) const = 0;
virtual std::optional<DateComponents> setMillisecondToDateComponents(double) const = 0;
virtual void setupLayoutParameters(DateTimeEditElement::LayoutParameters&, const DateComponents&) const = 0;
virtual bool isValidFormat(OptionSet<DateTimeFormatValidationResults>) const = 0;
Modified: trunk/Source/WebCore/html/DateInputType.cpp (282241 => 282242)
--- trunk/Source/WebCore/html/DateInputType.cpp 2021-09-09 22:24:42 UTC (rev 282241)
+++ trunk/Source/WebCore/html/DateInputType.cpp 2021-09-09 23:39:40 UTC (rev 282242)
@@ -74,7 +74,7 @@
return StepRange(stepBase, RangeLimitations::Valid, minimum, maximum, step, dateStepDescription);
}
-std::optional<DateComponents> DateInputType::parseToDateComponents(const StringView& source) const
+std::optional<DateComponents> DateInputType::parseToDateComponents(StringView source) const
{
return DateComponents::fromParsingDate(source);
}
Modified: trunk/Source/WebCore/html/DateInputType.h (282241 => 282242)
--- trunk/Source/WebCore/html/DateInputType.h 2021-09-09 22:24:42 UTC (rev 282241)
+++ trunk/Source/WebCore/html/DateInputType.h 2021-09-09 23:39:40 UTC (rev 282242)
@@ -45,7 +45,7 @@
const AtomString& formControlType() const override;
DateComponentsType dateType() const override;
StepRange createStepRange(AnyStepHandling) const override;
- std::optional<DateComponents> parseToDateComponents(const StringView&) const override;
+ std::optional<DateComponents> parseToDateComponents(StringView) const override;
std::optional<DateComponents> setMillisecondToDateComponents(double) const override;
bool isValidFormat(OptionSet<DateTimeFormatValidationResults>) const final;
Modified: trunk/Source/WebCore/html/DateTimeLocalInputType.cpp (282241 => 282242)
--- trunk/Source/WebCore/html/DateTimeLocalInputType.cpp 2021-09-09 22:24:42 UTC (rev 282241)
+++ trunk/Source/WebCore/html/DateTimeLocalInputType.cpp 2021-09-09 23:39:40 UTC (rev 282242)
@@ -83,7 +83,7 @@
return StepRange(stepBase, RangeLimitations::Valid, minimum, maximum, step, dateTimeLocalStepDescription);
}
-std::optional<DateComponents> DateTimeLocalInputType::parseToDateComponents(const StringView& source) const
+std::optional<DateComponents> DateTimeLocalInputType::parseToDateComponents(StringView source) const
{
return DateComponents::fromParsingDateTimeLocal(source);
}
Modified: trunk/Source/WebCore/html/DateTimeLocalInputType.h (282241 => 282242)
--- trunk/Source/WebCore/html/DateTimeLocalInputType.h 2021-09-09 22:24:42 UTC (rev 282241)
+++ trunk/Source/WebCore/html/DateTimeLocalInputType.h 2021-09-09 23:39:40 UTC (rev 282242)
@@ -50,7 +50,7 @@
double valueAsDate() const final;
ExceptionOr<void> setValueAsDate(double) const final;
StepRange createStepRange(AnyStepHandling) const final;
- std::optional<DateComponents> parseToDateComponents(const StringView&) const final;
+ std::optional<DateComponents> parseToDateComponents(StringView) const final;
std::optional<DateComponents> setMillisecondToDateComponents(double) const final;
bool isValidFormat(OptionSet<DateTimeFormatValidationResults>) const final;
Modified: trunk/Source/WebCore/html/MonthInputType.cpp (282241 => 282242)
--- trunk/Source/WebCore/html/MonthInputType.cpp 2021-09-09 22:24:42 UTC (rev 282241)
+++ trunk/Source/WebCore/html/MonthInputType.cpp 2021-09-09 23:39:40 UTC (rev 282242)
@@ -117,7 +117,7 @@
return Decimal::fromDouble(months);
}
-std::optional<DateComponents> MonthInputType::parseToDateComponents(const StringView& source) const
+std::optional<DateComponents> MonthInputType::parseToDateComponents(StringView source) const
{
return DateComponents::fromParsingMonth(source);
}
Modified: trunk/Source/WebCore/html/MonthInputType.h (282241 => 282242)
--- trunk/Source/WebCore/html/MonthInputType.h 2021-09-09 22:24:42 UTC (rev 282241)
+++ trunk/Source/WebCore/html/MonthInputType.h 2021-09-09 23:39:40 UTC (rev 282242)
@@ -52,7 +52,7 @@
Decimal parseToNumber(const String&, const Decimal&) const override;
Decimal defaultValueForStepUp() const override;
StepRange createStepRange(AnyStepHandling) const override;
- std::optional<DateComponents> parseToDateComponents(const StringView&) const override;
+ std::optional<DateComponents> parseToDateComponents(StringView) const override;
std::optional<DateComponents> setMillisecondToDateComponents(double) const override;
void handleDOMActivateEvent(Event&) override;
Modified: trunk/Source/WebCore/html/TimeInputType.cpp (282241 => 282242)
--- trunk/Source/WebCore/html/TimeInputType.cpp 2021-09-09 22:24:42 UTC (rev 282241)
+++ trunk/Source/WebCore/html/TimeInputType.cpp 2021-09-09 23:39:40 UTC (rev 282242)
@@ -92,7 +92,7 @@
return StepRange(stepBase, RangeLimitations::Valid, minimum, maximum, step, timeStepDescription);
}
-std::optional<DateComponents> TimeInputType::parseToDateComponents(const StringView& source) const
+std::optional<DateComponents> TimeInputType::parseToDateComponents(StringView source) const
{
return DateComponents::fromParsingTime(source);
}
Modified: trunk/Source/WebCore/html/TimeInputType.h (282241 => 282242)
--- trunk/Source/WebCore/html/TimeInputType.h 2021-09-09 22:24:42 UTC (rev 282241)
+++ trunk/Source/WebCore/html/TimeInputType.h 2021-09-09 23:39:40 UTC (rev 282242)
@@ -46,7 +46,7 @@
DateComponentsType dateType() const override;
Decimal defaultValueForStepUp() const override;
StepRange createStepRange(AnyStepHandling) const override;
- std::optional<DateComponents> parseToDateComponents(const StringView&) const override;
+ std::optional<DateComponents> parseToDateComponents(StringView) const override;
std::optional<DateComponents> setMillisecondToDateComponents(double) const override;
void handleDOMActivateEvent(Event&) override;
Modified: trunk/Source/WebCore/html/WeekInputType.cpp (282241 => 282242)
--- trunk/Source/WebCore/html/WeekInputType.cpp 2021-09-09 22:24:42 UTC (rev 282241)
+++ trunk/Source/WebCore/html/WeekInputType.cpp 2021-09-09 23:39:40 UTC (rev 282242)
@@ -68,7 +68,7 @@
return StepRange(stepBase, RangeLimitations::Valid, minimum, maximum, step, weekStepDescription);
}
-std::optional<DateComponents> WeekInputType::parseToDateComponents(const StringView& source) const
+std::optional<DateComponents> WeekInputType::parseToDateComponents(StringView source) const
{
return DateComponents::fromParsingWeek(source);
}
Modified: trunk/Source/WebCore/html/WeekInputType.h (282241 => 282242)
--- trunk/Source/WebCore/html/WeekInputType.h 2021-09-09 22:24:42 UTC (rev 282241)
+++ trunk/Source/WebCore/html/WeekInputType.h 2021-09-09 23:39:40 UTC (rev 282242)
@@ -48,7 +48,7 @@
const AtomString& formControlType() const override;
DateComponentsType dateType() const override;
StepRange createStepRange(AnyStepHandling) const override;
- std::optional<DateComponents> parseToDateComponents(const StringView&) const override;
+ std::optional<DateComponents> parseToDateComponents(StringView) const override;
std::optional<DateComponents> setMillisecondToDateComponents(double) const override;
void handleDOMActivateEvent(Event&) override;
Modified: trunk/Source/WebCore/html/parser/HTMLParserIdioms.cpp (282241 => 282242)
--- trunk/Source/WebCore/html/parser/HTMLParserIdioms.cpp 2021-09-09 22:24:42 UTC (rev 282241)
+++ trunk/Source/WebCore/html/parser/HTMLParserIdioms.cpp 2021-09-09 23:39:40 UTC (rev 282242)
@@ -456,7 +456,7 @@
return true;
}
-bool parseMetaHTTPEquivRefresh(const StringView& input, double& delay, String& url)
+bool parseMetaHTTPEquivRefresh(StringView input, double& delay, String& url)
{
if (LIKELY(input.is8Bit())) {
auto* start = input.characters8();
Modified: trunk/Source/WebCore/html/parser/HTMLParserIdioms.h (282241 => 282242)
--- trunk/Source/WebCore/html/parser/HTMLParserIdioms.h 2021-09-09 22:24:42 UTC (rev 282241)
+++ trunk/Source/WebCore/html/parser/HTMLParserIdioms.h 2021-09-09 23:39:40 UTC (rev 282242)
@@ -77,7 +77,7 @@
Vector<double> parseHTMLListOfOfFloatingPointNumberValues(StringView);
// https://html.spec.whatwg.org/multipage/semantics.html#attr-meta-http-equiv-refresh
-bool parseMetaHTTPEquivRefresh(const StringView&, double& delay, String& url);
+bool parseMetaHTTPEquivRefresh(StringView, double& delay, String& url);
// https://html.spec.whatwg.org/multipage/infrastructure.html#cors-settings-attribute
String parseCORSSettingsAttribute(const AtomString&);
Modified: trunk/Source/WebCore/html/parser/HTMLSrcsetParser.h (282241 => 282242)
--- trunk/Source/WebCore/html/parser/HTMLSrcsetParser.h 2021-09-09 22:24:42 UTC (rev 282241)
+++ trunk/Source/WebCore/html/parser/HTMLSrcsetParser.h 2021-09-09 23:39:40 UTC (rev 282242)
@@ -78,7 +78,7 @@
{
}
- ImageCandidate(const StringView& source, const DescriptorParsingResult& result, OriginAttribute originAttribute)
+ ImageCandidate(StringView source, const DescriptorParsingResult& result, OriginAttribute originAttribute)
: string(source)
, density(result.hasDensity() ? result.density() : UninitializedDescriptor)
, resourceWidth(result.hasWidth() ? result.resourceWidth() : UninitializedDescriptor)
Modified: trunk/Source/WebCore/layout/formattingContexts/inline/InlineTextItem.cpp (282241 => 282242)
--- trunk/Source/WebCore/layout/formattingContexts/inline/InlineTextItem.cpp 2021-09-09 22:24:42 UTC (rev 282241)
+++ trunk/Source/WebCore/layout/formattingContexts/inline/InlineTextItem.cpp 2021-09-09 23:39:40 UTC (rev 282242)
@@ -42,7 +42,7 @@
size_t length { 0 };
bool isWordSeparator { true };
};
-static std::optional<WhitespaceContent> moveToNextNonWhitespacePosition(const StringView& textContent, size_t startPosition, bool preserveNewline, bool preserveTab, bool treatNonBreakingSpaceAsRegularSpace)
+static std::optional<WhitespaceContent> moveToNextNonWhitespacePosition(StringView textContent, size_t startPosition, bool preserveNewline, bool preserveTab, bool treatNonBreakingSpaceAsRegularSpace)
{
auto hasWordSeparatorCharacter = false;
auto isWhitespaceCharacter = [&](auto character) {
Modified: trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp (282241 => 282242)
--- trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp 2021-09-09 22:24:42 UTC (rev 282241)
+++ trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp 2021-09-09 23:39:40 UTC (rev 282242)
@@ -98,7 +98,7 @@
return block.relativePositionOffset();
}
-static bool canUseSimplifiedTextMeasuring(const StringView& content, const FontCascade& fontCascade, bool whitespaceIsCollapsed)
+static bool canUseSimplifiedTextMeasuring(StringView content, const FontCascade& fontCascade, bool whitespaceIsCollapsed)
{
if (fontCascade.codePath(TextRun(content)) == FontCascade::CodePath::Complex)
return false;
Modified: trunk/Source/WebCore/mathml/MathMLPresentationElement.cpp (282241 => 282242)
--- trunk/Source/WebCore/mathml/MathMLPresentationElement.cpp 2021-09-09 22:24:42 UTC (rev 282241)
+++ trunk/Source/WebCore/mathml/MathMLPresentationElement.cpp 2021-09-09 23:39:40 UTC (rev 282242)
@@ -203,7 +203,7 @@
return attribute.value();
}
-MathMLElement::Length MathMLPresentationElement::parseNumberAndUnit(const StringView& string)
+MathMLElement::Length MathMLPresentationElement::parseNumberAndUnit(StringView string)
{
LengthType lengthType = LengthType::UnitLess;
unsigned stringLength = string.length();
@@ -245,7 +245,7 @@
return length;
}
-MathMLElement::Length MathMLPresentationElement::parseNamedSpace(const StringView& string)
+MathMLElement::Length MathMLPresentationElement::parseNamedSpace(StringView string)
{
// Named space values are case-sensitive.
int namedSpaceValue;
Modified: trunk/Source/WebCore/mathml/MathMLPresentationElement.h (282241 => 282242)
--- trunk/Source/WebCore/mathml/MathMLPresentationElement.h 2021-09-09 22:24:42 UTC (rev 282241)
+++ trunk/Source/WebCore/mathml/MathMLPresentationElement.h 2021-09-09 23:39:40 UTC (rev 282242)
@@ -60,8 +60,8 @@
RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) override;
bool isPresentationMathML() const final { return true; }
- static Length parseNumberAndUnit(const StringView&);
- static Length parseNamedSpace(const StringView&);
+ static Length parseNumberAndUnit(StringView);
+ static Length parseNamedSpace(StringView);
static MathVariant parseMathVariantAttribute(const AtomString& attributeValue);
};
Modified: trunk/Source/WebCore/page/Quirks.cpp (282241 => 282242)
--- trunk/Source/WebCore/page/Quirks.cpp 2021-09-09 22:24:42 UTC (rev 282241)
+++ trunk/Source/WebCore/page/Quirks.cpp 2021-09-09 23:39:40 UTC (rev 282242)
@@ -285,7 +285,7 @@
return false;
}
-static bool shouldSuppressAutocorrectionAndAutocaptializationInHiddenEditableAreasForHost(const StringView& host)
+static bool shouldSuppressAutocorrectionAndAutocaptializationInHiddenEditableAreasForHost(StringView host)
{
#if PLATFORM(IOS_FAMILY)
return equalLettersIgnoringASCIICase(host, "docs.google.com");
Modified: trunk/Source/WebCore/platform/graphics/FontCascade.cpp (282241 => 282242)
--- trunk/Source/WebCore/platform/graphics/FontCascade.cpp 2021-09-09 22:24:42 UTC (rev 282241)
+++ trunk/Source/WebCore/platform/graphics/FontCascade.cpp 2021-09-09 23:39:40 UTC (rev 282242)
@@ -1061,7 +1061,7 @@
return std::make_pair(count, isAfterExpansion);
}
-std::pair<unsigned, bool> FontCascade::expansionOpportunityCount(const StringView& stringView, TextDirection direction, ExpansionBehavior expansionBehavior)
+std::pair<unsigned, bool> FontCascade::expansionOpportunityCount(StringView stringView, TextDirection direction, ExpansionBehavior expansionBehavior)
{
// For each character, iterating from left to right:
// If it is recognized as a space, insert an opportunity after it
@@ -1072,7 +1072,7 @@
return expansionOpportunityCountInternal(stringView.characters16(), stringView.length(), direction, expansionBehavior);
}
-bool FontCascade::leftExpansionOpportunity(const StringView& stringView, TextDirection direction)
+bool FontCascade::leftExpansionOpportunity(StringView stringView, TextDirection direction)
{
if (!stringView.length())
return false;
@@ -1091,7 +1091,7 @@
return canExpandAroundIdeographsInComplexText() && isCJKIdeographOrSymbol(initialCharacter);
}
-bool FontCascade::rightExpansionOpportunity(const StringView& stringView, TextDirection direction)
+bool FontCascade::rightExpansionOpportunity(StringView stringView, TextDirection direction)
{
if (!stringView.length())
return false;
Modified: trunk/Source/WebCore/platform/graphics/FontCascade.h (282241 => 282242)
--- trunk/Source/WebCore/platform/graphics/FontCascade.h 2021-09-09 22:24:42 UTC (rev 282241)
+++ trunk/Source/WebCore/platform/graphics/FontCascade.h 2021-09-09 23:39:40 UTC (rev 282242)
@@ -187,12 +187,12 @@
// Returns (the number of opportunities, whether the last expansion is a trailing expansion)
// If there are no opportunities, the bool will be true iff we are forbidding leading expansions.
- static std::pair<unsigned, bool> expansionOpportunityCount(const StringView&, TextDirection, ExpansionBehavior);
+ static std::pair<unsigned, bool> expansionOpportunityCount(StringView, TextDirection, ExpansionBehavior);
// Whether or not there is an expansion opportunity just before the first character
// Note that this does not take a isAfterExpansion flag; this assumes that isAfterExpansion is false
- static bool leftExpansionOpportunity(const StringView&, TextDirection);
- static bool rightExpansionOpportunity(const StringView&, TextDirection);
+ static bool leftExpansionOpportunity(StringView, TextDirection);
+ static bool rightExpansionOpportunity(StringView, TextDirection);
WEBCORE_EXPORT static void setShouldUseSmoothing(bool);
WEBCORE_EXPORT static bool shouldUseSmoothing();
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (282241 => 282242)
--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm 2021-09-09 22:24:42 UTC (rev 282241)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm 2021-09-09 23:39:40 UTC (rev 282242)
@@ -821,7 +821,7 @@
// Work around this broken implementation by pre-parsing the fragment and ensuring that it meets their
// criteria. Problematic strings from the TC0051.html test include "t=3&", and this problem generally is
// with subtrings between the '&' character not including an equal sign.
- auto hasInvalidNumberOfEqualCharacters = [](const StringView& fragmentParameter) {
+ auto hasInvalidNumberOfEqualCharacters = [](StringView fragmentParameter) {
auto results = fragmentParameter.splitAllowingEmptyEntries('=');
auto iterator = results.begin();
return iterator == results.end() || ++iterator == results.end() || ++iterator != results.end();
Modified: trunk/Source/WebCore/rendering/LegacyLineLayout.cpp (282241 => 282242)
--- trunk/Source/WebCore/rendering/LegacyLineLayout.cpp 2021-09-09 22:24:42 UTC (rev 282241)
+++ trunk/Source/WebCore/rendering/LegacyLineLayout.cpp 2021-09-09 23:39:40 UTC (rev 282242)
@@ -895,7 +895,7 @@
BidiRun* previousRun = nullptr;
for (; run; run = run->next()) {
auto computeExpansionOpportunities = [&expansionOpportunities, &expansionOpportunityCount, textAlign, &isAfterExpansion] (RenderBlockFlow& block,
- LegacyInlineTextBox& textBox, BidiRun* previousRun, BidiRun* nextRun, const StringView& stringView, TextDirection direction)
+ LegacyInlineTextBox& textBox, BidiRun* previousRun, BidiRun* nextRun, StringView stringView, TextDirection direction)
{
if (stringView.isEmpty()) {
// Empty runs should still produce an entry in expansionOpportunities list so that the number of items matches the number of runs.
Modified: trunk/Source/WebCore/svg/SVGParserUtilities.cpp (282241 => 282242)
--- trunk/Source/WebCore/svg/SVGParserUtilities.cpp 2021-09-09 22:24:42 UTC (rev 282241)
+++ trunk/Source/WebCore/svg/SVGParserUtilities.cpp 2021-09-09 23:39:40 UTC (rev 282242)
@@ -149,7 +149,7 @@
return genericParseNumber(buffer, skip);
}
-std::optional<float> parseNumber(const StringView& string, SuffixSkippingPolicy skip)
+std::optional<float> parseNumber(StringView string, SuffixSkippingPolicy skip)
{
return readCharactersForParsing(string, [skip](auto buffer) -> std::optional<float> {
auto result = genericParseNumber(buffer, skip);
@@ -192,7 +192,7 @@
return genericParseArcFlag(buffer);
}
-std::optional<std::pair<float, float>> parseNumberOptionalNumber(const StringView& string)
+std::optional<std::pair<float, float>> parseNumberOptionalNumber(StringView string)
{
if (string.isEmpty())
return std::nullopt;
@@ -216,7 +216,7 @@
});
}
-std::optional<FloatPoint> parsePoint(const StringView& string)
+std::optional<FloatPoint> parsePoint(StringView string)
{
if (string.isEmpty())
return std::nullopt;
@@ -236,7 +236,7 @@
});
}
-std::optional<FloatRect> parseRect(const StringView& string)
+std::optional<FloatRect> parseRect(StringView string)
{
return readCharactersForParsing(string, [](auto buffer) -> std::optional<FloatRect> {
skipOptionalSVGSpaces(buffer);
@@ -258,7 +258,7 @@
});
}
-std::optional<HashSet<String>> parseGlyphName(const StringView& string)
+std::optional<HashSet<String>> parseGlyphName(StringView string)
{
// FIXME: Parsing error detection is missing.
@@ -361,7 +361,7 @@
return range;
}
-std::optional<std::pair<UnicodeRanges, HashSet<String>>> parseKerningUnicodeString(const StringView& string)
+std::optional<std::pair<UnicodeRanges, HashSet<String>>> parseKerningUnicodeString(StringView string)
{
// FIXME: Parsing error detection is missing.
Modified: trunk/Source/WebCore/svg/SVGParserUtilities.h (282241 => 282242)
--- trunk/Source/WebCore/svg/SVGParserUtilities.h 2021-09-09 22:24:42 UTC (rev 282241)
+++ trunk/Source/WebCore/svg/SVGParserUtilities.h 2021-09-09 23:39:40 UTC (rev 282242)
@@ -39,21 +39,21 @@
std::optional<float> parseNumber(StringParsingBuffer<LChar>&, SuffixSkippingPolicy = SuffixSkippingPolicy::Skip);
std::optional<float> parseNumber(StringParsingBuffer<UChar>&, SuffixSkippingPolicy = SuffixSkippingPolicy::Skip);
-std::optional<float> parseNumber(const StringView&, SuffixSkippingPolicy = SuffixSkippingPolicy::Skip);
+std::optional<float> parseNumber(StringView, SuffixSkippingPolicy = SuffixSkippingPolicy::Skip);
-std::optional<std::pair<float, float>> parseNumberOptionalNumber(const StringView&);
+std::optional<std::pair<float, float>> parseNumberOptionalNumber(StringView);
std::optional<bool> parseArcFlag(StringParsingBuffer<LChar>&);
std::optional<bool> parseArcFlag(StringParsingBuffer<UChar>&);
-std::optional<FloatPoint> parsePoint(const StringView&);
-std::optional<FloatRect> parseRect(const StringView&);
+std::optional<FloatPoint> parsePoint(StringView);
+std::optional<FloatRect> parseRect(StringView);
std::optional<FloatPoint> parseFloatPoint(StringParsingBuffer<LChar>&);
std::optional<FloatPoint> parseFloatPoint(StringParsingBuffer<UChar>&);
-std::optional<std::pair<UnicodeRanges, HashSet<String>>> parseKerningUnicodeString(const StringView&);
-std::optional<HashSet<String>> parseGlyphName(const StringView&);
+std::optional<std::pair<UnicodeRanges, HashSet<String>>> parseKerningUnicodeString(StringView);
+std::optional<HashSet<String>> parseGlyphName(StringView);
// SVG allows several different whitespace characters: