Permalink
Browse files

Anchors don't agree with setUrl. Using load instead. Fixes #92

  • Loading branch information...
1 parent 89bee3c commit f75bc3dbad9e4c9c2419d5b62ad0f639a47e3507 @halogenandtoast halogenandtoast committed Sep 30, 2011
Showing with 8 additions and 5 deletions.
  1. +7 −0 spec/driver_spec.rb
  2. +1 −5 src/Visit.cpp
View
@@ -177,6 +177,13 @@
end
end
+ it "handles anchor tags" do
+ subject.visit("#test")
+ subject.find("//*[contains(., 'hello')]").should_not be_empty
+ subject.visit("#test")
+ subject.find("//*[contains(., 'hello')]").should_not be_empty
+ end
+
it "finds content after loading a URL" do
subject.find("//*[contains(., 'hello')]").should_not be_empty
end
View
@@ -8,11 +8,7 @@ Visit::Visit(WebPage *page, QObject *parent) : Command(page, parent) {
void Visit::start(QStringList &arguments) {
QUrl requestedUrl = QUrl(arguments[0]);
- page()->currentFrame()->setUrl(QUrl(requestedUrl));
- if(requestedUrl.hasFragment()) {
- // workaround for https://bugs.webkit.org/show_bug.cgi?id=32723
- page()->currentFrame()->setUrl(QUrl(requestedUrl));
- }
+ page()->currentFrame()->load(QUrl(requestedUrl));
}
void Visit::loadFinished(bool success) {

0 comments on commit f75bc3d

Please sign in to comment.