Chromium Code Reviews| Index: third_party/WebKit/Source/core/frame/FrameSerializer.cpp |
| diff --git a/third_party/WebKit/Source/core/frame/FrameSerializer.cpp b/third_party/WebKit/Source/core/frame/FrameSerializer.cpp |
| index c2041086ac548e84e3404397db3b5bc03bd27b55..41eb44870b4684be35ebc2b427cfe2d8a1844089 100644 |
| --- a/third_party/WebKit/Source/core/frame/FrameSerializer.cpp |
| +++ b/third_party/WebKit/Source/core/frame/FrameSerializer.cpp |
| @@ -79,15 +79,6 @@ const int32_t maxSerializationTimeUmaMicroseconds = 10 * secondsToMicroseconds; |
| namespace blink { |
| -static bool shouldIgnoreElement(const Element& element) { |
| - if (isHTMLScriptElement(element)) |
| - return true; |
| - if (isHTMLNoScriptElement(element)) |
| - return true; |
| - return isHTMLMetaElement(element) && |
| - toHTMLMetaElement(element).computeEncoding().isValid(); |
| -} |
| - |
| class SerializerMarkupAccumulator : public MarkupAccumulator { |
| STACK_ALLOCATED(); |
| @@ -109,6 +100,7 @@ class SerializerMarkupAccumulator : public MarkupAccumulator { |
| void appendEndTag(const Element&) override; |
| private: |
| + bool shouldIgnoreElement(const Element&) const; |
| void appendAttributeValue(StringBuilder& out, const String& attributeValue); |
| void appendRewrittenAttribute(StringBuilder& out, |
| const Element&, |
| @@ -219,6 +211,19 @@ void SerializerMarkupAccumulator::appendEndTag(const Element& element) { |
| MarkupAccumulator::appendEndTag(element); |
| } |
| +bool SerializerMarkupAccumulator::shouldIgnoreElement( |
| + const Element& element) const { |
| + if (isHTMLScriptElement(element)) |
| + return true; |
| + if (isHTMLNoScriptElement(element)) |
| + return true; |
| + if (isHTMLMetaElement(element) && |
| + toHTMLMetaElement(element).computeEncoding().isValid()) { |
| + return true; |
| + } |
| + return m_delegate.shouldIgnoreElement(element); |
|
carlosk
2016/11/30 23:30:22
This might be a dumb question but why is this logi
jianli
2016/12/01 02:19:38
It seems that this is useful in supporting multipl
|
| +} |
| + |
| void SerializerMarkupAccumulator::appendAttributeValue( |
| StringBuilder& out, |
| const String& attributeValue) { |