~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to src/3rdparty/webkit/WebCore/wml/WMLGoElement.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2009-11-02 18:30:08 UTC
  • mfrom: (1.2.2 upstream)
  • mto: (15.2.5 experimental)
  • mto: This revision was merged to the branch mainline in revision 88.
  • Revision ID: james.westby@ubuntu.com-20091102183008-b6a4gcs128mvfb3m
Tags: upstream-4.6.0~beta1
ImportĀ upstreamĀ versionĀ 4.6.0~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/**
2
 
 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
 
2
 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
3
3
 *
4
4
 * This library is free software; you can redistribute it and/or
5
5
 * modify it under the terms of the GNU Library General Public
28
28
#include "Frame.h"
29
29
#include "FrameLoader.h"
30
30
#include "HTMLNames.h"
 
31
#include "MappedAttribute.h"
31
32
#include "ResourceRequest.h"
32
33
#include "TextEncoding.h"
33
34
#include "WMLCardElement.h"
49
50
 
50
51
void WMLGoElement::registerPostfieldElement(WMLPostfieldElement* postfield)
51
52
{
 
53
    ASSERT(m_postfieldElements.find(postfield) == WTF::notFound);
52
54
    m_postfieldElements.append(postfield);
53
55
}
 
56
 
 
57
void WMLGoElement::deregisterPostfieldElement(WMLPostfieldElement* postfield)
 
58
{
 
59
    size_t position = m_postfieldElements.find(postfield);
 
60
    ASSERT(position != WTF::notFound);
 
61
    m_postfieldElements.remove(position);
 
62
}
54
63
 
55
64
void WMLGoElement::parseMappedAttribute(MappedAttribute* attr)
56
65
{
64
73
        WMLTaskElement::parseMappedAttribute(attr);
65
74
}
66
75
 
67
 
void WMLGoElement::executeTask(Event* event)
 
76
void WMLGoElement::executeTask()
68
77
{
69
 
    Document* doc = document();
70
 
    WMLPageState* pageState = wmlPageStateForDocument(doc);
 
78
    ASSERT(document()->isWMLDocument());
 
79
    WMLDocument* document = static_cast<WMLDocument*>(this->document());
 
80
 
 
81
    WMLPageState* pageState = wmlPageStateForDocument(document);
71
82
    if (!pageState)
72
83
        return;
73
84
 
74
 
    WMLCardElement* card = pageState->activeCard();
 
85
    WMLCardElement* card = document->activeCard();
75
86
    if (!card)
76
87
        return;
77
88
 
78
 
    Frame* frame = doc->frame();
 
89
    Frame* frame = document->frame();
79
90
    if (!frame)
80
91
        return;
81
92
 
88
99
        return;
89
100
 
90
101
    // Substitute variables within target url attribute value
91
 
    KURL url = doc->completeURL(substituteVariableReferences(href, doc, WMLVariableEscapingEscape));
 
102
    KURL url = document->completeURL(substituteVariableReferences(href, document, WMLVariableEscapingEscape));
92
103
    if (url.isEmpty())
93
104
        return;
94
105
 
99
110
        eventTimer->stop();
100
111
 
101
112
    // FIXME: 'newcontext' handling not implemented for external cards
102
 
    bool inSameDeck = doc->url().path() == url.path();
103
 
    if (inSameDeck && url.hasRef()) {
104
 
        // Force frame loader to load the URL with fragment identifier
105
 
        loader->setForceReloadWmlDeck(true);
106
 
 
107
 
        if (WMLCardElement* card = WMLCardElement::findNamedCardInDocument(doc, url.ref())) {
 
113
    bool inSameDeck = document->url().path() == url.path();
 
114
    if (inSameDeck && url.hasFragmentIdentifier()) {
 
115
        if (WMLCardElement* card = WMLCardElement::findNamedCardInDocument(document, url.fragmentIdentifier())) {
108
116
            if (card->isNewContext())
109
117
                pageState->reset();
110
118
        }
131
139
            request.setCachePolicy(ReloadIgnoringCacheData);
132
140
    }
133
141
 
134
 
    loader->load(request);
 
142
    loader->load(request, false);
135
143
}
136
144
 
137
145
void WMLGoElement::preparePOSTRequest(ResourceRequest& request, bool inSameDeck, const String& cacheControl)