Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
KDE Libraries
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Unmaintained
KDE Libraries
Commits
d3397ea0
Commit
d3397ea0
authored
Oct 15, 2001
by
David Faure
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support for document.lastModified
svn path=/trunk/kdelibs/; revision=118024
parent
f6971c1a
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
62 additions
and
26 deletions
+62
-26
khtml/dom/html_document.cpp
khtml/dom/html_document.cpp
+6
-0
khtml/dom/html_document.h
khtml/dom/html_document.h
+7
-1
khtml/ecma/kjs_html.cpp
khtml/ecma/kjs_html.cpp
+4
-3
khtml/html/html_documentimpl.cpp
khtml/html/html_documentimpl.cpp
+7
-0
khtml/html/html_documentimpl.h
khtml/html/html_documentimpl.h
+1
-0
khtml/khtml_part.cpp
khtml/khtml_part.cpp
+12
-2
khtml/khtml_part.h
khtml/khtml_part.h
+25
-20
No files found.
khtml/dom/html_document.cpp
View file @
d3397ea0
...
...
@@ -128,6 +128,12 @@ DOMString HTMLDocument::domain() const
return
((
HTMLDocumentImpl
*
)
impl
)
->
domain
();
}
DOMString
HTMLDocument
::
lastModified
()
const
{
if
(
!
impl
)
return
DOMString
();
return
((
HTMLDocumentImpl
*
)
impl
)
->
lastModified
();
}
DOMString
HTMLDocument
::
URL
()
const
{
if
(
!
impl
)
return
DOMString
();
...
...
khtml/dom/html_document.h
View file @
d3397ea0
...
...
@@ -121,6 +121,12 @@ public:
*/
DOMString
domain
()
const
;
/**
* The date the document was last modified.
*
*/
DOMString
lastModified
()
const
;
/**
* The complete URI of the document.
*
...
...
@@ -289,7 +295,7 @@ public:
*
* converts the given (potentially relative) URL in a
* full-qualified one, using the baseURL / document URL for
* the missing parts.
* the missing parts.
*/
DOMString
completeURL
(
const
DOMString
&
url
)
const
;
};
...
...
khtml/ecma/kjs_html.cpp
View file @
d3397ea0
...
...
@@ -177,7 +177,8 @@ bool KJS::HTMLDocument::hasProperty(const UString &p, bool recursive) const
p
==
"body"
||
p
==
"location"
||
p
==
"images"
||
p
==
"applets"
||
p
==
"links"
||
p
==
"forms"
||
p
==
"anchors"
||
p
==
"all"
||
p
==
"cookie"
||
p
==
"open"
||
p
==
"close"
||
p
==
"write"
||
p
==
"writeln"
||
p
==
"getElementById"
||
p
==
"getElementsByName"
)
p
==
"writeln"
||
p
==
"getElementById"
||
p
==
"getElementsByName"
||
p
==
"lastModified"
)
return
true
;
if
(
!
static_cast
<
DOM
::
HTMLDocument
>
(
node
).
all
().
namedItem
(
p
.
string
()).
isNull
())
...
...
@@ -265,8 +266,8 @@ KJSO KJS::HTMLDocument::tryGet(const UString &p) const
// return Undefined();
// else if (p == "ids")
// return Undefined();
//
else if (p == "lastModified")
// return Undefined(
);
else
if
(
p
==
"lastModified"
)
return
String
(
doc
.
lastModified
()
);
else
if
(
p
==
"height"
)
return
Number
(
part
->
view
()
?
part
->
view
()
->
visibleWidth
()
:
0
);
else
if
(
p
==
"width"
)
...
...
khtml/html/html_documentimpl.cpp
View file @
d3397ea0
...
...
@@ -108,6 +108,13 @@ DOMString HTMLDocumentImpl::domain() const
return
KURL
(
URL
()
).
host
();
}
DOMString
HTMLDocumentImpl
::
lastModified
()
const
{
if
(
view
()
)
return
view
()
->
part
()
->
lastModified
();
return
DOMString
();
}
HTMLElementImpl
*
HTMLDocumentImpl
::
body
()
{
NodeImpl
*
de
=
documentElement
();
...
...
khtml/html/html_documentimpl.h
View file @
d3397ea0
...
...
@@ -56,6 +56,7 @@ public:
DOMString
referrer
()
const
;
DOMString
domain
()
const
;
DOMString
lastModified
()
const
;
HTMLElementImpl
*
body
();
void
setBody
(
HTMLElementImpl
*
_body
);
...
...
khtml/khtml_part.cpp
View file @
d3397ea0
...
...
@@ -268,6 +268,7 @@ public:
QString
m_kjsStatusBarText
;
QString
m_kjsDefaultStatusBarText
;
QString
m_lastModified
;
// QStrings for SSL metadata
// Note: When adding new variables don't forget to update ::saveState()/::restoreState()!
...
...
@@ -1306,6 +1307,10 @@ void KHTMLPart::slotData( KIO::Job* kio_job, const QByteArray &data )
}
d
->
m_bHTTPRefresh
=
true
;
}
// Support for http last-modified
d
->
m_lastModified
=
d
->
m_job
->
queryMetaData
(
"modified"
);
kdDebug
()
<<
"KHTMLPart::slotData metadata modified: "
<<
d
->
m_lastModified
<<
endl
;
}
KHTMLPageCache
::
self
()
->
addData
(
d
->
m_cacheId
,
data
);
...
...
@@ -1953,7 +1958,7 @@ bool KHTMLPart::findTextNext( const QString &str, bool forward, bool caseSensiti
{
DOMStringImpl
*
t
=
(
static_cast
<
TextImpl
*>
(
d
->
m_findNode
))
->
string
();
QConstString
s
(
t
->
s
,
t
->
l
);
int
matchLen
=
0
;
if
(
isRegExp
)
{
QRegExp
matcher
(
str
);
...
...
@@ -1966,7 +1971,7 @@ bool KHTMLPart::findTextNext( const QString &str, bool forward, bool caseSensiti
d
->
m_findPos
=
s
.
string
().
find
(
str
,
d
->
m_findPos
+
1
,
caseSensitive
);
matchLen
=
str
.
length
();
}
if
(
d
->
m_findPos
!=
-
1
)
{
int
x
=
0
,
y
=
0
;
...
...
@@ -3532,6 +3537,11 @@ QString KHTMLPart::referrer() const
return
d
->
m_referrer
;
}
QString
KHTMLPart
::
lastModified
()
const
{
return
d
->
m_lastModified
;
}
void
KHTMLPart
::
updateFontSize
(
int
add
)
{
resetFontSizes
();
...
...
khtml/khtml_part.h
View file @
d3397ea0
...
...
@@ -148,7 +148,7 @@ class KHTMLPart : public KParts::ReadOnlyPart
friend
class
KHTMLPartBrowserHostExtension
;
friend
class
HTMLTokenizer
;
friend
class
XMLTokenizer
;
Q_PROPERTY
(
bool
javaScriptEnabled
READ
jScriptEnabled
WRITE
setJScriptEnabled
)
Q_PROPERTY
(
bool
javaEnabled
READ
javaEnabled
WRITE
setJavaEnabled
)
Q_PROPERTY
(
bool
autoloadImages
READ
autoloadImages
WRITE
setAutoloadImages
)
...
...
@@ -341,16 +341,16 @@ public:
void
enablePlugins
(
bool
e
)
{
return
setPluginsEnabled
(
e
);
}
void
autoloadImages
(
bool
e
)
{
return
setAutoloadImages
(
e
);
}
void
enableMetaRefresh
(
bool
e
)
{
return
setMetaRefreshEnabled
(
e
);
}
KURL
baseURL
()
const
;
QString
baseTarget
()
const
;
KURL
completeURL
(
const
QString
&
url
);
#endif
#endif
/**
* schedules a redirection after delay seconds
*/
void
scheduleRedirection
(
int
delay
,
const
QString
&
url
);
void
scheduleRedirection
(
int
delay
,
const
QString
&
url
);
/**
* Clear the widget and prepares it for new content.
...
...
@@ -527,7 +527,7 @@ public:
/**
* Retrieve the cursor which is used when the cursor is on a link.
*/
QCursor
urlCursor
()
const
;
QCursor
urlCursor
()
const
;
/**
* Initiate a text search.
...
...
@@ -617,7 +617,7 @@ public:
/**
* @internal
*/
const
KHTMLSettings
*
settings
()
const
;
const
KHTMLSettings
*
settings
()
const
;
/**
* Retrieve a pointer to the parent KHTMLPart if the part is a frame
...
...
@@ -634,11 +634,11 @@ public:
*/
QStringList
frameNames
()
const
;
#if QT_VERSION < 300
#if QT_VERSION < 300
QList
<
KParts
::
ReadOnlyPart
>
frames
()
const
;
#else
QPtrList
<
KParts
::
ReadOnlyPart
>
frames
()
const
;
#endif
#endif
/**
* Find a frame by name. Returns 0L if frame can't be found.
...
...
@@ -687,6 +687,11 @@ public:
*/
QString
referrer
()
const
;
/**
* Last-modified date (in raw string format), if received in the [HTTP] headers.
*/
QString
lastModified
()
const
;
signals:
/**
* Emitted if the cursor is moved over an URL.
...
...
@@ -788,7 +793,7 @@ private slots:
/**
* @internal
*/
void
reparseConfiguration
();
void
reparseConfiguration
();
/**
* @internal
...
...
@@ -861,7 +866,7 @@ private slots:
void
slotLoadImages
();
/**
* @internal
* @internal
*/
void
submitFormAgain
();
...
...
@@ -928,8 +933,8 @@ private:
/**
* @internal
*/
bool
restoreURL
(
const
KURL
&
url
);
bool
restoreURL
(
const
KURL
&
url
);
/**
* @internal
*/
...
...
@@ -938,30 +943,30 @@ private:
/**
* @internal
*/
bool
openURLInFrame
(
const
KURL
&
url
,
const
KParts
::
URLArgs
&
urlArgs
);
bool
openURLInFrame
(
const
KURL
&
url
,
const
KParts
::
URLArgs
&
urlArgs
);
void
startAutoScroll
();
void
stopAutoScroll
();
void
overURL
(
const
QString
&
url
,
const
QString
&
target
,
bool
shiftPressed
=
false
);
void
updateFontSize
(
int
add
);
void
setFontBaseInternal
(
int
base
,
bool
absolute
);
void
updateFontSize
(
int
add
);
void
setFontBaseInternal
(
int
base
,
bool
absolute
);
/**
* @internal
*/
bool
processObjectRequest
(
khtml
::
ChildFrame
*
child
,
const
KURL
&
url
,
const
QString
&
mimetype
);
bool
processObjectRequest
(
khtml
::
ChildFrame
*
child
,
const
KURL
&
url
,
const
QString
&
mimetype
);
/**
* @internal
*/
void
submitForm
(
const
char
*
action
,
const
QString
&
url
,
const
QByteArray
&
formData
,
const
QString
&
target
,
const
QString
&
contentType
=
QString
::
null
,
const
QString
&
boundary
=
QString
::
null
);
const
QString
&
boundary
=
QString
::
null
);
/**
* @internal
*/
void
popupMenu
(
const
QString
&
url
);
void
popupMenu
(
const
QString
&
url
);
void
init
(
KHTMLView
*
view
,
GUIProfile
prof
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment