summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/WebCore/html
diff options
context:
space:
mode:
authorJocelyn Turcotte <jocelyn.turcotte@nokia.com>2009-10-01 09:45:01 (GMT)
committerJocelyn Turcotte <jocelyn.turcotte@nokia.com>2009-10-01 09:45:01 (GMT)
commit34bd937aea27fabbfac964b80bc0ab50d677277e (patch)
treeb82cc9d1fa598f81244482f6d48859c54031a70e /src/3rdparty/webkit/WebCore/html
parent0ec49eca052e452a20d0ab7219c3a42589745ba5 (diff)
downloadQt-34bd937aea27fabbfac964b80bc0ab50d677277e.zip
Qt-34bd937aea27fabbfac964b80bc0ab50d677277e.tar.gz
Qt-34bd937aea27fabbfac964b80bc0ab50d677277e.tar.bz2
Updated WebKit from /home/joce/dev/qtwebkit/ to qtwebkit-4.6-snapshot-30092009-2 ( 284ebfc0df42d408d99838507c1ed335fba9bcf0 )
Changes in WebKit/qt since the last update: ++ b/WebKit/qt/ChangeLog 2009-09-29 Andras Becsi <becsi.andras@stud.u-szeged.hu> Reviewed by Tor Arne Vestbø. [Qt] Default font size reconciliation to 16px/13px to match other platform's de-facto standard. This fixes https://bugs.webkit.org/show_bug.cgi?id=19674. * Api/qwebsettings.cpp: (QWebSettings::QWebSettings): 2009-09-29 Jedrzej Nowacki <jedrzej.nowacki@nokia.com> Reviewed by Simon Hausmann. https://bugs.webkit.org/show_bug.cgi?id=29844 QWebPage dependency autotest fix. Fix for database() autotest. All opened databases should be removed at end of test. * tests/qwebpage/tst_qwebpage.cpp: (tst_QWebPage::database): 2009-09-29 Jedrzej Nowacki <jedrzej.nowacki@nokia.com> Reviewed by Simon Hausmann. Some QWebHistory and QWebPage autotest crash fixes. Some checking for m_mainFrame were added. MainFrame should be created at some point of QWebPage live cicle. https://bugs.webkit.org/show_bug.cgi?id=29803 * Api/qwebpage.cpp: (QWebPage::~QWebPage): (QWebPage::currentFrame): (QWebPage::history): (QWebPage::selectedText): (QWebPage::updatePositionDependentActions): * tests/qwebpage/tst_qwebpage.cpp: (tst_QWebPage::crashTests_LazyInitializationOfMainFrame): 2009-09-29 Kenneth Rohde Christiansen <kenneth@webkit.org> Reviewed by Simon Hausmann and Tor Arne Vestbø. Implement QWebPage Extension for error pages, incl. an example on how to use it in QtLauncher. Correct our use of ResourceError. * Api/qwebpage.h: (ExtensionOption::): (ExtensionOption::ErrorPageExtensionReturn::ErrorPageExtensionReturn): * QtLauncher/main.cpp: (WebPage::supportsExtension): (MainWindow::MainWindow): (MainWindow::selectElements): (WebPage::extension): * WebCoreSupport/FrameLoaderClientQt.cpp: (WebCore::FrameLoaderClientQt::cancelledError): (WebCore::FrameLoaderClientQt::blockedError): (WebCore::FrameLoaderClientQt::cannotShowURLError): (WebCore::FrameLoaderClientQt::interruptForPolicyChangeError): (WebCore::FrameLoaderClientQt::cannotShowMIMETypeError): (WebCore::FrameLoaderClientQt::fileDoesNotExistError): (WebCore::FrameLoaderClientQt::callErrorPageExtension): (WebCore::FrameLoaderClientQt::dispatchDidFailProvisionalLoad): (WebCore::FrameLoaderClientQt::dispatchDidFailLoad): * WebCoreSupport/FrameLoaderClientQt.h:
Diffstat (limited to 'src/3rdparty/webkit/WebCore/html')
-rw-r--r--src/3rdparty/webkit/WebCore/html/HTMLCanvasElement.cpp23
-rw-r--r--src/3rdparty/webkit/WebCore/html/HTMLInputElement.cpp8
-rw-r--r--src/3rdparty/webkit/WebCore/html/HTMLInputElement.h2
-rw-r--r--src/3rdparty/webkit/WebCore/html/HTMLInputElement.idl3
-rw-r--r--src/3rdparty/webkit/WebCore/html/HTMLLinkElement.cpp18
-rw-r--r--src/3rdparty/webkit/WebCore/html/HTMLTextAreaElement.cpp22
-rw-r--r--src/3rdparty/webkit/WebCore/html/HTMLTextAreaElement.h4
-rw-r--r--src/3rdparty/webkit/WebCore/html/HTMLTextAreaElement.idl3
8 files changed, 57 insertions, 26 deletions
diff --git a/src/3rdparty/webkit/WebCore/html/HTMLCanvasElement.cpp b/src/3rdparty/webkit/WebCore/html/HTMLCanvasElement.cpp
index c8202fd..9b2f70c 100644
--- a/src/3rdparty/webkit/WebCore/html/HTMLCanvasElement.cpp
+++ b/src/3rdparty/webkit/WebCore/html/HTMLCanvasElement.cpp
@@ -165,17 +165,20 @@ CanvasRenderingContext* HTMLCanvasElement::getContext(const String& type)
return m_context.get();
}
#if ENABLE(3D_CANVAS)
- if ((type == "webkit-3d") ||
- (type == "GL")) {
- if (m_context && !m_context->is3d())
- return 0;
- if (!m_context) {
- m_context = new CanvasRenderingContext3D(this);
-
- // Need to make sure a RenderLayer and compositing layer get created for the Canvas
- setNeedsStyleRecalc(SyntheticStyleChange);
+ Settings* settings = document()->settings();
+ if (settings && settings->experimentalWebGLEnabled()) {
+ if ((type == "webkit-3d") ||
+ (type == "GL")) {
+ if (m_context && !m_context->is3d())
+ return 0;
+ if (!m_context) {
+ m_context = new CanvasRenderingContext3D(this);
+
+ // Need to make sure a RenderLayer and compositing layer get created for the Canvas
+ setNeedsStyleRecalc(SyntheticStyleChange);
+ }
+ return m_context.get();
}
- return m_context.get();
}
#endif
return 0;
diff --git a/src/3rdparty/webkit/WebCore/html/HTMLInputElement.cpp b/src/3rdparty/webkit/WebCore/html/HTMLInputElement.cpp
index 0aefe7f..e6b8228 100644
--- a/src/3rdparty/webkit/WebCore/html/HTMLInputElement.cpp
+++ b/src/3rdparty/webkit/WebCore/html/HTMLInputElement.cpp
@@ -34,6 +34,7 @@
#include "Event.h"
#include "EventHandler.h"
#include "EventNames.h"
+#include "ExceptionCode.h"
#include "File.h"
#include "FileList.h"
#include "FocusController.h"
@@ -1609,9 +1610,12 @@ int HTMLInputElement::maxLength() const
return m_data.maxLength();
}
-void HTMLInputElement::setMaxLength(int _maxLength)
+void HTMLInputElement::setMaxLength(int _maxLength, ExceptionCode& exceptionCode)
{
- setAttribute(maxlengthAttr, String::number(_maxLength));
+ if (_maxLength < 0)
+ exceptionCode = INDEX_SIZE_ERR;
+ else
+ setAttribute(maxlengthAttr, String::number(_maxLength));
}
bool HTMLInputElement::multiple() const
diff --git a/src/3rdparty/webkit/WebCore/html/HTMLInputElement.h b/src/3rdparty/webkit/WebCore/html/HTMLInputElement.h
index 63d1634..16e3b58 100644
--- a/src/3rdparty/webkit/WebCore/html/HTMLInputElement.h
+++ b/src/3rdparty/webkit/WebCore/html/HTMLInputElement.h
@@ -201,7 +201,7 @@ public:
#endif
int maxLength() const;
- void setMaxLength(int);
+ void setMaxLength(int, ExceptionCode&);
bool multiple() const;
void setMultiple(bool);
diff --git a/src/3rdparty/webkit/WebCore/html/HTMLInputElement.idl b/src/3rdparty/webkit/WebCore/html/HTMLInputElement.idl
index 07bab90..7cdf487 100644
--- a/src/3rdparty/webkit/WebCore/html/HTMLInputElement.idl
+++ b/src/3rdparty/webkit/WebCore/html/HTMLInputElement.idl
@@ -42,7 +42,8 @@ module html {
#if defined(ENABLE_DATALIST) && ENABLE_DATALIST
readonly attribute HTMLElement list;
#endif
- attribute long maxLength;
+ attribute long maxLength
+ setter raises(DOMException);
attribute boolean multiple;
attribute [ConvertNullToNullString] DOMString name;
attribute [Reflect] DOMString pattern;
diff --git a/src/3rdparty/webkit/WebCore/html/HTMLLinkElement.cpp b/src/3rdparty/webkit/WebCore/html/HTMLLinkElement.cpp
index 8705521..0971ef5 100644
--- a/src/3rdparty/webkit/WebCore/html/HTMLLinkElement.cpp
+++ b/src/3rdparty/webkit/WebCore/html/HTMLLinkElement.cpp
@@ -252,7 +252,23 @@ void HTMLLinkElement::setCSSStyleSheet(const String& url, const String& charset,
if (enforceMIMEType && document()->page() && !document()->page()->settings()->enforceCSSMIMETypeInStrictMode())
enforceMIMEType = false;
- m_sheet->parseString(sheet->sheetText(enforceMIMEType), strictParsing);
+ String sheetText = sheet->sheetText(enforceMIMEType);
+ m_sheet->parseString(sheetText, strictParsing);
+
+ if (strictParsing && document()->settings() && document()->settings()->needsSiteSpecificQuirks()) {
+ // Work around <https://bugs.webkit.org/show_bug.cgi?id=28350>.
+ DEFINE_STATIC_LOCAL(const String, slashKHTMLFixesDotCss, ("/KHTMLFixes.css"));
+ DEFINE_STATIC_LOCAL(const String, mediaWikiKHTMLFixesStyleSheet, ("/* KHTML fix stylesheet */\n/* work around the horizontal scrollbars */\n#column-content { margin-left: 0; }\n\n"));
+ // There are two variants of KHTMLFixes.css. One is equal to mediaWikiKHTMLFixesStyleSheet,
+ // while the other lacks the second trailing newline.
+ if (url.endsWith(slashKHTMLFixesDotCss) && mediaWikiKHTMLFixesStyleSheet.startsWith(sheetText)
+ && sheetText.length() >= mediaWikiKHTMLFixesStyleSheet.length() - 1) {
+ ASSERT(m_sheet->length() == 1);
+ ExceptionCode ec;
+ m_sheet->deleteRule(0, ec);
+ }
+ }
+
m_sheet->setTitle(title());
RefPtr<MediaList> media = MediaList::createAllowingDescriptionSyntax(m_media);
diff --git a/src/3rdparty/webkit/WebCore/html/HTMLTextAreaElement.cpp b/src/3rdparty/webkit/WebCore/html/HTMLTextAreaElement.cpp
index f398fc2..b5e4ced 100644
--- a/src/3rdparty/webkit/WebCore/html/HTMLTextAreaElement.cpp
+++ b/src/3rdparty/webkit/WebCore/html/HTMLTextAreaElement.cpp
@@ -32,6 +32,7 @@
#include "Document.h"
#include "Event.h"
#include "EventNames.h"
+#include "ExceptionCode.h"
#include "FocusController.h"
#include "FormDataList.h"
#include "Frame.h"
@@ -283,16 +284,16 @@ void HTMLTextAreaElement::handleBeforeTextInsertedEvent(BeforeTextInsertedEvent*
{
ASSERT(event);
ASSERT(renderer());
- bool ok;
- unsigned maxLength = getAttribute(maxlengthAttr).string().toUInt(&ok);
- if (!ok)
+ int signedMaxLength = maxLength();
+ if (signedMaxLength < 0)
return;
+ unsigned unsignedMaxLength = static_cast<unsigned>(signedMaxLength);
unsigned currentLength = toRenderTextControl(renderer())->text().numGraphemeClusters();
unsigned selectionLength = plainText(document()->frame()->selection()->selection().toNormalizedRange().get()).numGraphemeClusters();
ASSERT(currentLength >= selectionLength);
unsigned baseLength = currentLength - selectionLength;
- unsigned appendableLength = maxLength > baseLength ? maxLength - baseLength : 0;
+ unsigned appendableLength = unsignedMaxLength > baseLength ? unsignedMaxLength - baseLength : 0;
event->setText(sanitizeUserInputValue(event->text(), appendableLength));
}
@@ -401,14 +402,19 @@ void HTMLTextAreaElement::setDefaultValue(const String& defaultValue)
setValue(value);
}
-unsigned HTMLTextAreaElement::maxLength() const
+int HTMLTextAreaElement::maxLength() const
{
- return getAttribute(maxlengthAttr).string().toUInt();
+ bool ok;
+ int value = getAttribute(maxlengthAttr).string().toInt(&ok);
+ return ok && value >= 0 ? value : -1;
}
-void HTMLTextAreaElement::setMaxLength(unsigned newValue)
+void HTMLTextAreaElement::setMaxLength(int newValue, ExceptionCode& exceptionCode)
{
- setAttribute(maxlengthAttr, String::number(newValue));
+ if (newValue < 0)
+ exceptionCode = INDEX_SIZE_ERR;
+ else
+ setAttribute(maxlengthAttr, String::number(newValue));
}
void HTMLTextAreaElement::accessKeyAction(bool)
diff --git a/src/3rdparty/webkit/WebCore/html/HTMLTextAreaElement.h b/src/3rdparty/webkit/WebCore/html/HTMLTextAreaElement.h
index ef96fc5..cfd471a 100644
--- a/src/3rdparty/webkit/WebCore/html/HTMLTextAreaElement.h
+++ b/src/3rdparty/webkit/WebCore/html/HTMLTextAreaElement.h
@@ -79,8 +79,8 @@ public:
String defaultValue() const;
void setDefaultValue(const String&);
int textLength() const { return value().length(); }
- unsigned maxLength() const;
- void setMaxLength(unsigned);
+ int maxLength() const;
+ void setMaxLength(int, ExceptionCode&);
void rendererWillBeDestroyed();
diff --git a/src/3rdparty/webkit/WebCore/html/HTMLTextAreaElement.idl b/src/3rdparty/webkit/WebCore/html/HTMLTextAreaElement.idl
index 84583f5..db5154e 100644
--- a/src/3rdparty/webkit/WebCore/html/HTMLTextAreaElement.idl
+++ b/src/3rdparty/webkit/WebCore/html/HTMLTextAreaElement.idl
@@ -34,7 +34,8 @@ module html {
attribute long cols;
attribute boolean disabled;
attribute boolean autofocus;
- attribute unsigned long maxLength;
+ attribute long maxLength
+ setter raises(DOMException);
attribute [ConvertNullToNullString] DOMString name;
attribute [ConvertNullToNullString, Reflect] DOMString placeholder;
attribute boolean readOnly;