- various small cleanups
* khtml/xml/dom_docimpl.h: Added policyBaseURL and setPolicyBaseURL.
* khtml/html/html_documentimpl.h: Removed policyBaseURL and setPolicyBaseURL.
* khtml/xml/xml_tokenizer.h: Marked isWaitingForScripts const.
* khtml/xml/xml_tokenizer.cpp: (khtml::XMLTokenizer::isWaitingForScripts): Marked const.
* khtml/html/htmltokenizer.h: Marked isWaitingForScripts const.
* khtml/html/htmltokenizer.cpp:
(khtml::HTMLTokenizer::isWaitingForScripts): Marked const.
(khtml::HTMLTokenizer::setOnHold): Took out extraneous line of code.
* khtml/khtml_part.h: Removed docImpl function.
* khtml/khtml_part.cpp: Ditto.
* khtml/xml/dom_docimpl.cpp: (DocumentImpl::close): Simplified code that implements
the "redirect during onload" optimization. Now uses isScheduledLocationChangePending.
* kwq/KWQKHTMLPart.h: Removed now-unused _firstResponderAtMouseDownTime.
* kwq/KWQKHTMLPart.mm: Removed _firstResponderAtMouseDownTime (forgot to land this
part of the change last time, which is why the build broke).
(KWQKHTMLPart::updatePolicyBaseURL): Use xmlDocImpl instead of docImpl.
(KWQKHTMLPart::setPolicyBaseURL): Ditto.
(KWQKHTMLPart::keyEvent): Ditto.
(KWQKHTMLPart::dispatchCPPEvent): Ditto.
(KWQKHTMLPart::bodyBackgroundColor): Ditto.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@7996
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2004-11-12 Darin Adler <darin@apple.com>
+
+ Reviewed by Maciej.
+
+ - various small cleanups
+
+ * khtml/xml/dom_docimpl.h: Added policyBaseURL and setPolicyBaseURL.
+ * khtml/html/html_documentimpl.h: Removed policyBaseURL and setPolicyBaseURL.
+
+ * khtml/xml/xml_tokenizer.h: Marked isWaitingForScripts const.
+ * khtml/xml/xml_tokenizer.cpp: (khtml::XMLTokenizer::isWaitingForScripts): Marked const.
+ * khtml/html/htmltokenizer.h: Marked isWaitingForScripts const.
+ * khtml/html/htmltokenizer.cpp:
+ (khtml::HTMLTokenizer::isWaitingForScripts): Marked const.
+ (khtml::HTMLTokenizer::setOnHold): Took out extraneous line of code.
+
+ * khtml/khtml_part.h: Removed docImpl function.
+ * khtml/khtml_part.cpp: Ditto.
+
+ * khtml/xml/dom_docimpl.cpp: (DocumentImpl::close): Simplified code that implements
+ the "redirect during onload" optimization. Now uses isScheduledLocationChangePending.
+
+ * kwq/KWQKHTMLPart.h: Removed now-unused _firstResponderAtMouseDownTime.
+ * kwq/KWQKHTMLPart.mm: Removed _firstResponderAtMouseDownTime (forgot to land this
+ part of the change last time, which is why the build broke).
+ (KWQKHTMLPart::updatePolicyBaseURL): Use xmlDocImpl instead of docImpl.
+ (KWQKHTMLPart::setPolicyBaseURL): Ditto.
+ (KWQKHTMLPart::keyEvent): Ditto.
+ (KWQKHTMLPart::dispatchCPPEvent): Ditto.
+ (KWQKHTMLPart::bodyBackgroundColor): Ditto.
+
2004-11-12 Chris Blumenberg <cblu@apple.com>
<rdar://problem/3843312> REGRESSION: Tabbing into content area puts insertion point at start, should go to where it last was
*
* Copyright (C) 1999 Lars Knoll (knoll@kde.org)
* (C) 1999 Antti Koivisto (koivisto@kde.org)
- * Copyright (C) 2003 Apple Computer, Inc.
+ * Copyright (C) 2004 Apple Computer, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
DOMString lastModified() const;
DOMString cookie() const;
void setCookie( const DOMString &);
-#if APPLE_CHANGES
- DOMString policyBaseURL() const { return m_policyBaseURL; }
- void setPolicyBaseURL(const DOMString &s) { m_policyBaseURL = s; }
-#endif
void setBody(HTMLElementImpl *_body, int& exceptioncode);
// we actually store ints inside the pointer value itself; would use void *
// but that makes the template unhappy.
QDict<char> namedImageAndFormCounts;
-
-#if APPLE_CHANGES
- DOMString m_policyBaseURL;
-#endif
};
}; //namespace
}
}
-bool HTMLTokenizer::isWaitingForScripts()
+bool HTMLTokenizer::isWaitingForScripts() const
{
return loadingExtScript;
}
void HTMLTokenizer::setOnHold(bool _onHold)
{
- if (onHold == _onHold) return;
onHold = _onHold;
}
virtual void write(const TokenizerString &str, bool appendData);
virtual void finish();
- virtual void setOnHold(bool _onHold);
+ virtual void setOnHold(bool onHold);
+ virtual bool isWaitingForScripts() const;
virtual void stopped();
virtual bool processingData() const;
// from CachedObjectClient
void notifyFinished(CachedObject *finishedObj);
- virtual bool isWaitingForScripts();
protected:
// Internal buffers
///////////////////
return true;
}
-DOM::HTMLDocumentImpl *KHTMLPart::docImpl() const
-{
- if ( d && d->m_doc && d->m_doc->isHTMLDocument() )
- return static_cast<HTMLDocumentImpl*>(d->m_doc);
- return 0;
-}
-
DOM::DocumentImpl *KHTMLPart::xmlDocImpl() const
{
if ( d )
DOM::EventListener *createHTMLEventListener( QString code );
-#if APPLE_CHANGES
- public:
-#endif
-
- DOM::HTMLDocumentImpl *docImpl() const;
+public:
DOM::DocumentImpl *xmlDocImpl() const;
void replaceDocImpl(DOM::DocumentImpl* newDoc);
-#if APPLE_CHANGES
- private:
-#endif
+private:
khtml::ChildFrame *childFrame( const QObject *obj );
khtml::ChildFrame *recursiveFrameRequest( const KURL &url, const KParts::URLArgs &args, bool callParent = true );
// First fire the onload.
bool doload = !parsing() && m_tokenizer && !m_processingLoadEvent;
- bool wasNotRedirecting = !part() || part()->d->m_scheduledRedirection == noRedirectionScheduled || part()->d->m_scheduledRedirection == historyNavigationScheduled;
+ bool wasLocationChangePending = part() && part()->isScheduledLocationChangePending();
- m_processingLoadEvent = true;
if (body() && doload) {
+ m_processingLoadEvent = true;
// We have to clear the tokenizer, in case someone document.write()s from the
// onLoad event handler, as in Radar 3206524
delete m_tokenizer;
if (!ownerElement())
printf("onload fired at %d\n", elapsedTime());
#endif
+ m_processingLoadEvent = false;
}
- m_processingLoadEvent = false;
// Make sure both the initial layout and reflow happen after the onload
// fires. This will improve onload scores, and other browsers do it.
// If they wanna cheat, we can too. -dwh
- bool isRedirectingSoon = view() && view()->part()->d->m_scheduledRedirection != noRedirectionScheduled && view()->part()->d->m_scheduledRedirection != historyNavigationScheduled && view()->part()->d->m_delayRedirect == 0;
+ bool isLocationChangePending = part() && part()->isScheduledLocationChangePending();
- if (doload && wasNotRedirecting && isRedirectingSoon && m_startTime.elapsed() < cLayoutTimerDelay) {
+ if (doload && !wasLocationChangePending && isLocationChangePending && m_startTime.elapsed() < cLayoutTimerDelay) {
// Just bail out. During the onload we were shifted to another page.
// i-Bench does this. When this happens don't bother painting or laying out.
delete m_tokenizer;
DOMString domain() const;
void setDomain( const DOMString &newDomain, bool force = false ); // not part of the DOM
+
+ DOMString policyBaseURL() const { return m_policyBaseURL; }
+ void setPolicyBaseURL(const DOMString &s) { m_policyBaseURL = s; }
// The following implements the rule from HTML 4 for what valid names are.
// To get this right for all the XML cases, we probably have to improve this or move it
QMap<QString, HTMLMapElementImpl *> m_imageMapsByName;
+ DOMString m_policyBaseURL;
+
#if APPLE_CHANGES
public:
KWQSignal m_finishedParsing;
virtual void write(const TokenizerString &str, bool);
virtual void finish();
virtual void setOnHold(bool onHold);
- virtual bool isWaitingForScripts();
+ virtual bool isWaitingForScripts() const;
#ifdef KHTML_XSLT
void setTransformSource(DocumentImpl* doc);
}
}
-bool XMLTokenizer::isWaitingForScripts()
+bool XMLTokenizer::isWaitingForScripts() const
{
return m_cachedScript != 0;
}
virtual void write(const TokenizerString &str, bool appendData) = 0;
virtual void finish() = 0;
virtual void setOnHold(bool onHold) = 0;
- virtual bool isWaitingForScripts() = 0;
+ virtual bool isWaitingForScripts() const = 0;
virtual void stopped() {};
virtual bool processingData() const { return false; }
int _activationEventNumber;
static NSEvent *_currentEvent;
- static NSResponder *_firstResponderAtMouseDownTime;
KURL _submittedFormURL;
using KParts::URLArgs;
NSEvent *KWQKHTMLPart::_currentEvent = nil;
-NSResponder *KWQKHTMLPart::_firstResponderAtMouseDownTime = nil;
void KHTMLPart::completed()
{
void KWQKHTMLPart::updatePolicyBaseURL()
{
- // FIXME: docImpl() returns null for everything other than HTML documents; is this causing problems? -dwh
- if (parentPart() && parentPart()->docImpl()) {
- setPolicyBaseURL(parentPart()->docImpl()->policyBaseURL());
+ if (parentPart() && parentPart()->xmlDocImpl()) {
+ setPolicyBaseURL(parentPart()->xmlDocImpl()->policyBaseURL());
} else {
setPolicyBaseURL(m_url.url());
}
void KWQKHTMLPart::setPolicyBaseURL(const DOMString &s)
{
- // FIXME: XML documents will cause this to return null. docImpl() is
- // an HTMLdocument only. -dwh
- if (docImpl())
- docImpl()->setPolicyBaseURL(s);
+ if (xmlDocImpl())
+ xmlDocImpl()->setPolicyBaseURL(s);
ConstFrameIt end = d->m_frames.end();
for (ConstFrameIt it = d->m_frames.begin(); it != end; ++it) {
ReadOnlyPart *subpart = (*it).m_part;
return false;
}
NodeImpl *node = doc->focusNode();
- if (!node && docImpl()) {
- node = docImpl()->body();
- }
if (!node) {
- return false;
+ node = doc->body();
+ if (!node) {
+ return false;
+ }
}
if ([event type] == NSKeyDown) {
bool KWQKHTMLPart::dispatchCPPEvent(int eventId, KWQClipboard::AccessPolicy policy)
{
NodeImpl *target = d->m_selection.start().element();
- if (!target && docImpl()) {
- target = docImpl()->body();
+ if (!target && xmlDocImpl()) {
+ target = xmlDocImpl()->body();
}
if (!target) {
return true;
NSColor *KWQKHTMLPart::bodyBackgroundColor() const
{
- if (docImpl() && docImpl()->body() && docImpl()->body()->renderer()) {
- QColor bgColor = docImpl()->body()->renderer()->style()->backgroundColor();
+ if (xmlDocImpl() && xmlDocImpl()->body() && xmlDocImpl()->body()->renderer()) {
+ QColor bgColor = xmlDocImpl()->body()->renderer()->style()->backgroundColor();
if (bgColor.isValid()) {
return bgColor.getNSColor();
}