| Index: third_party/WebKit/Source/core/html/HTMLViewSourceDocument.cpp
|
| diff --git a/third_party/WebKit/Source/core/html/HTMLViewSourceDocument.cpp b/third_party/WebKit/Source/core/html/HTMLViewSourceDocument.cpp
|
| index f385cd82b5130f9c354cd5a24851c6efab6c8076..1187e24824105607e6f1c0e99311ba7a09742927 100644
|
| --- a/third_party/WebKit/Source/core/html/HTMLViewSourceDocument.cpp
|
| +++ b/third_party/WebKit/Source/core/html/HTMLViewSourceDocument.cpp
|
| @@ -162,9 +162,13 @@ void HTMLViewSourceDocument::processTagToken(const String& source,
|
| index = addRange(source, index,
|
| iter->valueRange().start - token.startIndex(), emptyAtom);
|
|
|
| - bool isLink = name == srcAttr || name == hrefAttr;
|
| - index = addRange(source, index, iter->valueRange().end - token.startIndex(),
|
| - "html-attribute-value", isLink, tagName == aTag, value);
|
| + if (name == srcsetAttr) {
|
| + index = addSrcset(source, index, iter->valueRange().end - token.startIndex());
|
| + } else {
|
| + bool isLink = name == srcAttr || name == hrefAttr;
|
| + index = addRange(source, index, iter->valueRange().end - token.startIndex(),
|
| + "html-attribute-value", isLink, tagName == aTag, value);
|
| + }
|
|
|
| ++iter;
|
| }
|
| @@ -312,6 +316,30 @@ Element* HTMLViewSourceDocument::addLink(const AtomicString& url,
|
| return anchor;
|
| }
|
|
|
| +int HTMLViewSourceDocument::addSrcset(const String& source,
|
| + int start,
|
| + int end) {
|
| + String srcset = source.substring(start, end-start);
|
| + Vector<String> srclist;
|
| + srcset.split(',', true, srclist);
|
| + unsigned size = srclist.size();
|
| + for (unsigned i = 0; i < size; i++) {
|
| + Vector<String> tmp;
|
| + srclist[i].split(' ', tmp);
|
| + if (tmp.size() > 0) {
|
| + AtomicString link(tmp[0]);
|
| + m_current = addLink(link, false);
|
| + addText(srclist[i], "html-attribute-value");
|
| + m_current = toElement(m_current->parentNode());
|
| + } else {
|
| + addText(srclist[i], "html-attribute-value");
|
| + }
|
| + if (i + 1 < size)
|
| + addText(",", "html-attribute-value");
|
| + }
|
| + return end;
|
| +}
|
| +
|
| void HTMLViewSourceDocument::maybeAddSpanForAnnotation(
|
| SourceAnnotation annotation) {
|
| if (annotation == AnnotateSourceAsXSS) {
|
|
|