| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013, Opera Software ASA. All rights reserved. | 2 * Copyright (c) 2013, Opera Software ASA. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 | 162 |
| 163 private: | 163 private: |
| 164 static void configureSettings(WebSettings* settings) | 164 static void configureSettings(WebSettings* settings) |
| 165 { | 165 { |
| 166 settings->setImagesEnabled(true); | 166 settings->setImagesEnabled(true); |
| 167 settings->setLoadsImagesAutomatically(true); | 167 settings->setLoadsImagesAutomatically(true); |
| 168 settings->setJavaScriptEnabled(true); | 168 settings->setJavaScriptEnabled(true); |
| 169 } | 169 } |
| 170 | 170 |
| 171 // PageSerializer::Delegate implementation. | 171 // PageSerializer::Delegate implementation. |
| 172 bool shouldIgnoreAttribute(const Attribute&) override | |
| 173 { | |
| 174 return false; | |
| 175 } | |
| 176 | |
| 177 // PageSerializer::Delegate implementation. | |
| 178 bool rewriteLink(const Element& element, String& rewrittenLink) | 172 bool rewriteLink(const Element& element, String& rewrittenLink) |
| 179 { | 173 { |
| 180 String completeURL; | 174 String completeURL; |
| 181 for (const auto& attribute : element.attributes()) { | 175 for (const auto& attribute : element.attributes()) { |
| 182 if (element.hasLegalLinkAttribute(attribute.name())) { | 176 if (element.hasLegalLinkAttribute(attribute.name())) { |
| 183 completeURL = element.document().completeURL(attribute.value()); | 177 completeURL = element.document().completeURL(attribute.value()); |
| 184 break; | 178 break; |
| 185 } | 179 } |
| 186 } | 180 } |
| 187 | 181 |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 EXPECT_EQ("saved from url=(0015)http://foo.com/", PageSerializer::markOfTheW
ebDeclaration(KURL(ParsedURLString, "http://foo.com"))); | 526 EXPECT_EQ("saved from url=(0015)http://foo.com/", PageSerializer::markOfTheW
ebDeclaration(KURL(ParsedURLString, "http://foo.com"))); |
| 533 EXPECT_EQ("saved from url=(0015)http://f-o.com/", PageSerializer::markOfTheW
ebDeclaration(KURL(ParsedURLString, "http://f-o.com"))); | 527 EXPECT_EQ("saved from url=(0015)http://f-o.com/", PageSerializer::markOfTheW
ebDeclaration(KURL(ParsedURLString, "http://f-o.com"))); |
| 534 EXPECT_EQ("saved from url=(0019)http://foo.com-%2D/", PageSerializer::markOf
TheWebDeclaration(KURL(ParsedURLString, "http://foo.com--"))); | 528 EXPECT_EQ("saved from url=(0019)http://foo.com-%2D/", PageSerializer::markOf
TheWebDeclaration(KURL(ParsedURLString, "http://foo.com--"))); |
| 535 EXPECT_EQ("saved from url=(0024)http://f-%2D.com-%2D%3E/", PageSerializer::m
arkOfTheWebDeclaration(KURL(ParsedURLString, "http://f--.com-->"))); | 529 EXPECT_EQ("saved from url=(0024)http://f-%2D.com-%2D%3E/", PageSerializer::m
arkOfTheWebDeclaration(KURL(ParsedURLString, "http://f--.com-->"))); |
| 536 EXPECT_EQ("saved from url=(0020)http://foo.com/?-%2D", PageSerializer::markO
fTheWebDeclaration(KURL(ParsedURLString, "http://foo.com?--"))); | 530 EXPECT_EQ("saved from url=(0020)http://foo.com/?-%2D", PageSerializer::markO
fTheWebDeclaration(KURL(ParsedURLString, "http://foo.com?--"))); |
| 537 EXPECT_EQ("saved from url=(0020)http://foo.com/#-%2D", PageSerializer::markO
fTheWebDeclaration(KURL(ParsedURLString, "http://foo.com#--"))); | 531 EXPECT_EQ("saved from url=(0020)http://foo.com/#-%2D", PageSerializer::markO
fTheWebDeclaration(KURL(ParsedURLString, "http://foo.com#--"))); |
| 538 EXPECT_EQ("saved from url=(0026)http://foo.com/#bar-%2Dbaz", PageSerializer:
:markOfTheWebDeclaration(KURL(ParsedURLString, "http://foo.com#bar--baz"))); | 532 EXPECT_EQ("saved from url=(0026)http://foo.com/#bar-%2Dbaz", PageSerializer:
:markOfTheWebDeclaration(KURL(ParsedURLString, "http://foo.com#bar--baz"))); |
| 539 } | 533 } |
| 540 | 534 |
| 541 } // namespace blink | 535 } // namespace blink |
| OLD | NEW |