зеркало из https://github.com/mozilla/gecko-dev.git
Merge mozilla-central into cedar
This commit is contained in:
Коммит
dcc96580e7
|
@ -100,6 +100,7 @@
|
|||
#endif
|
||||
|
||||
#include "mozilla/FunctionTimer.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsAccessibilityService
|
||||
|
@ -275,7 +276,7 @@ nsAccessibilityService::CreateHTMLImageAccessible(nsIContent* aContent,
|
|||
if (!mapElmName.IsEmpty()) {
|
||||
if (mapElmName.CharAt(0) == '#')
|
||||
mapElmName.Cut(0,1);
|
||||
mapElm = htmlDoc->GetImageMap(mapElmName);
|
||||
mapElm = do_QueryInterface(htmlDoc->GetImageMap(mapElmName));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -35,8 +35,8 @@
|
|||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef _nsIContentSerializer_h__
|
||||
#define _nsIContentSerializer_h__
|
||||
#ifndef nsIContentSerializer_h
|
||||
#define nsIContentSerializer_h
|
||||
|
||||
#include "nsISupports.h"
|
||||
|
||||
|
@ -44,7 +44,11 @@ class nsIContent;
|
|||
class nsIDocument;
|
||||
class nsAString;
|
||||
|
||||
/* starting interface: nsIContentSerializer */
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
class Element;
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
#define NS_ICONTENTSERIALIZER_IID \
|
||||
{ 0xb1ee32f2, 0xb8c4, 0x49b9, \
|
||||
|
@ -77,11 +81,11 @@ class nsIContentSerializer : public nsISupports {
|
|||
NS_IMETHOD AppendDoctype(nsIContent *aDoctype,
|
||||
nsAString& aStr) = 0;
|
||||
|
||||
NS_IMETHOD AppendElementStart(nsIContent *aElement,
|
||||
nsIContent *aOriginalElement,
|
||||
NS_IMETHOD AppendElementStart(mozilla::dom::Element* aElement,
|
||||
mozilla::dom::Element* aOriginalElement,
|
||||
nsAString& aStr) = 0;
|
||||
|
||||
NS_IMETHOD AppendElementEnd(nsIContent *aElement,
|
||||
NS_IMETHOD AppendElementEnd(mozilla::dom::Element* aElement,
|
||||
nsAString& aStr) = 0;
|
||||
|
||||
NS_IMETHOD Flush(nsAString& aStr) = 0;
|
||||
|
@ -100,4 +104,4 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsIContentSerializer, NS_ICONTENTSERIALIZER_IID)
|
|||
#define NS_CONTENTSERIALIZER_CONTRACTID_PREFIX \
|
||||
"@mozilla.org/layout/contentserializer;1?mimetype="
|
||||
|
||||
#endif /* __gen_nsIContentSerializer_h__ */
|
||||
#endif /* nsIContentSerializer_h */
|
||||
|
|
|
@ -151,6 +151,20 @@ CPPSRCS = \
|
|||
ThirdPartyUtil.cpp \
|
||||
$(NULL)
|
||||
|
||||
# Are we targeting x86-32 or x86-64? If so, we want to include SSE2 code for
|
||||
# nsTextFragment.cpp
|
||||
ifneq (,$(INTEL_ARCHITECTURE))
|
||||
|
||||
CPPSRCS += nsTextFragmentSSE2.cpp
|
||||
|
||||
# gcc requires -msse2 for this file since it uses SSE2 intrinsics. (See bug
|
||||
# 585538 comment 12.)
|
||||
ifdef GNU_CC
|
||||
nsTextFragmentSSE2.$(OBJ_SUFFIX): CXXFLAGS+=-msse2
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
GQI_SRCS = contentbase.gqi
|
||||
|
||||
# we don't want the shared lib, but we want to force the creation of a
|
||||
|
|
|
@ -63,8 +63,9 @@
|
|||
#include "nsIURI.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "nsEscape.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
|
||||
//#define DEBUG_BenB
|
||||
using namespace mozilla::dom;
|
||||
|
||||
static inline PRUnichar* escape(const nsString& source)
|
||||
{
|
||||
|
@ -241,8 +242,8 @@ mozSanitizingHTMLSerializer::AppendText(nsIContent* aText,
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
mozSanitizingHTMLSerializer::AppendElementStart(nsIContent *aElement,
|
||||
nsIContent *aOriginalElement,
|
||||
mozSanitizingHTMLSerializer::AppendElementStart(Element* aElement,
|
||||
Element* aOriginalElement,
|
||||
nsAString& aStr)
|
||||
{
|
||||
NS_ENSURE_ARG(aElement);
|
||||
|
@ -270,7 +271,7 @@ mozSanitizingHTMLSerializer::AppendElementStart(nsIContent *aElement,
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
mozSanitizingHTMLSerializer::AppendElementEnd(nsIContent *aElement,
|
||||
mozSanitizingHTMLSerializer::AppendElementEnd(Element* aElement,
|
||||
nsAString& aStr)
|
||||
{
|
||||
NS_ENSURE_ARG(aElement);
|
||||
|
|
|
@ -89,10 +89,11 @@ public:
|
|||
{ return NS_OK; }
|
||||
NS_IMETHOD AppendDoctype(nsIContent *aDoctype, nsAString& aStr)
|
||||
{ return NS_OK; }
|
||||
NS_IMETHOD AppendElementStart(nsIContent *aElement,
|
||||
nsIContent *aOriginalElement,
|
||||
nsAString& aStr);
|
||||
NS_IMETHOD AppendElementEnd(nsIContent *aElement, nsAString& aStr);
|
||||
NS_IMETHOD AppendElementStart(mozilla::dom::Element* aElement,
|
||||
mozilla::dom::Element* aOriginalElement,
|
||||
nsAString& aStr);
|
||||
NS_IMETHOD AppendElementEnd(mozilla::dom::Element* aElement,
|
||||
nsAString& aStr);
|
||||
NS_IMETHOD Flush(nsAString& aStr);
|
||||
|
||||
NS_IMETHOD AppendDocumentStart(nsIDocument *aDocument,
|
||||
|
@ -150,7 +151,7 @@ protected:
|
|||
PRUint32 mSkipLevel;
|
||||
nsHashtable mAllowedTags;
|
||||
|
||||
nsCOMPtr<nsIContent> mContent;
|
||||
nsRefPtr<mozilla::dom::Element> mContent;
|
||||
nsAString* mOutputString;
|
||||
nsIParserNode* mParserNode;
|
||||
nsCOMPtr<nsIParserService> mParserService;
|
||||
|
|
|
@ -422,7 +422,7 @@ nsDocumentEncoder::SerializeNodeEnd(nsINode* aNode,
|
|||
return NS_OK;
|
||||
|
||||
if (aNode->IsElement()) {
|
||||
mSerializer->AppendElementEnd(static_cast<nsIContent*>(aNode), aStr);
|
||||
mSerializer->AppendElementEnd(aNode->AsElement(), aStr);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -72,6 +72,9 @@
|
|||
#include "nsIEditorDocShell.h"
|
||||
#include "nsIEditor.h"
|
||||
#include "nsIHTMLEditor.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
|
||||
using namespace mozilla::dom;
|
||||
|
||||
static const PRInt32 kLongLineLen = 128;
|
||||
|
||||
|
@ -228,8 +231,8 @@ nsHTMLContentSerializer::SerializeHTMLAttributes(nsIContent* aContent,
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLContentSerializer::AppendElementStart(nsIContent *aElement,
|
||||
nsIContent *aOriginalElement,
|
||||
nsHTMLContentSerializer::AppendElementStart(Element* aElement,
|
||||
Element* aOriginalElement,
|
||||
nsAString& aStr)
|
||||
{
|
||||
NS_ENSURE_ARG(aElement);
|
||||
|
@ -342,7 +345,7 @@ nsHTMLContentSerializer::AppendElementStart(nsIContent *aElement,
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLContentSerializer::AppendElementEnd(nsIContent *aElement,
|
||||
nsHTMLContentSerializer::AppendElementEnd(Element* aElement,
|
||||
nsAString& aStr)
|
||||
{
|
||||
NS_ENSURE_ARG(aElement);
|
||||
|
|
|
@ -57,11 +57,11 @@ class nsHTMLContentSerializer : public nsXHTMLContentSerializer {
|
|||
nsHTMLContentSerializer();
|
||||
virtual ~nsHTMLContentSerializer();
|
||||
|
||||
NS_IMETHOD AppendElementStart(nsIContent *aElement,
|
||||
nsIContent *aOriginalElement,
|
||||
NS_IMETHOD AppendElementStart(mozilla::dom::Element* aElement,
|
||||
mozilla::dom::Element* aOriginalElement,
|
||||
nsAString& aStr);
|
||||
|
||||
NS_IMETHOD AppendElementEnd(nsIContent *aElement,
|
||||
|
||||
NS_IMETHOD AppendElementEnd(mozilla::dom::Element* aElement,
|
||||
nsAString& aStr);
|
||||
|
||||
NS_IMETHOD AppendDocumentStart(nsIDocument *aDocument,
|
||||
|
|
|
@ -57,6 +57,9 @@
|
|||
#include "nsUnicharUtils.h"
|
||||
#include "nsCRT.h"
|
||||
#include "nsIParserService.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
|
||||
using namespace mozilla::dom;
|
||||
|
||||
#define PREF_STRUCTS "converter.html2txt.structs"
|
||||
#define PREF_HEADER_STRATEGY "converter.html2txt.header_strategy"
|
||||
|
@ -381,8 +384,8 @@ nsPlainTextSerializer::AppendCDATASection(nsIContent* aCDATASection,
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsPlainTextSerializer::AppendElementStart(nsIContent *aElement,
|
||||
nsIContent *aOriginalElement,
|
||||
nsPlainTextSerializer::AppendElementStart(Element* aElement,
|
||||
Element* aOriginalElement,
|
||||
nsAString& aStr)
|
||||
{
|
||||
NS_ENSURE_ARG(aElement);
|
||||
|
@ -414,7 +417,7 @@ nsPlainTextSerializer::AppendElementStart(nsIContent *aElement,
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsPlainTextSerializer::AppendElementEnd(nsIContent *aElement,
|
||||
nsPlainTextSerializer::AppendElementEnd(Element* aElement,
|
||||
nsAString& aStr)
|
||||
{
|
||||
NS_ENSURE_ARG(aElement);
|
||||
|
|
|
@ -56,6 +56,12 @@
|
|||
#include "nsIDocumentEncoder.h"
|
||||
#include "nsTArray.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
class Element;
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
class nsPlainTextSerializer : public nsIContentSerializer,
|
||||
public nsIHTMLContentSink,
|
||||
public nsIHTMLToTextSink
|
||||
|
@ -84,10 +90,10 @@ public:
|
|||
PRInt32 aEndOffset, nsAString& aStr) { return NS_OK; }
|
||||
NS_IMETHOD AppendDoctype(nsIContent *aDoctype,
|
||||
nsAString& aStr) { return NS_OK; }
|
||||
NS_IMETHOD AppendElementStart(nsIContent *aElement,
|
||||
nsIContent *aOriginalElement,
|
||||
NS_IMETHOD AppendElementStart(mozilla::dom::Element* aElement,
|
||||
mozilla::dom::Element* aOriginalElement,
|
||||
nsAString& aStr);
|
||||
NS_IMETHOD AppendElementEnd(nsIContent *aElement,
|
||||
NS_IMETHOD AppendElementEnd(mozilla::dom::Element* aElement,
|
||||
nsAString& aStr);
|
||||
NS_IMETHOD Flush(nsAString& aStr);
|
||||
|
||||
|
@ -235,7 +241,7 @@ protected:
|
|||
section.
|
||||
mHeaderCounter[1] for <h1> etc. */
|
||||
|
||||
nsCOMPtr<nsIContent> mContent;
|
||||
nsRefPtr<mozilla::dom::Element> mContent;
|
||||
|
||||
// For handling table rows
|
||||
nsAutoTArray<PRPackedBool, 8> mHasWrittenCellsForRow;
|
||||
|
|
|
@ -48,6 +48,7 @@
|
|||
#include "nsBidiUtils.h"
|
||||
#include "nsUnicharUtils.h"
|
||||
#include "nsUTF8Utils.h"
|
||||
#include "mozilla/SSE.h"
|
||||
|
||||
#define TEXTFRAG_WHITE_AFTER_NEWLINE 50
|
||||
#define TEXTFRAG_MAX_NEWLINES 7
|
||||
|
@ -144,6 +145,69 @@ nsTextFragment::operator=(const nsTextFragment& aOther)
|
|||
return *this;
|
||||
}
|
||||
|
||||
static inline PRBool
|
||||
Is8BitUnvectorized(const PRUnichar *str, const PRUnichar *end)
|
||||
{
|
||||
#if PR_BYTES_PER_WORD == 4
|
||||
const size_t mask = 0xff00ff00;
|
||||
const PRUint32 alignMask = 0x3;
|
||||
const PRUint32 numUnicharsPerWord = 2;
|
||||
#elif PR_BYTES_PER_WORD == 8
|
||||
const size_t mask = 0xff00ff00ff00ff00;
|
||||
const PRUint32 alignMask = 0x7;
|
||||
const PRUint32 numUnicharsPerWord = 4;
|
||||
#else
|
||||
#error Unknown platform!
|
||||
#endif
|
||||
|
||||
const PRInt32 len = end - str;
|
||||
PRInt32 i = 0;
|
||||
|
||||
// Align ourselves to a word boundary.
|
||||
PRInt32 alignLen =
|
||||
PR_MIN(len, PRInt32(((-NS_PTR_TO_UINT32(str)) & alignMask) / sizeof(PRUnichar)));
|
||||
for (; i < alignLen; i++) {
|
||||
if (str[i] > 255)
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
// Check one word at a time.
|
||||
const PRInt32 wordWalkEnd = ((len - i) / numUnicharsPerWord) * numUnicharsPerWord;
|
||||
for (; i < wordWalkEnd; i += numUnicharsPerWord) {
|
||||
const size_t word = *reinterpret_cast<const size_t*>(str + i);
|
||||
if (word & mask)
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
// Take care of the remainder one character at a time.
|
||||
for (; i < len; i++) {
|
||||
if (str[i] > 255)
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
#ifdef MOZILLA_MAY_SUPPORT_SSE2
|
||||
namespace mozilla {
|
||||
namespace SSE2 {
|
||||
PRBool Is8Bit(const PRUnichar *str, const PRUnichar *end);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline PRBool
|
||||
Is8Bit(const PRUnichar *str, const PRUnichar *end)
|
||||
{
|
||||
#ifdef MOZILLA_MAY_SUPPORT_SSE2
|
||||
if (mozilla::supports_sse2()) {
|
||||
return mozilla::SSE2::Is8Bit(str, end);
|
||||
}
|
||||
#endif
|
||||
|
||||
return Is8BitUnvectorized(str, end);
|
||||
}
|
||||
|
||||
void
|
||||
nsTextFragment::SetTo(const PRUnichar* aBuffer, PRInt32 aLength)
|
||||
{
|
||||
|
@ -203,14 +267,7 @@ nsTextFragment::SetTo(const PRUnichar* aBuffer, PRInt32 aLength)
|
|||
}
|
||||
|
||||
// See if we need to store the data in ucs2 or not
|
||||
PRBool need2 = PR_FALSE;
|
||||
while (ucp < uend) {
|
||||
PRUnichar ch = *ucp++;
|
||||
if (ch >= 256) {
|
||||
need2 = PR_TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
PRBool need2 = !Is8Bit(ucp, uend);
|
||||
|
||||
if (need2) {
|
||||
// Use ucs2 storage because we have to
|
||||
|
@ -293,18 +350,7 @@ nsTextFragment::Append(const PRUnichar* aBuffer, PRUint32 aLength)
|
|||
|
||||
// Current string is a 1-byte string, check if the new data fits in one byte too.
|
||||
|
||||
const PRUnichar* ucp = aBuffer;
|
||||
const PRUnichar* uend = ucp + aLength;
|
||||
PRBool need2 = PR_FALSE;
|
||||
while (ucp < uend) {
|
||||
PRUnichar ch = *ucp++;
|
||||
if (ch >= 256) {
|
||||
need2 = PR_TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (need2) {
|
||||
if (!Is8Bit(aBuffer, aBuffer + aLength)) {
|
||||
// The old data was 1-byte, but the new is not so we have to expand it
|
||||
// all to 2-byte
|
||||
PRUnichar* buff = (PRUnichar*)nsMemory::Alloc((mState.mLength + aLength) *
|
||||
|
|
|
@ -0,0 +1,72 @@
|
|||
// This file should only be compiled if you're on x86 or x86_64. Additionally,
|
||||
// you'll need to compile this file with -msse2 if you're using gcc.
|
||||
|
||||
#include <emmintrin.h>
|
||||
#include "nscore.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace SSE2 {
|
||||
|
||||
static inline bool
|
||||
is_zero (__m128i x)
|
||||
{
|
||||
return
|
||||
_mm_movemask_epi8(_mm_cmpeq_epi8(x, _mm_setzero_si128())) == 0xffff;
|
||||
}
|
||||
|
||||
PRBool
|
||||
Is8Bit(const PRUnichar *str, const PRUnichar *end)
|
||||
{
|
||||
const PRUint32 numUnicharsPerVector = 8;
|
||||
|
||||
#if PR_BYTES_PER_WORD == 4
|
||||
const size_t mask = 0xff00ff00;
|
||||
const PRUint32 numUnicharsPerWord = 2;
|
||||
#elif PR_BYTES_PER_WORD == 8
|
||||
const size_t mask = 0xff00ff00ff00ff00;
|
||||
const PRUint32 numUnicharsPerWord = 4;
|
||||
#else
|
||||
#error Unknown platform!
|
||||
#endif
|
||||
|
||||
const PRInt32 len = end - str;
|
||||
PRInt32 i = 0;
|
||||
|
||||
// Align ourselves to a 16-byte boundary, as required by _mm_load_si128
|
||||
// (i.e. MOVDQA).
|
||||
PRInt32 alignLen =
|
||||
PR_MIN(len, PRInt32(((-NS_PTR_TO_UINT32(str)) & 0xf) / sizeof(PRUnichar)));
|
||||
for (; i < alignLen; i++) {
|
||||
if (str[i] > 255)
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
// Check one XMM register (16 bytes) at a time.
|
||||
const PRInt32 vectWalkEnd = ((len - i) / numUnicharsPerVector) * numUnicharsPerVector;
|
||||
__m128i vectmask = _mm_set1_epi16(0xff00);
|
||||
for(; i < vectWalkEnd; i += numUnicharsPerVector) {
|
||||
const __m128i vect = *reinterpret_cast<const __m128i*>(str + i);
|
||||
if (!is_zero(_mm_and_si128(vect, vectmask)))
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
// Check one word at a time.
|
||||
const PRInt32 wordWalkEnd = ((len - i) / numUnicharsPerWord) * numUnicharsPerWord;
|
||||
for(; i < wordWalkEnd; i += numUnicharsPerWord) {
|
||||
const size_t word = *reinterpret_cast<const size_t*>(str + i);
|
||||
if (word & mask)
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
// Take care of the remainder one character at a time.
|
||||
for (; i < len; i++) {
|
||||
if (str[i] > 255) {
|
||||
return PR_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
} // namespace SSE2
|
||||
} // namespace mozilla
|
|
@ -64,6 +64,9 @@
|
|||
#include "nsContentUtils.h"
|
||||
#include "nsAttrName.h"
|
||||
#include "nsILineBreaker.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
|
||||
using namespace mozilla::dom;
|
||||
|
||||
static const char kMozStr[] = "moz";
|
||||
|
||||
|
@ -915,8 +918,8 @@ nsXMLContentSerializer::SerializeAttributes(nsIContent* aContent,
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXMLContentSerializer::AppendElementStart(nsIContent *aElement,
|
||||
nsIContent *aOriginalElement,
|
||||
nsXMLContentSerializer::AppendElementStart(Element* aElement,
|
||||
Element* aOriginalElement,
|
||||
nsAString& aStr)
|
||||
{
|
||||
NS_ENSURE_ARG(aElement);
|
||||
|
@ -1016,7 +1019,7 @@ nsXMLContentSerializer::AppendEndOfElementStart(nsIContent *aOriginalElement,
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXMLContentSerializer::AppendElementEnd(nsIContent *aElement,
|
||||
nsXMLContentSerializer::AppendElementEnd(Element* aElement,
|
||||
nsAString& aStr)
|
||||
{
|
||||
NS_ENSURE_ARG(aElement);
|
||||
|
|
|
@ -88,11 +88,11 @@ class nsXMLContentSerializer : public nsIContentSerializer {
|
|||
NS_IMETHOD AppendDoctype(nsIContent *aDoctype,
|
||||
nsAString& aStr);
|
||||
|
||||
NS_IMETHOD AppendElementStart(nsIContent *aElement,
|
||||
nsIContent *aOriginalElement,
|
||||
NS_IMETHOD AppendElementStart(mozilla::dom::Element* aElement,
|
||||
mozilla::dom::Element* aOriginalElement,
|
||||
nsAString& aStr);
|
||||
|
||||
NS_IMETHOD AppendElementEnd(nsIContent *aElement,
|
||||
|
||||
NS_IMETHOD AppendElementEnd(mozilla::dom::Element* aElement,
|
||||
nsAString& aStr);
|
||||
|
||||
NS_IMETHOD Flush(nsAString& aStr) { return NS_OK; }
|
||||
|
|
|
@ -431,6 +431,7 @@ _TEST_FILES2 = \
|
|||
test_bug567350.html \
|
||||
test_bug574596.html \
|
||||
test_bug578096.html \
|
||||
test_bug585978.html \
|
||||
test_bug592366.html \
|
||||
test_bug597345.html \
|
||||
script-1_bug597345.sjs \
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=585978
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 585978</title>
|
||||
<script type="application/javascript" src="/MochiKit/packed.js"></script>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=585978">Mozilla Bug 585978</a>
|
||||
|
||||
<script type="application/javascript;version=1.7">
|
||||
|
||||
/* Test that if we have a unicode character in the middle of an ascii string,
|
||||
the unicode character survives translation into and out of a text node. */
|
||||
|
||||
for (let i = 0; i < 128; i++) {
|
||||
let node = document.createTextNode('');
|
||||
let str = '';
|
||||
for (let j = 0; j < i; j++) {
|
||||
str += 'a';
|
||||
}
|
||||
str += '\uA0A9'
|
||||
node.data = str;
|
||||
|
||||
for (let j = 0; j < 32; j++) {
|
||||
is(node.data, str);
|
||||
|
||||
str += 'b';
|
||||
node.appendData('b');
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -7767,14 +7767,14 @@ ctx.fillStyle = '#fff';
|
|||
ctx.fillRect(20, 10, 60, 10);
|
||||
|
||||
var imgdata1 = ctx.getImageData(85, 25, -10, -10);
|
||||
ok(imgdata1.data[0] === 0, "imgdata1.data[\""+(0)+"\"] === 0");
|
||||
ok(imgdata1.data[1] === 0, "imgdata1.data[\""+(1)+"\"] === 0");
|
||||
ok(imgdata1.data[2] === 0, "imgdata1.data[\""+(2)+"\"] === 0");
|
||||
ok(imgdata1.data[0] === 255, "imgdata1.data[\""+(0)+"\"] === 255");
|
||||
ok(imgdata1.data[1] === 255, "imgdata1.data[\""+(1)+"\"] === 255");
|
||||
ok(imgdata1.data[2] === 255, "imgdata1.data[\""+(2)+"\"] === 255");
|
||||
ok(imgdata1.data[3] === 255, "imgdata1.data[\""+(3)+"\"] === 255");
|
||||
ok(imgdata1.data[imgdata1.length-4+0] === 255, "imgdata1.data[imgdata1.length-4+0] === 255");
|
||||
ok(imgdata1.data[imgdata1.length-4+1] === 255, "imgdata1.data[imgdata1.length-4+1] === 255");
|
||||
ok(imgdata1.data[imgdata1.length-4+2] === 255, "imgdata1.data[imgdata1.length-4+2] === 255");
|
||||
ok(imgdata1.data[imgdata1.length-4+3] === 255, "imgdata1.data[imgdata1.length-4+3] === 255");
|
||||
ok(imgdata1.data[imgdata1.data.length-4+0] === 0, "imgdata1.data[imgdata1.data.length-4+0] === 0");
|
||||
ok(imgdata1.data[imgdata1.data.length-4+1] === 0, "imgdata1.data[imgdata1.data.length-4+1] === 0");
|
||||
ok(imgdata1.data[imgdata1.data.length-4+2] === 0, "imgdata1.data[imgdata1.data.length-4+2] === 0");
|
||||
ok(imgdata1.data[imgdata1.data.length-4+3] === 255, "imgdata1.data[imgdata1.data.length-4+3] === 255");
|
||||
|
||||
var imgdata2 = ctx.getImageData(0, 0, -1, -1);
|
||||
ok(imgdata2.data[0] === 0, "imgdata2.data[\""+(0)+"\"] === 0");
|
||||
|
|
|
@ -39,11 +39,13 @@
|
|||
#include "nsReadableUtils.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIContent.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "nsIHTMLDocument.h"
|
||||
#include "nsIDOMHTMLMapElement.h"
|
||||
#include "nsImageMapUtils.h"
|
||||
|
||||
using namespace mozilla::dom;
|
||||
|
||||
/*static*/
|
||||
already_AddRefed<nsIDOMHTMLMapElement>
|
||||
nsImageMapUtils::FindImageMap(nsIDocument *aDocument,
|
||||
|
@ -79,9 +81,9 @@ nsImageMapUtils::FindImageMap(nsIDocument *aDocument,
|
|||
|
||||
nsCOMPtr<nsIHTMLDocument> htmlDoc(do_QueryInterface(aDocument));
|
||||
if (htmlDoc) {
|
||||
nsIDOMHTMLMapElement* map = htmlDoc->GetImageMap(usemap);
|
||||
NS_IF_ADDREF(map);
|
||||
return map;
|
||||
nsCOMPtr<nsIDOMHTMLMapElement> map =
|
||||
do_QueryInterface(htmlDoc->GetImageMap(usemap));
|
||||
return map.forget();
|
||||
} else {
|
||||
// For XHTML elements embedded in non-XHTML documents we get the
|
||||
// map by id since XHTML requires that where a "name" attribute
|
||||
|
@ -89,7 +91,7 @@ nsImageMapUtils::FindImageMap(nsIDocument *aDocument,
|
|||
// XHTML. The attribute "name" is officially deprecated. This
|
||||
// simplifies our life becase we can simply get the map with
|
||||
// getElementById().
|
||||
nsIContent *element = aDocument->GetElementById(usemap);
|
||||
Element* element = aDocument->GetElementById(usemap);
|
||||
|
||||
if (element) {
|
||||
nsIDOMHTMLMapElement* map;
|
||||
|
|
|
@ -1158,7 +1158,7 @@ nsHTMLDocument::SetTitle(const nsAString& aTitle)
|
|||
return nsDocument::SetTitle(aTitle);
|
||||
}
|
||||
|
||||
nsIDOMHTMLMapElement *
|
||||
Element*
|
||||
nsHTMLDocument::GetImageMap(const nsAString& aMapName)
|
||||
{
|
||||
if (!mImageMaps) {
|
||||
|
@ -1168,25 +1168,12 @@ nsHTMLDocument::GetImageMap(const nsAString& aMapName)
|
|||
nsAutoString name;
|
||||
PRUint32 i, n = mImageMaps->Length(PR_TRUE);
|
||||
for (i = 0; i < n; ++i) {
|
||||
nsCOMPtr<nsIDOMHTMLMapElement> map(
|
||||
do_QueryInterface(mImageMaps->GetNodeAt(i)));
|
||||
|
||||
PRBool match;
|
||||
nsresult rv;
|
||||
|
||||
rv = map->GetId(name);
|
||||
NS_ENSURE_SUCCESS(rv, nsnull);
|
||||
|
||||
match = name.Equals(aMapName);
|
||||
if (!match) {
|
||||
rv = map->GetName(name);
|
||||
NS_ENSURE_SUCCESS(rv, nsnull);
|
||||
|
||||
match = name.Equals(aMapName, nsCaseInsensitiveStringComparator());
|
||||
}
|
||||
|
||||
if (match) {
|
||||
return map;
|
||||
nsIContent* map = mImageMaps->GetNodeAt(i);
|
||||
if (map->AttrValueIs(kNameSpaceID_None, nsGkAtoms::id, aMapName,
|
||||
eCaseMatters) ||
|
||||
map->AttrValueIs(kNameSpaceID_None, nsGkAtoms::name, aMapName,
|
||||
eIgnoreCase)) {
|
||||
return map->AsElement();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -43,7 +43,6 @@
|
|||
#include "nsIDOMHTMLDocument.h"
|
||||
#include "nsIDOMNSHTMLDocument.h"
|
||||
#include "nsIDOMHTMLBodyElement.h"
|
||||
#include "nsIDOMHTMLMapElement.h"
|
||||
#include "nsIDOMHTMLCollection.h"
|
||||
#include "nsIScriptElement.h"
|
||||
#include "jsapi.h"
|
||||
|
@ -106,7 +105,7 @@ public:
|
|||
|
||||
virtual void EndLoad();
|
||||
|
||||
virtual nsIDOMHTMLMapElement *GetImageMap(const nsAString& aMapName);
|
||||
virtual mozilla::dom::Element* GetImageMap(const nsAString& aMapName);
|
||||
|
||||
virtual void SetCompatibilityMode(nsCompatibility aMode);
|
||||
|
||||
|
|
|
@ -34,28 +34,29 @@
|
|||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
#ifndef nsIHTMLDocument_h___
|
||||
#define nsIHTMLDocument_h___
|
||||
|
||||
#ifndef nsIHTMLDocument_h
|
||||
#define nsIHTMLDocument_h
|
||||
|
||||
#include "nsISupports.h"
|
||||
#include "nsCompatibility.h"
|
||||
#include "nsContentList.h"
|
||||
|
||||
class nsIImageMap;
|
||||
class nsString;
|
||||
class nsIDOMNodeList;
|
||||
class nsIDOMHTMLCollection;
|
||||
class nsIDOMHTMLMapElement;
|
||||
class nsHTMLStyleSheet;
|
||||
class nsIStyleSheet;
|
||||
class nsIDOMHTMLFormElement;
|
||||
class nsIContent;
|
||||
class nsIDOMHTMLBodyElement;
|
||||
class nsIScriptElement;
|
||||
class nsIEditor;
|
||||
class nsContentList;
|
||||
class nsWrapperCache;
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
class Element;
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
#define NS_IHTMLDOCUMENT_IID \
|
||||
{ 0x840cacc9, 0x1956, 0x4987, \
|
||||
{ 0x80, 0x6e, 0xc6, 0xab, 0x19, 0x1b, 0x92, 0xd2 } }
|
||||
{ 0xe43a4bfd, 0xff5a, 0x40b0, \
|
||||
{ 0x8c, 0x31, 0x24, 0xac, 0xe8, 0x15, 0xda, 0xf2 } }
|
||||
|
||||
|
||||
/**
|
||||
|
@ -66,7 +67,7 @@ class nsIHTMLDocument : public nsISupports
|
|||
public:
|
||||
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IHTMLDOCUMENT_IID)
|
||||
|
||||
virtual nsIDOMHTMLMapElement *GetImageMap(const nsAString& aMapName) = 0;
|
||||
virtual mozilla::dom::Element* GetImageMap(const nsAString& aMapName) = 0;
|
||||
|
||||
/**
|
||||
* Set compatibility mode for this document
|
||||
|
@ -189,4 +190,4 @@ public:
|
|||
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(nsIHTMLDocument, NS_IHTMLDOCUMENT_IID)
|
||||
|
||||
#endif /* nsIHTMLDocument_h___ */
|
||||
#endif /* nsIHTMLDocument_h */
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
#include "nsSMILValue.h"
|
||||
#include "nsComputedDOMStyle.h"
|
||||
#include "nsStyleAnimation.h"
|
||||
#include "nsIContent.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "nsIDOMElement.h"
|
||||
|
||||
using namespace mozilla::dom;
|
||||
|
|
|
@ -45,9 +45,11 @@
|
|||
#include "nsCSSValue.h"
|
||||
#include "nsColor.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsIContent.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "nsDebug.h"
|
||||
|
||||
using namespace mozilla::dom;
|
||||
|
||||
/*static*/ nsSMILCSSValueType nsSMILCSSValueType::sSingleton;
|
||||
|
||||
struct ValueWrapper {
|
||||
|
@ -350,7 +352,7 @@ nsSMILCSSValueType::Interpolate(const nsSMILValue& aStartVal,
|
|||
|
||||
// Helper function to extract presContext
|
||||
static nsPresContext*
|
||||
GetPresContextForElement(nsIContent* aElem)
|
||||
GetPresContextForElement(Element* aElem)
|
||||
{
|
||||
nsIDocument* doc = aElem->GetCurrentDoc();
|
||||
if (!doc) {
|
||||
|
@ -366,7 +368,7 @@ GetPresContextForElement(nsIContent* aElem)
|
|||
// Helper function to parse a string into a nsStyleAnimation::Value
|
||||
static PRBool
|
||||
ValueFromStringHelper(nsCSSProperty aPropID,
|
||||
nsIContent* aTargetElement,
|
||||
Element* aTargetElement,
|
||||
nsPresContext* aPresContext,
|
||||
const nsAString& aString,
|
||||
nsStyleAnimation::Value& aStyleAnimValue)
|
||||
|
@ -405,11 +407,10 @@ ValueFromStringHelper(nsCSSProperty aPropID,
|
|||
// static
|
||||
void
|
||||
nsSMILCSSValueType::ValueFromString(nsCSSProperty aPropID,
|
||||
nsIContent* aTargetElement,
|
||||
Element* aTargetElement,
|
||||
const nsAString& aString,
|
||||
nsSMILValue& aValue)
|
||||
{
|
||||
// XXXbz aTargetElement should be an Element
|
||||
NS_ABORT_IF_FALSE(aValue.IsNull(), "Outparam should be null-typed");
|
||||
nsPresContext* presContext = GetPresContextForElement(aTargetElement);
|
||||
if (!presContext) {
|
||||
|
|
|
@ -44,15 +44,22 @@
|
|||
#include "nsCSSProperty.h"
|
||||
#include "nscore.h" // For NS_OVERRIDE
|
||||
|
||||
class nsIContent;
|
||||
class nsAString;
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
class Element;
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
/*
|
||||
* nsSMILCSSValueType: Represents a SMIL-animated CSS value.
|
||||
*/
|
||||
class nsSMILCSSValueType : public nsISMILType
|
||||
{
|
||||
public:
|
||||
typedef mozilla::dom::Element Element;
|
||||
|
||||
// Singleton for nsSMILValue objects to hold onto.
|
||||
static nsSMILCSSValueType sSingleton;
|
||||
|
||||
|
@ -97,7 +104,7 @@ public:
|
|||
* @post aValue.IsNull() || aValue.mType == nsSMILCSSValueType::sSingleton
|
||||
*/
|
||||
static void ValueFromString(nsCSSProperty aPropID,
|
||||
nsIContent* aTargetElement,
|
||||
Element* aTargetElement,
|
||||
const nsAString& aString,
|
||||
nsSMILValue& aValue);
|
||||
|
||||
|
|
|
@ -82,6 +82,9 @@
|
|||
|
||||
#include "Layers.h"
|
||||
|
||||
#include "mozilla/dom/Element.h"
|
||||
|
||||
using namespace mozilla::dom;
|
||||
using namespace mozilla::layers;
|
||||
|
||||
static PRBool IsUniversalXPConnectCapable()
|
||||
|
@ -1623,12 +1626,13 @@ nsDOMWindowUtils::GetLayerManagerType(nsAString& aType)
|
|||
}
|
||||
|
||||
static PRBool
|
||||
ComputeAnimationValue(nsCSSProperty aProperty, nsIContent* aContent,
|
||||
ComputeAnimationValue(nsCSSProperty aProperty,
|
||||
Element* aElement,
|
||||
const nsAString& aInput,
|
||||
nsStyleAnimation::Value& aOutput)
|
||||
{
|
||||
|
||||
if (!nsStyleAnimation::ComputeValue(aProperty, aContent, aInput,
|
||||
if (!nsStyleAnimation::ComputeValue(aProperty, aElement, aInput,
|
||||
PR_FALSE, aOutput)) {
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
@ -1678,8 +1682,8 @@ nsDOMWindowUtils::ComputeAnimationDistance(nsIDOMElement* aElement,
|
|||
|
||||
nsStyleAnimation::Value v1, v2;
|
||||
if (property == eCSSProperty_UNKNOWN ||
|
||||
!ComputeAnimationValue(property, content, aValue1, v1) ||
|
||||
!ComputeAnimationValue(property, content, aValue2, v2)) {
|
||||
!ComputeAnimationValue(property, content->AsElement(), aValue1, v1) ||
|
||||
!ComputeAnimationValue(property, content->AsElement(), aValue2, v2)) {
|
||||
return NS_ERROR_ILLEGAL_VALUE;
|
||||
}
|
||||
|
||||
|
|
|
@ -46,17 +46,7 @@ MODULE = dom
|
|||
XPIDL_MODULE = dom_loadsave
|
||||
|
||||
XPIDLSRCS = \
|
||||
nsIDOMDOMImplementationLS.idl \
|
||||
nsIDOMLSException.idl \
|
||||
nsIDOMLSInput.idl \
|
||||
nsIDOMLSLoadEvent.idl \
|
||||
nsIDOMLSOutput.idl \
|
||||
nsIDOMLSParser.idl \
|
||||
nsIDOMLSParserFilter.idl \
|
||||
nsIDOMLSProgressEvent.idl \
|
||||
nsIDOMLSResourceResolver.idl \
|
||||
nsIDOMLSSerializer.idl \
|
||||
nsIDOMLSSerializerFilter.idl \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
|
|
@ -1,59 +0,0 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2000
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Johnny Stenback <jst@mozilla.jstenback.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
||||
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "domstubs.idl"
|
||||
|
||||
interface nsIDOMLSParser;
|
||||
interface nsIDOMLSSerializer;
|
||||
interface nsIDOMLSInput;
|
||||
interface nsIDOMLSOutput;
|
||||
|
||||
[scriptable, uuid(e2c8b03c-a49a-4923-81b0-ba9a86da0e21)]
|
||||
interface nsIDOMDOMImplementationLS : nsISupports
|
||||
{
|
||||
// DOMImplementationLSMode
|
||||
const unsigned short MODE_SYNCHRONOUS = 1;
|
||||
const unsigned short MODE_ASYNCHRONOUS = 2;
|
||||
|
||||
nsIDOMLSParser createLSParser(in unsigned short mode,
|
||||
in DOMString schemaType)
|
||||
raises(DOMException);
|
||||
nsIDOMLSSerializer createLSSerializer();
|
||||
nsIDOMLSInput createLSInput();
|
||||
nsIDOMLSOutput createLSOutput();
|
||||
};
|
|
@ -1,48 +0,0 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2000
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Johnny Stenback <jst@mozilla.jstenback.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
||||
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "domstubs.idl"
|
||||
|
||||
[scriptable, uuid(1cc8e4b3-1dbb-4adc-a913-1527bf67748c)]
|
||||
interface nsIDOMLSException : nsISupports
|
||||
{
|
||||
const unsigned short PARSE_ERR = 81;
|
||||
const unsigned short SERIALIZE_ERR = 82;
|
||||
|
||||
readonly attribute unsigned short code;
|
||||
};
|
|
@ -1,56 +0,0 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2000
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Johnny Stenback <jst@mozilla.jstenback.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
||||
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "domstubs.idl"
|
||||
|
||||
interface nsIInputStream;
|
||||
|
||||
[scriptable, uuid(165e7f61-5048-4c2c-b4bf-6b44bb617ee4)]
|
||||
interface nsIDOMLSInput : nsISupports
|
||||
{
|
||||
// Depending on the language binding in use,
|
||||
// this attribute may not be available.
|
||||
attribute nsISupports characterStream;
|
||||
attribute nsIInputStream byteStream;
|
||||
attribute DOMString stringData;
|
||||
attribute DOMString systemId;
|
||||
attribute DOMString publicId;
|
||||
attribute DOMString baseURI;
|
||||
attribute DOMString encoding;
|
||||
attribute boolean certifiedText;
|
||||
};
|
|
@ -1,48 +0,0 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2000
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Johnny Stenback <jst@mozilla.jstenback.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
||||
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsIDOMEvent.idl"
|
||||
|
||||
interface nsIDOMLSInput;
|
||||
|
||||
[scriptable, uuid(6c16a810-a37d-4859-b557-337341631aee)]
|
||||
interface nsIDOMLSLoadEvent : nsIDOMEvent
|
||||
{
|
||||
readonly attribute nsIDOMDocument newDocument;
|
||||
readonly attribute nsIDOMLSInput input;
|
||||
};
|
|
@ -1,52 +0,0 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2000
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Johnny Stenback <jst@mozilla.jstenback.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
||||
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "domstubs.idl"
|
||||
|
||||
interface nsIOutputStream;
|
||||
|
||||
[scriptable, uuid(757e9971-8890-478d-a53a-07f9f6f6e0d3)]
|
||||
interface nsIDOMLSOutput : nsISupports
|
||||
{
|
||||
// Depending on the language binding in use,
|
||||
// this attribute may not be available.
|
||||
attribute nsISupports characterStream;
|
||||
attribute nsIOutputStream byteStream;
|
||||
attribute DOMString systemId;
|
||||
attribute DOMString encoding;
|
||||
};
|
|
@ -1,73 +0,0 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2000
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Johnny Stenback <jst@mozilla.jstenback.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
||||
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "domstubs.idl"
|
||||
|
||||
interface nsIDOMDOMConfiguration;
|
||||
interface nsIDOMLSParserFilter;
|
||||
interface nsIDOMLSInput;
|
||||
interface LSException;
|
||||
|
||||
[scriptable, uuid(2a31a3a0-be68-40af-9f64-914192f0fba2)]
|
||||
interface nsIDOMLSParser : nsISupports
|
||||
{
|
||||
readonly attribute nsIDOMDOMConfiguration domConfig;
|
||||
attribute nsIDOMLSParserFilter filter;
|
||||
readonly attribute boolean async;
|
||||
readonly attribute boolean busy;
|
||||
nsIDOMDocument parse(in nsIDOMLSInput input)
|
||||
raises(DOMException,
|
||||
LSException);
|
||||
nsIDOMDocument parseURI(in DOMString uri)
|
||||
raises(DOMException,
|
||||
LSException);
|
||||
|
||||
// ACTION_TYPES
|
||||
const unsigned short ACTION_APPEND_AS_CHILDREN = 1;
|
||||
const unsigned short ACTION_REPLACE_CHILDREN = 2;
|
||||
const unsigned short ACTION_INSERT_BEFORE = 3;
|
||||
const unsigned short ACTION_INSERT_AFTER = 4;
|
||||
const unsigned short ACTION_REPLACE = 5;
|
||||
|
||||
nsIDOMNode parseWithContext(in nsIDOMLSInput input,
|
||||
in nsIDOMNode contextArg,
|
||||
in unsigned short action)
|
||||
raises(DOMException,
|
||||
LSException);
|
||||
void abort();
|
||||
};
|
|
@ -1,53 +0,0 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2000
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Johnny Stenback <jst@mozilla.jstenback.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
||||
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "domstubs.idl"
|
||||
|
||||
[scriptable, uuid(10e8893d-ddf5-45d1-8872-615d72065fb4)]
|
||||
interface nsIDOMLSParserFilter : nsISupports
|
||||
{
|
||||
// Constants returned by startElement and acceptNode
|
||||
const short FILTER_ACCEPT = 1;
|
||||
const short FILTER_REJECT = 2;
|
||||
const short FILTER_SKIP = 3;
|
||||
const short FILTER_INTERRUPT = 4;
|
||||
|
||||
unsigned short startElement(in nsIDOMElement elementArg);
|
||||
unsigned short acceptNode(in nsIDOMNode nodeArg);
|
||||
readonly attribute unsigned long whatToShow;
|
||||
};
|
|
@ -1,51 +0,0 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2000
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Johnny Stenback <jst@mozilla.jstenback.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
||||
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "domstubs.idl"
|
||||
|
||||
interface nsIDOMLSInput;
|
||||
|
||||
[scriptable, uuid(9e61c7c8-8698-4477-9971-0923513919bd)]
|
||||
interface nsIDOMLSResourceResolver : nsISupports
|
||||
{
|
||||
nsIDOMLSInput resolveResource(in DOMString type,
|
||||
in DOMString namespaceURI,
|
||||
in DOMString publicId,
|
||||
in DOMString systemId,
|
||||
in DOMString baseURI);
|
||||
};
|
|
@ -1,61 +0,0 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2000
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Johnny Stenback <jst@mozilla.jstenback.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
||||
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "domstubs.idl"
|
||||
|
||||
interface nsIDOMDOMConfiguration;
|
||||
interface nsIDOMLSOutput;
|
||||
interface nsIDOMLSSerializerFilter;
|
||||
interface LSException;
|
||||
|
||||
[scriptable, uuid(96ea4792-d362-4c28-a8c2-0337790d648a)]
|
||||
interface nsIDOMLSSerializer : nsISupports
|
||||
{
|
||||
readonly attribute nsIDOMDOMConfiguration domConfig;
|
||||
attribute DOMString newLine;
|
||||
attribute nsIDOMLSSerializerFilter filter;
|
||||
boolean write(in nsIDOMNode nodeArg,
|
||||
in nsIDOMLSOutput destination)
|
||||
raises(LSException);
|
||||
boolean writeToURI(in nsIDOMNode nodeArg,
|
||||
in DOMString uri)
|
||||
raises(LSException);
|
||||
DOMString writeToString(in nsIDOMNode nodeArg)
|
||||
raises(DOMException,
|
||||
LSException);
|
||||
};
|
|
@ -1,45 +0,0 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2000
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Johnny Stenback <jst@mozilla.jstenback.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
||||
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsIDOMNodeFilter.idl"
|
||||
|
||||
[scriptable, uuid(b9b6ec85-f69f-4a5a-a96a-8a7a8f07e2b4)]
|
||||
interface nsIDOMLSSerializerFilter : nsIDOMNodeFilter
|
||||
{
|
||||
readonly attribute unsigned long whatToShow;
|
||||
};
|
|
@ -50,10 +50,12 @@
|
|||
#include "nsCSSParser.h"
|
||||
#include "mozilla/css/Declaration.h"
|
||||
#include "nsCSSStruct.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "prlog.h"
|
||||
#include <math.h>
|
||||
|
||||
namespace css = mozilla::css;
|
||||
namespace dom = mozilla::dom;
|
||||
|
||||
// HELPER METHODS
|
||||
// --------------
|
||||
|
@ -1780,7 +1782,7 @@ nsStyleAnimation::AddWeighted(nsCSSProperty aProperty,
|
|||
|
||||
already_AddRefed<css::StyleRule>
|
||||
BuildStyleRule(nsCSSProperty aProperty,
|
||||
nsIContent* aTargetElement,
|
||||
dom::Element* aTargetElement,
|
||||
const nsAString& aSpecifiedValue,
|
||||
PRBool aUseSVGMode)
|
||||
{
|
||||
|
@ -1822,15 +1824,14 @@ BuildStyleRule(nsCSSProperty aProperty,
|
|||
|
||||
inline
|
||||
already_AddRefed<nsStyleContext>
|
||||
LookupStyleContext(nsIContent* aElement)
|
||||
LookupStyleContext(dom::Element* aElement)
|
||||
{
|
||||
nsIDocument* doc = aElement->GetCurrentDoc();
|
||||
nsIPresShell* shell = doc->GetShell();
|
||||
if (!shell) {
|
||||
return nsnull;
|
||||
}
|
||||
return nsComputedDOMStyle::GetStyleContextForElement(aElement->AsElement(),
|
||||
nsnull, shell);
|
||||
return nsComputedDOMStyle::GetStyleContextForElement(aElement, nsnull, shell);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1855,7 +1856,7 @@ LookupStyleContext(nsIContent* aElement)
|
|||
*/
|
||||
already_AddRefed<nsStyleContext>
|
||||
StyleWithDeclarationAdded(nsCSSProperty aProperty,
|
||||
nsIContent* aTargetElement,
|
||||
dom::Element* aTargetElement,
|
||||
const nsAString& aSpecifiedValue,
|
||||
PRBool aUseSVGMode)
|
||||
{
|
||||
|
@ -1888,12 +1889,11 @@ StyleWithDeclarationAdded(nsCSSProperty aProperty,
|
|||
|
||||
PRBool
|
||||
nsStyleAnimation::ComputeValue(nsCSSProperty aProperty,
|
||||
nsIContent* aTargetElement,
|
||||
dom::Element* aTargetElement,
|
||||
const nsAString& aSpecifiedValue,
|
||||
PRBool aUseSVGMode,
|
||||
Value& aComputedValue)
|
||||
{
|
||||
// XXXbz aTargetElement should be an Element
|
||||
NS_ABORT_IF_FALSE(aTargetElement, "null target element");
|
||||
NS_ABORT_IF_FALSE(aTargetElement->GetCurrentDoc(),
|
||||
"we should only be able to actively animate nodes that "
|
||||
|
|
|
@ -50,7 +50,6 @@
|
|||
#include "nsCoord.h"
|
||||
#include "nsColor.h"
|
||||
|
||||
class nsIContent;
|
||||
class nsPresContext;
|
||||
class nsStyleContext;
|
||||
class nsCSSValue;
|
||||
|
@ -59,6 +58,12 @@ struct nsCSSValuePair;
|
|||
struct nsCSSValuePairList;
|
||||
struct nsCSSRect;
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
class Element;
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
/**
|
||||
* Utility class to handle animated style values
|
||||
*/
|
||||
|
@ -171,7 +176,7 @@ public:
|
|||
* @return PR_TRUE on success, PR_FALSE on failure.
|
||||
*/
|
||||
static PRBool ComputeValue(nsCSSProperty aProperty,
|
||||
nsIContent* aElement,
|
||||
mozilla::dom::Element* aElement,
|
||||
const nsAString& aSpecifiedValue,
|
||||
PRBool aUseSVGMode,
|
||||
Value& aComputedValue);
|
||||
|
|
|
@ -285,8 +285,9 @@ namespace places {
|
|||
// We can't use StringBeginsWith here, unfortunately. Although it will
|
||||
// happily take a case-insensitive UTF8 comparator, it eventually calls
|
||||
// nsACString::Equals, which checks that the two strings contain the same
|
||||
// number of bytes before calling the comparator. This is clearly not what
|
||||
// we want.
|
||||
// number of bytes before calling the comparator. Two characters may be
|
||||
// case-insensitively equal while taking up different numbers of bytes, so
|
||||
// this is not what we want.
|
||||
|
||||
const_char_iterator tokenStart(aToken.BeginReading()),
|
||||
tokenEnd(aToken.EndReading()),
|
||||
|
|
Загрузка…
Ссылка в новой задаче