WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
111951
Anchor tag ignored if image width and height are absent
https://bugs.webkit.org/show_bug.cgi?id=111951
Summary
Anchor tag ignored if image width and height are absent
Andy Bajka
Reported
2013-03-10 19:13:18 PDT
This is a huge problem for forum users because image width and height specifications are not specified in the html <img> tag. Below is an example, using Safari on my iMac (Version 6.0.2 (8536.26.17) click on the link below, it should scroll to post #10 but does not. [url]
http://www.southbayriders.com/forums/showthread.php?t=10730&p=235955#post235955[/url
] If I disable images in Safari the link will scroll properly to post #10.
Attachments
Add attachment
proposed patch, testcase, etc.
Andy Bajka
Comment 1
2013-03-11 09:58:58 PDT
Please edit my first post. The url tags should be removed.
http://www.southbayriders.com/forums/showthread.php?t=10730&p=235955#post235955
Alexey Proskuryakov
Comment 2
2013-03-11 12:29:02 PDT
I'm not sure if it's because of image size not being specified. I think that this is just flaky - sometimes we scroll to anchor on load, and other time don't, randomly. There must be an existing bug about this, but I couldn't find it now.
Alexey Proskuryakov
Comment 3
2013-03-11 12:31:43 PDT
In the case that I'm wrong and it's indeed about image size, then this just sounds the same as
bug 44772
which you found.
Andy Bajka
Comment 4
2013-03-11 12:37:44 PDT
Sorry about the duplicate bug. This is a huge problem for forums. I would like to verify if this is a Webkit problem or a Safari problem. The anchor works perfect in Chrome even where there are no width and height information on image.
Andy Bajka
Comment 5
2013-05-25 17:03:07 PDT
Can someone confirm if this is a webkit bug? Please use your iPad or iPhone and click this link:
http://www.southbayriders.com/forums/threads/10730/#post-235955
It should scroll to the post #10.
Andy Bajka
Comment 6
2013-05-25 17:05:41 PDT
Can someone confirm if this is a webkit bug? Please use your iPad or iPhone and click this link:
http://www.southbayriders.com/forums/threads/10730/#post-235955
It should scroll to post #10. The bug relates to the image height not being set. All other browsers work properly even if the image height is not set. Only Webkit and iOS fails to perform this most critical and basic function.
Brady Eidson
Comment 7
2013-05-25 18:46:47 PDT
(In reply to
comment #5
)
> Can someone confirm if this is a webkit bug?
As the filer of the bug, and therefore a contributor to the WebKit open source project, *you* can help confirm this. As of now, you've conjectured that the bug is because there's no height/width on the img tag. Alexey thinks this is unlikely, as do I. Yes, you have a URL that reproduces this for you. No, that doesn't necessarily make it easy to get to the root cause and fix it. The best thing anybody who feels this bug is important and has the time to explore it can do is create a reduction. This link should help you get started on that -
http://www.webkit.org/quality/reduction.html
Andy Bajka
Comment 8
2013-05-25 18:56:43 PDT
One thing I noticed is that if the page is not cached, the link will scroll to the correct anchor point. But if the page is cached and you reload the page, it doesn't scroll to the correct anchor point. Again I have confirmed that this issue deals with the absence of the height setting for the image contained in the same page. If you turn off images the page scrolls to the correct anchor point every time, on initial load or after a page reload. Here's another link to see what I mean:
http://xenforo.com/community/threads/responsive-design.50888/#post-544517
The above link should scroll to post #10.
Andy Bajka
Comment 9
2013-05-25 19:01:29 PDT
Hi Brady, I have done a reduction and *I* can confirm this is a bug in Safari for iOS. My problem is that I don't know how to confirm if this is a bug in webkit. I only assume it's a webkit problem because all the browsers that run on an iPad or iPhone have the same bug.
Brady Eidson
Comment 10
2013-05-25 19:50:40 PDT
(In reply to
comment #9
)
> Hi Brady, > > I have done a reduction and *I* can confirm this is a bug in Safari for iOS. My problem is that I don't know how to confirm if this is a bug in webkit.
I don't understand... you are unable to try the reduction in Safari on the desktop or with a WebKit nightly? Is there something particular about the reduction that makes it apply only to mobile devices?
Andy Bajka
Comment 11
2013-05-25 20:31:40 PDT
I have an iPad and I run Safari mobile on it. My understanding is WebKit is the underlying code behind Safari Mobile. I don't know how one tests WebKit Nightly on an iPad.
Brady Eidson
Comment 12
2013-05-25 23:30:14 PDT
(In reply to
comment #11
)
> I have an iPad and I run Safari mobile on it. > > My understanding is WebKit is the underlying code behind Safari Mobile. I don't know how one tests WebKit Nightly on an iPad.
To clarify - Safari on Mac OS X, or a WebKit build on any of the desktop platforms supported by the project (namely, all of them)
Brady Eidson
Comment 13
2013-05-25 23:30:45 PDT
Also, you say you have a reduction, but there is no reduction attached here or linked to from here.
Andy Bajka
Comment 14
2013-05-25 23:48:44 PDT
(In reply to
comment #12
)
> (In reply to
comment #11
) > > I have an iPad and I run Safari mobile on it. > > > > My understanding is WebKit is the underlying code behind Safari Mobile. I don't know how one tests WebKit Nightly on an iPad. > > To clarify - Safari on Mac OS X, or a WebKit build on any of the desktop platforms supported by the project (namely, all of them)
Sorry I'm not sure what you're asking. This bug only occurs on iOS Safari Mobile and all the other browsers that are available for the iPad and iPhone. This bug does not occur on Safari for OS X.
Andy Bajka
Comment 15
2013-05-26 00:35:00 PDT
(In reply to
comment #13
)
> Also, you say you have a reduction, but there is no reduction attached here or linked to from here.
Here's reduction example. Please use an iPad or iPhone for this test running Safari Mobile. The first time you click the link it will scroll to the anchor as it should. But if you reload the page it scrolls and stops before the anchor. The amount it's off by is the height of the one image in this test page above the anchor.
http://www.southbayriders.com/webkit/test.php/#tips
If you add the height information to the image the anchor works perfectly every time, even after a page reload. One might ask, why not just add the height information to all images. The reason is that forums don't use the height to indicate the image height. This is done so that images can be dynamically scaled tp fit within the message area.
Brady Eidson
Comment 16
2013-05-26 12:37:37 PDT
(In reply to
comment #14
)
> (In reply to
comment #12
) > > (In reply to
comment #11
) > > > I have an iPad and I run Safari mobile on it. > > > > > > My understanding is WebKit is the underlying code behind Safari Mobile. I don't know how one tests WebKit Nightly on an iPad. > > > > To clarify - Safari on Mac OS X, or a WebKit build on any of the desktop platforms supported by the project (namely, all of them) > > Sorry I'm not sure what you're asking. >This bug only occurs on iOS Safari Mobile and all the other browsers that are available for the iPad and iPhone. > > This bug does not occur on Safari for OS X.
That's precisely what I was asking. However, in your first post when reporting this bug...
> Below is an example, using Safari on my iMac (Version 6.0.2 (8536.26.17) click on the link below, it should scroll to post #10 but does not.
So... which is it? Does it reproduce in Safari on OS X, or not?
Andy Bajka
Comment 17
2013-05-26 12:48:23 PDT
(In reply to
comment #16
)
> So... which is it? Does it reproduce in Safari on OS X, or not?
This bug does not reproduce in Safari on OS X. This bug only occurs on Safari Mobile for iOS.
Andy Bajka
Comment 18
2013-05-26 12:51:20 PDT
Originally this was a bug in Safari both OS X and iOS. It's been recently fixed in OS X. I sure hope it can be fixed in iOS because it makes using forums on an iPad or iPhone very difficult. The reason is that forum software often use a redirect back to the same web page and that's when this anchor problem shows up.
Brady Eidson
Comment 19
2013-05-26 13:10:49 PDT
(In reply to
comment #18
)
> Originally this was a bug in Safari both OS X and iOS. It's been recently fixed in OS X. > > I sure hope it can be fixed in iOS because it makes using forums on an iPad or iPhone very difficult. The reason is that forum software often use a redirect back to the same web page and that's when this anchor problem shows up.
Safari on iOS is a product shipped by Apple, so to file a bug report on it you should head to developer.apple.com and do so with a free developer account. It seems like this used to reproduce here at the WebKit open source project, but no longer does. That being the case, let's go ahead and close this. Feel free to re-open if you can reproduce it in a configuration using ToT WebKit from webkit.org.
Andy Bajka
Comment 20
2013-05-26 13:35:56 PDT
Is WebKit for Safari OS X the same as used on Safari Mobile for iOS ??
Brady Eidson
Comment 21
2013-05-26 13:56:01 PDT
(In reply to
comment #20
)
> Is WebKit for Safari OS X the same as used on Safari Mobile for iOS ??
WebKit is Webkit. But whatever version a particular vendor decides to ship as part of a particular project is up to that vendor. OS X, iOS, and Safari are products that Apple ships. OS X and iOS also contain WebKit binaries. What source code those binaries were built from is up to Apple. If you have a bug with a version of OS X + Safari or iOS + Mobile Safari that you cannot reproduce using sources directly from the WebKit open source project, I'd highly suggest filing a bug with Apple.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug