WebKit Bugzilla
Attachment 343482 Details for
Bug 186988
: CSSGradientValue's color stops vector wastes 12KB on theverge.com
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186988-20180624211950.patch (text/plain), 2.81 KB, created by
Simon Fraser (smfr)
on 2018-06-24 21:19:50 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Simon Fraser (smfr)
Created:
2018-06-24 21:19:50 PDT
Size:
2.81 KB
patch
obsolete
>Subversion Revision: 233132 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 8ffb021ad5f848e06fb7849c0c980d8f46447b21..086c82037ac65fb524e78d7124f27dab7bc77071 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,19 @@ >+2018-06-24 Simon Fraser <simon.fraser@apple.com> >+ >+ CSSGradientValue's color stops vector wastes 12KB on theverge.com >+ https://bugs.webkit.org/show_bug.cgi?id=186988 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Shrink the color stops vector when we're done parsing the stops. >+ >+ * css/CSSGradientValue.h: >+ (WebCore::CSSGradientValue::doneAddingStops): >+ * css/parser/CSSPropertyParserHelpers.cpp: >+ (WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradient): >+ (WebCore::CSSPropertyParserHelpers::consumeGradientColorStops): >+ (WebCore::CSSPropertyParserHelpers::consumeAngularGradientColorStops): >+ > 2018-06-23 Zalan Bujtas <zalan@apple.com> > > [Mail] Use the Mail Viewer width as the base for resolving horizontal viewport units >diff --git a/Source/WebCore/css/CSSGradientValue.h b/Source/WebCore/css/CSSGradientValue.h >index 68f8240f2dced5d5dbaf93ebd07688beed04658d..7697b74d7574d36376c8997fd61559285d189572 100644 >--- a/Source/WebCore/css/CSSGradientValue.h >+++ b/Source/WebCore/css/CSSGradientValue.h >@@ -69,6 +69,7 @@ public: > void setSecondY(RefPtr<CSSPrimitiveValue>&& val) { m_secondY = WTFMove(val); } > > void addStop(const CSSGradientColorStop& stop) { m_stops.append(stop); } >+ void doneAddingStops() { m_stops.shrinkToFit(); } > > unsigned stopCount() const { return m_stops.size(); } > >diff --git a/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp b/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp >index 87f58e8569806045a71b7da3c981e8838dc16a6c..ab62b08f195da480fb47a6b4f09e8c49b956b597 100644 >--- a/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp >+++ b/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp >@@ -957,6 +957,7 @@ static RefPtr<CSSValue> consumeDeprecatedGradient(CSSParserTokenRange& args, CSS > result->addStop(stop); > } > >+ result->doneAddingStops(); > return result; > } > >@@ -984,6 +985,8 @@ static bool consumeGradientColorStops(CSSParserTokenRange& range, CSSParserMode > gradient.addStop(stop); > } while (consumeCommaIncludingWhitespace(range)); > >+ gradient.doneAddingStops(); >+ > // The last color stop cannot be a color hint. > if (previousStopWasColorHint) > return false; >@@ -1017,6 +1020,8 @@ static bool consumeAngularGradientColorStops(CSSParserTokenRange& range, CSSPars > gradient.addStop(stop); > } while (consumeCommaIncludingWhitespace(range)); > >+ gradient.doneAddingStops(); >+ > // The last color stop cannot be a color hint. > if (previousStopWasColorHint) > return false;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186988
: 343482