Commit 8f4e862d authored by rwlbuis's avatar rwlbuis

LayoutTests:

        Reviewed by Maciej.

        Testcase for:
        http://bugs.webkit.org/show_bug.cgi?id=11321
        Element with :target pseudo-class still matched after fragment identifier change

        * fast/css/target-fragment-match-expected.checksum: Added.
        * fast/css/target-fragment-match-expected.png: Added.
        * fast/css/target-fragment-match-expected.txt: Added.
        * fast/css/target-fragment-match.html: Added.

WebCore:
        Reviewed by Maciej.

        http://bugs.webkit.org/show_bug.cgi?id=11321
        Element with :target pseudo-class still matched after fragment identifier change

        Make sure the page does a style recalculation and possible rendering
        when navigating back from a page with an anchor to a page without
        an anchor.

        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::gotoAnchor):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@17848 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent b2127b75
2006-11-18 Rob Buis <buis@kde.org>
Reviewed by Maciej.
Testcase for:
http://bugs.webkit.org/show_bug.cgi?id=11321
Element with :target pseudo-class still matched after fragment identifier change
* fast/css/target-fragment-match-expected.checksum: Added.
* fast/css/target-fragment-match-expected.png: Added.
* fast/css/target-fragment-match-expected.txt: Added.
* fast/css/target-fragment-match.html: Added.
2006-11-18 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Rob (yay!).
235692744d60d335221d792b3050fd06
\ No newline at end of file
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x50
RenderBlock {HTML} at (0,0) size 800x50
RenderBody {BODY} at (8,16) size 784x18
RenderBlock {DIV} at (0,0) size 784x18
RenderBlock {P} at (0,0) size 784x18
RenderText {#text} at (0,0) size 612x18
text run at (0,0) width 612: "I should be highlighted first because of the anchor, and de-highlighted when there is no fragment."
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<style type="text/css">
div:target {
background-color: #66CCFF;
}
</style>
<script>
function test()
{
if (window.layoutTestController)
layoutTestController.waitUntilDone();
window.location.hash ='#target-01';
document.body.offsetTop;
window.history.back();
if (window.layoutTestController)
layoutTestController.notifyDone();
}
</script>
</head>
<body onload="test()">
<div id="target-01">
<p>I should be highlighted first because of the anchor, and de-highlighted when there is no fragment.</p>
</div>
</body></html>
2006-11-18 Rob Buis <buis@kde.org>
Reviewed by Maciej.
http://bugs.webkit.org/show_bug.cgi?id=11321
Element with :target pseudo-class still matched after fragment identifier change
Make sure the page does a style recalculation and possible rendering
when navigating back from a page with an anchor to a page without
an anchor.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::gotoAnchor):
2006-11-18 Don Gibson <dgibson77@gmail.com>
Reviewed by Sam Weinig.
......@@ -994,7 +994,11 @@ void FrameLoader::commitIconURLToIconDatabase(const KURL& icon)
void FrameLoader::gotoAnchor()
{
// If our URL has no ref, then we have no place we need to jump to.
if (!m_URL.hasRef())
// OTOH if css target was set previously, we want to set it to 0, recalc
// and possibly repaint because :target pseudo class may have been
// set(See bug 11321)
if (!m_URL.hasRef() &&
!(m_frame->document() && m_frame->document()->getCSSTarget()))
return;
DeprecatedString ref = m_URL.encodedHtmlRef();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment