Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(578)

Unified Diff: Source/core/html/HTMLImageElement.cpp

Issue 290803002: Return an absolute URL for HTMLImageElement.currentSrc (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Test that currentSrc is absolute Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/html/HTMLImageElement.cpp
diff --git a/Source/core/html/HTMLImageElement.cpp b/Source/core/html/HTMLImageElement.cpp
index f236266a651d13830a5dd6e38c292f095bb1c0ae..c12b866073233e62c31c645cf43c141568710a22 100644
--- a/Source/core/html/HTMLImageElement.cpp
+++ b/Source/core/html/HTMLImageElement.cpp
@@ -161,6 +161,7 @@ void HTMLImageElement::parseAttribute(const QualifiedName& name, const AtomicStr
effectiveSize = SizesAttributeParser::findEffectiveSize(fastGetAttribute(sizesAttr), MediaValuesCached::create(document()));
ImageCandidate candidate = bestFitSourceForImageAttributes(document().devicePixelRatio(), effectiveSize, fastGetAttribute(srcAttr), fastGetAttribute(srcsetAttr));
m_bestFitImageURL = candidate.toAtomicString();
+ m_currentSrc = AtomicString(document().completeURL(imageSourceURL()).string());
float candidateScaleFactor = candidate.scaleFactor();
// FIXME: Make this ">0" part match the spec, once it settles.
if (candidateScaleFactor > 0)
@@ -315,7 +316,7 @@ int HTMLImageElement::naturalHeight() const
const AtomicString& HTMLImageElement::currentSrc() const
{
- return m_bestFitImageURL;
+ return m_currentSrc;
}
bool HTMLImageElement::isURLAttribute(const Attribute& attribute) const

Powered by Google App Engine
This is Rietveld 408576698