a testcase for a new khtml problem
Luciano Montanaro
mikelima at cirulla.net
Mon May 2 16:17:58 BST 2005
El Lunes 02 Mayo 2005 15:57, Allan Sandfeld Jensen escribió:
> On Monday 02 May 2005 11:20, Luciano Montanaro wrote:
> > As things are now, the code could as well have the IE compatible mode,
> > and the strict netscape compatible mode.
> >
> > I tested also what firefox does in strict mode: in this case the
> > document interface is completely removed.
> >
> > Couldn't we have document.all removed in strict mode and allowed in
> > quirks-non-netscape mode?
>
> No. We had many webpages that fail because they detects us as IE. We need
> either disable document.all completly or hide it.
>
> The right way would probably be to add a HiddenObject type to KJS that
> compares like undefined and acts like an object. (Harri, comments?)
That would work, I suppose. I was hesitant to propose such a change for
what is, in the end a workaround. Are there many objects that may need
to be conditionally hidden?
The document.all object could be disabled completely in strict mode with
something like the following:
Index: kjs_html.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/ecma/kjs_html.cpp,v
retrieving revision 1.281
diff -p -u -r1.281 kjs_html.cpp
--- kjs_html.cpp 3 Apr 2005 16:24:14 -0000 1.281
+++ kjs_html.cpp 2 May 2005 15:10:50 -0000
@@ -319,7 +319,8 @@ Value KJS::HTMLDocument::tryGet(ExecStat
}
case All:
// Disable document.all when we try to be Netscape-compatible
- if ( exec->interpreter()->compatMode() == Interpreter::NetscapeCompat )
+ if ( (exec->interpreter()->compatMode() == Interpreter::NetscapeCompat) ||
+ node.handle()->getDocument()->inStrictMode() )
return Undefined();
else
if ( exec->interpreter()->compatMode() == Interpreter::IECompat )
in this way document advertised as strict would not have access to the
document.all extension.
Luciano
>
> `Allan
--
Luciano Montanaro //
\\ //
\x/Un euro, un voto!
More information about the kfm-devel
mailing list