Closed Bug 526721 Opened 12 years ago Closed 11 years ago

"View Image Info" displays the wrong size if the document's first image has the same url, same alt but different scale

Categories

(Firefox :: Page Info Window, defect)

3.6 Branch
defect
Not set
minor

Tracking

()

RESOLVED FIXED
Firefox 3.7a1
Tracking Status
status1.9.2 --- beta3-fixed

People

(Reporter: alice0775, Assigned: mozilla.bugs)

References

Details

Attachments

(3 files, 2 obsolete files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2b2pre) Gecko/20091104 Firefox/3.5.1 (.NET CLR 3.5.30729)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2b2pre) Gecko/20091104 Firefox/3.5.1 (.NET CLR 3.5.30729)

"Page Info" does not detect of images in a document,there are same url,same alt and different scale.

Reproducible: Always

Steps to Reproduce:
1.Start Namoroka/Minfield with new profile
2.Open Test case
3.Tools > Page Info
4.Select media tab

Actual Results:  
Only one url is displayed in address pane.
Dimensions is "128px × 128px (scaled to 80px × 80px)"


Expected Results:  
Two urls should be shown in address pane.
and Dimension should be "128px × 128px (scaled to 200px × 200px)" at secont url
Attached file Test Case
Blocks: 201264
Version: unspecified → 3.6 Branch
And Bug 526534 is related
In comment #0
 s/at secont url/at second url/
Blocks: 524106
No longer blocks: 524106
Status: UNCONFIRMED → RESOLVED
Closed: 12 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 526534
Verified Duplicate.  The patch for 526534 fixes this bug too.
Status: RESOLVED → VERIFIED
(In reply to comment #4)
> 
> *** This bug has been marked as a duplicate of bug 526534 ***
(In reply to comment #5)
> Verified Duplicate.  The patch for 526534 fixes this bug too.

I dont think so.
This is Page info own bug.

REOPEN need.
(In reply to comment #6)
> This is Page info own bug.
>
> REOPEN need.

Bug 526534 is also a bug in Page Info.  This bug looks exactly the same as 526534 to me, though this bug contains steps to reproduce, which are useful for QA.
Status: VERIFIED → UNCONFIRMED
Resolution: DUPLICATE → ---
The patch for Bug 526534 didn't fix this.  I'm not sure why it didn't though.

Dao: Do you know why the lines

if (elem == gImageElement)
  gImageView.data[i][COL_IMAGE_NODE] = elem;

wouldn't handle this.  I know that they are executed on this testcase, but I don't know why they wouldn't change the image element, sizing, etc. to be correct when it does it for everything else.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Assigning to me.
Assignee: nobody → mozilla.bugs
Status: NEW → ASSIGNED
Attached patch Patch (obsolete) — Splinter Review
This is based on Dao's suggestions from an irc discussion.
Attachment #411904 - Flags: review?(dao)
Attached patch Patch v 1.1 (obsolete) — Splinter Review
This has a test added.
Attachment #411904 - Attachment is obsolete: true
Attachment #411909 - Flags: review?(dao)
Attachment #411904 - Flags: review?(dao)
Comment on attachment 411909 [details] [diff] [review]
Patch v 1.1

>diff --git a/browser/base/content/pageinfo/pageInfo.js b/browser/base/content/pageinfo/pageInfo.js
>--- a/browser/base/content/pageinfo/pageInfo.js
>+++ b/browser/base/content/pageinfo/pageInfo.js
>@@ -80,17 +80,17 @@ pageInfoTreeView.prototype = {
>   {
>     this.data[row][column.index] = value;
>   },
> 
>   addRow: function(row)
>   {
>     this.rows = this.data.push(row);
>     this.rowCountChanged(this.rows - 1, 1);
>-    if (this.selection.count == 0 && this.rowCount)
>+    if (this.selection.count == 0 && this.rowCount && !gImageElement)
>       this.selection.select(0);
>   },
> 
>   rowCountChanged: function(index, count)
>   {
>     this.tree.rowCountChanged(index, count);
>   },
> 
>diff --git a/browser/base/content/test/browser_bug517902.js b/browser/base/content/test/browser_bug517902.js
>--- a/browser/base/content/test/browser_bug517902.js
>+++ b/browser/base/content/test/browser_bug517902.js
>@@ -26,13 +26,14 @@ function test() {
>           finish();
>         });
>       });
>     }, true);
>   }, true);
> 
>   content.location =
>     "data:text/html," +
>+    "<img src='about:logo?b' height=200 width=250 alt=2>" +
>     "<img src='about:logo?a' height=200 width=250>" +
>     "<img src='about:logo?b' height=200 width=250 alt=1>" +
>     "<img src='about:logo?b' height=200 width=250 alt=2>" +
>     "<img src='about:logo?b' height=100 width=150 alt=2 id='test-image'>";

Please remove the 4th image, it's redundant now. Also please choose a different height and width for the new image in order to make a potential failure easily identifiable.
Attachment #411909 - Flags: review?(dao) → review+
Attached patch Patch v 1.2Splinter Review
Changes made.
Attachment #411909 - Attachment is obsolete: true
Attachment #411911 - Flags: approval1.9.2?
Keywords: checkin-needed
Summary: "Page Info" does not detect of images in a document,there are same url,same alt and different scale → "View Image Info" displays the wrong size if the document's first image has the same url, same alt but different scale
http://hg.mozilla.org/mozilla-central/rev/499fab2b6aa4
Blocks: 526534
No longer blocks: 201264
Severity: normal → minor
Status: ASSIGNED → RESOLVED
Closed: 12 years ago12 years ago
Flags: in-testsuite+
Keywords: checkin-needed
OS: Windows Vista → All
Hardware: x86 → All
Resolution: --- → FIXED
Target Milestone: --- → Firefox 3.7a1
Why does Summary Change?
Tgis is "Page Info" own bug.
Please read STR in  comment #0 .

Why does status change to RESOLVED FIXED?
The bug is not fixed.
STR of comment #0 is reproduced.

Or, Is this bug INVALID?
It is expected that only image is listed in Page Info, per bug 201264.
(In reply to comment #16)
> It is expected that only image is listed in Page Info, per bug 201264.

If it is true,
I think that the scaled size should not be displayed in Page Info.
Because, there are different scaled image in a document,It is not rational to display only a found scaled size.
(In reply to comment #17)
> (In reply to comment #16)
> > It is expected that only image is listed in Page Info, per bug 201264.

Oops, "only image" should be "only one of the duplicate images".

> If it is true,
> I think that the scaled size should not be displayed in Page Info.
> Because, there are different scaled image in a document,It is not rational to
> display only a found scaled size.

Well, the size is quite important when it comes to "View Image Info".
(In reply to comment #18)
> (In reply to comment #17)
> > (In reply to comment #16)
> > > It is expected that only image is listed in Page Info, per bug 201264.
> 
> Oops, "only image" should be "only one of the duplicate images".

In the document, there are not only(scaled to 80px × 80px) but also (scaled to 200px × 200px),
I do not understand why (scaled to 80px × 80px)is display only?

I think Page Info should be,
AAA: Any scaled size should not be displayed
OR
BBB: both scaled sizes should be displayed

And I think that nobody mentions scaleed size in the bug 201264.

> 
> > If it is true,
> > I think that the scaled size should not be displayed in Page Info.
> > Because, there are different scaled image in a document,It is not rational to
> > display only a found scaled size.
> 
> Well, the size is quite important when it comes to "View Image Info".

I am not  talking about "View Image Info"
(In reply to comment #19)
> I am not  talking about "View Image Info"

Yet I do. View Image Info opens the Page Info window.
Attached file Test Case
I can not see image in Media view
In this case "Page info" is useless.
Would you mind filing a new bug? This bug's summary has been adjusted to match what the patch fixes.
Comment on attachment 411911 [details] [diff] [review]
Patch v 1.2

a192=beltzner
Attachment #411911 - Flags: approval1.9.2? → approval1.9.2+
Keywords: checkin-needed
With a nightly 1.9.2 build, 01-21-10, I am seeing the actual results as specified in comment #0 

Latest 1.9.2 Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2pre) Gecko/20100121 Namoroka/3.6pre
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
The behavior in comment #0 is intentional, so that if a page has 200+ instances of the same images that are all scaled differently, only one of them is listed.  The patch for this bug fixes the case where if "View Image Info" is performed on any of those images, it falsely loads the data of the first instance of that image.

So updated STR would be

1. Load either testcase
2. Right+click the second image and do View Image Info
3. Verify that it's size and apparent dimensions are "128px × 128px (scaled to 200px × 200px)" and not the dimensions of the smaller image
I am re-resolving this, since the issue that can be fixed about this has already been fixed, and fixing the other issues in comment #0 would break Bug 201264.
Status: REOPENED → RESOLVED
Closed: 12 years ago11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.