Merge latest green inbound changeset and mozilla-central

This commit is contained in:
Ed Morley 2013-05-10 09:13:03 +01:00
Родитель 609e523ba7 9845580de2
Коммит cb2a0bbccd
255 изменённых файлов: 3687 добавлений и 1809 удалений

Просмотреть файл

@ -2198,10 +2198,10 @@ nsDocument::RemoveStyleSheetsFromStyleSets(nsCOMArray<nsIStyleSheet>& aSheets, n
}
nsresult
void
nsDocument::ResetStylesheetsToURI(nsIURI* aURI)
{
NS_PRECONDITION(aURI, "Null URI passed to ResetStylesheetsToURI");
MOZ_ASSERT(aURI);
mozAutoDocUpdate upd(this, UPDATE_STYLE, true);
RemoveDocStyleSheetsFromStyleSets();
@ -2257,8 +2257,6 @@ nsDocument::ResetStylesheetsToURI(nsIURI* aURI)
if (shell) {
FillStyleSet(shell->StyleSet());
}
return NS_OK;
}
static bool

Просмотреть файл

@ -1150,7 +1150,7 @@ protected:
void RemoveDocStyleSheetsFromStyleSets();
void RemoveStyleSheetsFromStyleSets(nsCOMArray<nsIStyleSheet>& aSheets,
nsStyleSet::sheetType aType);
nsresult ResetStylesheetsToURI(nsIURI* aURI);
void ResetStylesheetsToURI(nsIURI* aURI);
void FillStyleSet(nsStyleSet* aStyleSet);
// Return whether all the presshells for this document are safe to flush

Просмотреть файл

@ -224,32 +224,44 @@ NS_IMETHODIMP
nsDOMUIEvent::GetPageX(int32_t* aPageX)
{
NS_ENSURE_ARG_POINTER(aPageX);
if (mPrivateDataDuplicated) {
*aPageX = mPagePoint.x;
} else {
*aPageX = nsDOMEvent::GetPageCoords(mPresContext,
mEvent,
mEvent->refPoint,
mClientPoint).x;
}
*aPageX = PageX();
return NS_OK;
}
int32_t
nsDOMUIEvent::PageX() const
{
if (mPrivateDataDuplicated) {
return mPagePoint.x;
}
return nsDOMEvent::GetPageCoords(mPresContext,
mEvent,
mEvent->refPoint,
mClientPoint).x;
}
NS_IMETHODIMP
nsDOMUIEvent::GetPageY(int32_t* aPageY)
{
NS_ENSURE_ARG_POINTER(aPageY);
if (mPrivateDataDuplicated) {
*aPageY = mPagePoint.y;
} else {
*aPageY = nsDOMEvent::GetPageCoords(mPresContext,
mEvent,
mEvent->refPoint,
mClientPoint).y;
}
*aPageY = PageY();
return NS_OK;
}
int32_t
nsDOMUIEvent::PageY() const
{
if (mPrivateDataDuplicated) {
return mPagePoint.y;
}
return nsDOMEvent::GetPageCoords(mPresContext,
mEvent,
mEvent->refPoint,
mClientPoint).y;
}
NS_IMETHODIMP
nsDOMUIEvent::GetWhich(uint32_t* aWhich)
{
@ -299,22 +311,27 @@ NS_IMETHODIMP
nsDOMUIEvent::GetRangeOffset(int32_t* aRangeOffset)
{
NS_ENSURE_ARG_POINTER(aRangeOffset);
nsIFrame* targetFrame = nullptr;
if (mPresContext) {
targetFrame = mPresContext->EventStateManager()->GetEventTarget();
}
if (targetFrame) {
nsPoint pt = nsLayoutUtils::GetEventCoordinatesRelativeTo(mEvent,
targetFrame);
*aRangeOffset = targetFrame->GetContentOffsetsFromPoint(pt).offset;
return NS_OK;
}
*aRangeOffset = 0;
*aRangeOffset = RangeOffset();
return NS_OK;
}
int32_t
nsDOMUIEvent::RangeOffset() const
{
if (!mPresContext) {
return 0;
}
nsIFrame* targetFrame = mPresContext->EventStateManager()->GetEventTarget();
if (!targetFrame) {
return 0;
}
nsPoint pt = nsLayoutUtils::GetEventCoordinatesRelativeTo(mEvent,
targetFrame);
return targetFrame->GetContentOffsetsFromPoint(pt).offset;
}
NS_IMETHODIMP
nsDOMUIEvent::GetCancelBubble(bool* aCancelBubble)
{
@ -331,7 +348,7 @@ nsDOMUIEvent::SetCancelBubble(bool aCancelBubble)
}
nsIntPoint
nsDOMUIEvent::GetLayerPoint()
nsDOMUIEvent::GetLayerPoint() const
{
if (!mEvent ||
(mEvent->eventStructType != NS_MOUSE_EVENT &&
@ -373,18 +390,23 @@ nsDOMUIEvent::GetLayerY(int32_t* aLayerY)
NS_IMETHODIMP
nsDOMUIEvent::GetIsChar(bool* aIsChar)
{
switch(mEvent->eventStructType)
*aIsChar = IsChar();
return NS_OK;
}
bool
nsDOMUIEvent::IsChar() const
{
switch (mEvent->eventStructType)
{
case NS_KEY_EVENT:
*aIsChar = ((nsKeyEvent*)mEvent)->isChar;
return NS_OK;
return static_cast<nsKeyEvent*>(mEvent)->isChar;
case NS_TEXT_EVENT:
*aIsChar = ((nsTextEvent*)mEvent)->isChar;
return NS_OK;
return static_cast<nsKeyEvent*>(mEvent)->isChar;
default:
*aIsChar = false;
return NS_OK;
return false;
}
MOZ_NOT_REACHED("Switch handles all cases.");
}
NS_IMETHODIMP

Просмотреть файл

@ -98,40 +98,28 @@ public:
return mozilla::dom::UIEventBinding::Wrap(aCx, aScope, this);
}
already_AddRefed<nsIDOMWindow> GetView()
nsIDOMWindow* GetView() const
{
nsCOMPtr<nsIDOMWindow> view = mView;
return view.forget();
return mView;
}
int32_t Detail()
int32_t Detail() const
{
return mDetail;
}
int32_t LayerX()
int32_t LayerX() const
{
return GetLayerPoint().x;
}
int32_t LayerY()
int32_t LayerY() const
{
return GetLayerPoint().y;
}
int32_t PageX()
{
int32_t x;
GetPageX(&x);
return x;
}
int32_t PageY()
{
int32_t y;
GetPageY(&y);
return y;
}
int32_t PageX() const;
int32_t PageY() const;
virtual uint32_t Which()
{
@ -144,30 +132,20 @@ public:
already_AddRefed<nsINode> GetRangeParent();
int32_t RangeOffset()
{
int32_t offset;
GetRangeOffset(&offset);
return offset;
}
int32_t RangeOffset() const;
bool CancelBubble()
bool CancelBubble() const
{
return mEvent->mFlags.mPropagationStopped;
}
bool IsChar()
{
bool isChar;
GetIsChar(&isChar);
return isChar;
}
bool IsChar() const;
protected:
// Internal helper functions
nsIntPoint GetClientPoint();
nsIntPoint GetMovementPoint();
nsIntPoint GetLayerPoint();
nsIntPoint GetLayerPoint() const;
nsIntPoint GetPagePoint();
nsCOMPtr<nsIDOMWindow> mView;

Просмотреть файл

@ -1,5 +0,0 @@
<!doctype html>
<title>The hidden attribute</title>
<link rel=author title=Ms2ger href=ms2ger@gmail.com>
<link rel=help href=http://www.whatwg.org/html5/#the-hidden-attribute>
<p>This line should be visible.

Просмотреть файл

@ -1,6 +0,0 @@
<!doctype html>
<title>The hidden attribute</title>
<link rel=author title=Ms2ger href=ms2ger@gmail.com>
<link rel=help href=http://www.whatwg.org/html5/#the-hidden-attribute>
<p>This line should be visible.
<p hidden>This line should not be visible.

Просмотреть файл

@ -1,9 +0,0 @@
<!doctype html>
<title>The hidden attribute</title>
<link rel=author title=Ms2ger href=ms2ger@gmail.com>
<link rel=help href=http://www.whatwg.org/html5/#the-hidden-attribute>
<style>
p { display: none; }
[hidden] { display: block; }
</style>
<p hidden>This line should be visible.

Просмотреть файл

@ -1,8 +0,0 @@
<!doctype html>
<title>The hidden attribute</title>
<link rel=author title=Ms2ger href=ms2ger@gmail.com>
<link rel=help href=http://www.whatwg.org/html5/#the-hidden-attribute>
<style>
p { display: block; }
</style>
<p hidden>This line should be visible.

Просмотреть файл

@ -1,8 +0,0 @@
<!doctype html>
<title>The hidden attribute</title>
<link rel=author title=Ms2ger href=ms2ger@gmail.com>
<link rel=help href=http://www.whatwg.org/html5/#the-hidden-attribute>
<style>
p { display: block !important; }
</style>
<p hidden>This line should be visible.

Просмотреть файл

@ -24,14 +24,6 @@ skip-if(B2G) == 41464-1b.html 41464-1-ref.html
== 649134-1.html 649134-ref.html
skip-if(Android||B2G) == 649134-2.html 649134-2-ref.html
== hidden-1a.html hidden-1-ref.html
== hidden-1b.html hidden-1-ref.html
== hidden-1c.html hidden-1-ref.html
== hidden-1d.html hidden-1-ref.html
== hidden-1e.html hidden-1-ref.html
== hidden-1f.html hidden-1-ref.html
== hidden-1g.html hidden-1-ref.html
== hidden-2.svg hidden-2-ref.svg
== href-attr-change-restyles.html href-attr-change-restyles-ref.html
== figure.html figure-ref.html
== table-border-1.html table-border-1-ref.html

Просмотреть файл

@ -433,8 +433,7 @@ XULDocument::StartDocumentLoad(const char* aCommand, nsIChannel* aChannel,
NS_GetFinalChannelURI(aChannel, getter_AddRefs(mDocumentURI));
NS_ENSURE_SUCCESS(rv, rv);
rv = ResetStylesheetsToURI(mDocumentURI);
if (NS_FAILED(rv)) return rv;
ResetStylesheetsToURI(mDocumentURI);
RetrieveRelevantHeaders(aChannel);

Просмотреть файл

@ -1,2 +1,2 @@
https://dvcs.w3.org/hg/editing|editing
hg|https://dvcs.w3.org/hg/editing|editing

Просмотреть файл

@ -0,0 +1,16 @@
# THIS FILE IS AUTOGENERATED BY parseFailures.py - DO NOT EDIT
DEPTH := @DEPTH@
topsrcdir := @top_srcdir@
srcdir := @srcdir@
VPATH := @srcdir@
relativesrcdir := @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
MOCHITEST_FILES := \
test_window-null-names.html.json \
$(NULL)
include $(topsrcdir)/config/rules.mk

Просмотреть файл

@ -0,0 +1,4 @@
# THIS FILE IS AUTOGENERATED BY parseFailures.py - DO NOT EDIT
DIRS += [
]

Просмотреть файл

@ -0,0 +1,3 @@
{
"Named access with null characters": true
}

Просмотреть файл

@ -10,11 +10,16 @@ relativesrcdir := @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
MOCHITEST_FILES := \
test_document.body-getter-frameset-and-body.html.json \
test_document.body-getter.html.json \
test_document.title-03.html.json \
test_document.title-04.xhtml.json \
test_document.title-06.html.json \
test_document.title-07.html.json \
test_nameditem-02.html.json \
test_nameditem-03.html.json \
test_nameditem-04.html.json \
test_nameditem-05.html.json \
test_nameditem-06.html.json \
$(NULL)
include $(topsrcdir)/config/rules.mk

Просмотреть файл

@ -10,7 +10,7 @@ relativesrcdir := @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
MOCHITEST_FILES := \
test_doc.gEBN-newelements.html.json \
test_document.getElementsByName-newelements.html.json \
$(NULL)
include $(topsrcdir)/config/rules.mk

Просмотреть файл

@ -1,3 +0,0 @@
{
"document.body and framesets": true
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"Frameset followed by body inside the html element": true,
"Body followed by frameset inside a non-HTML html element": true,
"Frameset inside an x element followed by a frameset": true,
"Frameset as the root node": true,
"Body as the root node with a frameset child": true,
"Frameset as the root node with a body child": true
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"If the only named item is an iframe, the contentWindow should be returned.": true,
"If there are two iframes, a collection should be returned.": true,
"If there are an iframe and another element (iframe first), a collection should be returned.": true,
"If there are an iframe and another element (iframe last), a collection should be returned.": true,
"If an iframe has a name and a different id, it should be returned by its name.": true,
"An iframe whose name looks like an array index should work.": true
}

Просмотреть файл

@ -0,0 +1,6 @@
{
"If there are two applets, a collection should be returned. (name)": true,
"If there are two applets, a collection should be returned. (id)": true,
"If there are two applets, a collection should be returned. (name and id)": true,
"If there are two applets, a collection should be returned. (id and name)": true
}

Просмотреть файл

@ -0,0 +1,3 @@
{
"If there are two forms, a collection should be returned. (name)": true
}

Просмотреть файл

@ -0,0 +1,6 @@
{
"If there are two embeds, a collection should be returned. (name)": true,
"If there is one embed, it should not be returned (id)": true,
"If there are two embeds, nothing should be returned. (id)": true,
"A name shouldn't affect getting an embed by id": true
}

Просмотреть файл

@ -0,0 +1,5 @@
{
"If there are two imgs, a collection should be returned. (name)": true,
"If there is one img, it should not be returned (id)": true,
"If there are two imgs, nothing should be returned. (id)": true
}

Просмотреть файл

@ -1,4 +1,3 @@
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
# THIS FILE IS AUTOGENERATED BY parseFailures.py - DO NOT EDIT
DIRS += [

Просмотреть файл

@ -1,4 +1,3 @@
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
# THIS FILE IS AUTOGENERATED BY parseFailures.py - DO NOT EDIT
DIRS += [

Просмотреть файл

@ -4,7 +4,9 @@ DIRS += [
'html/domxpath',
'html/html/browsers/browsing-the-web/read-media',
'html/html/browsers/the-window-object',
'html/html/browsers/the-window-object/named-access-on-the-window-object',
'html/html/dom/documents/dta',
'html/html/dom/documents/dta/doc.gEBN',
'html/html/dom/elements/global-attributes',
'html/html/editing/the-hidden-attribute',
'html/html/obsolete/implreq/oeaaa',

Просмотреть файл

@ -1,11 +1,11 @@
git+ssh://git@github.com:w3c/web-platform-tests.git|html
git|git://github.com/w3c/web-platform-tests.git|html
domxpath
html/browsers/browsing-the-web/read-media
html/browsers/the-window-object
html/dom/documents/dta
html/dom/documents/dom-tree-accessors
html/dom/elements/global-attributes
html/editing/the-hidden-attribute
html/obsolete/implreq/oeaaa
html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis
html/semantics/document-metadata/the-title-element
html/semantics/forms/the-form-element
html/semantics/forms/the-option-element

Просмотреть файл

@ -1,4 +1,3 @@
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
# THIS FILE IS AUTOGENERATED BY importTestsuite.py - DO NOT EDIT
DIRS += [

Просмотреть файл

@ -0,0 +1,16 @@
# THIS FILE IS AUTOGENERATED BY importTestsuite.py - DO NOT EDIT
DEPTH := @DEPTH@
topsrcdir := @top_srcdir@
srcdir := @srcdir@
VPATH := @srcdir@
relativesrcdir := @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
MOCHITEST_FILES := \
test_window-null-names.html \
$(NULL)
include $(topsrcdir)/config/rules.mk

Просмотреть файл

@ -0,0 +1,4 @@
# THIS FILE IS AUTOGENERATED BY importTestsuite.py - DO NOT EDIT
DIRS += [
]

Просмотреть файл

@ -0,0 +1,20 @@
<!doctype html>
<meta charset=utf-8>
<title>Named access with null characters</title>
<link rel="author" title="Ms2ger" href="ms2ger@gmail.com">
<link rel="help" href="http://www.whatwg.org/html/#window">
<link rel="help" href="http://www.whatwg.org/html/#dom-window-nameditem">
<link rel="help" href="http://dev.w3.org/2006/webapi/WebIDL/#named-properties-object">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id=log></div>
<script>
test(function() {
var iframe = document.createElement("iframe")
iframe.name = "a\0b"
document.body.appendChild(iframe)
assert_equals(window["a\0b"], iframe.contentWindow)
assert_equals(window["ab"], undefined)
assert_equals(window["a"], undefined)
});
</script>

Просмотреть файл

@ -51,7 +51,7 @@ test(function() {
}, "constructor");
var t = async_test("Dynamic name")
var t2 = async_test("Ghost name")
window.onload = t.step_func(function() {
t.step(function() {
var iframe = document.getElementsByTagName("iframe")[0];
iframe.setAttribute("src", "data:text/html,<script>window.name='foo'<\/script>");
iframe.onload = function() {

Просмотреть файл

@ -10,9 +10,7 @@ relativesrcdir := @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
MOCHITEST_FILES := \
test_document.body-getter-body-and-frameset.html \
test_document.body-getter-foreign-frameset.html \
test_document.body-getter-frameset-and-body.html \
test_document.body-getter.html \
test_document.body-setter-01.html \
test_document.embeds-document.plugins-01.html \
test_Document.getElementsByClassName-null-undef.html \
@ -28,6 +26,11 @@ MOCHITEST_FILES := \
test_document.title-07.html \
test_Element.getElementsByClassName-null-undef.html \
test_nameditem-01.html \
test_nameditem-02.html \
test_nameditem-03.html \
test_nameditem-04.html \
test_nameditem-05.html \
test_nameditem-06.html \
$(NULL)
include $(topsrcdir)/config/rules.mk

Просмотреть файл

@ -10,19 +10,19 @@ relativesrcdir := @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
MOCHITEST_FILES := \
test_doc.gEBN-case.html \
test_doc.gEBN-case.xhtml \
test_doc.gEBN-id.html \
test_doc.gEBN-id.xhtml \
test_doc.gEBN-namespace.html \
test_doc.gEBN-namespace.xhtml \
test_doc.gEBN-newelements.html \
test_doc.gEBN-newelements.xhtml \
test_doc.gEBN-null-undef.html \
test_doc.gEBN-null-undef.xhtml \
test_doc.gEBN-param.html \
test_doc.gEBN-param.xhtml \
test_doc.gEBN-same.html \
test_document.getElementsByName-case.html \
test_document.getElementsByName-case.xhtml \
test_document.getElementsByName-id.html \
test_document.getElementsByName-id.xhtml \
test_document.getElementsByName-namespace.html \
test_document.getElementsByName-namespace.xhtml \
test_document.getElementsByName-newelements.html \
test_document.getElementsByName-newelements.xhtml \
test_document.getElementsByName-null-undef.html \
test_document.getElementsByName-null-undef.xhtml \
test_document.getElementsByName-param.html \
test_document.getElementsByName-param.xhtml \
test_document.getElementsByName-same.html \
$(NULL)
include $(topsrcdir)/config/rules.mk

Просмотреть файл

@ -1,5 +1,4 @@
# THIS FILE IS AUTOGENERATED BY importTestsuite.py - DO NOT EDIT
DIRS += [
'doc.gEBN',
]

Просмотреть файл

@ -1,18 +0,0 @@
<!DOCTYPE html>
<title>document.body and framesets</title>
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
<link rel="help" href="http://www.whatwg.org/html5/#dom-document-body">
<link rel="stylesheet" href="/resources/testharness.css">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
var b =
document.documentElement.appendChild(document.createElement("body"));
document.documentElement.appendChild(document.createElement("frameset"));
</script>
<div id="log"></div>
<script>
test(function() {
assert_equals(document.body, b);
});
</script>

Просмотреть файл

@ -1,17 +0,0 @@
<!DOCTYPE html>
<title>document.body and a frameset in a foreign namespace</title>
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
<link rel="help" href="http://www.whatwg.org/html5/#dom-document-body">
<link rel="stylesheet" href="/resources/testharness.css">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
document.documentElement.appendChild(
document.createElementNS("http://example.org/test", "frameset"));
</script>
<div id="log"></div>
<script>
test(function() {
assert_equals(document.body, document.getElementsByTagName("body")[0]);
});
</script>

Просмотреть файл

@ -1,18 +0,0 @@
<!DOCTYPE html>
<title>document.body and framesets</title>
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
<link rel="help" href="http://www.whatwg.org/html5/#dom-document-body">
<link rel="stylesheet" href="/resources/testharness.css">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
var f =
document.documentElement.appendChild(document.createElement("frameset"));
document.documentElement.appendChild(document.createElement("body"));
</script>
<div id="log"></div>
<script>
test(function() {
assert_equals(document.body, f);
});
</script>

Просмотреть файл

@ -0,0 +1,125 @@
<!DOCTYPE html>
<title>Document.body</title>
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
<link rel="help" href="http://www.whatwg.org/html/#dom-document-body">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
</script>
<div id="log"></div>
<script>
function createDocument() {
var doc = document.implementation.createHTMLDocument("");
doc.removeChild(doc.documentElement);
return doc;
}
test(function() {
var doc = createDocument();
assert_equals(doc.body, null);
}, "Childless document");
test(function() {
var doc = createDocument();
doc.appendChild(doc.createElement("html"));
assert_equals(doc.body, null);
}, "Childless html element");
test(function() {
var doc = createDocument();
var html = doc.appendChild(doc.createElement("html"));
var b =
html.appendChild(doc.createElement("body"));
html.appendChild(doc.createElement("frameset"));
assert_equals(doc.body, b);
}, "Body followed by frameset inside the html element");
test(function() {
var doc = createDocument();
var html = doc.appendChild(doc.createElement("html"));
var f =
html.appendChild(doc.createElement("frameset"));
html.appendChild(doc.createElement("body"));
assert_equals(doc.body, f);
}, "Frameset followed by body inside the html element");
test(function() {
var doc = createDocument();
var html =
doc.appendChild(doc.createElementNS("http://example.org/test", "html"));
var b =
html.appendChild(doc.createElement("body"));
html.appendChild(doc.createElement("frameset"));
assert_equals(doc.body, b);
}, "Body followed by frameset inside a non-HTML html element");
test(function() {
var doc = createDocument();
var html =
doc.appendChild(doc.createElementNS("http://example.org/test", "html"));
var f =
html.appendChild(doc.createElement("frameset"));
html.appendChild(doc.createElement("body"));
assert_equals(doc.body, f);
}, "Frameset followed by body inside a non-HTML html element");
test(function() {
var doc = createDocument();
var html = doc.appendChild(doc.createElement("html"));
html.appendChild(
doc.createElementNS("http://example.org/test", "body"));
var b = html.appendChild(doc.createElement("body"));
assert_equals(doc.body, b);
}, "Non-HTML body followed by body inside the html element");
test(function() {
var doc = createDocument();
var html = doc.appendChild(doc.createElement("html"));
html.appendChild(
doc.createElementNS("http://example.org/test", "frameset"));
var b = html.appendChild(doc.createElement("body"));
assert_equals(doc.body, b);
}, "Non-HTML frameset followed by body inside the html element");
test(function() {
var doc = createDocument();
var html = doc.appendChild(doc.createElement("html"));
var x = html.appendChild(doc.createElement("x"));
x.appendChild(doc.createElement("body"));
var body = html.appendChild(doc.createElement("body"));
assert_equals(doc.body, body);
}, "Body inside an x element followed by a body");
test(function() {
var doc = createDocument();
var html = doc.appendChild(doc.createElement("html"));
var x = html.appendChild(doc.createElement("x"));
x.appendChild(doc.createElement("frameset"));
var frameset = html.appendChild(doc.createElement("frameset"));
assert_equals(doc.body, frameset);
}, "Frameset inside an x element followed by a frameset");
// Root node is not a html element.
test(function() {
var doc = createDocument();
doc.appendChild(doc.createElement("body"));
assert_equals(doc.body, null);
}, "Body as the root node");
test(function() {
var doc = createDocument();
doc.appendChild(doc.createElement("frameset"));
assert_equals(doc.body, null);
}, "Frameset as the root node");
test(function() {
var doc = createDocument();
var body = doc.appendChild(doc.createElement("body"));
body.appendChild(doc.createElement("frameset"));
assert_equals(doc.body, null);
}, "Body as the root node with a frameset child");
test(function() {
var doc = createDocument();
var frameset = doc.appendChild(doc.createElement("frameset"));
frameset.appendChild(doc.createElement("body"));
assert_equals(doc.body, null);
}, "Frameset as the root node with a body child");
test(function() {
var doc = createDocument();
doc.appendChild(doc.createElementNS("http://example.org/test", "body"));
assert_equals(doc.body, null);
}, "Non-HTML body as the root node");
test(function() {
var doc = createDocument();
doc.appendChild(doc.createElementNS("http://example.org/test", "frameset"));
assert_equals(doc.body, null);
}, "Non-HTML frameset as the root node");
</script>

Просмотреть файл

@ -1,17 +1,27 @@
<!DOCTYPE html>
<title>Setting document.body to incorrect values</title>
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
<link rel="help" href="http://www.whatwg.org/html5/#dom-document-body">
<link rel="help" href="http://www.whatwg.org/html/#dom-document-body">
<link rel="help" href="http://dev.w3.org/2006/webapi/WebIDL/#es-interface">
<link rel="stylesheet" href="/resources/testharness.css">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
test(function() {
assert_throws(new TypeError(), function() { document.body = "text" })
}, "Should throw a TypeError.");
assert_throws(new TypeError(), function() {
document.body = "text"
})
}, "Should throw a TypeError when trying to set document.body to a string.")
test(function() {
assert_throws("HIERARCHY_REQUEST_ERR", function() { document.body = document.createElement("div") })
}, "Should throw a HIERARCHY_REQUEST_ERR.");
assert_throws("HierarchyRequestError", function() {
document.body = document.createElement("div")
})
}, "Should throw a HierarchyRequestError when trying to set document.body to a div element.")
test(function() {
var doc = document.implementation.createHTMLDocument("")
doc.removeChild(doc.documentElement)
assert_throws("HierarchyRequestError", function() {
doc.body = document.createElement("body")
})
}, "Should throw a HierarchyRequestError when trying to set document.body when there's no root element.")
</script>

Просмотреть файл

@ -1,8 +1,8 @@
<!DOCTYPE html>
<meta charset=utf-8>
<title>Named items: img id &amp; name</title>
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
<link rel="help" href="http://www.whatwg.org/html5/#dom-document-nameditem">
<link rel="stylesheet" href="/resources/testharness.css">
<link rel="help" href="http://www.whatwg.org/html/#dom-document-nameditem">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
@ -15,5 +15,5 @@ test(function() {
assert_equals(document['a'], document.getElementsByTagName("img")[0]);
assert_equals(document.b, document.getElementsByTagName("img")[0]);
assert_equals(document['b'], document.getElementsByTagName("img")[0]);
});
}, "img elements that have a name and id attribute, should be accessible by both values.");
</script>

Просмотреть файл

@ -0,0 +1,99 @@
<!DOCTYPE html>
<meta charset=utf-8>
<title>Named items: iframes</title>
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
<link rel="help" href="http://www.whatwg.org/html/#dom-document-nameditem">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<div id="test">
<iframe name="test1"></iframe>
<iframe name="test2"></iframe>
<iframe name="test2"></iframe>
<iframe name="test3"></iframe>
<img name="test3">
<img name="test4">
<iframe name="test4"></iframe>
<iframe id="test5"></iframe>
<iframe name="test6" id="fail"></iframe>
<iframe name="fail" id="test7"></iframe>
<iframe name="42"></iframe>
</div>
<script>
test(function() {
var iframe = document.getElementsByTagName("iframe")[0];
assert_equals(iframe.name, "test1");
assert_true("test1" in document, '"test1" in document should be true');
assert_equals(document.test1, iframe.contentWindow);
}, "If the only named item is an iframe, the contentWindow should be returned.");
test(function() {
var iframe1 = document.getElementsByTagName("iframe")[1];
assert_equals(iframe1.name, "test2");
var iframe2 = document.getElementsByTagName("iframe")[2];
assert_equals(iframe2.name, "test2");
assert_true("test2" in document, '"test2" in document should be true');
var collection = document.test2;
assert_class_string(collection, "HTMLCollection", "collection should be an HTMLCollection");
assert_array_equals(collection, [iframe1, iframe2]);
}, "If there are two iframes, a collection should be returned.");
test(function() {
var iframe = document.getElementsByTagName("iframe")[3];
assert_equals(iframe.name, "test3");
var img = document.getElementsByTagName("img")[0];
assert_equals(img.name, "test3");
assert_true("test3" in document, '"test3" in document should be true');
var collection = document.test3;
assert_class_string(collection, "HTMLCollection", "collection should be an HTMLCollection");
assert_array_equals(collection, [iframe, img]);
}, "If there are an iframe and another element (iframe first), a collection should be returned.");
test(function() {
var iframe = document.getElementsByTagName("iframe")[4];
assert_equals(iframe.name, "test4");
var img = document.getElementsByTagName("img")[1];
assert_equals(img.name, "test4");
assert_true("test4" in document, '"test4" in document should be true');
var collection = document.test4;
assert_class_string(collection, "HTMLCollection", "collection should be an HTMLCollection");
assert_array_equals(collection, [img, iframe]);
}, "If there are an iframe and another element (iframe last), a collection should be returned.");
test(function() {
assert_false("test5" in document, '"test5" in document should be false');
assert_equals(document.test5, undefined);
}, "If an iframe has an id and no name, it should not be returned.");
test(function() {
var iframe = document.getElementsByTagName("iframe")[6];
assert_equals(iframe.name, "test6");
assert_true("test6" in document, '"test6" in document should be true');
assert_equals(document.test6, iframe.contentWindow);
}, "If an iframe has a name and a different id, it should be returned by its name.");
test(function() {
assert_false("test7" in document, '"test7" in document should be false');
assert_equals(document.test7, undefined);
}, "If an iframe has an id and a different name, it should not be returned by its id.");
test(function() {
var iframe = document.getElementsByTagName("iframe")[8];
assert_equals(iframe.name, "42");
assert_true(42 in document, '42 in document should be true');
assert_equals(document[42], iframe.contentWindow);
}, "An iframe whose name looks like an array index should work.");
</script>

Просмотреть файл

@ -0,0 +1,110 @@
<!DOCTYPE html>
<meta charset=utf-8>
<title>Named items: applets</title>
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
<link rel="help" href="http://www.whatwg.org/html/#dom-document-nameditem">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<div id="test">
<applet name=test1></applet>
<applet name=test2></applet>
<applet name=test2></applet>
<applet id=test3></applet>
<applet id=test4></applet>
<applet id=test4></applet>
<applet name=test5></applet>
<applet id=test5></applet>
<applet id=test6></applet>
<applet name=test6></applet>
<applet id=test7 name=fail></applet>
<applet name=test8 id=fail></applet>
</div>
<script>
test(function() {
var applet = document.getElementsByTagName("applet")[0];
assert_equals(applet.name, "test1");
assert_true("test1" in document, '"test1" in document should be true');
assert_equals(document.test1, applet);
}, "If there is one applet, it should be returned (name)");
test(function() {
var applet1 = document.getElementsByTagName("applet")[1];
assert_equals(applet1.name, "test2");
var applet2 = document.getElementsByTagName("applet")[2];
assert_equals(applet2.name, "test2");
assert_true("test2" in document, '"test2" in document should be true');
var collection = document.test2;
assert_class_string(collection, "HTMLCollection", "collection should be an HTMLCollection");
assert_array_equals(collection, [applet1, applet2]);
}, "If there are two applets, a collection should be returned. (name)");
test(function() {
var applet = document.getElementsByTagName("applet")[3];
assert_equals(applet.id, "test3");
assert_true("test3" in document, '"test3" in document should be true');
assert_equals(document.test3, applet);
}, "If there is one applet, it should be returned (id)");
test(function() {
var applet1 = document.getElementsByTagName("applet")[4];
assert_equals(applet1.id, "test4");
var applet2 = document.getElementsByTagName("applet")[5];
assert_equals(applet2.id, "test4");
assert_true("test4" in document, '"test4" in document should be true');
var collection = document.test4;
assert_class_string(collection, "HTMLCollection", "collection should be an HTMLCollection");
assert_array_equals(collection, [applet1, applet2]);
}, "If there are two applets, a collection should be returned. (id)");
test(function() {
var applet1 = document.getElementsByTagName("applet")[6];
assert_equals(applet1.name, "test5");
var applet2 = document.getElementsByTagName("applet")[7];
assert_equals(applet2.id, "test5");
assert_true("test5" in document, '"test5" in document should be true');
var collection = document.test5;
assert_class_string(collection, "HTMLCollection", "collection should be an HTMLCollection");
assert_array_equals(collection, [applet1, applet2]);
}, "If there are two applets, a collection should be returned. (name and id)");
test(function() {
var applet1 = document.getElementsByTagName("applet")[8];
assert_equals(applet1.id, "test6");
var applet2 = document.getElementsByTagName("applet")[9];
assert_equals(applet2.name, "test6");
assert_true("test6" in document, '"test6" in document should be true');
var collection = document.test6;
assert_class_string(collection, "HTMLCollection", "collection should be an HTMLCollection");
assert_array_equals(collection, [applet1, applet2]);
}, "If there are two applets, a collection should be returned. (id and name)");
test(function() {
var applet = document.getElementsByTagName("applet")[10];
assert_equals(applet.id, "test7");
assert_true("test7" in document, '"test7" in document should be true');
assert_equals(document.test7, applet);
}, "A name shouldn't affect getting an applet by id");
test(function() {
var applet = document.getElementsByTagName("applet")[11];
assert_equals(applet.name, "test8");
assert_true("test8" in document, '"test8" in document should be true');
assert_equals(document.test8, applet);
}, "An id shouldn't affect getting an applet by name");
</script>

Просмотреть файл

@ -0,0 +1,104 @@
<!DOCTYPE html>
<meta charset=utf-8>
<title>Named items: forms</title>
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
<link rel="help" href="http://www.whatwg.org/html/#dom-document-nameditem">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<div id="test">
<form name=test1></form>
<form name=test2></form>
<form name=test2></form>
<form id=test3></form>
<form id=test4></form>
<form id=test4></form>
<form name=test5></form>
<form id=test5></form>
<form id=test6></form>
<form name=test6></form>
<form id=test7 name=fail></form>
<form name=test8 id=fail></form>
</div>
<script>
test(function() {
var form = document.getElementsByTagName("form")[0];
assert_equals(form.name, "test1");
assert_true("test1" in document, '"test1" in document should be true');
assert_equals(document.test1, form);
}, "If there is one form, it should be returned (name)");
test(function() {
var form1 = document.getElementsByTagName("form")[1];
assert_equals(form1.name, "test2");
var form2 = document.getElementsByTagName("form")[2];
assert_equals(form2.name, "test2");
assert_true("test2" in document, '"test2" in document should be true');
var collection = document.test2;
assert_class_string(collection, "HTMLCollection", "collection should be an HTMLCollection");
assert_array_equals(collection, [form1, form2]);
}, "If there are two forms, a collection should be returned. (name)");
test(function() {
var form = document.getElementsByTagName("form")[3];
assert_equals(form.id, "test3");
assert_false("test3" in document, '"test3" in document should be false');
assert_equals(document.test3, undefined);
}, "If there is one form, it should not be returned (id)");
test(function() {
var form1 = document.getElementsByTagName("form")[4];
assert_equals(form1.id, "test4");
var form2 = document.getElementsByTagName("form")[5];
assert_equals(form2.id, "test4");
assert_false("test4" in document, '"test4" in document should be false');
assert_equals(document.test4, undefined);
}, "If there are two forms, nothing should be returned. (id)");
test(function() {
var form1 = document.getElementsByTagName("form")[6];
assert_equals(form1.name, "test5");
var form2 = document.getElementsByTagName("form")[7];
assert_equals(form2.id, "test5");
assert_true("test5" in document, '"test5" in document should be true');
assert_equals(document.test5, form1);
}, "If there are two forms, a collection should be returned. (name and id)");
test(function() {
var form1 = document.getElementsByTagName("form")[8];
assert_equals(form1.id, "test6");
var form2 = document.getElementsByTagName("form")[9];
assert_equals(form2.name, "test6");
assert_true("test6" in document, '"test6" in document should be true');
assert_equals(document.test6, form2);
}, "If there are two forms, a collection should be returned. (id and name)");
test(function() {
var form = document.getElementsByTagName("form")[10];
assert_equals(form.id, "test7");
assert_false("test7" in document, '"test7" in document should be false');
assert_equals(document.test7, undefined);
}, "A name shouldn't affect getting an form by id");
test(function() {
var form = document.getElementsByTagName("form")[11];
assert_equals(form.name, "test8");
assert_true("test8" in document, '"test8" in document should be true');
assert_equals(document.test8, form);
}, "An id shouldn't affect getting an form by name");
</script>

Просмотреть файл

@ -0,0 +1,104 @@
<!DOCTYPE html>
<meta charset=utf-8>
<title>Named items: embeds</title>
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
<link rel="help" href="http://www.whatwg.org/html/#dom-document-nameditem">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<div id="test">
<embed name=test1></embed>
<embed name=test2></embed>
<embed name=test2></embed>
<embed id=test3></embed>
<embed id=test4></embed>
<embed id=test4></embed>
<embed name=test5></embed>
<embed id=test5></embed>
<embed id=test6></embed>
<embed name=test6></embed>
<embed id=test7 name=fail></embed>
<embed name=test8 id=fail></embed>
</div>
<script>
test(function() {
var embed = document.getElementsByTagName("embed")[0];
assert_equals(embed.name, "test1");
assert_true("test1" in document, '"test1" in document should be true');
assert_equals(document.test1, embed);
}, "If there is one embed, it should be returned (name)");
test(function() {
var embed1 = document.getElementsByTagName("embed")[1];
assert_equals(embed1.name, "test2");
var embed2 = document.getElementsByTagName("embed")[2];
assert_equals(embed2.name, "test2");
assert_true("test2" in document, '"test2" in document should be true');
var collection = document.test2;
assert_class_string(collection, "HTMLCollection", "collection should be an HTMLCollection");
assert_array_equals(collection, [embed1, embed2]);
}, "If there are two embeds, a collection should be returned. (name)");
test(function() {
var embed = document.getElementsByTagName("embed")[3];
assert_equals(embed.id, "test3");
assert_false("test3" in document, '"test3" in document should be false');
assert_equals(document.test3, undefined);
}, "If there is one embed, it should not be returned (id)");
test(function() {
var embed1 = document.getElementsByTagName("embed")[4];
assert_equals(embed1.id, "test4");
var embed2 = document.getElementsByTagName("embed")[5];
assert_equals(embed2.id, "test4");
assert_false("test4" in document, '"test4" in document should be false');
assert_equals(document.test4, undefined);
}, "If there are two embeds, nothing should be returned. (id)");
test(function() {
var embed1 = document.getElementsByTagName("embed")[6];
assert_equals(embed1.name, "test5");
var embed2 = document.getElementsByTagName("embed")[7];
assert_equals(embed2.id, "test5");
assert_true("test5" in document, '"test5" in document should be true');
assert_equals(document.test5, embed1);
}, "If there are two embeds, a collection should be returned. (name and id)");
test(function() {
var embed1 = document.getElementsByTagName("embed")[8];
assert_equals(embed1.id, "test6");
var embed2 = document.getElementsByTagName("embed")[9];
assert_equals(embed2.name, "test6");
assert_true("test6" in document, '"test6" in document should be true');
assert_equals(document.test6, embed2);
}, "If there are two embeds, a collection should be returned. (id and name)");
test(function() {
var embed = document.getElementsByTagName("embed")[10];
assert_equals(embed.id, "test7");
assert_false("test7" in document, '"test7" in document should be false');
assert_equals(document.test7, undefined);
}, "A name shouldn't affect getting an embed by id");
test(function() {
var embed = document.getElementsByTagName("embed")[11];
assert_equals(embed.name, "test8");
assert_true("test8" in document, '"test8" in document should be true');
assert_equals(document.test8, embed);
}, "An id shouldn't affect getting an embed by name");
</script>

Просмотреть файл

@ -0,0 +1,106 @@
<!DOCTYPE html>
<meta charset=utf-8>
<title>Named items: imgs</title>
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
<link rel="help" href="http://www.whatwg.org/html/#dom-document-nameditem">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<div id="test">
<img name=test1>
<img name=test2>
<img name=test2>
<img id=test3>
<img id=test4>
<img id=test4>
<img name=test5>
<img id=test5>
<img id=test6>
<img name=test6>
<img id=test7 name=fail>
<img name=test8 id=fail>
</div>
<script>
test(function() {
var img = document.getElementsByTagName("img")[0];
assert_equals(img.name, "test1");
assert_true("test1" in document, '"test1" in document should be true');
assert_equals(document.test1, img);
}, "If there is one img, it should be returned (name)");
test(function() {
var img1 = document.getElementsByTagName("img")[1];
assert_equals(img1.name, "test2");
var img2 = document.getElementsByTagName("img")[2];
assert_equals(img2.name, "test2");
assert_true("test2" in document, '"test2" in document should be true');
var collection = document.test2;
assert_class_string(collection, "HTMLCollection", "collection should be an HTMLCollection");
assert_array_equals(collection, [img1, img2]);
}, "If there are two imgs, a collection should be returned. (name)");
test(function() {
var img = document.getElementsByTagName("img")[3];
assert_equals(img.id, "test3");
assert_false("test3" in document, '"test3" in document should be false');
assert_equals(document.test3, undefined);
}, "If there is one img, it should not be returned (id)");
test(function() {
var img1 = document.getElementsByTagName("img")[4];
assert_equals(img1.id, "test4");
var img2 = document.getElementsByTagName("img")[5];
assert_equals(img2.id, "test4");
assert_false("test4" in document, '"test4" in document should be false');
var collection = document.test4;
assert_class_string(collection, "HTMLCollection", "collection should be an HTMLCollection");
assert_array_equals(collection, [img1, img2]);
}, "If there are two imgs, nothing should be returned. (id)");
test(function() {
var img1 = document.getElementsByTagName("img")[6];
assert_equals(img1.name, "test5");
var img2 = document.getElementsByTagName("img")[7];
assert_equals(img2.id, "test5");
assert_true("test5" in document, '"test5" in document should be true');
assert_equals(document.test5, img1);
}, "If there are two imgs, the one with a name should be returned. (name and id)");
test(function() {
var img1 = document.getElementsByTagName("img")[8];
assert_equals(img1.id, "test6");
var img2 = document.getElementsByTagName("img")[9];
assert_equals(img2.name, "test6");
assert_true("test6" in document, '"test6" in document should be true');
assert_equals(document.test6, img2);
}, "If there are two imgs, the one with a name should be returned. (id and name)");
test(function() {
var img = document.getElementsByTagName("img")[10];
assert_equals(img.id, "test7");
assert_true("test7" in document, '"test7" in document should be true');
assert_equals(document.test7, img);
}, "A name should affect getting an img by id");
test(function() {
var img = document.getElementsByTagName("img")[11];
assert_equals(img.name, "test8");
assert_true("test8" in document, '"test8" in document should be true');
assert_equals(document.test8, img);
}, "An id shouldn't affect getting an img by name");
</script>

Просмотреть файл

@ -10,12 +10,9 @@
<link rel="help" href="http://dev.w3.org/html5/spec/Overview.html#the-dir-attribute" />
<meta name="assert" content="
When dir='auto', the direction is set according to the first strong character
of the text.
of the text while ignoring bdi elements.
In this test, it is the Latin letter A, thus the direction must be
resolved as LTR.
The element with dir='auto' contains a bdi element whose first
strong character is RTL. This is ignored by the containing
element, but causes the bdi itself to be resolved as RTL" />
resolved as LTR." />
<style>
input, textarea {
font-size:1em;
@ -46,18 +43,18 @@
</div>
<div class="test">
<div dir="ltr">
<div dir="ltr"><bdi dir="rtl">123&#x05D3;&#x05D4;&#x05D5;</bdi>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
<div dir="ltr"><bdi>&#x05D3;&#x05D4;&#x05D5;</bdi>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
</div>
<div dir="rtl">
<div dir="ltr"><bdi dir="rtl">123&#x05D3;&#x05D4;&#x05D5;</bdi>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
<div dir="ltr"><bdi>&#x05D3;&#x05D4;&#x05D5;</bdi>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
</div>
</div>
<div class="ref">
<div dir="ltr">
<div dir="ltr"><bdi dir="rtl">123&#x05D3;&#x05D4;&#x05D5;</bdi>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
<div dir="ltr"><bdi>&#x05D3;&#x05D4;&#x05D5;</bdi>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
</div>
<div dir="rtl">
<div dir="ltr"><bdi dir="rtl">123&#x05D3;&#x05D4;&#x05D5;</bdi>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
<div dir="ltr"><bdi>&#x05D3;&#x05D4;&#x05D5;</bdi>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
</div>
</div>
</body>

Просмотреть файл

@ -10,12 +10,9 @@
<link rel="help" href="http://dev.w3.org/html5/spec/Overview.html#the-dir-attribute" />
<meta name="assert" content="
When dir='auto', the direction is set according to the first strong character
of the text.
of the text while ignoring bdi elements.
In this test, it is the Latin letter A, thus the direction must be
resolved as LTR.
The element with dir='auto' contains a bdi element whose first
strong character is RTL. This is ignored by the containing
element, but causes the bdi itself to be resolved as RTL." />
resolved as LTR." />
<style>
input, textarea {
font-size:1em;
@ -46,18 +43,18 @@
</div>
<div class="test">
<div dir="ltr">
<div dir="auto"><bdi>123&#x05D3;&#x05D4;&#x05D5;</bdi>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
<div dir="auto"><bdi>&#x05D3;&#x05D4;&#x05D5;</bdi>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
</div>
<div dir="rtl">
<div dir="auto"><bdi>123&#x05D3;&#x05D4;&#x05D5;</bdi>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
<div dir="auto"><bdi>&#x05D3;&#x05D4;&#x05D5;</bdi>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
</div>
</div>
<div class="ref">
<div dir="ltr">
<div dir="ltr"><bdi dir="rtl">123&#x05D3;&#x05D4;&#x05D5;</bdi>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
<div dir="ltr"><bdi>&#x05D3;&#x05D4;&#x05D5;</bdi>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
</div>
<div dir="rtl">
<div dir="ltr"><bdi dir="rtl">123&#x05D3;&#x05D4;&#x05D5;</bdi>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
<div dir="ltr"><bdi>&#x05D3;&#x05D4;&#x05D5;</bdi>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
</div>
</div>
</body>

Просмотреть файл

@ -10,12 +10,9 @@
<link rel="help" href="http://dev.w3.org/html5/spec/Overview.html#the-dir-attribute" />
<meta name="assert" content="
When dir='auto', the direction is set according to the first strong character
of the text.
of the text while ignoring bdi elements.
In this test, it is the Hebrew letter Alef, thus the direction must be
resolved as RTL.
The element with dir='auto' contains a bdi element whose first
strong character is LTR. This is ignored by the containing
element, but causes the bdi itself to be resolved as LTR." />
resolved as RTL." />
<style>
input, textarea {
font-size:1em;
@ -43,18 +40,18 @@
</div>
<div class="test">
<div dir="ltr">
<div dir="rtl"><bdi dir="ltr">123DEF</bdi>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
<div dir="rtl"><bdi>DEF</bdi>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
</div>
<div dir="rtl">
<div dir="rtl"><bdi dir="ltr">123DEF</bdi>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
<div dir="rtl"><bdi>DEF</bdi>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
</div>
</div>
<div class="ref">
<div dir="ltr">
<div dir="rtl"><bdi dir="ltr">123DEF</bdi>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
<div dir="rtl"><bdi>DEF</bdi>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
</div>
<div dir="rtl">
<div dir="rtl"><bdi dir="ltr">123DEF</bdi>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
<div dir="rtl"><bdi>DEF</bdi>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
</div>
</div>
</body>

Просмотреть файл

@ -10,12 +10,9 @@
<link rel="help" href="http://dev.w3.org/html5/spec/Overview.html#the-dir-attribute" />
<meta name="assert" content="
When dir='auto', the direction is set according to the first strong character
of the text.
of the text while ignoring bdi elements.
In this test, it is the Hebrew letter Alef, thus the direction must be
resolved as RTL.
The element with dir='auto' contains a bdi element whose first
strong character is LTR. This is ignored by the containing
element, but causes the bdi itself to be resolved as LTR." />
resolved as RTL." />
<style>
input, textarea {
font-size:1em;
@ -43,18 +40,18 @@
</div>
<div class="test">
<div dir="ltr">
<div dir="auto"><bdi>123DEF</bdi>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
<div dir="auto"><bdi>DEF</bdi>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
</div>
<div dir="rtl">
<div dir="auto"><bdi>123DEF</bdi>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
<div dir="auto"><bdi>DEF</bdi>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
</div>
</div>
<div class="ref">
<div dir="ltr">
<div dir="rtl"><bdi dir="ltr">123DEF</bdi>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
<div dir="rtl"><bdi>DEF</bdi>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
</div>
<div dir="rtl">
<div dir="rtl"><bdi dir="ltr">123DEF</bdi>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
<div dir="rtl"><bdi>DEF</bdi>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
</div>
</div>
</body>

Просмотреть файл

@ -0,0 +1,61 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>HTML Test: dir=auto, start with dir, then L</title>
<link rel="reference" href="dir_auto-contained-dir-L-ref.html" />
<link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
<link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
<link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
<link rel="help" href="http://dev.w3.org/html5/spec/Overview.html#the-dir-attribute" />
<meta name="assert" content="
When dir='auto', the direction is set according to the first strong character
of the text while ignoring contained elements with an explicit dir of their own.
In this test, it is the Latin letter A, thus the direction must be
resolved as LTR." />
<style>
input, textarea {
font-size:1em;
}
body {
font-size:2em;
}
.test, .ref {
border: medium solid gray;
width: 400px;
margin: 20px;
}
.comments {
display: none;
}
</style>
</head>
<body>
<div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
<div class="comments">
Key to entities used below:
&#x05D0; - The Hebrew letter Alef (strongly RTL).
&#x05D1; - The Hebrew letter Bet (strongly RTL).
&#x05D2; - The Hebrew letter Gimel (strongly RTL).
&#x05D3; - The Hebrew letter Dalet (strongly RTL).
&#x05D4; - The Hebrew letter He (strongly RTL).
&#x05D5; - The Hebrew letter Vav (strongly RTL).
</div>
<div class="test">
<div dir="ltr">
<div dir="ltr"><p dir="rtl">&#x05D3;&#x05D4;&#x05D5;</p>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
</div>
<div dir="rtl">
<div dir="ltr"><p dir="rtl">&#x05D3;&#x05D4;&#x05D5;</p>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
</div>
</div>
<div class="ref">
<div dir="ltr">
<div dir="ltr"><p dir="rtl">&#x05D3;&#x05D4;&#x05D5;</p>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
</div>
<div dir="rtl">
<div dir="ltr"><p dir="rtl">&#x05D3;&#x05D4;&#x05D5;</p>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
</div>
</div>
</body>
</html>

Просмотреть файл

@ -0,0 +1,58 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>HTML Test: dir=auto, start with dir, then R</title>
<link rel="reference" href="dir_auto-contained-dir-R-ref.html" />
<link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
<link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
<link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
<link rel="help" href="http://dev.w3.org/html5/spec/Overview.html#the-dir-attribute" />
<meta name="assert" content="
When dir='auto', the direction is set according to the first strong character
of the text while ignoring contained elements with an explicit dir of their own.
In this test, it is the Hebrew letter Alef, thus the direction must be
resolved as RTL." />
<style>
input, textarea {
font-size:1em;
}
body {
font-size:2em;
}
.test, .ref {
border: medium solid gray;
width: 400px;
margin: 20px;
}
.comments {
display: none;
}
</style>
</head>
<body>
<div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
<div class="comments">
Key to entities used below:
&#x05D0; - The Hebrew letter Alef (strongly RTL).
&#x05D1; - The Hebrew letter Bet (strongly RTL).
&#x05D2; - The Hebrew letter Gimel (strongly RTL).
</div>
<div class="test">
<div dir="ltr">
<div dir="rtl"><p dir="ltr">DEF</p>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
</div>
<div dir="rtl">
<div dir="rtl"><p dir="ltr">DEF</p>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
</div>
</div>
<div class="ref">
<div dir="ltr">
<div dir="rtl"><p dir="ltr">DEF</p>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
</div>
<div dir="rtl">
<div dir="rtl"><p dir="ltr">DEF</p>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
</div>
</div>
</body>
</html>

Просмотреть файл

@ -40,30 +40,18 @@
</div>
<div class="test">
<div dir="ltr">
<div dir="ltr"><style>input, textarea {
font-size:1em;
}
body {color:red;}</style>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
<div dir="ltr"><style>body {color:black;}</style>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
</div>
<div dir="rtl">
<div dir="ltr"><style>input, textarea {
font-size:1em;
}
body {color:red;}</style>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
<div dir="ltr"><style>body {color:black;}</style>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
</div>
</div>
<div class="ref">
<div dir="ltr">
<div dir="ltr"><style>input, textarea {
font-size:1em;
}
body {color:red;}</style>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
<div dir="ltr"><style>body {color:black;}</style>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
</div>
<div dir="rtl">
<div dir="ltr"><style>input, textarea {
font-size:1em;
}
body {color:red;}</style>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
<div dir="ltr"><style>body {color:black;}</style>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
</div>
</div>
</body>

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше