Page Menu
Home
Code
Search
Configure Global Search
Log In
Files
F948323
html_rtl.html
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Subscribers
None
html_rtl.html
View Options
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<
html
dir
=
"rtl"
>
<
head
>
<
title
>
testing Core HTML/DOM/CSS/Style utils
</
title
>
<
style
type
=
"text/css"
>
@
import
"../../resources/dojo.css"
;
</
style
>
<
script
type
=
"text/javascript"
src
=
"../../dojo.js"
djConfig
=
"isDebug: true"
></
script
>
<
script
type
=
"text/javascript"
>
dojo
.
require
(
"doh.runner"
);
dojo
.
addOnLoad
(
function
(){
doh
.
register
(
"t"
,
[
function
coordsWithVertScrollbar
(
t
){
// show vertical scrollbar
dojo
.
byId
(
"rect_vert"
).
style
.
display
=
""
;
try
{
t
.
is
(
100
,
dojo
.
coords
(
'rect100'
).
x
);
}
finally
{
dojo
.
byId
(
"rect_vert"
).
style
.
display
=
"none"
;
}
},
function
coordsWithHorzScrollbar
(
t
){
// show horizonal scrollbar & scroll a bit left
dojo
.
byId
(
"rect_horz"
).
style
.
display
=
""
;
scrollBy
(
-
50
,
0
);
try
{
t
.
is
(
100
,
dojo
.
coords
(
'rect100'
,
true
).
x
);
}
finally
{
dojo
.
byId
(
"rect_horz"
).
style
.
display
=
"none"
;
}
},
function
eventClientXY
(
t
){
// IE only test
if
(
dojo
.
isIE
){
// show vertical scrollbar
dojo
.
byId
(
"rect_vert"
).
style
.
display
=
""
;
var
rect
=
dojo
.
byId
(
"rect100"
);
var
assertException
=
null
;
function
rect_onclick
(
e
){
// move the rectangle to the mouse point
rect
.
style
.
left
=
e
.
pageX
+
"px"
;
rect
.
style
.
top
=
e
.
pageY
+
"px"
;
window
.
alert
(
"Do NOT move your mouse!!!\n\n"
+
"The black rectangle's top-left point should be under the mouse point.\n\n"
+
"If not, you will see a failure in the test report later.\n\n"
+
"Now press the space bar, but do NOT move your mouse."
);
rect
.
fireEvent
(
'ondblclick'
);
}
function
rect_ondblclick
(){
// test if the rectangle is really under the mouse point
try
{
t
.
is
(
0
,
event
.
offsetX
);
t
.
is
(
0
,
event
.
offsetY
);
}
catch
(
e
){
// allow the exception in a event handler go to the event firer
assertException
=
e
;
}
}
dojo
.
connect
(
rect
,
"onclick"
,
null
,
rect_onclick
);
dojo
.
connect
(
rect
,
"ondblclick"
,
null
,
rect_ondblclick
);
window
.
alert
(
"Move the mouse to anywhere in this page, and then press the space bar."
);
rect
.
fireEvent
(
'onclick'
);
if
(
assertException
!=
null
){
throw
assertException
;
}
}
}
]
);
doh
.
run
();
});
</
script
>
<
style
type
=
"text/css"
>
#
rect100
{
background-color
:
black
;
color
:
white
;
position
:
absolute
;
left
:
100
px
;
top
:
100
px
;
width
:
100
px
;
height
:
100
px
;
border
:
0
px
;
padding
:
0
px
;
margin
:
0
px
;
overflow
:
hidden
;
}
</
style
>
</
head
>
<
body
>
<
h1
>
testing Core HTML/DOM/CSS/Style utils
</
h1
>
<
div
id
=
"rect100"
>
100px rect, abs,
mouse point is at top-left after the test "eventClientXY"
</
div
>
<
div
id
=
"rect_vert"
style
=
"height:1600px;display:none"
>
show vertical scrollbar
</
div
>
<
div
id
=
"rect_horz"
style
=
"width:1600px;display:none"
>
show horizonal scrollbar
</
div
>
</
body
>
</
html
>
File Metadata
Details
Attached
Mime Type
text/html
Expires
Sat, Apr 26, 15:49 (2 m, 34 s ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27235
Default Alt Text
html_rtl.html (3 KB)
Attached To
rZEDHG ZedLegacy
Event Timeline
Log In to Comment