зеркало из https://github.com/mozilla/gecko-dev.git
b=26282 r=vidur@netscape.com Now when using the alternate content for an
image that can't be rendered we ignore everything after one of: ; # ?
This commit is contained in:
Родитель
59c456d260
Коммит
f15ca67f0e
|
@ -7849,13 +7849,21 @@ nsCSSFrameConstructor::ConstructAlternateImageFrame(nsIPresShell* aPresShell,
|
|||
// extension
|
||||
aContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::src, altText);
|
||||
if (altText.Length() > 0) {
|
||||
// Trim off the path part of the filename
|
||||
// The path is a hierarchical structure of segments. Get the last substring
|
||||
// in the path
|
||||
PRInt32 offset = altText.RFindChar('/');
|
||||
if (offset >= 0) {
|
||||
altText.Cut(0, offset + 1);
|
||||
}
|
||||
|
||||
// Trim off the extension
|
||||
// Ignore fragment identifiers ('#' delimiter), query strings ('?'
|
||||
// delimiter), and anything beginning with ';'
|
||||
offset = altText.FindCharInSet("#?;");
|
||||
if (offset >= 0) {
|
||||
altText.Truncate(offset);
|
||||
}
|
||||
|
||||
// Trim off any extension (including the '.')
|
||||
offset = altText.RFindChar('.');
|
||||
if (offset >= 0) {
|
||||
altText.Truncate(offset);
|
||||
|
|
|
@ -7849,13 +7849,21 @@ nsCSSFrameConstructor::ConstructAlternateImageFrame(nsIPresShell* aPresShell,
|
|||
// extension
|
||||
aContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::src, altText);
|
||||
if (altText.Length() > 0) {
|
||||
// Trim off the path part of the filename
|
||||
// The path is a hierarchical structure of segments. Get the last substring
|
||||
// in the path
|
||||
PRInt32 offset = altText.RFindChar('/');
|
||||
if (offset >= 0) {
|
||||
altText.Cut(0, offset + 1);
|
||||
}
|
||||
|
||||
// Trim off the extension
|
||||
// Ignore fragment identifiers ('#' delimiter), query strings ('?'
|
||||
// delimiter), and anything beginning with ';'
|
||||
offset = altText.FindCharInSet("#?;");
|
||||
if (offset >= 0) {
|
||||
altText.Truncate(offset);
|
||||
}
|
||||
|
||||
// Trim off any extension (including the '.')
|
||||
offset = altText.RFindChar('.');
|
||||
if (offset >= 0) {
|
||||
altText.Truncate(offset);
|
||||
|
|
Загрузка…
Ссылка в новой задаче