| Index: third_party/WebKit/Source/web/WebFrameSerializer.cpp
|
| diff --git a/third_party/WebKit/Source/web/WebFrameSerializer.cpp b/third_party/WebKit/Source/web/WebFrameSerializer.cpp
|
| index 2761caac1e1b3e3b8e44f692da8e29c9db19e742..eaa7ce181b5c6717af265c81928a8a5f1c8fe951 100644
|
| --- a/third_party/WebKit/Source/web/WebFrameSerializer.cpp
|
| +++ b/third_party/WebKit/Source/web/WebFrameSerializer.cpp
|
| @@ -81,7 +81,7 @@ class MHTMLFrameSerializerDelegate final : public FrameSerializer::Delegate {
|
| public:
|
| explicit MHTMLFrameSerializerDelegate(
|
| WebFrameSerializer::MHTMLPartsGenerationDelegate&);
|
| - bool shouldIgnoreAttribute(const Attribute&) override;
|
| + bool shouldIgnoreAttribute(const Element&, const Attribute&) override;
|
| bool rewriteLink(const Element&, String& rewrittenLink) override;
|
| bool shouldSkipResourceWithURL(const KURL&) override;
|
| bool shouldSkipResource(const Resource&) override;
|
| @@ -95,12 +95,18 @@ MHTMLFrameSerializerDelegate::MHTMLFrameSerializerDelegate(
|
| : m_webDelegate(webDelegate) {}
|
|
|
| bool MHTMLFrameSerializerDelegate::shouldIgnoreAttribute(
|
| + const Element& element,
|
| const Attribute& attribute) {
|
| // TODO(fgorski): Presence of srcset attribute causes MHTML to not display
|
| // images, as only the value of src is pulled into the archive. Discarding
|
| // srcset prevents the problem. Long term we should make sure to MHTML plays
|
| // nicely with srcset.
|
| - return attribute.localName() == HTMLNames::srcsetAttr;
|
| + if (attribute.localName() == HTMLNames::srcsetAttr)
|
| + return true;
|
| +
|
| + // Do not include attributes that contain javascript. This is because the
|
| + // script will not be executed when a MHTML page is being loaded.
|
| + return element.isScriptingAttribute(attribute);
|
| }
|
|
|
| bool MHTMLFrameSerializerDelegate::rewriteLink(const Element& element,
|
|
|