DescriptionSave-Page-As-Complete-Html: Fixing how links are rewritten in subframes.
This CL fixes how links are rewritten in subframes, by tweaking
save_package.cc to exclude the "directory" part from links rewritten
for subframes (i.e. only links rewritten for the main frame should
include the "directory" part).
Rewriting of links in subframes has regressed in crrev.com/1320453004 [1],
which stopped using "recursive" serialization mode of WebPageSerializerImpl.
In "recursive" serialization mode only the main frame would use a
non-empty directory name in WebPageSerializerImpl::serialize [2].
Note that crrev.com/1320453004 has initially landed in 47.0.2522.0.
This regression meant that we used local links of the form
"./foo_files/img.png" in all frames (i.e. in ./foo_files/subframe.htm)
rather than only in the main frame (i.e. in foo.htm).
Note that saving subframes had some issues also before the regression
(i.e. 46.0.2490.80 has trouble saving
https://anforowicz.github.io/nested-frames/index.htm as noted in
crbug.com/554666), but the regression in crrev.com/1320453004 made
things even worse... :-/
[1] See in crrev.com/1320453004/patch/180001/190008 how
WebPageSerializer::serialize is called.
[2] https://chromium.googlesource.com/chromium/src/+/11d41626fbe8e88fb507371df3beda99fce268a1/third_party/WebKit/Source/web/WebPageSerializerImpl.cpp#504
BUG=554666
Committed: https://crrev.com/0296979a51bf3e6347371c9b3432d7c90f73cec1
Cr-Commit-Position: refs/heads/master@{#359705}
Patch Set 1 #Patch Set 2 : Rebasing... #Patch Set 3 : Fixed the name of a test. #
Total comments: 3
Messages
Total messages: 23 (9 generated)
|