diff options
Diffstat (limited to 'WebCore/wml')
-rw-r--r-- | WebCore/wml/WMLAnchorElement.cpp | 4 | ||||
-rw-r--r-- | WebCore/wml/WMLCardElement.cpp | 2 | ||||
-rw-r--r-- | WebCore/wml/WMLDoElement.cpp | 13 | ||||
-rw-r--r-- | WebCore/wml/WMLDocument.cpp | 4 | ||||
-rw-r--r-- | WebCore/wml/WMLDocument.h | 4 | ||||
-rw-r--r-- | WebCore/wml/WMLGoElement.cpp | 18 | ||||
-rw-r--r-- | WebCore/wml/WMLGoElement.h | 2 | ||||
-rw-r--r-- | WebCore/wml/WMLIntrinsicEventHandler.cpp | 2 | ||||
-rw-r--r-- | WebCore/wml/WMLOptionElement.cpp | 4 | ||||
-rw-r--r-- | WebCore/wml/WMLPageState.cpp | 1 | ||||
-rw-r--r-- | WebCore/wml/WMLPageState.h | 4 | ||||
-rw-r--r-- | WebCore/wml/WMLPrevElement.cpp | 9 | ||||
-rw-r--r-- | WebCore/wml/WMLPrevElement.h | 2 | ||||
-rw-r--r-- | WebCore/wml/WMLRefreshElement.cpp | 11 | ||||
-rw-r--r-- | WebCore/wml/WMLRefreshElement.h | 2 | ||||
-rw-r--r-- | WebCore/wml/WMLSelectElement.cpp | 6 | ||||
-rw-r--r-- | WebCore/wml/WMLSelectElement.h | 3 | ||||
-rw-r--r-- | WebCore/wml/WMLTaskElement.h | 2 |
18 files changed, 39 insertions, 54 deletions
diff --git a/WebCore/wml/WMLAnchorElement.cpp b/WebCore/wml/WMLAnchorElement.cpp index b9b3f53..91526b9 100644 --- a/WebCore/wml/WMLAnchorElement.cpp +++ b/WebCore/wml/WMLAnchorElement.cpp @@ -54,7 +54,7 @@ void WMLAnchorElement::defaultEventHandler(Event* event) shouldHandle = static_cast<KeyboardEvent*>(event)->keyIdentifier() == "Enter"; if (shouldHandle && m_task) { - m_task->executeTask(); + m_task->executeTask(event); event->setDefaultHandled(); return; } @@ -71,7 +71,7 @@ void WMLAnchorElement::registerTask(WMLTaskElement* task) void WMLAnchorElement::deregisterTask(WMLTaskElement* task) { - ASSERT_UNUSED(task, m_task == task); + ASSERT(m_task == task); m_task = 0; } diff --git a/WebCore/wml/WMLCardElement.cpp b/WebCore/wml/WMLCardElement.cpp index 818b818..63240f3 100644 --- a/WebCore/wml/WMLCardElement.cpp +++ b/WebCore/wml/WMLCardElement.cpp @@ -339,6 +339,8 @@ WMLCardElement* WMLCardElement::determineActiveCard(Document* doc) // Update the document title doc->setTitle(activeCard->title()); + // Set the active activeCard in the WMLPageState object + pageState->setActiveCard(activeCard); return activeCard; } diff --git a/WebCore/wml/WMLDoElement.cpp b/WebCore/wml/WMLDoElement.cpp index 38ad5dd..34be6df 100644 --- a/WebCore/wml/WMLDoElement.cpp +++ b/WebCore/wml/WMLDoElement.cpp @@ -70,17 +70,14 @@ void WMLDoElement::defaultEventHandler(Event* event) if (m_type == "accept" || m_type == "options") { if (m_task) - m_task->executeTask(); + m_task->executeTask(event); } else if (m_type == "prev") { - ASSERT(document()->isWMLDocument()); - WMLDocument* document = static_cast<WMLDocument*>(this->document()); - - WMLPageState* pageState = wmlPageStateForDocument(document); + WMLPageState* pageState = wmlPageStateForDocument(document()); if (!pageState) return; - + // Stop the timer of the current card if it is active - if (WMLCardElement* card = document->activeCard()) { + if (WMLCardElement* card = pageState->activeCard()) { if (WMLTimerElement* eventTimer = card->eventTimer()) eventTimer->stop(); } @@ -175,7 +172,7 @@ void WMLDoElement::registerTask(WMLTaskElement* task) void WMLDoElement::deregisterTask(WMLTaskElement* task) { - ASSERT_UNUSED(task, m_task == task); + ASSERT(m_task == task); m_task = 0; } diff --git a/WebCore/wml/WMLDocument.cpp b/WebCore/wml/WMLDocument.cpp index ef0bfc8..f2287be 100644 --- a/WebCore/wml/WMLDocument.cpp +++ b/WebCore/wml/WMLDocument.cpp @@ -79,8 +79,10 @@ void WMLDocument::finishedParsing() return; } - if (m_activeCard) + if (m_activeCard) { m_activeCard->handleIntrinsicEventIfNeeded(); + m_activeCard = 0; + } } bool WMLDocument::initialize(bool aboutToFinishParsing) diff --git a/WebCore/wml/WMLDocument.h b/WebCore/wml/WMLDocument.h index 9053518..fb3e62e 100644 --- a/WebCore/wml/WMLDocument.h +++ b/WebCore/wml/WMLDocument.h @@ -34,7 +34,7 @@ class WMLDocument : public Document { public: static PassRefPtr<WMLDocument> create(Frame* frame) { - return adoptRef(new WMLDocument(frame)); + return new WMLDocument(frame); } virtual ~WMLDocument(); @@ -44,8 +44,6 @@ public: bool initialize(bool aboutToFinishParsing = false); - WMLCardElement* activeCard() const { return m_activeCard; } - private: WMLDocument(Frame*); WMLCardElement* m_activeCard; diff --git a/WebCore/wml/WMLGoElement.cpp b/WebCore/wml/WMLGoElement.cpp index 8076207..635302f 100644 --- a/WebCore/wml/WMLGoElement.cpp +++ b/WebCore/wml/WMLGoElement.cpp @@ -73,20 +73,18 @@ void WMLGoElement::parseMappedAttribute(MappedAttribute* attr) WMLTaskElement::parseMappedAttribute(attr); } -void WMLGoElement::executeTask() +void WMLGoElement::executeTask(Event*) { - ASSERT(document()->isWMLDocument()); - WMLDocument* document = static_cast<WMLDocument*>(this->document()); - - WMLPageState* pageState = wmlPageStateForDocument(document); + Document* doc = document(); + WMLPageState* pageState = wmlPageStateForDocument(doc); if (!pageState) return; - WMLCardElement* card = document->activeCard(); + WMLCardElement* card = pageState->activeCard(); if (!card) return; - Frame* frame = document->frame(); + Frame* frame = doc->frame(); if (!frame) return; @@ -99,7 +97,7 @@ void WMLGoElement::executeTask() return; // Substitute variables within target url attribute value - KURL url = document->completeURL(substituteVariableReferences(href, document, WMLVariableEscapingEscape)); + KURL url = doc->completeURL(substituteVariableReferences(href, doc, WMLVariableEscapingEscape)); if (url.isEmpty()) return; @@ -110,9 +108,9 @@ void WMLGoElement::executeTask() eventTimer->stop(); // FIXME: 'newcontext' handling not implemented for external cards - bool inSameDeck = document->url().path() == url.path(); + bool inSameDeck = doc->url().path() == url.path(); if (inSameDeck && url.hasFragmentIdentifier()) { - if (WMLCardElement* card = WMLCardElement::findNamedCardInDocument(document, url.fragmentIdentifier())) { + if (WMLCardElement* card = WMLCardElement::findNamedCardInDocument(doc, url.fragmentIdentifier())) { if (card->isNewContext()) pageState->reset(); } diff --git a/WebCore/wml/WMLGoElement.h b/WebCore/wml/WMLGoElement.h index 36c7be2..75c1858 100644 --- a/WebCore/wml/WMLGoElement.h +++ b/WebCore/wml/WMLGoElement.h @@ -39,7 +39,7 @@ public: void deregisterPostfieldElement(WMLPostfieldElement*); virtual void parseMappedAttribute(MappedAttribute*); - virtual void executeTask(); + virtual void executeTask(Event*); private: void preparePOSTRequest(ResourceRequest&, bool inSameDeck, const String& cacheControl); diff --git a/WebCore/wml/WMLIntrinsicEventHandler.cpp b/WebCore/wml/WMLIntrinsicEventHandler.cpp index 8e4c276..67364d9 100644 --- a/WebCore/wml/WMLIntrinsicEventHandler.cpp +++ b/WebCore/wml/WMLIntrinsicEventHandler.cpp @@ -48,7 +48,7 @@ void WMLIntrinsicEventHandler::triggerIntrinsicEvent(WMLIntrinsicEventType type) { RefPtr<WMLIntrinsicEvent> event = m_events.get(type); ASSERT(event->taskElement()); - event->taskElement()->executeTask(); + event->taskElement()->executeTask(0); } bool WMLIntrinsicEventHandler::hasIntrinsicEvent(WMLIntrinsicEventType type) const diff --git a/WebCore/wml/WMLOptionElement.cpp b/WebCore/wml/WMLOptionElement.cpp index 61fa762..764d3a1 100644 --- a/WebCore/wml/WMLOptionElement.cpp +++ b/WebCore/wml/WMLOptionElement.cpp @@ -158,10 +158,6 @@ RenderStyle* WMLOptionElement::nonRendererRenderStyle() const void WMLOptionElement::handleIntrinsicEventIfNeeded() { - WMLSelectElement* select = ownerSelectElement(this); - if (!select || !select->initialized()) - return; - WMLIntrinsicEventHandler* eventHandler = this->eventHandler(); if (!eventHandler) return; diff --git a/WebCore/wml/WMLPageState.cpp b/WebCore/wml/WMLPageState.cpp index 3e1863d..5f431bb 100644 --- a/WebCore/wml/WMLPageState.cpp +++ b/WebCore/wml/WMLPageState.cpp @@ -35,6 +35,7 @@ namespace WebCore { WMLPageState::WMLPageState(Page* page) : m_page(page) + , m_activeCard(0) , m_hasAccessControlData(false) { } diff --git a/WebCore/wml/WMLPageState.h b/WebCore/wml/WMLPageState.h index a5d8b23..de0af91 100644 --- a/WebCore/wml/WMLPageState.h +++ b/WebCore/wml/WMLPageState.h @@ -54,6 +54,9 @@ public: Page* page() const { return m_page; } + WMLCardElement* activeCard() const { return m_activeCard; } + void setActiveCard(WMLCardElement* card) { m_activeCard = card; } + // Deck access control bool processAccessControlData(const String& dmain, const String& path); void resetAccessControlData(); @@ -67,6 +70,7 @@ private: private: Page* m_page; WMLVariableMap m_variables; + WMLCardElement* m_activeCard; String m_accessDomain; String m_accessPath; bool m_hasAccessControlData; diff --git a/WebCore/wml/WMLPrevElement.cpp b/WebCore/wml/WMLPrevElement.cpp index 3d487ea..2688d03 100644 --- a/WebCore/wml/WMLPrevElement.cpp +++ b/WebCore/wml/WMLPrevElement.cpp @@ -40,16 +40,13 @@ WMLPrevElement::~WMLPrevElement() { } -void WMLPrevElement::executeTask() +void WMLPrevElement::executeTask(Event*) { - ASSERT(document()->isWMLDocument()); - WMLDocument* document = static_cast<WMLDocument*>(this->document()); - - WMLPageState* pageState = wmlPageStateForDocument(document); + WMLPageState* pageState = wmlPageStateForDocument(document()); if (!pageState) return; - WMLCardElement* card = document->activeCard(); + WMLCardElement* card = pageState->activeCard(); if (!card) return; diff --git a/WebCore/wml/WMLPrevElement.h b/WebCore/wml/WMLPrevElement.h index ce8596e..232c1b0 100644 --- a/WebCore/wml/WMLPrevElement.h +++ b/WebCore/wml/WMLPrevElement.h @@ -31,7 +31,7 @@ public: WMLPrevElement(const QualifiedName& tagName, Document*); virtual ~WMLPrevElement(); - virtual void executeTask(); + virtual void executeTask(Event*); }; } diff --git a/WebCore/wml/WMLRefreshElement.cpp b/WebCore/wml/WMLRefreshElement.cpp index bcf87ac..c05a2c9 100644 --- a/WebCore/wml/WMLRefreshElement.cpp +++ b/WebCore/wml/WMLRefreshElement.cpp @@ -41,16 +41,13 @@ WMLRefreshElement::~WMLRefreshElement() { } -void WMLRefreshElement::executeTask() +void WMLRefreshElement::executeTask(Event*) { - ASSERT(document()->isWMLDocument()); - WMLDocument* document = static_cast<WMLDocument*>(this->document()); - - WMLPageState* pageState = wmlPageStateForDocument(document); + WMLPageState* pageState = wmlPageStateForDocument(document()); if (!pageState) return; - WMLCardElement* card = document->activeCard(); + WMLCardElement* card = pageState->activeCard(); if (!card) return; @@ -65,7 +62,7 @@ void WMLRefreshElement::executeTask() storeVariableState(pageState); // Redisplay curremt card with current variable state - if (Frame* frame = document->frame()) { + if (Frame* frame = document()->frame()) { if (FrameLoader* loader = frame->loader()) loader->reload(); } diff --git a/WebCore/wml/WMLRefreshElement.h b/WebCore/wml/WMLRefreshElement.h index 43b71b5..7b1729e 100644 --- a/WebCore/wml/WMLRefreshElement.h +++ b/WebCore/wml/WMLRefreshElement.h @@ -31,7 +31,7 @@ public: WMLRefreshElement(const QualifiedName& tagName, Document*); virtual ~WMLRefreshElement(); - virtual void executeTask(); + virtual void executeTask(Event*); }; } diff --git a/WebCore/wml/WMLSelectElement.cpp b/WebCore/wml/WMLSelectElement.cpp index 03ca05a..2d03a3f 100644 --- a/WebCore/wml/WMLSelectElement.cpp +++ b/WebCore/wml/WMLSelectElement.cpp @@ -39,7 +39,6 @@ using namespace WMLNames; WMLSelectElement::WMLSelectElement(const QualifiedName& tagName, Document* document) : WMLFormControlElement(tagName, document) - , m_initialized(false) { } @@ -243,17 +242,14 @@ void WMLSelectElement::selectInitialOptions() // Spec: Step 1 - the default option index is determined using iname and ivalue calculateDefaultOptionIndices(); - if (m_defaultOptionIndices.isEmpty()) { - m_initialized = true; + if (m_defaultOptionIndices.isEmpty()) return; - } // Spec: Step 2 – initialise variables initializeVariables(); // Spec: Step 3 – pre-select option(s) specified by the default option index selectDefaultOptions(); - m_initialized = true; } void WMLSelectElement::insertedIntoTree(bool deep) diff --git a/WebCore/wml/WMLSelectElement.h b/WebCore/wml/WMLSelectElement.h index 5ab7da6..412a950 100644 --- a/WebCore/wml/WMLSelectElement.h +++ b/WebCore/wml/WMLSelectElement.h @@ -85,8 +85,6 @@ public: void scrollToSelection(); void selectInitialOptions(); - bool initialized() const { return m_initialized; } - private: virtual void insertedIntoTree(bool); @@ -106,7 +104,6 @@ private: String ivalue() const; SelectElementData m_data; - bool m_initialized; Vector<unsigned> m_defaultOptionIndices; }; diff --git a/WebCore/wml/WMLTaskElement.h b/WebCore/wml/WMLTaskElement.h index b813285..b5dab8c 100644 --- a/WebCore/wml/WMLTaskElement.h +++ b/WebCore/wml/WMLTaskElement.h @@ -40,7 +40,7 @@ public: virtual void insertedIntoDocument(); virtual void removedFromDocument(); - virtual void executeTask() = 0; + virtual void executeTask(Event*) = 0; void registerVariableSetter(WMLSetvarElement*); void deregisterVariableSetter(WMLSetvarElement*); |