summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/html
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2012-10-16 14:56:46 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2012-10-16 14:57:30 +0200
commitb297e0fa5c217c9467033b7c8b46891a52870120 (patch)
tree43fc14689295e9e64f2719d05aad94e3049f6cd7 /Source/WebCore/html
parent69d517dbfa69903d8593cc1737f0474b21e3251e (diff)
Revert "Imported WebKit commit 0dc6cd75e1d4836eaffbb520be96fac4847cc9d2 (http://svn.webkit.org/repository/webkit/trunk@131300)"
This reverts commit 5466563f4b5b6b86523e3f89bb7f77e5b5270c78. Caused OOM issues on some CI machines :(
Diffstat (limited to 'Source/WebCore/html')
-rw-r--r--Source/WebCore/html/BaseDateAndTimeInputType.cpp6
-rw-r--r--Source/WebCore/html/BaseDateAndTimeInputType.h4
-rw-r--r--Source/WebCore/html/BaseMultipleFieldsDateAndTimeInputType.cpp358
-rw-r--r--Source/WebCore/html/BaseMultipleFieldsDateAndTimeInputType.h101
-rw-r--r--Source/WebCore/html/ClassList.cpp66
-rw-r--r--Source/WebCore/html/ClassList.h28
-rw-r--r--Source/WebCore/html/DOMFormData.idl29
-rw-r--r--Source/WebCore/html/DOMSettableTokenList.cpp43
-rw-r--r--Source/WebCore/html/DOMSettableTokenList.h28
-rw-r--r--Source/WebCore/html/DOMSettableTokenList.idl15
-rw-r--r--Source/WebCore/html/DOMTokenList.cpp129
-rw-r--r--Source/WebCore/html/DOMTokenList.h24
-rw-r--r--Source/WebCore/html/DOMTokenList.idl27
-rw-r--r--Source/WebCore/html/DOMURL.idl28
-rw-r--r--Source/WebCore/html/DateInputType.cpp42
-rw-r--r--Source/WebCore/html/DateInputType.h27
-rw-r--r--Source/WebCore/html/DateTimeFieldsState.cpp2
-rw-r--r--Source/WebCore/html/DateTimeFieldsState.h4
-rw-r--r--Source/WebCore/html/DateTimeInputType.cpp63
-rw-r--r--Source/WebCore/html/DateTimeInputType.h17
-rw-r--r--Source/WebCore/html/DateTimeLocalInputType.cpp63
-rw-r--r--Source/WebCore/html/DateTimeLocalInputType.h19
-rw-r--r--Source/WebCore/html/FormController.cpp34
-rw-r--r--Source/WebCore/html/HTMLAllCollection.idl31
-rw-r--r--Source/WebCore/html/HTMLAnchorElement.idl71
-rw-r--r--Source/WebCore/html/HTMLAppletElement.idl41
-rw-r--r--Source/WebCore/html/HTMLAreaElement.idl43
-rw-r--r--Source/WebCore/html/HTMLAudioElement.idl14
-rw-r--r--Source/WebCore/html/HTMLBRElement.idl9
-rw-r--r--Source/WebCore/html/HTMLBaseElement.idl11
-rw-r--r--Source/WebCore/html/HTMLBaseFontElement.idl15
-rw-r--r--Source/WebCore/html/HTMLBodyElement.idl61
-rw-r--r--Source/WebCore/html/HTMLButtonElement.idl45
-rw-r--r--Source/WebCore/html/HTMLCanvasElement.cpp13
-rw-r--r--Source/WebCore/html/HTMLCanvasElement.h3
-rw-r--r--Source/WebCore/html/HTMLCanvasElement.idl23
-rw-r--r--Source/WebCore/html/HTMLCollection.cpp2
-rw-r--r--Source/WebCore/html/HTMLCollection.idl29
-rw-r--r--Source/WebCore/html/HTMLDListElement.idl9
-rw-r--r--Source/WebCore/html/HTMLDataListElement.idl12
-rw-r--r--Source/WebCore/html/HTMLDetailsElement.idl12
-rw-r--r--Source/WebCore/html/HTMLDialogElement.idl19
-rw-r--r--Source/WebCore/html/HTMLDirectoryElement.idl9
-rw-r--r--Source/WebCore/html/HTMLDivElement.idl9
-rw-r--r--Source/WebCore/html/HTMLDocument.idl65
-rw-r--r--Source/WebCore/html/HTMLElement.idl105
-rw-r--r--Source/WebCore/html/HTMLEmbedElement.idl33
-rw-r--r--Source/WebCore/html/HTMLFieldSetElement.idl27
-rw-r--r--Source/WebCore/html/HTMLFontElement.idl13
-rw-r--r--Source/WebCore/html/HTMLFormElement.cpp7
-rw-r--r--Source/WebCore/html/HTMLFormElement.h8
-rw-r--r--Source/WebCore/html/HTMLFormElement.idl43
-rw-r--r--Source/WebCore/html/HTMLFrameElement.idl41
-rw-r--r--Source/WebCore/html/HTMLFrameElementBase.cpp2
-rw-r--r--Source/WebCore/html/HTMLFrameSetElement.idl57
-rw-r--r--Source/WebCore/html/HTMLHRElement.idl15
-rw-r--r--Source/WebCore/html/HTMLHeadElement.idl9
-rw-r--r--Source/WebCore/html/HTMLHeadingElement.idl9
-rw-r--r--Source/WebCore/html/HTMLHtmlElement.idl11
-rw-r--r--Source/WebCore/html/HTMLIFrameElement.idl45
-rw-r--r--Source/WebCore/html/HTMLImageElement.idl59
-rw-r--r--Source/WebCore/html/HTMLInputElement.cpp8
-rw-r--r--Source/WebCore/html/HTMLInputElement.h1
-rw-r--r--Source/WebCore/html/HTMLInputElement.idl145
-rw-r--r--Source/WebCore/html/HTMLIntentElement.idl21
-rw-r--r--Source/WebCore/html/HTMLKeygenElement.idl33
-rw-r--r--Source/WebCore/html/HTMLLIElement.cpp4
-rw-r--r--Source/WebCore/html/HTMLLIElement.idl11
-rw-r--r--Source/WebCore/html/HTMLLabelElement.idl15
-rw-r--r--Source/WebCore/html/HTMLLegendElement.idl13
-rw-r--r--Source/WebCore/html/HTMLLinkElement.idl35
-rw-r--r--Source/WebCore/html/HTMLMapElement.idl11
-rw-r--r--Source/WebCore/html/HTMLMarqueeElement.idl45
-rw-r--r--Source/WebCore/html/HTMLMediaElement.cpp11
-rw-r--r--Source/WebCore/html/HTMLMediaElement.h2
-rw-r--r--Source/WebCore/html/HTMLMediaElement.idl148
-rw-r--r--Source/WebCore/html/HTMLMenuElement.idl9
-rw-r--r--Source/WebCore/html/HTMLMetaElement.idl15
-rw-r--r--Source/WebCore/html/HTMLMeterElement.idl37
-rw-r--r--Source/WebCore/html/HTMLModElement.idl11
-rw-r--r--Source/WebCore/html/HTMLOListElement.idl15
-rw-r--r--Source/WebCore/html/HTMLObjectElement.idl69
-rw-r--r--Source/WebCore/html/HTMLOptGroupElement.idl11
-rw-r--r--Source/WebCore/html/HTMLOptionElement.idl33
-rw-r--r--Source/WebCore/html/HTMLOptionsCollection.idl31
-rw-r--r--Source/WebCore/html/HTMLOutputElement.idl30
-rw-r--r--Source/WebCore/html/HTMLParagraphElement.idl9
-rw-r--r--Source/WebCore/html/HTMLParamElement.idl15
-rw-r--r--Source/WebCore/html/HTMLPlugInElement.cpp14
-rw-r--r--Source/WebCore/html/HTMLPlugInElement.h16
-rw-r--r--Source/WebCore/html/HTMLPlugInImageElement.cpp21
-rw-r--r--Source/WebCore/html/HTMLPlugInImageElement.h6
-rw-r--r--Source/WebCore/html/HTMLPreElement.idl19
-rw-r--r--Source/WebCore/html/HTMLProgressElement.idl22
-rw-r--r--Source/WebCore/html/HTMLPropertiesCollection.idl25
-rw-r--r--Source/WebCore/html/HTMLQuoteElement.idl9
-rw-r--r--Source/WebCore/html/HTMLScriptElement.idl27
-rw-r--r--Source/WebCore/html/HTMLSelectElement.cpp10
-rw-r--r--Source/WebCore/html/HTMLSelectElement.idl73
-rw-r--r--Source/WebCore/html/HTMLSourceElement.idl14
-rw-r--r--Source/WebCore/html/HTMLSpanElement.idl9
-rw-r--r--Source/WebCore/html/HTMLStyleElement.cpp35
-rw-r--r--Source/WebCore/html/HTMLStyleElement.h6
-rw-r--r--Source/WebCore/html/HTMLStyleElement.idl19
-rw-r--r--Source/WebCore/html/HTMLTableCaptionElement.idl13
-rw-r--r--Source/WebCore/html/HTMLTableCellElement.idl37
-rw-r--r--Source/WebCore/html/HTMLTableColElement.idl19
-rw-r--r--Source/WebCore/html/HTMLTableElement.idl63
-rw-r--r--Source/WebCore/html/HTMLTableRowElement.idl27
-rw-r--r--Source/WebCore/html/HTMLTableSectionElement.idl25
-rw-r--r--Source/WebCore/html/HTMLTextAreaElement.cpp32
-rw-r--r--Source/WebCore/html/HTMLTextAreaElement.idl69
-rw-r--r--Source/WebCore/html/HTMLTextFormControlElement.cpp4
-rw-r--r--Source/WebCore/html/HTMLTitleElement.idl9
-rw-r--r--Source/WebCore/html/HTMLTrackElement.idl34
-rw-r--r--Source/WebCore/html/HTMLUListElement.idl11
-rw-r--r--Source/WebCore/html/HTMLUnknownElement.idl7
-rw-r--r--Source/WebCore/html/HTMLVideoElement.idl48
-rw-r--r--Source/WebCore/html/ImageData.idl17
-rw-r--r--Source/WebCore/html/ImageDocument.cpp3
-rw-r--r--Source/WebCore/html/MediaController.idl64
-rw-r--r--Source/WebCore/html/MediaError.idl22
-rw-r--r--Source/WebCore/html/MediaKeyError.idl26
-rw-r--r--Source/WebCore/html/MediaKeyEvent.idl29
-rw-r--r--Source/WebCore/html/MicroDataItemValue.idl15
-rw-r--r--Source/WebCore/html/MonthInputType.cpp25
-rw-r--r--Source/WebCore/html/MonthInputType.h19
-rw-r--r--Source/WebCore/html/NumberInputType.cpp6
-rw-r--r--Source/WebCore/html/RadioNodeList.idl16
-rw-r--r--Source/WebCore/html/TextFieldInputType.cpp4
-rw-r--r--Source/WebCore/html/TextMetrics.idl9
-rw-r--r--Source/WebCore/html/TimeInputType.cpp228
-rw-r--r--Source/WebCore/html/TimeInputType.h69
-rw-r--r--Source/WebCore/html/TimeRanges.idl21
-rw-r--r--Source/WebCore/html/ValidityState.idl29
-rw-r--r--Source/WebCore/html/VoidCallback.idl12
-rw-r--r--Source/WebCore/html/WeekInputType.cpp25
-rw-r--r--Source/WebCore/html/WeekInputType.h18
-rw-r--r--Source/WebCore/html/canvas/ArrayBuffer.idl21
-rw-r--r--Source/WebCore/html/canvas/ArrayBufferView.idl20
-rw-r--r--Source/WebCore/html/canvas/CanvasGradient.idl14
-rw-r--r--Source/WebCore/html/canvas/CanvasPattern.idl8
-rw-r--r--Source/WebCore/html/canvas/CanvasRenderingContext.idl17
-rw-r--r--Source/WebCore/html/canvas/CanvasRenderingContext2D.idl404
-rwxr-xr-xSource/WebCore/html/canvas/DataView.idl97
-rw-r--r--Source/WebCore/html/canvas/EXTTextureFilterAnisotropic.idl20
-rw-r--r--Source/WebCore/html/canvas/Float32Array.idl40
-rw-r--r--Source/WebCore/html/canvas/Float64Array.idl40
-rw-r--r--Source/WebCore/html/canvas/Int16Array.idl40
-rw-r--r--Source/WebCore/html/canvas/Int32Array.idl40
-rw-r--r--Source/WebCore/html/canvas/Int8Array.idl40
-rw-r--r--Source/WebCore/html/canvas/OESStandardDerivatives.idl18
-rw-r--r--Source/WebCore/html/canvas/OESTextureFloat.idl14
-rw-r--r--Source/WebCore/html/canvas/OESVertexArrayObject.idl28
-rw-r--r--Source/WebCore/html/canvas/Uint16Array.idl38
-rw-r--r--Source/WebCore/html/canvas/Uint32Array.idl38
-rw-r--r--Source/WebCore/html/canvas/Uint8Array.idl38
-rw-r--r--Source/WebCore/html/canvas/Uint8ClampedArray.idl40
-rw-r--r--Source/WebCore/html/canvas/WebGLActiveInfo.idl17
-rw-r--r--Source/WebCore/html/canvas/WebGLBuffer.idl10
-rw-r--r--Source/WebCore/html/canvas/WebGLCompressedTextureS3TC.idl26
-rw-r--r--Source/WebCore/html/canvas/WebGLContextAttributes.idl24
-rw-r--r--Source/WebCore/html/canvas/WebGLContextEvent.idl15
-rw-r--r--Source/WebCore/html/canvas/WebGLDebugRendererInfo.idl20
-rw-r--r--Source/WebCore/html/canvas/WebGLDebugShaders.idl16
-rw-r--r--Source/WebCore/html/canvas/WebGLDepthTexture.idl18
-rw-r--r--Source/WebCore/html/canvas/WebGLFramebuffer.cpp22
-rw-r--r--Source/WebCore/html/canvas/WebGLFramebuffer.idl10
-rw-r--r--Source/WebCore/html/canvas/WebGLLoseContext.idl18
-rw-r--r--Source/WebCore/html/canvas/WebGLProgram.idl10
-rw-r--r--Source/WebCore/html/canvas/WebGLRenderbuffer.idl10
-rw-r--r--Source/WebCore/html/canvas/WebGLRenderingContext.cpp13
-rw-r--r--Source/WebCore/html/canvas/WebGLRenderingContext.h2
-rw-r--r--Source/WebCore/html/canvas/WebGLRenderingContext.idl1272
-rw-r--r--Source/WebCore/html/canvas/WebGLShader.idl10
-rw-r--r--Source/WebCore/html/canvas/WebGLShaderPrecisionFormat.idl17
-rw-r--r--Source/WebCore/html/canvas/WebGLTexture.idl10
-rw-r--r--Source/WebCore/html/canvas/WebGLUniformLocation.idl10
-rw-r--r--Source/WebCore/html/canvas/WebGLVertexArrayObjectOES.idl10
-rw-r--r--Source/WebCore/html/parser/HTMLConstructionSite.cpp2
-rw-r--r--Source/WebCore/html/shadow/CalendarPickerElement.cpp (renamed from Source/WebCore/html/shadow/PickerIndicatorElement.cpp)44
-rw-r--r--Source/WebCore/html/shadow/CalendarPickerElement.h (renamed from Source/WebCore/html/shadow/PickerIndicatorElement.h)12
-rw-r--r--Source/WebCore/html/shadow/ContentDistributor.cpp21
-rw-r--r--Source/WebCore/html/shadow/ContentSelectorQuery.cpp42
-rw-r--r--Source/WebCore/html/shadow/ContentSelectorQuery.h26
-rw-r--r--Source/WebCore/html/shadow/DateTimeEditElement.cpp83
-rw-r--r--Source/WebCore/html/shadow/DateTimeEditElement.h16
-rw-r--r--Source/WebCore/html/shadow/DateTimeFieldElement.cpp15
-rw-r--r--Source/WebCore/html/shadow/DateTimeFieldElement.h5
-rw-r--r--Source/WebCore/html/shadow/DateTimeFieldElements.cpp208
-rw-r--r--Source/WebCore/html/shadow/DateTimeFieldElements.h85
-rw-r--r--Source/WebCore/html/shadow/DateTimeNumericFieldElement.cpp104
-rw-r--r--Source/WebCore/html/shadow/DateTimeNumericFieldElement.h15
-rw-r--r--Source/WebCore/html/shadow/DateTimeSymbolicFieldElement.cpp2
-rw-r--r--Source/WebCore/html/shadow/DateTimeSymbolicFieldElement.h2
-rw-r--r--Source/WebCore/html/shadow/HTMLContentElement.idl15
-rw-r--r--Source/WebCore/html/shadow/HTMLShadowElement.cpp28
-rw-r--r--Source/WebCore/html/shadow/HTMLShadowElement.h6
-rw-r--r--Source/WebCore/html/shadow/HTMLShadowElement.idl15
-rw-r--r--Source/WebCore/html/shadow/InsertionPoint.cpp29
-rw-r--r--Source/WebCore/html/shadow/InsertionPoint.h6
-rw-r--r--Source/WebCore/html/shadow/SliderThumbElement.cpp2
-rw-r--r--Source/WebCore/html/shadow/SpinButtonElement.cpp2
-rw-r--r--Source/WebCore/html/shadow/TextFieldDecorationElement.cpp22
-rw-r--r--Source/WebCore/html/shadow/TextFieldDecorationElement.h3
-rw-r--r--Source/WebCore/html/track/TextTrack.idl59
-rw-r--r--Source/WebCore/html/track/TextTrackCue.idl87
-rw-r--r--Source/WebCore/html/track/TextTrackCueList.idl21
-rw-r--r--Source/WebCore/html/track/TextTrackList.idl45
-rw-r--r--Source/WebCore/html/track/TrackEvent.idl17
210 files changed, 3588 insertions, 4381 deletions
diff --git a/Source/WebCore/html/BaseDateAndTimeInputType.cpp b/Source/WebCore/html/BaseDateAndTimeInputType.cpp
index 44c3a83d7..4b7f93cf0 100644
--- a/Source/WebCore/html/BaseDateAndTimeInputType.cpp
+++ b/Source/WebCore/html/BaseDateAndTimeInputType.cpp
@@ -34,7 +34,7 @@
#include "HTMLInputElement.h"
#include "HTMLNames.h"
#include "KeyboardEvent.h"
-#include "Localizer.h"
+#include "LocalizedDate.h"
#include <limits>
#include <wtf/CurrentTime.h>
#include <wtf/DateMath.h>
@@ -156,7 +156,7 @@ String BaseDateAndTimeInputType::localizeValue(const String& proposedValue) cons
if (!parseToDateComponents(proposedValue, &date))
return proposedValue;
- String localized = element()->localizer().formatDateTime(date);
+ String localized = formatLocalizedDate(date);
return localized.isEmpty() ? proposedValue : localized;
}
@@ -170,7 +170,7 @@ String BaseDateAndTimeInputType::convertFromVisibleValue(const String& visibleVa
if (visibleValue.isEmpty())
return visibleValue;
- double parsedValue = element()->localizer().parseDateTime(visibleValue, dateType());
+ double parsedValue = parseLocalizedDate(visibleValue, dateType());
if (!isfinite(parsedValue))
return visibleValue;
diff --git a/Source/WebCore/html/BaseDateAndTimeInputType.h b/Source/WebCore/html/BaseDateAndTimeInputType.h
index 96b7b5fe6..a49910fde 100644
--- a/Source/WebCore/html/BaseDateAndTimeInputType.h
+++ b/Source/WebCore/html/BaseDateAndTimeInputType.h
@@ -44,13 +44,12 @@ protected:
virtual void handleKeydownEvent(KeyboardEvent*) OVERRIDE;
virtual Decimal parseToNumber(const String&, const Decimal&) const OVERRIDE;
virtual bool parseToDateComponents(const String&, DateComponents*) const OVERRIDE;
- virtual String sanitizeValue(const String&) const OVERRIDE;
virtual String serialize(const Decimal&) const OVERRIDE;
String serializeWithComponents(const DateComponents&) const;
- virtual bool setMillisecondToDateComponents(double, DateComponents*) const = 0;
private:
virtual bool parseToDateComponentsInternal(const UChar*, unsigned length, DateComponents*) const = 0;
+ virtual bool setMillisecondToDateComponents(double, DateComponents*) const = 0;
virtual DateComponents::Type dateType() const = 0;
virtual double valueAsDate() const OVERRIDE;
virtual void setValueAsDate(double, ExceptionCode&) const OVERRIDE;
@@ -64,6 +63,7 @@ private:
virtual String localizeValue(const String&) const OVERRIDE;
virtual String visibleValue() const OVERRIDE;
virtual String convertFromVisibleValue(const String&) const OVERRIDE;
+ virtual String sanitizeValue(const String&) const OVERRIDE;
};
} // namespace WebCore
diff --git a/Source/WebCore/html/BaseMultipleFieldsDateAndTimeInputType.cpp b/Source/WebCore/html/BaseMultipleFieldsDateAndTimeInputType.cpp
deleted file mode 100644
index a4668e1e3..000000000
--- a/Source/WebCore/html/BaseMultipleFieldsDateAndTimeInputType.cpp
+++ /dev/null
@@ -1,358 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
-#include "BaseMultipleFieldsDateAndTimeInputType.h"
-
-#include "CSSValueKeywords.h"
-#include "DateComponents.h"
-#include "DateTimeFieldsState.h"
-#include "ElementShadow.h"
-#include "FormController.h"
-#include "HTMLDataListElement.h"
-#include "HTMLInputElement.h"
-#include "HTMLOptionElement.h"
-#include "KeyboardEvent.h"
-#include "Localizer.h"
-#include "Page.h"
-#include "PickerIndicatorElement.h"
-#include "RenderTheme.h"
-#include "ShadowRoot.h"
-#include <wtf/DateMath.h>
-
-namespace WebCore {
-
-void BaseMultipleFieldsDateAndTimeInputType::didBlurFromControl()
-{
- // We don't need to call blur(). This function is called when control
- // lost focus.
-
- // Remove focus ring by CSS "focus" pseudo class.
- element()->setFocus(false);
-}
-
-void BaseMultipleFieldsDateAndTimeInputType::didFocusOnControl()
-{
- // We don't need to call focus(). This function is called when control
- // got focus.
-
- // Add focus ring by CSS "focus" pseudo class.
- element()->setFocus(true);
-}
-
-void BaseMultipleFieldsDateAndTimeInputType::editControlValueChanged()
-{
- RefPtr<HTMLInputElement> input(element());
- input->setValueInternal(sanitizeValue(m_dateTimeEditElement->value()), DispatchNoEvent);
- input->setNeedsStyleRecalc();
- input->dispatchFormControlInputEvent();
- input->dispatchFormControlChangeEvent();
- input->notifyFormStateChanged();
-}
-
-bool BaseMultipleFieldsDateAndTimeInputType::hasCustomFocusLogic() const
-{
- return false;
-}
-
-bool BaseMultipleFieldsDateAndTimeInputType::isEditControlOwnerDisabled() const
-{
- return element()->readOnly();
-}
-
-bool BaseMultipleFieldsDateAndTimeInputType::isEditControlOwnerReadOnly() const
-{
- return element()->disabled();
-}
-
-BaseMultipleFieldsDateAndTimeInputType::BaseMultipleFieldsDateAndTimeInputType(HTMLInputElement* element)
- : BaseDateAndTimeInputType(element)
- , m_dateTimeEditElement(0)
- , m_pickerIndicatorElement(0)
- , m_pickerIndicatorIsVisible(false)
- , m_pickerIndicatorIsAlwaysVisible(false)
-{
-}
-
-BaseMultipleFieldsDateAndTimeInputType::~BaseMultipleFieldsDateAndTimeInputType()
-{
- if (m_dateTimeEditElement)
- m_dateTimeEditElement->removeEditControlOwner();
-}
-
-void BaseMultipleFieldsDateAndTimeInputType::blur()
-{
- if (m_dateTimeEditElement)
- m_dateTimeEditElement->blurByOwner();
-}
-
-RenderObject* BaseMultipleFieldsDateAndTimeInputType::createRenderer(RenderArena* arena, RenderStyle* style) const
-{
- return InputType::createRenderer(arena, style);
-}
-
-void BaseMultipleFieldsDateAndTimeInputType::createShadowSubtree()
-{
- DEFINE_STATIC_LOCAL(AtomicString, dateAndTimeInputContainerPseudoId, ("-webkit-date-and-time-container", AtomicString::ConstructFromLiteral));
-
- ASSERT(element()->shadow());
-
- Document* document = element()->document();
- RefPtr<HTMLDivElement> container = HTMLDivElement::create(document);
- element()->userAgentShadowRoot()->appendChild(container);
- container->setShadowPseudoId(dateAndTimeInputContainerPseudoId);
-
- RefPtr<DateTimeEditElement> dateTimeEditElement(DateTimeEditElement::create(document, *this));
- m_dateTimeEditElement = dateTimeEditElement.get();
- container->appendChild(m_dateTimeEditElement);
- updateInnerTextValue();
-
-#if ENABLE(DATALIST_ELEMENT) || ENABLE(CALENDAR_PICKER)
- bool shouldAddPickerIndicator = false;
-#if ENABLE(DATALIST_ELEMENT)
- if (InputType::themeSupportsDataListUI(this))
- shouldAddPickerIndicator = true;
-#endif
-#if ENABLE(CALENDAR_PICKER)
- RefPtr<RenderTheme> theme = document->page() ? document->page()->theme() : RenderTheme::defaultTheme();
- if (theme->supportsCalendarPicker(formControlType())) {
- shouldAddPickerIndicator = true;
- m_pickerIndicatorIsAlwaysVisible = true;
- }
-#endif
- if (shouldAddPickerIndicator) {
- RefPtr<PickerIndicatorElement> pickerElement = PickerIndicatorElement::create(document);
- m_pickerIndicatorElement = pickerElement.get();
- container->appendChild(m_pickerIndicatorElement);
- m_pickerIndicatorIsVisible = true;
- updatePickerIndicatorVisibility();
- }
-#endif // ENABLE(DATALIST_ELEMENT) || ENABLE(CALENDAR_PICKER)
-}
-
-void BaseMultipleFieldsDateAndTimeInputType::destroyShadowSubtree()
-{
- if (m_dateTimeEditElement) {
- m_dateTimeEditElement->removeEditControlOwner();
- m_dateTimeEditElement = 0;
- }
- BaseDateAndTimeInputType::destroyShadowSubtree();
-}
-
-void BaseMultipleFieldsDateAndTimeInputType::focus(bool)
-{
- if (m_dateTimeEditElement)
- m_dateTimeEditElement->focusByOwner();
-}
-
-void BaseMultipleFieldsDateAndTimeInputType::forwardEvent(Event* event)
-{
- if (m_dateTimeEditElement)
- m_dateTimeEditElement->defaultEventHandler(event);
-}
-
-void BaseMultipleFieldsDateAndTimeInputType::disabledAttributeChanged()
-{
- if (m_dateTimeEditElement)
- m_dateTimeEditElement->disabledStateChanged();
-}
-
-void BaseMultipleFieldsDateAndTimeInputType::handleKeydownEvent(KeyboardEvent* event)
-{
- Document* document = element()->document();
- RefPtr<RenderTheme> theme = document->page() ? document->page()->theme() : RenderTheme::defaultTheme();
- if (theme->shouldOpenPickerWithF4Key() && event->keyIdentifier() == "F4") {
- if (m_pickerIndicatorElement)
- m_pickerIndicatorElement->openPopup();
- event->setDefaultHandled();
- } else if (m_pickerIndicatorIsVisible && event->keyIdentifier() == "Down" && event->getModifierState("Alt")) {
- if (m_pickerIndicatorElement)
- m_pickerIndicatorElement->openPopup();
- event->setDefaultHandled();
- } else
- forwardEvent(event);
-}
-
-bool BaseMultipleFieldsDateAndTimeInputType::isKeyboardFocusable(KeyboardEvent*) const
-{
- return false;
-}
-
-bool BaseMultipleFieldsDateAndTimeInputType::isMouseFocusable() const
-{
- return false;
-}
-
-AtomicString BaseMultipleFieldsDateAndTimeInputType::localeIdentifier() const
-{
- return element()->computeInheritedLanguage();
-}
-
-void BaseMultipleFieldsDateAndTimeInputType::minOrMaxAttributeChanged()
-{
- updateInnerTextValue();
-}
-
-void BaseMultipleFieldsDateAndTimeInputType::readonlyAttributeChanged()
-{
- if (m_dateTimeEditElement)
- m_dateTimeEditElement->readOnlyStateChanged();
-}
-
-bool BaseMultipleFieldsDateAndTimeInputType::isTextField() const
-{
- return false;
-}
-
-void BaseMultipleFieldsDateAndTimeInputType::restoreFormControlState(const FormControlState& state)
-{
- if (!m_dateTimeEditElement)
- return;
- DateComponents date;
- setMillisecondToDateComponents(createStepRange(AnyIsDefaultStep).minimum().toDouble(), &date);
- DateTimeFieldsState dateTimeFieldsState = DateTimeFieldsState::restoreFormControlState(state);
- m_dateTimeEditElement->setValueAsDateTimeFieldsState(dateTimeFieldsState, date);
- element()->setValueInternal(sanitizeValue(m_dateTimeEditElement->value()), DispatchNoEvent);
-}
-
-FormControlState BaseMultipleFieldsDateAndTimeInputType::saveFormControlState() const
-{
- if (!m_dateTimeEditElement)
- return FormControlState();
-
- return m_dateTimeEditElement->valueAsDateTimeFieldsState().saveFormControlState();
-}
-
-void BaseMultipleFieldsDateAndTimeInputType::setValue(const String& sanitizedValue, bool valueChanged, TextFieldEventBehavior eventBehavior)
-{
- InputType::setValue(sanitizedValue, valueChanged, eventBehavior);
- if (valueChanged)
- updateInnerTextValue();
-}
-
-bool BaseMultipleFieldsDateAndTimeInputType::shouldUseInputMethod() const
-{
- return false;
-}
-
-void BaseMultipleFieldsDateAndTimeInputType::stepAttributeChanged()
-{
- updateInnerTextValue();
-}
-
-void BaseMultipleFieldsDateAndTimeInputType::updateInnerTextValue()
-{
- if (!m_dateTimeEditElement)
- return;
-
- DateTimeEditElement::LayoutParameters layoutParameters(element()->localizer(), createStepRange(AnyIsDefaultStep));
-
- DateComponents date;
- const bool hasValue = parseToDateComponents(element()->value(), &date);
- if (!hasValue)
- setMillisecondToDateComponents(layoutParameters.stepRange.minimum().toDouble(), &date);
-
- setupLayoutParameters(layoutParameters, date);
-
- if (hasValue)
- m_dateTimeEditElement->setValueAsDate(layoutParameters, date);
- else
- m_dateTimeEditElement->setEmptyValue(layoutParameters, date);
-}
-
-#if ENABLE(DATALIST_ELEMENT)
-void BaseMultipleFieldsDateAndTimeInputType::listAttributeTargetChanged()
-{
- updatePickerIndicatorVisibility();
-}
-#endif
-
-#if ENABLE(DATALIST_ELEMENT) || ENABLE(CALENDAR_PICKER)
-void BaseMultipleFieldsDateAndTimeInputType::updatePickerIndicatorVisibility()
-{
-#if ENABLE(CALENDAR_PICKER)
- if (m_pickerIndicatorIsAlwaysVisible) {
- showPickerIndicator();
- return;
- }
-#endif
-#if ENABLE(DATALIST_ELEMENT)
- if (HTMLDataListElement* dataList = element()->dataList()) {
- RefPtr<HTMLCollection> options = dataList->options();
- for (unsigned i = 0; HTMLOptionElement* option = toHTMLOptionElement(options->item(i)); ++i) {
- if (element()->isValidValue(option->value())) {
- showPickerIndicator();
- return;
- }
- }
- }
- hidePickerIndicator();
-#endif
-}
-
-void BaseMultipleFieldsDateAndTimeInputType::hidePickerIndicator()
-{
- if (!m_pickerIndicatorIsVisible)
- return;
- m_pickerIndicatorIsVisible = false;
- ASSERT(m_pickerIndicatorElement);
- m_pickerIndicatorElement->setInlineStyleProperty(CSSPropertyDisplay, CSSValueNone);
-}
-
-void BaseMultipleFieldsDateAndTimeInputType::showPickerIndicator()
-{
- if (m_pickerIndicatorIsVisible)
- return;
- m_pickerIndicatorIsVisible = true;
- ASSERT(m_pickerIndicatorElement);
- m_pickerIndicatorElement->removeInlineStyleProperty(CSSPropertyDisplay);
-}
-#endif // ENABLE(DATALIST_ELEMENT) || ENABLE(CALENDAR_PICKER)
-
-int BaseMultipleFieldsDateAndTimeInputType::fullYear(const String& source) const
-{
- DateComponents date;
- if (!parseToDateComponents(source, &date))
- return DateTimeEditElement::LayoutParameters::undefinedYear();
- return date.fullYear();
-}
-
-bool BaseMultipleFieldsDateAndTimeInputType::shouldHaveSecondField(const DateComponents& date) const
-{
- StepRange stepRange = createStepRange(AnyIsDefaultStep);
- return date.second()
- || !stepRange.minimum().remainder(static_cast<int>(msPerMinute)).isZero()
- || !stepRange.step().remainder(static_cast<int>(msPerMinute)).isZero();
-}
-
-} // namespace WebCore
-
-#endif
diff --git a/Source/WebCore/html/BaseMultipleFieldsDateAndTimeInputType.h b/Source/WebCore/html/BaseMultipleFieldsDateAndTimeInputType.h
deleted file mode 100644
index 319330438..000000000
--- a/Source/WebCore/html/BaseMultipleFieldsDateAndTimeInputType.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef BaseMultipleFieldsDateAndTimeInputType_h
-#define BaseMultipleFieldsDateAndTimeInputType_h
-
-#include "BaseDateAndTimeInputType.h"
-
-#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
-#include "DateTimeEditElement.h"
-
-namespace WebCore {
-
-class PickerIndicatorElement;
-
-class BaseMultipleFieldsDateAndTimeInputType : public BaseDateAndTimeInputType, protected DateTimeEditElement::EditControlOwner {
-protected:
- BaseMultipleFieldsDateAndTimeInputType(HTMLInputElement*);
- virtual ~BaseMultipleFieldsDateAndTimeInputType();
-
- int fullYear(const String&) const;
- virtual void setupLayoutParameters(DateTimeEditElement::LayoutParameters&, const DateComponents&) const = 0;
- bool shouldHaveSecondField(const DateComponents&) const;
-
-private:
- // DateTimeEditElement::EditControlOwner functions
- virtual void didBlurFromControl() OVERRIDE FINAL;
- virtual void didFocusOnControl() OVERRIDE FINAL;
- virtual void editControlValueChanged() OVERRIDE FINAL;
- virtual bool isEditControlOwnerDisabled() const OVERRIDE FINAL;
- virtual bool isEditControlOwnerReadOnly() const OVERRIDE FINAL;
- virtual AtomicString localeIdentifier() const OVERRIDE FINAL;
-
- // InputType functions
- virtual void blur() OVERRIDE FINAL;
- virtual RenderObject* createRenderer(RenderArena*, RenderStyle*) const OVERRIDE FINAL;
- virtual void createShadowSubtree() OVERRIDE FINAL;
- virtual void destroyShadowSubtree() OVERRIDE FINAL;
- virtual void disabledAttributeChanged() OVERRIDE FINAL;
- virtual void focus(bool restorePreviousSelection) OVERRIDE FINAL;
- virtual void forwardEvent(Event*) OVERRIDE FINAL;
- virtual void handleKeydownEvent(KeyboardEvent*) OVERRIDE FINAL;
- virtual bool hasCustomFocusLogic() const OVERRIDE FINAL;
- virtual bool isKeyboardFocusable(KeyboardEvent*) const OVERRIDE FINAL;
- virtual bool isMouseFocusable() const OVERRIDE FINAL;
- virtual bool isTextField() const OVERRIDE FINAL;
- virtual void minOrMaxAttributeChanged() OVERRIDE FINAL;
- virtual void readonlyAttributeChanged() OVERRIDE FINAL;
- virtual void restoreFormControlState(const FormControlState&) OVERRIDE FINAL;
- virtual FormControlState saveFormControlState() const OVERRIDE FINAL;
- virtual void setValue(const String&, bool valueChanged, TextFieldEventBehavior) OVERRIDE FINAL;
- virtual bool shouldUseInputMethod() const OVERRIDE FINAL;
- virtual void stepAttributeChanged() OVERRIDE FINAL;
- virtual void updateInnerTextValue() OVERRIDE FINAL;
- virtual void listAttributeTargetChanged() OVERRIDE FINAL;
-
- void showPickerIndicator();
- void hidePickerIndicator();
- void updatePickerIndicatorVisibility();
-
- DateTimeEditElement* m_dateTimeEditElement;
-#if ENABLE(DATALIST_ELEMENT) || ENABLE(CALENDAR_PICKER)
- PickerIndicatorElement* m_pickerIndicatorElement;
- bool m_pickerIndicatorIsVisible;
-#if ENABLE(CALENDAR_PICKER)
- bool m_pickerIndicatorIsAlwaysVisible;
-#endif
-#endif
-};
-
-} // namespace WebCore
-
-#endif
-#endif // TimeInputType_h
diff --git a/Source/WebCore/html/ClassList.cpp b/Source/WebCore/html/ClassList.cpp
index 5ff3bdaf6..a325a1226 100644
--- a/Source/WebCore/html/ClassList.cpp
+++ b/Source/WebCore/html/ClassList.cpp
@@ -25,17 +25,21 @@
#include "config.h"
#include "ClassList.h"
+#include "Element.h"
+#include "HTMLNames.h"
#include "HTMLParserIdioms.h"
#include "SpaceSplitString.h"
#include <wtf/text/StringBuilder.h>
namespace WebCore {
+using namespace HTMLNames;
+
ClassList::ClassList(Element* element)
: m_element(element)
{
if (m_element->document()->inQuirksMode())
- m_classNamesForQuirksMode.set(value(), false);
+ m_classNamesForQuirksMode.set(m_element->getAttribute(classAttr), false);
}
void ClassList::ref()
@@ -60,11 +64,71 @@ const AtomicString ClassList::item(unsigned index) const
return classNames()[index];
}
+bool ClassList::contains(const AtomicString& token, ExceptionCode& ec) const
+{
+ if (!validateToken(token, ec))
+ return false;
+ return containsInternal(token);
+}
+
bool ClassList::containsInternal(const AtomicString& token) const
{
return m_element->hasClass() && classNames().contains(token);
}
+void ClassList::add(const AtomicString& token, ExceptionCode& ec)
+{
+ if (!validateToken(token, ec))
+ return;
+ addInternal(token);
+}
+
+void ClassList::addInternal(const AtomicString& token)
+{
+ const AtomicString& oldClassName(m_element->getAttribute(classAttr));
+ if (oldClassName.isEmpty())
+ m_element->setAttribute(classAttr, token);
+ else if (!containsInternal(token)) {
+ const AtomicString& newClassName(addToken(oldClassName, token));
+ m_element->setAttribute(classAttr, newClassName);
+ }
+}
+
+void ClassList::remove(const AtomicString& token, ExceptionCode& ec)
+{
+ if (!validateToken(token, ec))
+ return;
+ removeInternal(token);
+}
+
+void ClassList::removeInternal(const AtomicString& token)
+{
+ // Check using contains first since it uses AtomicString comparisons instead
+ // of character by character testing.
+ if (!containsInternal(token))
+ return;
+ const AtomicString& newClassName(removeToken(m_element->getAttribute(classAttr), token));
+ m_element->setAttribute(classAttr, newClassName);
+}
+
+bool ClassList::toggle(const AtomicString& token, ExceptionCode& ec)
+{
+ if (!validateToken(token, ec))
+ return false;
+
+ if (containsInternal(token)) {
+ removeInternal(token);
+ return false;
+ }
+ addInternal(token);
+ return true;
+}
+
+String ClassList::toString() const
+{
+ return m_element->getAttribute(classAttr);
+}
+
void ClassList::reset(const String& newClassName)
{
if (m_element->document()->inQuirksMode())
diff --git a/Source/WebCore/html/ClassList.h b/Source/WebCore/html/ClassList.h
index 5e339c045..992fad474 100644
--- a/Source/WebCore/html/ClassList.h
+++ b/Source/WebCore/html/ClassList.h
@@ -26,17 +26,11 @@
#define ClassList_h
#include "DOMTokenList.h"
-#include "Element.h"
-#include "HTMLNames.h"
#include "SpaceSplitString.h"
#include <wtf/PassOwnPtr.h>
-#include <wtf/Vector.h>
-
namespace WebCore {
-using namespace HTMLNames;
-
class Element;
typedef int ExceptionCode;
@@ -48,26 +42,30 @@ public:
return adoptPtr(new ClassList(element));
}
- virtual void ref() OVERRIDE;
- virtual void deref() OVERRIDE;
+ virtual void ref();
+ virtual void deref();
- virtual unsigned length() const OVERRIDE;
- virtual const AtomicString item(unsigned index) const OVERRIDE;
+ virtual unsigned length() const;
+ virtual const AtomicString item(unsigned index) const;
+ virtual bool contains(const AtomicString&, ExceptionCode&) const;
+ virtual void add(const AtomicString&, ExceptionCode&);
+ virtual void remove(const AtomicString&, ExceptionCode&);
+ virtual bool toggle(const AtomicString&, ExceptionCode&);
+ virtual String toString() const;
- virtual Element* element() OVERRIDE { return m_element; }
+ virtual Element* element() { return m_element; }
void reset(const String&);
private:
ClassList(Element*);
- virtual bool containsInternal(const AtomicString&) const OVERRIDE;
+ void addInternal(const AtomicString&);
+ bool containsInternal(const AtomicString&) const;
+ void removeInternal(const AtomicString&);
const SpaceSplitString& classNames() const;
- virtual AtomicString value() const OVERRIDE { return m_element->getAttribute(classAttr); }
- virtual void setValue(const AtomicString& value) OVERRIDE { m_element->setAttribute(classAttr, value); }
-
Element* m_element;
SpaceSplitString m_classNamesForQuirksMode;
};
diff --git a/Source/WebCore/html/DOMFormData.idl b/Source/WebCore/html/DOMFormData.idl
index cf16babdb..73eaa6618 100644
--- a/Source/WebCore/html/DOMFormData.idl
+++ b/Source/WebCore/html/DOMFormData.idl
@@ -28,17 +28,20 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- CustomConstructor,
- ConstructorParameters=1,
- JSGenerateToNativeObject,
- JSGenerateToJSObject,
- InterfaceName=FormData
-] interface DOMFormData {
- // void append(DOMString name, DOMString value);
- // void append(DOMString name, Blob value, optional DOMString filename);
- [Custom] void append(in [Optional=DefaultIsUndefined] DOMString name,
- in [Optional=DefaultIsUndefined] DOMString value,
- in [Optional=DefaultIsUndefined] DOMString filename);
-};
+module html {
+ interface [
+ CustomConstructor,
+ ConstructorParameters=1,
+ JSGenerateToNativeObject,
+ JSGenerateToJSObject,
+ InterfaceName=FormData
+ ] DOMFormData {
+ // void append(DOMString name, DOMString value);
+ // void append(DOMString name, Blob value, optional DOMString filename);
+ [Custom] void append(in [Optional=DefaultIsUndefined] DOMString name,
+ in [Optional=DefaultIsUndefined] DOMString value,
+ in [Optional=DefaultIsUndefined] DOMString filename);
+ };
+
+}
diff --git a/Source/WebCore/html/DOMSettableTokenList.cpp b/Source/WebCore/html/DOMSettableTokenList.cpp
index 4ef0f7f51..3a86e9c00 100644
--- a/Source/WebCore/html/DOMSettableTokenList.cpp
+++ b/Source/WebCore/html/DOMSettableTokenList.cpp
@@ -44,46 +44,55 @@ const AtomicString DOMSettableTokenList::item(unsigned index) const
return m_tokens[index];
}
-bool DOMSettableTokenList::containsInternal(const AtomicString& token) const
+bool DOMSettableTokenList::contains(const AtomicString& token, ExceptionCode& ec) const
{
+ if (!validateToken(token, ec))
+ return false;
return m_tokens.contains(token);
}
-void DOMSettableTokenList::add(const Vector<String>& tokens, ExceptionCode& ec)
+void DOMSettableTokenList::add(const AtomicString& token, ExceptionCode& ec)
{
- DOMTokenList::add(tokens, ec);
-
- for (size_t i = 0; i < tokens.size(); ++i) {
- if (m_tokens.isNull())
- m_tokens.set(tokens[i], false);
- else
- m_tokens.add(tokens[i]);
- }
+ if (!validateToken(token, ec) || m_tokens.contains(token))
+ return;
+ addInternal(token);
}
void DOMSettableTokenList::addInternal(const AtomicString& token)
{
- DOMTokenList::addInternal(token);
+ m_value = addToken(m_value, token);
if (m_tokens.isNull())
m_tokens.set(token, false);
else
m_tokens.add(token);
}
-void DOMSettableTokenList::remove(const Vector<String>& tokens, ExceptionCode& ec)
+void DOMSettableTokenList::remove(const AtomicString& token, ExceptionCode& ec)
{
- DOMTokenList::remove(tokens, ec);
- for (size_t i = 0; i < tokens.size(); ++i)
- m_tokens.remove(tokens[i]);
+ if (!validateToken(token, ec) || !m_tokens.contains(token))
+ return;
+ removeInternal(token);
}
void DOMSettableTokenList::removeInternal(const AtomicString& token)
{
- DOMTokenList::removeInternal(token);
+ m_value = removeToken(m_value, token);
m_tokens.remove(token);
}
-void DOMSettableTokenList::setValue(const AtomicString& value)
+bool DOMSettableTokenList::toggle(const AtomicString& token, ExceptionCode& ec)
+{
+ if (!validateToken(token, ec))
+ return false;
+ if (m_tokens.contains(token)) {
+ removeInternal(token);
+ return false;
+ }
+ addInternal(token);
+ return true;
+}
+
+void DOMSettableTokenList::setValue(const String& value)
{
m_value = value;
m_tokens.set(value, false);
diff --git a/Source/WebCore/html/DOMSettableTokenList.h b/Source/WebCore/html/DOMSettableTokenList.h
index f338dc32b..0b23c6ab2 100644
--- a/Source/WebCore/html/DOMSettableTokenList.h
+++ b/Source/WebCore/html/DOMSettableTokenList.h
@@ -44,28 +44,28 @@ public:
}
virtual ~DOMSettableTokenList();
- virtual void ref() OVERRIDE { RefCounted<DOMSettableTokenList>::ref(); }
- virtual void deref() OVERRIDE { RefCounted<DOMSettableTokenList>::deref(); }
+ virtual void ref() { RefCounted<DOMSettableTokenList>::ref(); }
+ virtual void deref() { RefCounted<DOMSettableTokenList>::deref(); }
- virtual unsigned length() const OVERRIDE { return m_tokens.size(); }
- virtual const AtomicString item(unsigned index) const OVERRIDE;
-
- virtual void add(const Vector<String>&, ExceptionCode&) OVERRIDE;
- virtual void remove(const Vector<String>&, ExceptionCode&) OVERRIDE;
-
- virtual AtomicString value() const OVERRIDE { return m_value; }
- virtual void setValue(const AtomicString&) OVERRIDE;
+ virtual unsigned length() const { return m_tokens.size(); }
+ virtual const AtomicString item(unsigned index) const;
+ virtual bool contains(const AtomicString&, ExceptionCode&) const;
+ virtual void add(const AtomicString&, ExceptionCode&);
+ virtual void remove(const AtomicString&, ExceptionCode&);
+ virtual bool toggle(const AtomicString&, ExceptionCode&);
+ virtual String toString() const { return value(); }
+ String value() const { return m_value; }
const SpaceSplitString& tokens() const { return m_tokens; }
+ void setValue(const String&);
private:
DOMSettableTokenList();
- virtual void addInternal(const AtomicString&) OVERRIDE;
- virtual bool containsInternal(const AtomicString&) const OVERRIDE;
- virtual void removeInternal(const AtomicString&) OVERRIDE;
+ void removeInternal(const AtomicString&);
+ void addInternal(const AtomicString&);
- AtomicString m_value;
+ String m_value;
SpaceSplitString m_tokens;
};
diff --git a/Source/WebCore/html/DOMSettableTokenList.idl b/Source/WebCore/html/DOMSettableTokenList.idl
index 5b4d10869..93bf67f69 100644
--- a/Source/WebCore/html/DOMSettableTokenList.idl
+++ b/Source/WebCore/html/DOMSettableTokenList.idl
@@ -22,10 +22,13 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- IndexedGetter,
- JSGenerateToJSObject
-] interface DOMSettableTokenList : DOMTokenList {
- attribute DOMString value;
-};
+module core {
+ interface [
+ IndexedGetter,
+ JSGenerateToJSObject
+ ] DOMSettableTokenList : DOMTokenList {
+ attribute DOMString value;
+ };
+
+}
diff --git a/Source/WebCore/html/DOMTokenList.cpp b/Source/WebCore/html/DOMTokenList.cpp
index 533b1f103..7132b1169 100644
--- a/Source/WebCore/html/DOMTokenList.cpp
+++ b/Source/WebCore/html/DOMTokenList.cpp
@@ -49,138 +49,23 @@ bool DOMTokenList::validateToken(const AtomicString& token, ExceptionCode& ec)
return true;
}
-bool DOMTokenList::validateTokens(const Vector<String>& tokens, ExceptionCode& ec)
-{
- for (size_t i = 0; i < tokens.size(); ++i) {
- if (!validateToken(tokens[i], ec))
- return false;
- }
-
- return true;
-}
-
-bool DOMTokenList::contains(const AtomicString& token, ExceptionCode& ec) const
-{
- if (!validateToken(token, ec))
- return false;
- return containsInternal(token);
-}
-
-void DOMTokenList::add(const AtomicString& token, ExceptionCode& ec)
-{
- Vector<String> tokens;
- tokens.append(token.string());
- add(tokens, ec);
-}
-
-void DOMTokenList::add(const Vector<String>& tokens, ExceptionCode& ec)
-{
- Vector<String> filteredTokens;
- for (size_t i = 0; i < tokens.size(); ++i) {
- if (!validateToken(tokens[i], ec))
- return;
- if (!containsInternal(tokens[i]))
- filteredTokens.append(tokens[i]);
- }
-
- if (filteredTokens.isEmpty())
- return;
-
- setValue(addTokens(value(), filteredTokens));
-}
-
-void DOMTokenList::remove(const AtomicString& token, ExceptionCode& ec)
-{
- Vector<String> tokens;
- tokens.append(token.string());
- remove(tokens, ec);
-}
-
-void DOMTokenList::remove(const Vector<String>& tokens, ExceptionCode& ec)
-{
- if (!validateTokens(tokens, ec))
- return;
-
- // Check using containsInternal first since it is a lot faster than going
- // through the string character by character.
- bool found = false;
- for (size_t i = 0; i < tokens.size(); ++i) {
- if (containsInternal(tokens[i])) {
- found = true;
- break;
- }
- }
-
- if (found)
- setValue(removeTokens(value(), tokens));
-}
-
-bool DOMTokenList::toggle(const AtomicString& token, ExceptionCode& ec)
-{
- if (!validateToken(token, ec))
- return false;
-
- if (containsInternal(token)) {
- removeInternal(token);
- return false;
- }
- addInternal(token);
- return true;
-}
-
-void DOMTokenList::addInternal(const AtomicString& token)
-{
- if (!containsInternal(token))
- setValue(addToken(value(), token));
-}
-
-void DOMTokenList::removeInternal(const AtomicString& token)
-{
- // Check using contains first since it uses AtomicString comparisons instead
- // of character by character testing.
- if (!containsInternal(token))
- return;
- setValue(removeToken(value(), token));
-}
-
String DOMTokenList::addToken(const AtomicString& input, const AtomicString& token)
{
- Vector<String> tokens;
- tokens.append(token.string());
- return addTokens(input, tokens);
-}
-
-String DOMTokenList::addTokens(const AtomicString& input, const Vector<String>& tokens)
-{
- bool needsSpace = false;
+ if (input.isEmpty())
+ return token;
StringBuilder builder;
- if (!input.isEmpty()) {
- builder.append(input);
- needsSpace = !isHTMLSpace(input[input.length() - 1]);
- }
-
- for (size_t i = 0; i < tokens.size(); ++i) {
- if (needsSpace)
- builder.append(' ');
- builder.append(tokens[i]);
- needsSpace = true;
- }
+ builder.append(input);
+ if (!isHTMLSpace(input[input.length() - 1]))
+ builder.append(' ');
+ builder.append(token);
return builder.toString();
}
String DOMTokenList::removeToken(const AtomicString& input, const AtomicString& token)
{
- Vector<String> tokens;
- tokens.append(token.string());
- return removeTokens(input, tokens);
-}
-
-String DOMTokenList::removeTokens(const AtomicString& input, const Vector<String>& tokens)
-{
// Algorithm defined at http://www.whatwg.org/specs/web-apps/current-work/multipage/common-microsyntaxes.html#remove-a-token-from-a-string
- // New spec is at http://dom.spec.whatwg.org/#remove-a-token-from-a-string
unsigned inputLength = input.length();
StringBuilder output; // 3
@@ -200,7 +85,7 @@ String DOMTokenList::removeTokens(const AtomicString& input, const Vector<String
s.append(input[position++]);
// Step 8
- if (tokens.contains(s.toStringPreserveCapacity())) {
+ if (s.toStringPreserveCapacity() == token) {
// Step 8.1
while (position < inputLength && isHTMLSpace(input[position]))
++position;
diff --git a/Source/WebCore/html/DOMTokenList.h b/Source/WebCore/html/DOMTokenList.h
index 4b25dce5e..fd110b7ff 100644
--- a/Source/WebCore/html/DOMTokenList.h
+++ b/Source/WebCore/html/DOMTokenList.h
@@ -45,32 +45,18 @@ public:
virtual unsigned length() const = 0;
virtual const AtomicString item(unsigned index) const = 0;
-
- bool contains(const AtomicString&, ExceptionCode&) const;
- virtual void add(const Vector<String>&, ExceptionCode&);
- void add(const AtomicString&, ExceptionCode&);
- virtual void remove(const Vector<String>&, ExceptionCode&);
- void remove(const AtomicString&, ExceptionCode&);
- bool toggle(const AtomicString&, ExceptionCode&);
-
- AtomicString toString() const { return value(); }
+ virtual bool contains(const AtomicString&, ExceptionCode&) const = 0;
+ virtual void add(const AtomicString&, ExceptionCode&) = 0;
+ virtual void remove(const AtomicString&, ExceptionCode&) = 0;
+ virtual bool toggle(const AtomicString&, ExceptionCode&) = 0;
+ virtual String toString() const = 0;
virtual Element* element() { return 0; }
protected:
- virtual AtomicString value() const = 0;
- virtual void setValue(const AtomicString&) = 0;
-
- virtual void addInternal(const AtomicString&);
- virtual bool containsInternal(const AtomicString&) const = 0;
- virtual void removeInternal(const AtomicString&);
-
static bool validateToken(const AtomicString&, ExceptionCode&);
- static bool validateTokens(const Vector<String>&, ExceptionCode&);
static String addToken(const AtomicString&, const AtomicString&);
- static String addTokens(const AtomicString&, const Vector<String>&);
static String removeToken(const AtomicString&, const AtomicString&);
- static String removeTokens(const AtomicString&, const Vector<String>&);
};
} // namespace WebCore
diff --git a/Source/WebCore/html/DOMTokenList.idl b/Source/WebCore/html/DOMTokenList.idl
index 49544b7e5..cf57e1aee 100644
--- a/Source/WebCore/html/DOMTokenList.idl
+++ b/Source/WebCore/html/DOMTokenList.idl
@@ -22,19 +22,22 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- GenerateIsReachable=ImplElementRoot,
- IndexedGetter
-] interface DOMTokenList {
- readonly attribute unsigned long length;
- [TreatReturnedNullStringAs=Null] DOMString item(in unsigned long index);
- boolean contains(in DOMString token) raises(DOMException);
- void add(in DOMString... tokens) raises(DOMException);
- void remove(in DOMString... tokens) raises(DOMException);
- boolean toggle(in DOMString token) raises(DOMException);
+module core {
+
+ interface [
+ GenerateIsReachable=ImplElementRoot,
+ IndexedGetter
+ ] DOMTokenList {
+ readonly attribute unsigned long length;
+ [TreatReturnedNullStringAs=Null] DOMString item(in unsigned long index);
+ boolean contains(in DOMString token) raises(DOMException);
+ void add(in DOMString token) raises(DOMException);
+ void remove(in DOMString token) raises(DOMException);
+ boolean toggle(in DOMString token) raises(DOMException);
#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
- [NotEnumerable] DOMString toString();
+ [NotEnumerable] DOMString toString();
#endif
-};
+ };
+}
diff --git a/Source/WebCore/html/DOMURL.idl b/Source/WebCore/html/DOMURL.idl
index a90443f55..b36e8f7ce 100644
--- a/Source/WebCore/html/DOMURL.idl
+++ b/Source/WebCore/html/DOMURL.idl
@@ -24,20 +24,22 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- Conditional=BLOB,
- Constructor,
- JSGenerateToNativeObject,
- JSGenerateToJSObject,
- JSNoStaticTables,
- InterfaceName=URL
-] interface DOMURL {
+module html {
+ interface [
+ Conditional=BLOB,
+ Constructor,
+ JSGenerateToNativeObject,
+ JSGenerateToJSObject,
+ JSNoStaticTables,
+ InterfaceName=URL
+ ] DOMURL {
#if defined(ENABLE_MEDIA_SOURCE) && ENABLE_MEDIA_SOURCE
- [CallWith=ScriptExecutionContext,TreatReturnedNullStringAs=Null] static DOMString createObjectURL(in MediaSource? source);
+ [CallWith=ScriptExecutionContext,TreatReturnedNullStringAs=Null] static DOMString createObjectURL(in MediaSource? source);
#endif
#if defined(ENABLE_MEDIA_STREAM) && ENABLE_MEDIA_STREAM
- [CallWith=ScriptExecutionContext,TreatReturnedNullStringAs=Null] static DOMString createObjectURL(in MediaStream? stream);
+ [CallWith=ScriptExecutionContext,TreatReturnedNullStringAs=Null] static DOMString createObjectURL(in MediaStream? stream);
#endif
- [CallWith=ScriptExecutionContext,TreatReturnedNullStringAs=Null] static DOMString createObjectURL(in Blob? blob);
- [CallWith=ScriptExecutionContext] static void revokeObjectURL(in DOMString url);
-};
+ [CallWith=ScriptExecutionContext,TreatReturnedNullStringAs=Null] static DOMString createObjectURL(in Blob? blob);
+ [CallWith=ScriptExecutionContext] static void revokeObjectURL(in DOMString url);
+ };
+}
diff --git a/Source/WebCore/html/DateInputType.cpp b/Source/WebCore/html/DateInputType.cpp
index 1ff59329a..4e973da69 100644
--- a/Source/WebCore/html/DateInputType.cpp
+++ b/Source/WebCore/html/DateInputType.cpp
@@ -31,18 +31,17 @@
#include "config.h"
#include "DateInputType.h"
-#if ENABLE(INPUT_TYPE_DATE)
+#include "CalendarPickerElement.h"
#include "DateComponents.h"
-#include "DateTimeFieldsState.h"
#include "HTMLInputElement.h"
#include "HTMLNames.h"
#include "InputTypeNames.h"
#include "KeyboardEvent.h"
-#include "LocalizedStrings.h"
-#include "Localizer.h"
-#include "PickerIndicatorElement.h"
+#include "LocalizedDate.h"
#include <wtf/PassOwnPtr.h>
+#if ENABLE(INPUT_TYPE_DATE)
+
namespace WebCore {
using namespace HTMLNames;
@@ -52,8 +51,8 @@ static const int dateDefaultStepBase = 0;
static const int dateStepScaleFactor = 86400000;
inline DateInputType::DateInputType(HTMLInputElement* element)
- : BaseDateInputType(element)
-#if ENABLE(INPUT_TYPE_DATE_LEGACY_UI)
+ : BaseDateAndTimeInputType(element)
+#if ENABLE(CALENDAR_PICKER)
, m_pickerElement(0)
#endif
{
@@ -103,11 +102,11 @@ bool DateInputType::isDateField() const
return true;
}
-#if ENABLE(INPUT_TYPE_DATE_LEGACY_UI)
+#if ENABLE(CALENDAR_PICKER)
void DateInputType::createShadowSubtree()
{
BaseDateAndTimeInputType::createShadowSubtree();
- RefPtr<PickerIndicatorElement> pickerElement = PickerIndicatorElement::create(element()->document());
+ RefPtr<CalendarPickerElement> pickerElement = CalendarPickerElement::create(element()->document());
m_pickerElement = pickerElement.get();
containerElement()->insertBefore(m_pickerElement, innerBlockElement()->nextSibling(), ASSERT_NO_EXCEPTION);
}
@@ -165,30 +164,9 @@ bool DateInputType::usesFixedPlaceholder() const
String DateInputType::fixedPlaceholder()
{
- return element()->localizer().dateFormatText();
+ return localizedDateFormatText();
}
-#endif // ENABLE(INPUT_TYPE_DATE_LEGACY_UI)
-
-#if ENABLE(INPUT_MULTIPLE_FIELDS_UI) && !ENABLE(INPUT_TYPE_DATE_LEGACY_UI)
-String DateInputType::formatDateTimeFieldsState(const DateTimeFieldsState& dateTimeFieldsState) const
-{
- if (!dateTimeFieldsState.hasDayOfMonth() || !dateTimeFieldsState.hasMonth() || !dateTimeFieldsState.hasYear())
- return emptyString();
-
- return String::format("%04u-%02u-%02u", dateTimeFieldsState.year(), dateTimeFieldsState.month(), dateTimeFieldsState.dayOfMonth());
-}
-
-void DateInputType::setupLayoutParameters(DateTimeEditElement::LayoutParameters& layoutParameters, const DateComponents& date) const
-{
- layoutParameters.dateTimeFormat = layoutParameters.localizer.dateFormat();
- layoutParameters.fallbackDateTimeFormat = ASCIILiteral("yyyy-MM-dd");
- layoutParameters.minimumYear = fullYear(element()->fastGetAttribute(minAttr));
- layoutParameters.maximumYear = fullYear(element()->fastGetAttribute(maxAttr));
- layoutParameters.placeholderForDay = placeholderForDayOfMonthField();
- layoutParameters.placeholderForMonth = placeholderForMonthField();
- layoutParameters.placeholderForYear = placeholderForYearField();
-}
-#endif
+#endif // ENABLE(CALENDAR_PICKER)
} // namespace WebCore
#endif
diff --git a/Source/WebCore/html/DateInputType.h b/Source/WebCore/html/DateInputType.h
index 934ac2629..d48049daa 100644
--- a/Source/WebCore/html/DateInputType.h
+++ b/Source/WebCore/html/DateInputType.h
@@ -31,21 +31,16 @@
#ifndef DateInputType_h
#define DateInputType_h
-#if ENABLE(INPUT_TYPE_DATE)
-#include "BaseMultipleFieldsDateAndTimeInputType.h"
+#include "BaseDateAndTimeInputType.h"
#include <wtf/RefPtr.h>
-namespace WebCore {
+#if ENABLE(INPUT_TYPE_DATE)
-class PickerIndicatorElement;
+namespace WebCore {
-#if ENABLE(INPUT_MULTIPLE_FIELDS_UI) && !ENABLE(INPUT_TYPE_DATE_LEGACY_UI)
-typedef BaseMultipleFieldsDateAndTimeInputType BaseDateInputType;
-#else
-typedef BaseDateAndTimeInputType BaseDateInputType;
-#endif
+class CalendarPickerElement;
-class DateInputType : public BaseDateInputType {
+class DateInputType : public BaseDateAndTimeInputType {
public:
static PassOwnPtr<InputType> create(HTMLInputElement*);
@@ -57,8 +52,7 @@ private:
virtual bool parseToDateComponentsInternal(const UChar*, unsigned length, DateComponents*) const OVERRIDE;
virtual bool setMillisecondToDateComponents(double, DateComponents*) const OVERRIDE;
virtual bool isDateField() const OVERRIDE;
-
-#if ENABLE(INPUT_TYPE_DATE_LEGACY_UI)
+#if ENABLE(CALENDAR_PICKER)
virtual void createShadowSubtree() OVERRIDE;
virtual void destroyShadowSubtree() OVERRIDE;
virtual void handleKeydownEvent(KeyboardEvent*) OVERRIDE;
@@ -71,17 +65,10 @@ private:
virtual bool needsContainer() const OVERRIDE;
virtual bool shouldHaveSpinButton() const OVERRIDE;
- PickerIndicatorElement* m_pickerElement;
-#else
-#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
- // BaseMultipleFieldsDateAndTimeInputType functions
- virtual String formatDateTimeFieldsState(const DateTimeFieldsState&) const OVERRIDE;
- virtual void setupLayoutParameters(DateTimeEditElement::LayoutParameters&, const DateComponents&) const OVERRIDE;
-#endif
+ CalendarPickerElement* m_pickerElement;
#endif
};
} // namespace WebCore
-
#endif
#endif // DateInputType_h
diff --git a/Source/WebCore/html/DateTimeFieldsState.cpp b/Source/WebCore/html/DateTimeFieldsState.cpp
index ae03a13da..990389dc4 100644
--- a/Source/WebCore/html/DateTimeFieldsState.cpp
+++ b/Source/WebCore/html/DateTimeFieldsState.cpp
@@ -24,7 +24,7 @@
*/
#include "config.h"
-#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
+#if ENABLE(INPUT_TYPE_TIME_MULTIPLE_FIELDS)
#include "DateTimeFieldsState.h"
#include "FormController.h"
diff --git a/Source/WebCore/html/DateTimeFieldsState.h b/Source/WebCore/html/DateTimeFieldsState.h
index 2dd219546..6fb444071 100644
--- a/Source/WebCore/html/DateTimeFieldsState.h
+++ b/Source/WebCore/html/DateTimeFieldsState.h
@@ -26,7 +26,7 @@
#ifndef DateTimeFieldsState_h
#define DateTimeFieldsState_h
-#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
+#if ENABLE(INPUT_TYPE_TIME_MULTIPLE_FIELDS)
#include <wtf/text/WTFString.h>
namespace WebCore {
@@ -87,7 +87,7 @@ public:
private:
unsigned m_year;
- unsigned m_month; // 1 to 12.
+ unsigned m_month;
unsigned m_dayOfMonth;
unsigned m_hour; // 1 to 12.
unsigned m_minute;
diff --git a/Source/WebCore/html/DateTimeInputType.cpp b/Source/WebCore/html/DateTimeInputType.cpp
index 1746a13cf..09b423172 100644
--- a/Source/WebCore/html/DateTimeInputType.cpp
+++ b/Source/WebCore/html/DateTimeInputType.cpp
@@ -40,14 +40,6 @@
#if ENABLE(INPUT_TYPE_DATETIME)
-#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
-#include "DateTimeFieldsState.h"
-#include "LocalizedStrings.h"
-#include "Localizer.h"
-#include <wtf/text/StringBuilder.h>
-#include <wtf/text/WTFString.h>
-#endif
-
namespace WebCore {
using namespace HTMLNames;
@@ -105,61 +97,6 @@ bool DateTimeInputType::isDateTimeField() const
return true;
}
-#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
-// FIXME: It is better to share code for DateTimeInputType::formatDateTimeFieldsState()
-// and DateTimeInputLocalType::formatDateTimeFieldsState().
-String DateTimeInputType::formatDateTimeFieldsState(const DateTimeFieldsState& dateTimeFieldsState) const
-{
- if (!dateTimeFieldsState.hasDayOfMonth() || !dateTimeFieldsState.hasMonth() || !dateTimeFieldsState.hasYear()
- || !dateTimeFieldsState.hasHour() || !dateTimeFieldsState.hasMinute() || !dateTimeFieldsState.hasAMPM())
- return emptyString();
-
- if (dateTimeFieldsState.hasMillisecond() && dateTimeFieldsState.millisecond()) {
- return String::format("%04u-%02u-%02uT%02u:%02u:%02u.%03uZ",
- dateTimeFieldsState.year(),
- dateTimeFieldsState.month() + 1,
- dateTimeFieldsState.dayOfMonth(),
- dateTimeFieldsState.hour23(),
- dateTimeFieldsState.minute(),
- dateTimeFieldsState.hasSecond() ? dateTimeFieldsState.second() : 0,
- dateTimeFieldsState.millisecond());
- }
-
- if (dateTimeFieldsState.hasSecond() && dateTimeFieldsState.second()) {
- return String::format("%04u-%02u-%02uT%02u:%02u:%02uZ",
- dateTimeFieldsState.year(),
- dateTimeFieldsState.month() + 1,
- dateTimeFieldsState.dayOfMonth(),
- dateTimeFieldsState.hour23(),
- dateTimeFieldsState.minute(),
- dateTimeFieldsState.second());
- }
-
- return String::format("%04u-%02u-%02uT%02u:%02uZ",
- dateTimeFieldsState.year(),
- dateTimeFieldsState.month() + 1,
- dateTimeFieldsState.dayOfMonth(),
- dateTimeFieldsState.hour23(),
- dateTimeFieldsState.minute());
-}
-
-void DateTimeInputType::setupLayoutParameters(DateTimeEditElement::LayoutParameters& layoutParameters, const DateComponents& date) const
-{
- if (shouldHaveSecondField(date)) {
- layoutParameters.dateTimeFormat = layoutParameters.localizer.dateTimeFormatWithSeconds();
- layoutParameters.fallbackDateTimeFormat = "dd/MM/yyyy HH:mm:ss";
- } else {
- layoutParameters.dateTimeFormat = layoutParameters.localizer.dateTimeFormatWithoutSeconds();
- layoutParameters.fallbackDateTimeFormat = "dd/MM/yyyy HH:mm";
- }
- layoutParameters.minimumYear = fullYear(element()->fastGetAttribute(minAttr));
- layoutParameters.maximumYear = fullYear(element()->fastGetAttribute(maxAttr));
- layoutParameters.placeholderForDay = placeholderForDayOfMonthField();
- layoutParameters.placeholderForMonth = placeholderForMonthField();
- layoutParameters.placeholderForYear = placeholderForYearField();
-}
-#endif
-
} // namespace WebCore
#endif
diff --git a/Source/WebCore/html/DateTimeInputType.h b/Source/WebCore/html/DateTimeInputType.h
index ee3842019..d1f4a78aa 100644
--- a/Source/WebCore/html/DateTimeInputType.h
+++ b/Source/WebCore/html/DateTimeInputType.h
@@ -34,22 +34,15 @@
#include "BaseDateAndTimeInputType.h"
#if ENABLE(INPUT_TYPE_DATETIME)
-#include "BaseMultipleFieldsDateAndTimeInputType.h"
namespace WebCore {
-#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
-typedef BaseMultipleFieldsDateAndTimeInputType BaseDateTimeInputType;
-#else
-typedef BaseDateAndTimeInputType BaseDateTimeInputType;
-#endif
-
-class DateTimeInputType : public BaseDateTimeInputType {
+class DateTimeInputType : public BaseDateAndTimeInputType {
public:
static PassOwnPtr<InputType> create(HTMLInputElement*);
private:
- DateTimeInputType(HTMLInputElement* element) : BaseDateTimeInputType(element) { }
+ DateTimeInputType(HTMLInputElement* element) : BaseDateAndTimeInputType(element) { }
virtual const AtomicString& formControlType() const OVERRIDE;
virtual DateComponents::Type dateType() const OVERRIDE;
virtual StepRange createStepRange(AnyStepHandling) const OVERRIDE;
@@ -57,12 +50,6 @@ private:
virtual bool parseToDateComponentsInternal(const UChar*, unsigned length, DateComponents*) const OVERRIDE;
virtual bool setMillisecondToDateComponents(double, DateComponents*) const OVERRIDE;
virtual bool isDateTimeField() const OVERRIDE;
-
-#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
- // BaseMultipleFieldsDateAndTimeInputType functions
- virtual String formatDateTimeFieldsState(const DateTimeFieldsState&) const OVERRIDE FINAL;
- virtual void setupLayoutParameters(DateTimeEditElement::LayoutParameters&, const DateComponents&) const OVERRIDE FINAL;
-#endif
};
} // namespace WebCore
diff --git a/Source/WebCore/html/DateTimeLocalInputType.cpp b/Source/WebCore/html/DateTimeLocalInputType.cpp
index b0cb95a8f..9766b566c 100644
--- a/Source/WebCore/html/DateTimeLocalInputType.cpp
+++ b/Source/WebCore/html/DateTimeLocalInputType.cpp
@@ -39,14 +39,6 @@
#if ENABLE(INPUT_TYPE_DATETIMELOCAL)
-#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
-#include "DateTimeFieldsState.h"
-#include "LocalizedStrings.h"
-#include "Localizer.h"
-#include <wtf/text/StringBuilder.h>
-#include <wtf/text/WTFString.h>
-#endif
-
namespace WebCore {
using namespace HTMLNames;
@@ -111,61 +103,6 @@ bool DateTimeLocalInputType::isDateTimeLocalField() const
return true;
}
-#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
-// FIXME: It is better to share code for DateTimeInputType::formatDateTimeFieldsState()
-// and DateTimeInputLocalType::formatDateTimeFieldsState().
-String DateTimeLocalInputType::formatDateTimeFieldsState(const DateTimeFieldsState& dateTimeFieldsState) const
-{
- if (!dateTimeFieldsState.hasDayOfMonth() || !dateTimeFieldsState.hasMonth() || !dateTimeFieldsState.hasYear()
- || !dateTimeFieldsState.hasHour() || !dateTimeFieldsState.hasMinute() || !dateTimeFieldsState.hasAMPM())
- return emptyString();
-
- if (dateTimeFieldsState.hasMillisecond() && dateTimeFieldsState.millisecond()) {
- return String::format("%04u-%02u-%02uT%02u:%02u:%02u.%03u",
- dateTimeFieldsState.year(),
- dateTimeFieldsState.month() + 1,
- dateTimeFieldsState.dayOfMonth(),
- dateTimeFieldsState.hour23(),
- dateTimeFieldsState.minute(),
- dateTimeFieldsState.hasSecond() ? dateTimeFieldsState.second() : 0,
- dateTimeFieldsState.millisecond());
- }
-
- if (dateTimeFieldsState.hasSecond() && dateTimeFieldsState.second()) {
- return String::format("%04u-%02u-%02uT%02u:%02u:%02u",
- dateTimeFieldsState.year(),
- dateTimeFieldsState.month() + 1,
- dateTimeFieldsState.dayOfMonth(),
- dateTimeFieldsState.hour23(),
- dateTimeFieldsState.minute(),
- dateTimeFieldsState.second());
- }
-
- return String::format("%04u-%02u-%02uT%02u:%02u",
- dateTimeFieldsState.year(),
- dateTimeFieldsState.month() + 1,
- dateTimeFieldsState.dayOfMonth(),
- dateTimeFieldsState.hour23(),
- dateTimeFieldsState.minute());
-}
-
-void DateTimeLocalInputType::setupLayoutParameters(DateTimeEditElement::LayoutParameters& layoutParameters, const DateComponents& date) const
-{
- if (shouldHaveSecondField(date)) {
- layoutParameters.dateTimeFormat = layoutParameters.localizer.dateTimeFormatWithSeconds();
- layoutParameters.fallbackDateTimeFormat = "dd/MM/yyyy HH:mm:ss";
- } else {
- layoutParameters.dateTimeFormat = layoutParameters.localizer.dateTimeFormatWithoutSeconds();
- layoutParameters.fallbackDateTimeFormat = "dd/MM/yyyy HH:mm";
- }
- layoutParameters.minimumYear = fullYear(element()->fastGetAttribute(minAttr));
- layoutParameters.maximumYear = fullYear(element()->fastGetAttribute(maxAttr));
- layoutParameters.placeholderForDay = placeholderForDayOfMonthField();
- layoutParameters.placeholderForMonth = placeholderForMonthField();
- layoutParameters.placeholderForYear = placeholderForYearField();
-}
-#endif
-
} // namespace WebCore
#endif
diff --git a/Source/WebCore/html/DateTimeLocalInputType.h b/Source/WebCore/html/DateTimeLocalInputType.h
index d8ec63823..ca40b3774 100644
--- a/Source/WebCore/html/DateTimeLocalInputType.h
+++ b/Source/WebCore/html/DateTimeLocalInputType.h
@@ -31,23 +31,18 @@
#ifndef DateTimeLocalInputType_h
#define DateTimeLocalInputType_h
+#include "BaseDateAndTimeInputType.h"
+
#if ENABLE(INPUT_TYPE_DATETIMELOCAL)
-#include "BaseMultipleFieldsDateAndTimeInputType.h"
namespace WebCore {
-#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
-typedef BaseMultipleFieldsDateAndTimeInputType BaseDateTimeLocalInputType;
-#else
-typedef BaseDateAndTimeInputType BaseDateTimeLocalInputType;
-#endif
-
-class DateTimeLocalInputType : public BaseDateTimeLocalInputType {
+class DateTimeLocalInputType : public BaseDateAndTimeInputType {
public:
static PassOwnPtr<InputType> create(HTMLInputElement*);
private:
- DateTimeLocalInputType(HTMLInputElement* element) : BaseDateTimeLocalInputType(element) { }
+ DateTimeLocalInputType(HTMLInputElement* element) : BaseDateAndTimeInputType(element) { }
virtual const AtomicString& formControlType() const OVERRIDE;
virtual DateComponents::Type dateType() const OVERRIDE;
virtual double valueAsDate() const OVERRIDE;
@@ -56,12 +51,6 @@ private:
virtual bool parseToDateComponentsInternal(const UChar*, unsigned length, DateComponents*) const OVERRIDE;
virtual bool setMillisecondToDateComponents(double, DateComponents*) const OVERRIDE;
virtual bool isDateTimeLocalField() const OVERRIDE;
-
-#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
- // BaseMultipleFieldsDateAndTimeInputType functions
- virtual String formatDateTimeFieldsState(const DateTimeFieldsState&) const OVERRIDE FINAL;
- virtual void setupLayoutParameters(DateTimeEditElement::LayoutParameters&, const DateComponents&) const OVERRIDE FINAL;
-#endif
};
} // namespace WebCore
diff --git a/Source/WebCore/html/FormController.cpp b/Source/WebCore/html/FormController.cpp
index 7f87b97ff..fbfe7b714 100644
--- a/Source/WebCore/html/FormController.cpp
+++ b/Source/WebCore/html/FormController.cpp
@@ -228,8 +228,8 @@ void SavedFormState::serializeTo(Vector<String>& stateVector) const
{
stateVector.append(String::number(m_controlStateCount));
for (FormElementStateMap::const_iterator it = m_stateForNewFormElements.begin(); it != m_stateForNewFormElements.end(); ++it) {
- const FormElementKey& key = it->key;
- const Deque<FormControlState>& queue = it->value;
+ const FormElementKey& key = it->first;
+ const Deque<FormControlState>& queue = it->second;
for (Deque<FormControlState>::const_iterator queIterator = queue.begin(); queIterator != queue.end(); ++queIterator) {
stateVector.append(key.name());
stateVector.append(key.type());
@@ -243,7 +243,7 @@ void SavedFormState::appendControlState(const AtomicString& name, const AtomicSt
FormElementKey key(name.impl(), type.impl());
FormElementStateMap::iterator it = m_stateForNewFormElements.find(key);
if (it != m_stateForNewFormElements.end())
- it->value.append(state);
+ it->second.append(state);
else {
Deque<FormControlState> stateList;
stateList.append(state);
@@ -259,10 +259,10 @@ FormControlState SavedFormState::takeControlState(const AtomicString& name, cons
FormElementStateMap::iterator it = m_stateForNewFormElements.find(FormElementKey(name.impl(), type.impl()));
if (it == m_stateForNewFormElements.end())
return FormControlState();
- ASSERT(it->value.size());
- FormControlState state = it->value.takeFirst();
+ ASSERT(it->second.size());
+ FormControlState state = it->second.takeFirst();
m_controlStateCount--;
- if (!it->value.size())
+ if (!it->second.size())
m_stateForNewFormElements.remove(it);
return state;
}
@@ -271,10 +271,10 @@ Vector<String> SavedFormState::getReferencedFilePaths() const
{
Vector<String> toReturn;
for (FormElementStateMap::const_iterator it = m_stateForNewFormElements.begin(); it != m_stateForNewFormElements.end(); ++it) {
- const FormElementKey& key = it->key;
+ const FormElementKey& key = it->first;
if (AtomicString(key.type()) != AtomicString("file"))
continue;
- const Deque<FormControlState>& queue = it->value;
+ const Deque<FormControlState>& queue = it->second;
for (Deque<FormControlState>::const_iterator queIterator = queue.begin(); queIterator != queue.end(); ++queIterator) {
const Vector<FileChooserFileInfo>& selectedFiles = HTMLInputElement::filesFromFileInputFormControlState(*queIterator);
for (size_t i = 0; i < selectedFiles.size(); ++i)
@@ -349,12 +349,12 @@ AtomicString FormKeyGenerator::formKey(const HTMLFormControlElementWithState& co
}
FormToKeyMap::const_iterator it = m_formToKeyMap.find(form);
if (it != m_formToKeyMap.end())
- return it->value;
+ return it->second;
String signature = formSignature(*form);
ASSERT(!signature.isNull());
FormSignatureToNextIndexMap::AddResult result = m_formSignatureToNextIndexMap.add(signature, 0);
- unsigned nextIndex = result.iterator->value++;
+ unsigned nextIndex = result.iterator->second++;
StringBuilder builder;
builder.append(signature);
@@ -405,8 +405,8 @@ PassOwnPtr<FormController::SavedFormStateMap> FormController::createSavedFormSta
continue;
SavedFormStateMap::AddResult result = stateMap->add(keyGenerator->formKey(*control).impl(), nullptr);
if (result.isNewEntry)
- result.iterator->value = SavedFormState::create();
- result.iterator->value->appendControlState(control->name(), control->type(), control->saveFormControlState());
+ result.iterator->second = SavedFormState::create();
+ result.iterator->second->appendControlState(control->name(), control->type(), control->saveFormControlState());
}
return stateMap.release();
}
@@ -418,8 +418,8 @@ Vector<String> FormController::formElementsState() const
stateVector.reserveInitialCapacity(m_formElementsWithState.size() * 4);
stateVector.append(formStateSignature());
for (SavedFormStateMap::const_iterator it = stateMap->begin(); it != stateMap->end(); ++it) {
- stateVector.append(it->key.get());
- it->value->serializeTo(stateVector);
+ stateVector.append(it->first.get());
+ it->second->serializeTo(stateVector);
}
bool hasOnlySignature = stateVector.size() == 1;
if (hasOnlySignature)
@@ -441,8 +441,8 @@ FormControlState FormController::takeStateForFormElement(const HTMLFormControlEl
SavedFormStateMap::iterator it = m_savedFormStateMap.find(m_formKeyGenerator->formKey(control).impl());
if (it == m_savedFormStateMap.end())
return FormControlState();
- FormControlState state = it->value->takeControlState(control.name(), control.type());
- if (it->value->isEmpty())
+ FormControlState state = it->second->takeControlState(control.name(), control.type());
+ if (it->second->isEmpty())
m_savedFormStateMap.remove(it);
return state;
}
@@ -511,7 +511,7 @@ Vector<String> FormController::getReferencedFilePaths(const Vector<String>& stat
SavedFormStateMap map;
formStatesFromStateVector(stateVector, map);
for (SavedFormStateMap::const_iterator it = map.begin(); it != map.end(); ++it)
- toReturn.append(it->value->getReferencedFilePaths());
+ toReturn.append(it->second->getReferencedFilePaths());
return toReturn;
}
diff --git a/Source/WebCore/html/HTMLAllCollection.idl b/Source/WebCore/html/HTMLAllCollection.idl
index c9bc92cef..f9c093da0 100644
--- a/Source/WebCore/html/HTMLAllCollection.idl
+++ b/Source/WebCore/html/HTMLAllCollection.idl
@@ -23,18 +23,21 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- IndexedGetter,
- NamedGetter,
- CustomCall,
- MasqueradesAsUndefined,
- GenerateIsReachable=ImplBaseRoot,
- V8DependentLifetime
-] interface HTMLAllCollection {
- readonly attribute unsigned long length;
- [Custom] Node item(in [Optional=DefaultIsUndefined] unsigned long index);
- [Custom] Node namedItem(in DOMString name);
- // FIXME: This should return an HTMLAllCollection.
- NodeList tags(in DOMString name);
-};
+module html {
+ interface [
+ IndexedGetter,
+ NamedGetter,
+ CustomCall,
+ MasqueradesAsUndefined,
+ GenerateIsReachable=ImplBaseRoot,
+ V8DependentLifetime
+ ] HTMLAllCollection {
+ readonly attribute unsigned long length;
+ [Custom] Node item(in [Optional=DefaultIsUndefined] unsigned long index);
+ [Custom] Node namedItem(in DOMString name);
+ // FIXME: This should return an HTMLAllCollection.
+ NodeList tags(in DOMString name);
+ };
+
+}
diff --git a/Source/WebCore/html/HTMLAnchorElement.idl b/Source/WebCore/html/HTMLAnchorElement.idl
index df6836282..7bd174c63 100644
--- a/Source/WebCore/html/HTMLAnchorElement.idl
+++ b/Source/WebCore/html/HTMLAnchorElement.idl
@@ -18,53 +18,56 @@
* Boston, MA 02110-1301, USA.
*/
-interface HTMLAnchorElement : HTMLElement {
- [Reflect] attribute DOMString charset;
- [Reflect] attribute DOMString coords;
- [Conditional=DOWNLOAD_ATTRIBUTE, Reflect] attribute DOMString download;
- [Reflect, URL] attribute DOMString href;
- [Reflect] attribute DOMString hreflang;
- [Reflect] attribute DOMString name;
- [Reflect] attribute DOMString ping;
- [Reflect] attribute DOMString rel;
- [Reflect] attribute DOMString rev;
- [Reflect] attribute DOMString shape;
- [Reflect] attribute DOMString target;
- [Reflect] attribute DOMString type;
+module html {
+
+ interface HTMLAnchorElement : HTMLElement {
+ attribute [Reflect] DOMString charset;
+ attribute [Reflect] DOMString coords;
+ attribute [Conditional=DOWNLOAD_ATTRIBUTE, Reflect] DOMString download;
+ attribute [Reflect, URL] DOMString href;
+ attribute [Reflect] DOMString hreflang;
+ attribute [Reflect] DOMString name;
+ attribute [Reflect] DOMString ping;
+ attribute [Reflect] DOMString rel;
+ attribute [Reflect] DOMString rev;
+ attribute [Reflect] DOMString shape;
+ attribute [Reflect] DOMString target;
+ attribute [Reflect] DOMString type;
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
- [Reflect] attribute DOMString accessKey;
+ attribute [Reflect] DOMString accessKey;
#endif
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
- readonly attribute DOMString hash;
- readonly attribute DOMString host;
- readonly attribute DOMString hostname;
- readonly attribute DOMString pathname;
- readonly attribute DOMString port;
- readonly attribute DOMString protocol;
- readonly attribute DOMString search;
+ readonly attribute DOMString hash;
+ readonly attribute DOMString host;
+ readonly attribute DOMString hostname;
+ readonly attribute DOMString pathname;
+ readonly attribute DOMString port;
+ readonly attribute DOMString protocol;
+ readonly attribute DOMString search;
#else
- [TreatNullAs=NullString] attribute DOMString hash;
- [TreatNullAs=NullString] attribute DOMString host;
- [TreatNullAs=NullString] attribute DOMString hostname;
- [TreatNullAs=NullString] attribute DOMString pathname;
- [TreatNullAs=NullString] attribute DOMString port;
- [TreatNullAs=NullString] attribute DOMString protocol;
- [TreatNullAs=NullString] attribute DOMString search;
+ attribute [TreatNullAs=NullString] DOMString hash;
+ attribute [TreatNullAs=NullString] DOMString host;
+ attribute [TreatNullAs=NullString] DOMString hostname;
+ attribute [TreatNullAs=NullString] DOMString pathname;
+ attribute [TreatNullAs=NullString] DOMString port;
+ attribute [TreatNullAs=NullString] DOMString protocol;
+ attribute [TreatNullAs=NullString] DOMString search;
- [TreatNullAs=NullString] readonly attribute DOMString origin;
+ readonly attribute [TreatNullAs=NullString] DOMString origin;
#endif
- readonly attribute DOMString text;
+ readonly attribute DOMString text;
#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
- [NotEnumerable] DOMString toString();
+ [NotEnumerable] DOMString toString();
#endif
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
- // Objective-C extension:
- readonly attribute URL absoluteLinkURL;
+ // Objective-C extension:
+ readonly attribute URL absoluteLinkURL;
#endif
-};
+ };
+}
diff --git a/Source/WebCore/html/HTMLAppletElement.idl b/Source/WebCore/html/HTMLAppletElement.idl
index f80b11a5a..8f16a400f 100644
--- a/Source/WebCore/html/HTMLAppletElement.idl
+++ b/Source/WebCore/html/HTMLAppletElement.idl
@@ -18,29 +18,32 @@
* Boston, MA 02110-1301, USA.
*/
-[
- CustomNamedSetter,
- JSCustomGetOwnPropertySlotAndDescriptor,
- CustomCall
-] interface HTMLAppletElement : HTMLElement {
- [Reflect] attribute DOMString align;
- [Reflect] attribute DOMString alt;
- [Reflect] attribute DOMString archive;
- [Reflect] attribute DOMString code;
- [Reflect] attribute DOMString codeBase;
- [Reflect] attribute DOMString height;
+module html {
+
+ interface [
+ CustomNamedSetter,
+ JSCustomGetOwnPropertySlotAndDescriptor,
+ CustomCall
+ ] HTMLAppletElement : HTMLElement {
+ attribute [Reflect] DOMString align;
+ attribute [Reflect] DOMString alt;
+ attribute [Reflect] DOMString archive;
+ attribute [Reflect] DOMString code;
+ attribute [Reflect] DOMString codeBase;
+ attribute [Reflect] DOMString height;
#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
- [Reflect] attribute DOMString hspace;
+ attribute [Reflect] DOMString hspace;
#else
- [Reflect] attribute long hspace;
+ attribute [Reflect] long hspace;
#endif
- [Reflect] attribute DOMString name;
- [Reflect] attribute DOMString object;
+ attribute [Reflect] DOMString name;
+ attribute [Reflect] DOMString object;
#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
- [Reflect] attribute DOMString vspace;
+ attribute [Reflect] DOMString vspace;
#else
- [Reflect] attribute long vspace;
+ attribute [Reflect] long vspace;
#endif
- [Reflect] attribute DOMString width;
-};
+ attribute [Reflect] DOMString width;
+ };
+}
diff --git a/Source/WebCore/html/HTMLAreaElement.idl b/Source/WebCore/html/HTMLAreaElement.idl
index d0250529b..dfb9c9b5d 100644
--- a/Source/WebCore/html/HTMLAreaElement.idl
+++ b/Source/WebCore/html/HTMLAreaElement.idl
@@ -18,30 +18,33 @@
* Boston, MA 02110-1301, USA.
*/
-interface HTMLAreaElement : HTMLElement {
- [Reflect] attribute DOMString alt;
- [Reflect] attribute DOMString coords;
- [Reflect, URL] attribute DOMString href;
- [Reflect] attribute boolean noHref;
- [Reflect] attribute DOMString ping;
- [Reflect] attribute DOMString shape;
- [Reflect] attribute DOMString target;
+module html {
+
+ interface HTMLAreaElement : HTMLElement {
+ attribute [Reflect] DOMString alt;
+ attribute [Reflect] DOMString coords;
+ attribute [Reflect, URL] DOMString href;
+ attribute [Reflect] boolean noHref;
+ attribute [Reflect] DOMString ping;
+ attribute [Reflect] DOMString shape;
+ attribute [Reflect] DOMString target;
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
- [Reflect] attribute DOMString accessKey;
+ attribute [Reflect] DOMString accessKey;
#endif
- // IE Extensions
- readonly attribute DOMString hash;
- readonly attribute DOMString host;
- readonly attribute DOMString hostname;
- readonly attribute DOMString pathname;
- readonly attribute DOMString port;
- readonly attribute DOMString protocol;
- readonly attribute DOMString search;
+ // IE Extensions
+ readonly attribute DOMString hash;
+ readonly attribute DOMString host;
+ readonly attribute DOMString hostname;
+ readonly attribute DOMString pathname;
+ readonly attribute DOMString port;
+ readonly attribute DOMString protocol;
+ readonly attribute DOMString search;
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
- // Objective-C extension:
- readonly attribute URL absoluteLinkURL;
+ // Objective-C extension:
+ readonly attribute URL absoluteLinkURL;
#endif
-};
+ };
+}
diff --git a/Source/WebCore/html/HTMLAudioElement.idl b/Source/WebCore/html/HTMLAudioElement.idl
index 9b3f8c6af..1adf01c46 100644
--- a/Source/WebCore/html/HTMLAudioElement.idl
+++ b/Source/WebCore/html/HTMLAudioElement.idl
@@ -23,9 +23,11 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- ActiveDOMObject,
- Conditional=VIDEO,
- NamedConstructor=Audio(in [Optional=DefaultIsNullString] DOMString src)
-] interface HTMLAudioElement : HTMLMediaElement {
-};
+module html {
+ interface [
+ ActiveDOMObject,
+ Conditional=VIDEO,
+ NamedConstructor=Audio(in [Optional=DefaultIsNullString] DOMString src)
+ ] HTMLAudioElement : HTMLMediaElement {
+ };
+}
diff --git a/Source/WebCore/html/HTMLBRElement.idl b/Source/WebCore/html/HTMLBRElement.idl
index c909dc1c8..a6d215d53 100644
--- a/Source/WebCore/html/HTMLBRElement.idl
+++ b/Source/WebCore/html/HTMLBRElement.idl
@@ -17,7 +17,10 @@
* Boston, MA 02110-1301, USA.
*/
-interface HTMLBRElement : HTMLElement {
- [Reflect] attribute DOMString clear;
-};
+module html {
+ interface HTMLBRElement : HTMLElement {
+ attribute [Reflect] DOMString clear;
+ };
+
+}
diff --git a/Source/WebCore/html/HTMLBaseElement.idl b/Source/WebCore/html/HTMLBaseElement.idl
index 0f63ddd19..2750c9ee8 100644
--- a/Source/WebCore/html/HTMLBaseElement.idl
+++ b/Source/WebCore/html/HTMLBaseElement.idl
@@ -17,8 +17,11 @@
* Boston, MA 02110-1301, USA.
*/
-interface HTMLBaseElement : HTMLElement {
- [Reflect, URL] attribute DOMString href;
- [Reflect] attribute DOMString target;
-};
+module html {
+ interface HTMLBaseElement : HTMLElement {
+ attribute [Reflect, URL] DOMString href;
+ attribute [Reflect] DOMString target;
+ };
+
+}
diff --git a/Source/WebCore/html/HTMLBaseFontElement.idl b/Source/WebCore/html/HTMLBaseFontElement.idl
index 99bb33096..95bc92c37 100644
--- a/Source/WebCore/html/HTMLBaseFontElement.idl
+++ b/Source/WebCore/html/HTMLBaseFontElement.idl
@@ -17,12 +17,15 @@
* Boston, MA 02110-1301, USA.
*/
-interface HTMLBaseFontElement : HTMLElement {
- [Reflect] attribute DOMString color;
- [Reflect] attribute DOMString face;
+module html {
+
+ interface HTMLBaseFontElement : HTMLElement {
+ attribute [Reflect] DOMString color;
+ attribute [Reflect] DOMString face;
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
- [Reflect] attribute DOMString size; // this changed to a long, but our existing API is a string
+ attribute [Reflect] DOMString size; // this changed to a long, but our existing API is a string
#else
- [Reflect] attribute long size;
+ attribute [Reflect] long size;
#endif
-};
+ };
+}
diff --git a/Source/WebCore/html/HTMLBodyElement.idl b/Source/WebCore/html/HTMLBodyElement.idl
index 32a7d5095..a6b7f567d 100644
--- a/Source/WebCore/html/HTMLBodyElement.idl
+++ b/Source/WebCore/html/HTMLBodyElement.idl
@@ -18,39 +18,42 @@
* Boston, MA 02110-1301, USA.
*/
-interface HTMLBodyElement : HTMLElement {
- [Reflect] attribute DOMString aLink;
- [Reflect] attribute DOMString background;
- [Reflect] attribute DOMString bgColor;
- [Reflect] attribute DOMString link;
- [Reflect] attribute DOMString text;
- [Reflect] attribute DOMString vLink;
+module html {
+
+ interface HTMLBodyElement : HTMLElement {
+ attribute [Reflect] DOMString aLink;
+ attribute [Reflect] DOMString background;
+ attribute [Reflect] DOMString bgColor;
+ attribute [Reflect] DOMString link;
+ attribute [Reflect] DOMString text;
+ attribute [Reflect] DOMString vLink;
#if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C
- // Event handler attributes
- [NotEnumerable, JSWindowEventListener] attribute EventListener onbeforeunload;
- [NotEnumerable, JSWindowEventListener] attribute EventListener onhashchange;
- [NotEnumerable, JSWindowEventListener] attribute EventListener onmessage;
- [NotEnumerable, JSWindowEventListener] attribute EventListener onoffline;
- [NotEnumerable, JSWindowEventListener] attribute EventListener ononline;
- [NotEnumerable, JSWindowEventListener] attribute EventListener onpopstate;
- [NotEnumerable, JSWindowEventListener] attribute EventListener onresize;
- [NotEnumerable, JSWindowEventListener] attribute EventListener onstorage;
- [NotEnumerable, JSWindowEventListener] attribute EventListener onunload;
+ // Event handler attributes
+ attribute [NotEnumerable, JSWindowEventListener] EventListener onbeforeunload;
+ attribute [NotEnumerable, JSWindowEventListener] EventListener onhashchange;
+ attribute [NotEnumerable, JSWindowEventListener] EventListener onmessage;
+ attribute [NotEnumerable, JSWindowEventListener] EventListener onoffline;
+ attribute [NotEnumerable, JSWindowEventListener] EventListener ononline;
+ attribute [NotEnumerable, JSWindowEventListener] EventListener onpopstate;
+ attribute [NotEnumerable, JSWindowEventListener] EventListener onresize;
+ attribute [NotEnumerable, JSWindowEventListener] EventListener onstorage;
+ attribute [NotEnumerable, JSWindowEventListener] EventListener onunload;
- [Conditional=ORIENTATION_EVENTS, NotEnumerable, JSWindowEventListener] attribute EventListener onorientationchange;
+ attribute [Conditional=ORIENTATION_EVENTS, NotEnumerable, JSWindowEventListener] EventListener onorientationchange;
- // Overrides of Element attributes (with different implementation in bindings).
- [NotEnumerable, JSWindowEventListener] attribute EventListener onblur;
- [NotEnumerable, JSWindowEventListener] attribute EventListener onerror;
- [NotEnumerable, JSWindowEventListener] attribute EventListener onfocus;
- [NotEnumerable, JSWindowEventListener] attribute EventListener onload;
+ // Overrides of Element attributes (with different implementation in bindings).
+ attribute [NotEnumerable, JSWindowEventListener] EventListener onblur;
+ attribute [NotEnumerable, JSWindowEventListener] EventListener onerror;
+ attribute [NotEnumerable, JSWindowEventListener] EventListener onfocus;
+ attribute [NotEnumerable, JSWindowEventListener] EventListener onload;
- // Not implemented yet.
- // attribute [NotEnumerable, JSWindowEventListener] EventListener onafterprint;
- // attribute [NotEnumerable, JSWindowEventListener] EventListener onbeforeprint;
- // attribute [NotEnumerable, JSWindowEventListener] EventListener onredo;
- // attribute [NotEnumerable, JSWindowEventListener] EventListener onundo;
+ // Not implemented yet.
+ // attribute [NotEnumerable, JSWindowEventListener] EventListener onafterprint;
+ // attribute [NotEnumerable, JSWindowEventListener] EventListener onbeforeprint;
+ // attribute [NotEnumerable, JSWindowEventListener] EventListener onredo;
+ // attribute [NotEnumerable, JSWindowEventListener] EventListener onundo;
#endif
-};
+ };
+}
diff --git a/Source/WebCore/html/HTMLButtonElement.idl b/Source/WebCore/html/HTMLButtonElement.idl
index 252a422f2..02e91abef 100644
--- a/Source/WebCore/html/HTMLButtonElement.idl
+++ b/Source/WebCore/html/HTMLButtonElement.idl
@@ -18,32 +18,35 @@
* Boston, MA 02110-1301, USA.
*/
-interface HTMLButtonElement : HTMLElement {
- [Reflect] attribute boolean autofocus;
- [Reflect] attribute boolean disabled;
- readonly attribute HTMLFormElement form;
- [Reflect, URL] attribute DOMString formAction;
- [TreatNullAs=NullString] attribute DOMString formEnctype;
- [TreatNullAs=NullString] attribute DOMString formMethod;
- [Reflect] attribute boolean formNoValidate;
- [Reflect] attribute DOMString formTarget;
- [Reflect] attribute DOMString name;
- [TreatNullAs=NullString] attribute DOMString type;
- [Reflect] attribute DOMString value;
+module html {
- readonly attribute boolean willValidate;
- readonly attribute ValidityState validity;
- readonly attribute DOMString validationMessage;
- boolean checkValidity();
- void setCustomValidity(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString error);
+ interface HTMLButtonElement : HTMLElement {
+ attribute [Reflect] boolean autofocus;
+ attribute [Reflect] boolean disabled;
+ readonly attribute HTMLFormElement form;
+ attribute [Reflect, URL] DOMString formAction;
+ attribute [TreatNullAs=NullString] DOMString formEnctype;
+ attribute [TreatNullAs=NullString] DOMString formMethod;
+ attribute [Reflect] boolean formNoValidate;
+ attribute [Reflect] DOMString formTarget;
+ attribute [Reflect] DOMString name;
+ attribute [TreatNullAs=NullString] DOMString type;
+ attribute [Reflect] DOMString value;
- readonly attribute NodeList labels;
+ readonly attribute boolean willValidate;
+ readonly attribute ValidityState validity;
+ readonly attribute DOMString validationMessage;
+ boolean checkValidity();
+ void setCustomValidity(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString error);
+
+ readonly attribute NodeList labels;
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
- [Reflect] attribute DOMString accessKey;
+ attribute [Reflect] DOMString accessKey;
#endif
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
- void click();
+ void click();
#endif
-};
+ };
+}
diff --git a/Source/WebCore/html/HTMLCanvasElement.cpp b/Source/WebCore/html/HTMLCanvasElement.cpp
index ffc6182f5..e1b9f48a1 100644
--- a/Source/WebCore/html/HTMLCanvasElement.cpp
+++ b/Source/WebCore/html/HTMLCanvasElement.cpp
@@ -46,7 +46,6 @@
#include "Page.h"
#include "RenderHTMLCanvas.h"
#include "Settings.h"
-#include "WebCoreMemoryInstrumentation.h"
#include <math.h>
#include <stdio.h>
@@ -633,16 +632,4 @@ AffineTransform HTMLCanvasElement::baseTransform() const
return m_imageBuffer->baseTransform() * transform;
}
-void HTMLCanvasElement::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
-{
- MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM);
- HTMLElement::reportMemoryUsage(memoryObjectInfo);
- info.addMember(m_observers);
- info.addMember(m_context);
- info.addMember(m_imageBuffer);
- info.addMember(m_contextStateSaver);
- info.addMember(m_presentedImage);
- info.addMember(m_copiedImage);
-}
-
}
diff --git a/Source/WebCore/html/HTMLCanvasElement.h b/Source/WebCore/html/HTMLCanvasElement.h
index 6343b50ac..e80d85979 100644
--- a/Source/WebCore/html/HTMLCanvasElement.h
+++ b/Source/WebCore/html/HTMLCanvasElement.h
@@ -31,7 +31,6 @@
#include "FloatRect.h"
#include "HTMLElement.h"
#include "IntSize.h"
-#include <wtf/Forward.h>
#if PLATFORM(CHROMIUM) || PLATFORM(QT)
#define DefaultInterpolationQuality InterpolationMedium
@@ -138,8 +137,6 @@ public:
float deviceScaleFactor() const { return m_deviceScaleFactor; }
- virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE;
-
private:
HTMLCanvasElement(const QualifiedName&, Document*);
diff --git a/Source/WebCore/html/HTMLCanvasElement.idl b/Source/WebCore/html/HTMLCanvasElement.idl
index 9e85dca36..2be96a556 100644
--- a/Source/WebCore/html/HTMLCanvasElement.idl
+++ b/Source/WebCore/html/HTMLCanvasElement.idl
@@ -24,22 +24,25 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- JSGenerateToNativeObject
-] interface HTMLCanvasElement : HTMLElement {
+module html {
- attribute long width;
- attribute long height;
+ interface [
+ JSGenerateToNativeObject
+ ] HTMLCanvasElement : HTMLElement {
- [Custom] DOMString toDataURL(in [TreatNullAs=NullString, TreatUndefinedAs=NullString,Optional=DefaultIsUndefined] DOMString type)
- raises(DOMException);
+ attribute long width;
+ attribute long height;
+
+ [Custom] DOMString toDataURL(in [TreatNullAs=NullString, TreatUndefinedAs=NullString,Optional=DefaultIsUndefined] DOMString type)
+ raises(DOMException);
#if !defined(LANGUAGE_CPP) || !LANGUAGE_CPP
#if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C
- // The custom binding is needed to handle context creation attributes.
- [Custom] DOMObject getContext(in [Optional=DefaultIsUndefined] DOMString contextId);
+ // The custom binding is needed to handle context creation attributes.
+ [Custom] DOMObject getContext(in [Optional=DefaultIsUndefined] DOMString contextId);
#endif
#endif
-};
+ };
+}
diff --git a/Source/WebCore/html/HTMLCollection.cpp b/Source/WebCore/html/HTMLCollection.cpp
index 1ecb644ca..91e18a3fb 100644
--- a/Source/WebCore/html/HTMLCollection.cpp
+++ b/Source/WebCore/html/HTMLCollection.cpp
@@ -559,7 +559,7 @@ PassRefPtr<NodeList> HTMLCollection::tags(const String& name)
void HTMLCollectionCacheBase::append(NodeCacheMap& map, const AtomicString& key, Element* element)
{
- OwnPtr<Vector<Element*> >& vector = map.add(key.impl(), nullptr).iterator->value;
+ OwnPtr<Vector<Element*> >& vector = map.add(key.impl(), nullptr).iterator->second;
if (!vector)
vector = adoptPtr(new Vector<Element*>);
vector->append(element);
diff --git a/Source/WebCore/html/HTMLCollection.idl b/Source/WebCore/html/HTMLCollection.idl
index 8650428d0..efd91c72c 100644
--- a/Source/WebCore/html/HTMLCollection.idl
+++ b/Source/WebCore/html/HTMLCollection.idl
@@ -18,20 +18,23 @@
* Boston, MA 02110-1301, USA.
*/
-[
- IndexedGetter,
- NamedGetter,
- CustomToJSObject,
- GenerateIsReachable=ImplBaseRoot,
- V8DependentLifetime,
- ObjCPolymorphic
-] interface HTMLCollection {
- readonly attribute unsigned long length;
- Node item(in [Optional=DefaultIsUndefined] unsigned long index);
- [Custom] Node namedItem(in [Optional=DefaultIsUndefined] DOMString name);
+module html {
+
+ interface [
+ IndexedGetter,
+ NamedGetter,
+ CustomToJSObject,
+ GenerateIsReachable=ImplBaseRoot,
+ V8DependentLifetime,
+ ObjCPolymorphic
+ ] HTMLCollection {
+ readonly attribute unsigned long length;
+ Node item(in [Optional=DefaultIsUndefined] unsigned long index);
+ [Custom] Node namedItem(in [Optional=DefaultIsUndefined] DOMString name);
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
- NodeList tags(in [Optional=DefaultIsUndefined] DOMString name);
+ NodeList tags(in [Optional=DefaultIsUndefined] DOMString name);
#endif
-};
+ };
+}
diff --git a/Source/WebCore/html/HTMLDListElement.idl b/Source/WebCore/html/HTMLDListElement.idl
index 95a97ffac..1a9326fbf 100644
--- a/Source/WebCore/html/HTMLDListElement.idl
+++ b/Source/WebCore/html/HTMLDListElement.idl
@@ -17,7 +17,10 @@
* Boston, MA 02110-1301, USA.
*/
-interface HTMLDListElement : HTMLElement {
- [Reflect] attribute boolean compact;
-};
+module html {
+ interface HTMLDListElement : HTMLElement {
+ attribute [Reflect] boolean compact;
+ };
+
+}
diff --git a/Source/WebCore/html/HTMLDataListElement.idl b/Source/WebCore/html/HTMLDataListElement.idl
index 13fdaa404..7e0d69c96 100644
--- a/Source/WebCore/html/HTMLDataListElement.idl
+++ b/Source/WebCore/html/HTMLDataListElement.idl
@@ -28,8 +28,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- Conditional=DATALIST_ELEMENT,
-] interface HTMLDataListElement : HTMLElement {
- readonly attribute HTMLCollection options;
-};
+module html {
+ interface [
+ Conditional=DATALIST_ELEMENT,
+ ] HTMLDataListElement : HTMLElement {
+ readonly attribute HTMLCollection options;
+ };
+}
diff --git a/Source/WebCore/html/HTMLDetailsElement.idl b/Source/WebCore/html/HTMLDetailsElement.idl
index ca3894e2f..087f083ff 100644
--- a/Source/WebCore/html/HTMLDetailsElement.idl
+++ b/Source/WebCore/html/HTMLDetailsElement.idl
@@ -17,9 +17,11 @@
* Boston, MA 02110-1301, USA.
*/
-[
- Conditional=DETAILS_ELEMENT
-] interface HTMLDetailsElement : HTMLElement {
- [Reflect] attribute boolean open;
-};
+module html {
+ interface [
+ Conditional=DETAILS_ELEMENT
+ ] HTMLDetailsElement : HTMLElement {
+ attribute [Reflect] boolean open;
+ };
+}
diff --git a/Source/WebCore/html/HTMLDialogElement.idl b/Source/WebCore/html/HTMLDialogElement.idl
index a6df0c718..3c70c0c53 100644
--- a/Source/WebCore/html/HTMLDialogElement.idl
+++ b/Source/WebCore/html/HTMLDialogElement.idl
@@ -23,12 +23,15 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- Conditional=DIALOG_ELEMENT
-] interface HTMLDialogElement : HTMLElement {
- [Reflect] attribute boolean open;
- void close() raises(DOMException);
- void show();
- void showModal() raises(DOMException);
-};
+module html {
+ interface [
+ Conditional=DIALOG_ELEMENT
+ ] HTMLDialogElement : HTMLElement {
+ attribute [Reflect] boolean open;
+ void close() raises(DOMException);
+ void show();
+ void showModal() raises(DOMException);
+ };
+
+}
diff --git a/Source/WebCore/html/HTMLDirectoryElement.idl b/Source/WebCore/html/HTMLDirectoryElement.idl
index 541ae007f..b0969746a 100644
--- a/Source/WebCore/html/HTMLDirectoryElement.idl
+++ b/Source/WebCore/html/HTMLDirectoryElement.idl
@@ -17,7 +17,10 @@
* Boston, MA 02110-1301, USA.
*/
-interface HTMLDirectoryElement : HTMLElement {
- [Reflect] attribute boolean compact;
-};
+module html {
+ interface HTMLDirectoryElement : HTMLElement {
+ attribute [Reflect] boolean compact;
+ };
+
+}
diff --git a/Source/WebCore/html/HTMLDivElement.idl b/Source/WebCore/html/HTMLDivElement.idl
index 40c8db444..90fb84f8f 100644
--- a/Source/WebCore/html/HTMLDivElement.idl
+++ b/Source/WebCore/html/HTMLDivElement.idl
@@ -17,7 +17,10 @@
* Boston, MA 02110-1301, USA.
*/
-interface HTMLDivElement : HTMLElement {
- [Reflect] attribute DOMString align;
-};
+module html {
+ interface HTMLDivElement : HTMLElement {
+ attribute [Reflect] DOMString align;
+ };
+
+}
diff --git a/Source/WebCore/html/HTMLDocument.idl b/Source/WebCore/html/HTMLDocument.idl
index 717301c20..de9b51d84 100644
--- a/Source/WebCore/html/HTMLDocument.idl
+++ b/Source/WebCore/html/HTMLDocument.idl
@@ -18,45 +18,48 @@
* Boston, MA 02110-1301, USA.
*/
-[
- CustomNamedGetter,
- V8CustomToJSObject
-] interface HTMLDocument : Document {
- [JSCustom, V8Custom] void open();
- void close();
- [Custom] void write(in [Optional=DefaultIsUndefined] DOMString text);
- [Custom] void writeln(in [Optional=DefaultIsUndefined] DOMString text);
+module html {
- readonly attribute HTMLCollection embeds;
- readonly attribute HTMLCollection plugins;
- readonly attribute HTMLCollection scripts;
+ interface [
+ CustomNamedGetter,
+ V8CustomToJSObject
+ ] HTMLDocument : Document {
+ [JSCustom, V8Custom] void open();
+ void close();
+ [Custom] void write(in [Optional=DefaultIsUndefined] DOMString text);
+ [Custom] void writeln(in [Optional=DefaultIsUndefined] DOMString text);
- // Extensions
+ readonly attribute HTMLCollection embeds;
+ readonly attribute HTMLCollection plugins;
+ readonly attribute HTMLCollection scripts;
+
+ // Extensions
#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
- // FIXME: This should eventually be available (if they are wanted) for all languages.
- [Custom, Deletable] attribute HTMLAllCollection all;
+ // FIXME: This should eventually be available (if they are wanted) for all languages.
+ attribute [Custom, Deletable] HTMLAllCollection all;
#endif
- void clear();
+ void clear();
- void captureEvents();
- void releaseEvents();
+ void captureEvents();
+ void releaseEvents();
- readonly attribute long width;
- readonly attribute long height;
- [TreatNullAs=NullString] attribute DOMString dir;
- [TreatNullAs=NullString] attribute DOMString designMode;
- readonly attribute DOMString compatMode;
+ readonly attribute long width;
+ readonly attribute long height;
+ attribute [TreatNullAs=NullString] DOMString dir;
+ attribute [TreatNullAs=NullString] DOMString designMode;
+ readonly attribute DOMString compatMode;
- readonly attribute Element activeElement;
- boolean hasFocus();
+ readonly attribute Element activeElement;
+ boolean hasFocus();
- // Deprecated attributes
- [TreatNullAs=NullString] attribute DOMString bgColor;
- [TreatNullAs=NullString] attribute DOMString fgColor;
- [TreatNullAs=NullString] attribute DOMString alinkColor;
- [TreatNullAs=NullString] attribute DOMString linkColor;
- [TreatNullAs=NullString] attribute DOMString vlinkColor;
-};
+ // Deprecated attributes
+ attribute [TreatNullAs=NullString] DOMString bgColor;
+ attribute [TreatNullAs=NullString] DOMString fgColor;
+ attribute [TreatNullAs=NullString] DOMString alinkColor;
+ attribute [TreatNullAs=NullString] DOMString linkColor;
+ attribute [TreatNullAs=NullString] DOMString vlinkColor;
+ };
+}
diff --git a/Source/WebCore/html/HTMLElement.idl b/Source/WebCore/html/HTMLElement.idl
index d3206f2d1..9501d3a6a 100644
--- a/Source/WebCore/html/HTMLElement.idl
+++ b/Source/WebCore/html/HTMLElement.idl
@@ -18,77 +18,80 @@
* Boston, MA 02110-1301, USA.
*/
-[
- JSGenerateToNativeObject,
- JSCustomPushEventHandlerScope,
- V8CustomToJSObject
-] interface HTMLElement : Element {
- // iht.com relies on id returning the empty string when no id is present.
- // Other browsers do this as well. So we don't convert null to JS null.
- [Reflect] attribute DOMString id;
- [Reflect] attribute DOMString title;
- [Reflect] attribute DOMString lang;
- attribute boolean translate;
- [Reflect] attribute DOMString dir;
+module html {
- attribute long tabIndex;
- attribute boolean draggable;
- [Reflect] attribute DOMString webkitdropzone;
- [Reflect] attribute boolean hidden;
- [Reflect] attribute DOMString accessKey;
+ interface [
+ JSGenerateToNativeObject,
+ JSCustomPushEventHandlerScope,
+ V8CustomToJSObject
+ ] HTMLElement : Element {
+ // iht.com relies on id returning the empty string when no id is present.
+ // Other browsers do this as well. So we don't convert null to JS null.
+ attribute [Reflect] DOMString id;
+ attribute [Reflect] DOMString title;
+ attribute [Reflect] DOMString lang;
+ attribute boolean translate;
+ attribute [Reflect] DOMString dir;
- // Extensions
- [TreatNullAs=NullString] attribute DOMString innerHTML
- setter raises(DOMException);
- [TreatNullAs=NullString] attribute DOMString innerText
- setter raises(DOMException);
- [TreatNullAs=NullString] attribute DOMString outerHTML
- setter raises(DOMException);
- [TreatNullAs=NullString] attribute DOMString outerText
- setter raises(DOMException);
+ attribute long tabIndex;
+ attribute boolean draggable;
+ attribute [Reflect] DOMString webkitdropzone;
+ attribute [Reflect] boolean hidden;
+ attribute [Reflect] DOMString accessKey;
- Element insertAdjacentElement(in [Optional=DefaultIsUndefined] DOMString where,
- in [Optional=DefaultIsUndefined] Element element)
- raises(DOMException);
- void insertAdjacentHTML(in [Optional=DefaultIsUndefined] DOMString where,
- in [Optional=DefaultIsUndefined] DOMString html)
- raises(DOMException);
- void insertAdjacentText(in [Optional=DefaultIsUndefined] DOMString where,
- in [Optional=DefaultIsUndefined] DOMString text)
- raises(DOMException);
+ // Extensions
+ attribute [TreatNullAs=NullString] DOMString innerHTML
+ setter raises(DOMException);
+ attribute [TreatNullAs=NullString] DOMString innerText
+ setter raises(DOMException);
+ attribute [TreatNullAs=NullString] DOMString outerHTML
+ setter raises(DOMException);
+ attribute [TreatNullAs=NullString] DOMString outerText
+ setter raises(DOMException);
- readonly attribute HTMLCollection children;
+ Element insertAdjacentElement(in [Optional=DefaultIsUndefined] DOMString where,
+ in [Optional=DefaultIsUndefined] Element element)
+ raises(DOMException);
+ void insertAdjacentHTML(in [Optional=DefaultIsUndefined] DOMString where,
+ in [Optional=DefaultIsUndefined] DOMString html)
+ raises(DOMException);
+ void insertAdjacentText(in [Optional=DefaultIsUndefined] DOMString where,
+ in [Optional=DefaultIsUndefined] DOMString text)
+ raises(DOMException);
- [TreatNullAs=NullString] attribute DOMString contentEditable
- setter raises(DOMException);
- readonly attribute boolean isContentEditable;
+ readonly attribute HTMLCollection children;
- attribute boolean spellcheck;
+ attribute [TreatNullAs=NullString] DOMString contentEditable
+ setter raises(DOMException);
+ readonly attribute boolean isContentEditable;
+
+ attribute boolean spellcheck;
#if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C // No Objective-C bindings yet.
- [Conditional=MICRODATA, Reflect] attribute boolean itemScope;
- [Conditional=MICRODATA] readonly attribute DOMSettableTokenList itemType;
- [Conditional=MICRODATA, Reflect, URL] attribute DOMString itemId;
+ attribute [Conditional=MICRODATA, Reflect] boolean itemScope;
+ readonly attribute [Conditional=MICRODATA] DOMSettableTokenList itemType;
+ attribute [Conditional=MICRODATA, Reflect, URL] DOMString itemId;
- [Conditional=MICRODATA] readonly attribute DOMSettableTokenList itemRef;
- [Conditional=MICRODATA] readonly attribute DOMSettableTokenList itemProp;
+ readonly attribute [Conditional=MICRODATA] DOMSettableTokenList itemRef;
+ readonly attribute [Conditional=MICRODATA] DOMSettableTokenList itemProp;
#if defined(ENABLE_MICRODATA) && ENABLE_MICRODATA
- [Conditional=MICRODATA] readonly attribute HTMLPropertiesCollection properties;
+ readonly attribute [Conditional=MICRODATA] HTMLPropertiesCollection properties;
#endif
#endif
#if !defined(LANGUAGE_CPP) || !LANGUAGE_CPP
#if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C
- [Conditional=MICRODATA, Custom] attribute DOMObject itemValue
- setter raises(DOMException);
+ attribute [Conditional=MICRODATA, Custom] DOMObject itemValue
+ setter raises(DOMException);
#endif
#endif
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
- readonly attribute DOMString titleDisplayString;
+ readonly attribute DOMString titleDisplayString;
#endif
- void click();
-};
+ void click();
+ };
+}
diff --git a/Source/WebCore/html/HTMLEmbedElement.idl b/Source/WebCore/html/HTMLEmbedElement.idl
index 3716567ed..b6e3c166a 100644
--- a/Source/WebCore/html/HTMLEmbedElement.idl
+++ b/Source/WebCore/html/HTMLEmbedElement.idl
@@ -18,30 +18,33 @@
* Boston, MA 02110-1301, USA.
*/
-[
- CustomNamedSetter,
- JSCustomGetOwnPropertySlotAndDescriptor,
- CustomCall
-] interface HTMLEmbedElement : HTMLElement {
-attribute [Reflect] DOMString align;
+module html {
+
+ interface [
+ CustomNamedSetter,
+ JSCustomGetOwnPropertySlotAndDescriptor,
+ CustomCall
+ ] HTMLEmbedElement : HTMLElement {
+ attribute [Reflect] DOMString align;
#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
-attribute [Reflect] DOMString height;
+ attribute [Reflect] DOMString height;
#else
-attribute [Reflect] long height;
+ attribute [Reflect] long height;
#endif
-attribute [Reflect] DOMString name;
-attribute [Reflect, URL] DOMString src;
-attribute [Reflect] DOMString type;
+ attribute [Reflect] DOMString name;
+ attribute [Reflect, URL] DOMString src;
+ attribute [Reflect] DOMString type;
#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
-attribute [Reflect] DOMString width;
+ attribute [Reflect] DOMString width;
#else
-attribute [Reflect] long width;
+ attribute [Reflect] long width;
#endif
#if defined(ENABLE_SVG) && ENABLE_SVG
#if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C || defined(ENABLE_SVG_DOM_OBJC_BINDINGS) && ENABLE_SVG_DOM_OBJC_BINDINGS
-[CheckSecurityForNode] SVGDocument getSVGDocument() raises(DOMException);
+ [CheckSecurityForNode] SVGDocument getSVGDocument() raises(DOMException);
#endif
#endif
-};
+ };
+}
diff --git a/Source/WebCore/html/HTMLFieldSetElement.idl b/Source/WebCore/html/HTMLFieldSetElement.idl
index 5f3b4f385..d67b3f647 100644
--- a/Source/WebCore/html/HTMLFieldSetElement.idl
+++ b/Source/WebCore/html/HTMLFieldSetElement.idl
@@ -17,18 +17,21 @@
* Boston, MA 02110-1301, USA.
*/
-interface HTMLFieldSetElement : HTMLElement {
- [Reflect] attribute boolean disabled;
- readonly attribute HTMLFormElement form;
- [Reflect] attribute DOMString name;
+module html {
- readonly attribute DOMString type;
+ interface HTMLFieldSetElement : HTMLElement {
+ attribute [Reflect] boolean disabled;
+ readonly attribute HTMLFormElement form;
+ attribute [Reflect] DOMString name;
- readonly attribute HTMLCollection elements;
+ readonly attribute DOMString type;
- readonly attribute boolean willValidate;
- readonly attribute ValidityState validity;
- readonly attribute DOMString validationMessage;
- boolean checkValidity();
- void setCustomValidity(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString error);
-};
+ readonly attribute HTMLCollection elements;
+
+ readonly attribute boolean willValidate;
+ readonly attribute ValidityState validity;
+ readonly attribute DOMString validationMessage;
+ boolean checkValidity();
+ void setCustomValidity(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString error);
+ };
+}
diff --git a/Source/WebCore/html/HTMLFontElement.idl b/Source/WebCore/html/HTMLFontElement.idl
index d2da3a9eb..141816d1d 100644
--- a/Source/WebCore/html/HTMLFontElement.idl
+++ b/Source/WebCore/html/HTMLFontElement.idl
@@ -17,9 +17,12 @@
* Boston, MA 02110-1301, USA.
*/
-interface HTMLFontElement : HTMLElement {
- [Reflect] attribute DOMString color;
- [Reflect] attribute DOMString face;
- [Reflect] attribute DOMString size;
-};
+module html {
+ interface HTMLFontElement : HTMLElement {
+ attribute [Reflect] DOMString color;
+ attribute [Reflect] DOMString face;
+ attribute [Reflect] DOMString size;
+ };
+
+}
diff --git a/Source/WebCore/html/HTMLFormElement.cpp b/Source/WebCore/html/HTMLFormElement.cpp
index 0a251415f..947f4d92b 100644
--- a/Source/WebCore/html/HTMLFormElement.cpp
+++ b/Source/WebCore/html/HTMLFormElement.cpp
@@ -74,6 +74,7 @@ HTMLFormElement::HTMLFormElement(const QualifiedName& tagName, Document* documen
, m_isSubmittingOrPreparingForSubmission(false)
, m_shouldSubmit(false)
, m_isInResetFunction(false)
+ , m_wasMalformed(false)
, m_wasDemoted(false)
{
ASSERT(hasTagName(formTag));
@@ -686,10 +687,4 @@ void HTMLFormElement::finishParsingChildren()
document()->formController()->restoreControlStateIn(*this);
}
-void HTMLFormElement::copyNonAttributePropertiesFromElement(const Element& source)
-{
- m_wasDemoted = static_cast<const HTMLFormElement&>(source).m_wasDemoted;
- HTMLElement::copyNonAttributePropertiesFromElement(source);
-}
-
} // namespace
diff --git a/Source/WebCore/html/HTMLFormElement.h b/Source/WebCore/html/HTMLFormElement.h
index bf28cca3f..9d4739423 100644
--- a/Source/WebCore/html/HTMLFormElement.h
+++ b/Source/WebCore/html/HTMLFormElement.h
@@ -73,6 +73,11 @@ public:
void submitFromJavaScript();
void reset();
+ // Used to indicate a malformed state to keep from applying the bottom margin of the form.
+ // FIXME: Would probably be better to call this wasUnclosed; that's more specific.
+ void setMalformed(bool malformed) { m_wasMalformed = malformed; }
+ bool isMalformed() const { return m_wasMalformed; }
+
void setDemoted(bool demoted) { m_wasDemoted = demoted; }
void submitImplicitly(Event*, bool fromImplicitSubmissionTrigger);
@@ -128,8 +133,6 @@ private:
virtual bool shouldRegisterAsNamedItem() const OVERRIDE { return true; }
- virtual void copyNonAttributePropertiesFromElement(const Element&) OVERRIDE;
-
void submit(Event*, bool activateSubmitButton, bool processingUserGesture, FormSubmissionTrigger);
unsigned formElementIndexWithFormAttribute(Element*, unsigned rangeStart, unsigned rangeEnd);
@@ -161,6 +164,7 @@ private:
bool m_isInResetFunction;
+ bool m_wasMalformed;
bool m_wasDemoted;
};
diff --git a/Source/WebCore/html/HTMLFormElement.idl b/Source/WebCore/html/HTMLFormElement.idl
index 86a6f74c6..b6a536c08 100644
--- a/Source/WebCore/html/HTMLFormElement.idl
+++ b/Source/WebCore/html/HTMLFormElement.idl
@@ -18,28 +18,31 @@
* Boston, MA 02110-1301, USA.
*/
-[
- IndexedGetter,
- CustomNamedGetter
-] interface HTMLFormElement : HTMLElement {
- [Reflect=accept_charset] attribute DOMString acceptCharset;
- [Reflect, URL] attribute DOMString action;
- [Reflect] attribute DOMString autocomplete;
- [TreatNullAs=NullString] attribute DOMString enctype;
- [TreatNullAs=NullString] attribute DOMString encoding;
- [TreatNullAs=NullString] attribute DOMString method;
- [Reflect] attribute DOMString name;
- [Reflect] attribute boolean noValidate;
- [Reflect] attribute DOMString target;
+module html {
- readonly attribute HTMLCollection elements;
- readonly attribute long length;
+ interface [
+ IndexedGetter,
+ CustomNamedGetter
+ ] HTMLFormElement : HTMLElement {
+ attribute [Reflect=accept_charset] DOMString acceptCharset;
+ attribute [Reflect, URL] DOMString action;
+ attribute [Reflect] DOMString autocomplete;
+ attribute [TreatNullAs=NullString] DOMString enctype;
+ attribute [TreatNullAs=NullString] DOMString encoding;
+ attribute [TreatNullAs=NullString] DOMString method;
+ attribute [Reflect] DOMString name;
+ attribute [Reflect] boolean noValidate;
+ attribute [Reflect] DOMString target;
+
+ readonly attribute HTMLCollection elements;
+ readonly attribute long length;
#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
- [ImplementedAs=submitFromJavaScript] void submit();
+ [ImplementedAs=submitFromJavaScript] void submit();
#else
- void submit();
+ void submit();
#endif
- void reset();
- boolean checkValidity();
-};
+ void reset();
+ boolean checkValidity();
+ };
+}
diff --git a/Source/WebCore/html/HTMLFrameElement.idl b/Source/WebCore/html/HTMLFrameElement.idl
index e3747da5d..f40f7b1c5 100644
--- a/Source/WebCore/html/HTMLFrameElement.idl
+++ b/Source/WebCore/html/HTMLFrameElement.idl
@@ -18,34 +18,37 @@
* Boston, MA 02110-1301, USA.
*/
-interface HTMLFrameElement : HTMLElement {
+module html {
- [Reflect] attribute DOMString frameBorder;
- [Reflect] attribute DOMString longDesc;
- [Reflect] attribute DOMString marginHeight;
- [Reflect] attribute DOMString marginWidth;
- [Reflect] attribute DOMString name;
- [Reflect] attribute boolean noResize;
- [Reflect] attribute DOMString scrolling;
- [Reflect, URL] attribute DOMString src;
+ interface HTMLFrameElement : HTMLElement {
- // Introduced in DOM Level 2:
- [CheckSecurityForNode] readonly attribute Document contentDocument;
+ attribute [Reflect] DOMString frameBorder;
+ attribute [Reflect] DOMString longDesc;
+ attribute [Reflect] DOMString marginHeight;
+ attribute [Reflect] DOMString marginWidth;
+ attribute [Reflect] DOMString name;
+ attribute [Reflect] boolean noResize;
+ attribute [Reflect] DOMString scrolling;
+ attribute [Reflect, URL] DOMString src;
- // Extensions
- readonly attribute DOMWindow contentWindow;
+ // Introduced in DOM Level 2:
+ readonly attribute [CheckSecurityForNode] Document contentDocument;
+
+ // Extensions
+ readonly attribute DOMWindow contentWindow;
#if defined(ENABLE_SVG) && ENABLE_SVG
#if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C || defined(ENABLE_SVG_DOM_OBJC_BINDINGS) && ENABLE_SVG_DOM_OBJC_BINDINGS
- [CheckSecurityForNode] SVGDocument getSVGDocument()
- raises(DOMException);
+ [CheckSecurityForNode] SVGDocument getSVGDocument()
+ raises(DOMException);
#endif
#endif
- [TreatNullAs=NullString, CustomSetter] attribute DOMString location;
+ attribute [TreatNullAs=NullString, CustomSetter] DOMString location;
- readonly attribute long width;
- readonly attribute long height;
+ readonly attribute long width;
+ readonly attribute long height;
-};
+ };
+}
diff --git a/Source/WebCore/html/HTMLFrameElementBase.cpp b/Source/WebCore/html/HTMLFrameElementBase.cpp
index d7882f37c..eaa354994 100644
--- a/Source/WebCore/html/HTMLFrameElementBase.cpp
+++ b/Source/WebCore/html/HTMLFrameElementBase.cpp
@@ -67,7 +67,7 @@ bool HTMLFrameElementBase::isURLAllowed() const
}
if (Frame* parentFrame = document()->frame()) {
- if (parentFrame->page()->subframeCount() >= Page::maxNumberOfFrames)
+ if (parentFrame->page()->frameCount() >= Page::maxNumberOfFrames)
return false;
}
diff --git a/Source/WebCore/html/HTMLFrameSetElement.idl b/Source/WebCore/html/HTMLFrameSetElement.idl
index b4fa43da3..a3d4b3ec4 100644
--- a/Source/WebCore/html/HTMLFrameSetElement.idl
+++ b/Source/WebCore/html/HTMLFrameSetElement.idl
@@ -18,37 +18,40 @@
* Boston, MA 02110-1301, USA.
*/
-[
- CustomNamedGetter
-] interface HTMLFrameSetElement : HTMLElement {
- [Reflect] attribute DOMString cols;
- [Reflect] attribute DOMString rows;
+module html {
+
+ interface [
+ CustomNamedGetter
+ ] HTMLFrameSetElement : HTMLElement {
+ attribute [Reflect] DOMString cols;
+ attribute [Reflect] DOMString rows;
#if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C
- // Event handler attributes
- [NotEnumerable, JSWindowEventListener] attribute EventListener onbeforeunload;
- [NotEnumerable, JSWindowEventListener] attribute EventListener onhashchange;
- [NotEnumerable, JSWindowEventListener] attribute EventListener onmessage;
- [NotEnumerable, JSWindowEventListener] attribute EventListener onoffline;
- [NotEnumerable, JSWindowEventListener] attribute EventListener ononline;
- [NotEnumerable, JSWindowEventListener] attribute EventListener onpopstate;
- [NotEnumerable, JSWindowEventListener] attribute EventListener onresize;
- [NotEnumerable, JSWindowEventListener] attribute EventListener onstorage;
- [NotEnumerable, JSWindowEventListener] attribute EventListener onunload;
+ // Event handler attributes
+ attribute [NotEnumerable, JSWindowEventListener] EventListener onbeforeunload;
+ attribute [NotEnumerable, JSWindowEventListener] EventListener onhashchange;
+ attribute [NotEnumerable, JSWindowEventListener] EventListener onmessage;
+ attribute [NotEnumerable, JSWindowEventListener] EventListener onoffline;
+ attribute [NotEnumerable, JSWindowEventListener] EventListener ononline;
+ attribute [NotEnumerable, JSWindowEventListener] EventListener onpopstate;
+ attribute [NotEnumerable, JSWindowEventListener] EventListener onresize;
+ attribute [NotEnumerable, JSWindowEventListener] EventListener onstorage;
+ attribute [NotEnumerable, JSWindowEventListener] EventListener onunload;
- [Conditional=ORIENTATION_EVENTS, NotEnumerable, JSWindowEventListener] attribute EventListener onorientationchange;
+ attribute [Conditional=ORIENTATION_EVENTS, NotEnumerable, JSWindowEventListener] EventListener onorientationchange;
- // Overrides of Element attributes (with different implementation in bindings).
- [NotEnumerable, JSWindowEventListener] attribute EventListener onblur;
- [NotEnumerable, JSWindowEventListener] attribute EventListener onerror;
- [NotEnumerable, JSWindowEventListener] attribute EventListener onfocus;
- [NotEnumerable, JSWindowEventListener] attribute EventListener onload;
+ // Overrides of Element attributes (with different implementation in bindings).
+ attribute [NotEnumerable, JSWindowEventListener] EventListener onblur;
+ attribute [NotEnumerable, JSWindowEventListener] EventListener onerror;
+ attribute [NotEnumerable, JSWindowEventListener] EventListener onfocus;
+ attribute [NotEnumerable, JSWindowEventListener] EventListener onload;
- // Not implemented yet.
- // attribute [NotEnumerable, JSWindowEventListener] EventListener onafterprint;
- // attribute [NotEnumerable, JSWindowEventListener] EventListener onbeforeprint;
- // attribute [NotEnumerable, JSWindowEventListener] EventListener onredo;
- // attribute [NotEnumerable, JSWindowEventListener] EventListener onundo;
+ // Not implemented yet.
+ // attribute [NotEnumerable, JSWindowEventListener] EventListener onafterprint;
+ // attribute [NotEnumerable, JSWindowEventListener] EventListener onbeforeprint;
+ // attribute [NotEnumerable, JSWindowEventListener] EventListener onredo;
+ // attribute [NotEnumerable, JSWindowEventListener] EventListener onundo;
#endif
-};
+ };
+}
diff --git a/Source/WebCore/html/HTMLHRElement.idl b/Source/WebCore/html/HTMLHRElement.idl
index babe467cd..23a57da10 100644
--- a/Source/WebCore/html/HTMLHRElement.idl
+++ b/Source/WebCore/html/HTMLHRElement.idl
@@ -17,10 +17,13 @@
* Boston, MA 02110-1301, USA.
*/
-interface HTMLHRElement : HTMLElement {
- [Reflect] attribute DOMString align;
- [Reflect] attribute boolean noShade;
- [Reflect] attribute DOMString size;
- [Reflect] attribute DOMString width;
-};
+module html {
+ interface HTMLHRElement : HTMLElement {
+ attribute [Reflect] DOMString align;
+ attribute [Reflect] boolean noShade;
+ attribute [Reflect] DOMString size;
+ attribute [Reflect] DOMString width;
+ };
+
+}
diff --git a/Source/WebCore/html/HTMLHeadElement.idl b/Source/WebCore/html/HTMLHeadElement.idl
index 6a784bdd7..59bdbf0e7 100644
--- a/Source/WebCore/html/HTMLHeadElement.idl
+++ b/Source/WebCore/html/HTMLHeadElement.idl
@@ -17,7 +17,10 @@
* Boston, MA 02110-1301, USA.
*/
-interface HTMLHeadElement : HTMLElement {
- [Reflect] attribute DOMString profile;
-};
+module html {
+ interface HTMLHeadElement : HTMLElement {
+ attribute [Reflect] DOMString profile;
+ };
+
+}
diff --git a/Source/WebCore/html/HTMLHeadingElement.idl b/Source/WebCore/html/HTMLHeadingElement.idl
index 288f43902..e419c1c7d 100644
--- a/Source/WebCore/html/HTMLHeadingElement.idl
+++ b/Source/WebCore/html/HTMLHeadingElement.idl
@@ -17,7 +17,10 @@
* Boston, MA 02110-1301, USA.
*/
-interface HTMLHeadingElement : HTMLElement {
- [Reflect] attribute DOMString align;
-};
+module html {
+ interface HTMLHeadingElement : HTMLElement {
+ attribute [Reflect] DOMString align;
+ };
+
+}
diff --git a/Source/WebCore/html/HTMLHtmlElement.idl b/Source/WebCore/html/HTMLHtmlElement.idl
index 430cdc6f8..03c661cc8 100644
--- a/Source/WebCore/html/HTMLHtmlElement.idl
+++ b/Source/WebCore/html/HTMLHtmlElement.idl
@@ -17,8 +17,11 @@
* Boston, MA 02110-1301, USA.
*/
-interface HTMLHtmlElement : HTMLElement {
- [Reflect] attribute DOMString version;
- [Reflect, URL] attribute DOMString manifest;
-};
+module html {
+ interface HTMLHtmlElement : HTMLElement {
+ attribute [Reflect] DOMString version;
+ attribute [Reflect, URL] DOMString manifest;
+ };
+
+}
diff --git a/Source/WebCore/html/HTMLIFrameElement.idl b/Source/WebCore/html/HTMLIFrameElement.idl
index eea2fb72e..2dbf38dbe 100644
--- a/Source/WebCore/html/HTMLIFrameElement.idl
+++ b/Source/WebCore/html/HTMLIFrameElement.idl
@@ -18,32 +18,35 @@
* Boston, MA 02110-1301, USA.
*/
-interface HTMLIFrameElement : HTMLElement {
- [Reflect] attribute DOMString align;
- [Reflect] attribute DOMString frameBorder;
- [Reflect] attribute DOMString height;
- [Reflect] attribute DOMString longDesc;
- [Reflect] attribute DOMString marginHeight;
- [Reflect] attribute DOMString marginWidth;
- [Reflect] attribute DOMString name;
- [Reflect] attribute DOMString sandbox;
- [Reflect, Conditional=IFRAME_SEAMLESS] attribute boolean seamless;
- [Reflect] attribute DOMString scrolling;
- [Reflect, URL] attribute DOMString src;
- [Reflect] attribute DOMString srcdoc;
- [Reflect] attribute DOMString width;
+module html {
- // Introduced in DOM Level 2:
- [CheckSecurityForNode] readonly attribute Document contentDocument;
+ interface HTMLIFrameElement : HTMLElement {
+ attribute [Reflect] DOMString align;
+ attribute [Reflect] DOMString frameBorder;
+ attribute [Reflect] DOMString height;
+ attribute [Reflect] DOMString longDesc;
+ attribute [Reflect] DOMString marginHeight;
+ attribute [Reflect] DOMString marginWidth;
+ attribute [Reflect] DOMString name;
+ attribute [Reflect] DOMString sandbox;
+ attribute [Reflect, Conditional=IFRAME_SEAMLESS] boolean seamless;
+ attribute [Reflect] DOMString scrolling;
+ attribute [Reflect, URL] DOMString src;
+ attribute [Reflect] DOMString srcdoc;
+ attribute [Reflect] DOMString width;
- // Extensions
- readonly attribute DOMWindow contentWindow;
+ // Introduced in DOM Level 2:
+ readonly attribute [CheckSecurityForNode] Document contentDocument;
+
+ // Extensions
+ readonly attribute DOMWindow contentWindow;
#if defined(ENABLE_SVG) && ENABLE_SVG
#if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C || defined(ENABLE_SVG_DOM_OBJC_BINDINGS) && ENABLE_SVG_DOM_OBJC_BINDINGS
- [CheckSecurityForNode] SVGDocument getSVGDocument()
- raises(DOMException);
+ [CheckSecurityForNode] SVGDocument getSVGDocument()
+ raises(DOMException);
#endif
#endif
-};
+ };
+}
diff --git a/Source/WebCore/html/HTMLImageElement.idl b/Source/WebCore/html/HTMLImageElement.idl
index ce1ea1799..d893b6c0c 100644
--- a/Source/WebCore/html/HTMLImageElement.idl
+++ b/Source/WebCore/html/HTMLImageElement.idl
@@ -18,35 +18,38 @@
* Boston, MA 02110-1301, USA.
*/
-[
- JSGenerateToNativeObject
-] interface HTMLImageElement : HTMLElement {
- [Reflect] attribute DOMString name;
- [Reflect] attribute DOMString align;
- [Reflect] attribute DOMString alt;
- [Reflect] attribute DOMString border;
- [Reflect] attribute DOMString crossOrigin;
- attribute long height;
- [Reflect] attribute long hspace;
- [Reflect] attribute boolean isMap;
- [Reflect, URL] attribute DOMString longDesc;
- [Reflect, URL] attribute DOMString src;
- [Reflect] attribute DOMString useMap;
- [Reflect] attribute long vspace;
- attribute long width;
-
- // Extensions
- readonly attribute boolean complete;
- [Reflect,URL] attribute DOMString lowsrc;
- readonly attribute long naturalHeight;
- readonly attribute long naturalWidth;
- readonly attribute long x;
- readonly attribute long y;
+module html {
+
+ interface [
+ JSGenerateToNativeObject
+ ] HTMLImageElement : HTMLElement {
+ attribute [Reflect] DOMString name;
+ attribute [Reflect] DOMString align;
+ attribute [Reflect] DOMString alt;
+ attribute [Reflect] DOMString border;
+ attribute [Reflect] DOMString crossOrigin;
+ attribute long height;
+ attribute [Reflect] long hspace;
+ attribute [Reflect] boolean isMap;
+ attribute [Reflect, URL] DOMString longDesc;
+ attribute [Reflect, URL] DOMString src;
+ attribute [Reflect] DOMString useMap;
+ attribute [Reflect] long vspace;
+ attribute long width;
+
+ // Extensions
+ readonly attribute boolean complete;
+ attribute [Reflect,URL] DOMString lowsrc;
+ readonly attribute long naturalHeight;
+ readonly attribute long naturalWidth;
+ readonly attribute long x;
+ readonly attribute long y;
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
- // Objective-C extension:
- readonly attribute DOMString altDisplayString;
- readonly attribute URL absoluteImageURL;
+ // Objective-C extension:
+ readonly attribute DOMString altDisplayString;
+ readonly attribute URL absoluteImageURL;
#endif
-};
+ };
+}
diff --git a/Source/WebCore/html/HTMLInputElement.cpp b/Source/WebCore/html/HTMLInputElement.cpp
index 027f60f5e..d1ea76cae 100644
--- a/Source/WebCore/html/HTMLInputElement.cpp
+++ b/Source/WebCore/html/HTMLInputElement.cpp
@@ -1318,14 +1318,6 @@ void HTMLInputElement::setSize(unsigned size)
setAttribute(sizeAttr, String::number(size));
}
-void HTMLInputElement::setSize(unsigned size, ExceptionCode& ec)
-{
- if (!size)
- ec = INDEX_SIZE_ERR;
- else
- setSize(size);
-}
-
KURL HTMLInputElement::src() const
{
return document()->completeURL(fastGetAttribute(srcAttr));
diff --git a/Source/WebCore/html/HTMLInputElement.h b/Source/WebCore/html/HTMLInputElement.h
index 4184dc977..7fe0d6c14 100644
--- a/Source/WebCore/html/HTMLInputElement.h
+++ b/Source/WebCore/html/HTMLInputElement.h
@@ -208,7 +208,6 @@ public:
String alt() const;
void setSize(unsigned);
- void setSize(unsigned, ExceptionCode&);
KURL src() const;
diff --git a/Source/WebCore/html/HTMLInputElement.idl b/Source/WebCore/html/HTMLInputElement.idl
index 3c360477a..879a34f57 100644
--- a/Source/WebCore/html/HTMLInputElement.idl
+++ b/Source/WebCore/html/HTMLInputElement.idl
@@ -19,100 +19,103 @@
* Boston, MA 02110-1301, USA.
*/
-interface HTMLInputElement : HTMLElement {
- [Reflect] attribute DOMString accept;
- [Reflect] attribute DOMString alt;
- [Reflect] attribute DOMString autocomplete;
- [Reflect] attribute boolean autofocus;
- [Reflect=checked] attribute boolean defaultChecked;
- attribute boolean checked;
- [Reflect] attribute DOMString dirName;
- [Reflect] attribute boolean disabled;
- readonly attribute HTMLFormElement form;
- attribute FileList files;
- [Reflect, URL] attribute DOMString formAction;
- [TreatNullAs=NullString] attribute DOMString formEnctype;
- [TreatNullAs=NullString] attribute DOMString formMethod;
- [Reflect] attribute boolean formNoValidate;
- [Reflect] attribute DOMString formTarget;
- attribute unsigned long height;
- attribute boolean indeterminate;
- [Conditional=DATALIST_ELEMENT] readonly attribute HTMLElement list;
- [Reflect] attribute DOMString max;
- attribute long maxLength setter raises(DOMException);
- [Reflect] attribute DOMString min;
- [Reflect] attribute boolean multiple;
- [Reflect] attribute DOMString name;
- [Reflect] attribute DOMString pattern;
- [Reflect] attribute DOMString placeholder;
- [Reflect] attribute boolean readOnly;
- [Reflect] attribute boolean required;
+module html {
+
+ interface HTMLInputElement : HTMLElement {
+ attribute [Reflect] DOMString accept;
+ attribute [Reflect] DOMString alt;
+ attribute [Reflect] DOMString autocomplete;
+ attribute [Reflect] boolean autofocus;
+ attribute [Reflect=checked] boolean defaultChecked;
+ attribute boolean checked;
+ attribute [Reflect] DOMString dirName;
+ attribute [Reflect] boolean disabled;
+ readonly attribute HTMLFormElement form;
+ attribute FileList files;
+ attribute [Reflect, URL] DOMString formAction;
+ attribute [TreatNullAs=NullString] DOMString formEnctype;
+ attribute [TreatNullAs=NullString] DOMString formMethod;
+ attribute [Reflect] boolean formNoValidate;
+ attribute [Reflect] DOMString formTarget;
+ attribute unsigned long height;
+ attribute boolean indeterminate;
+ readonly attribute [Conditional=DATALIST_ELEMENT] HTMLElement list;
+ attribute [Reflect] DOMString max;
+ attribute long maxLength setter raises(DOMException);
+ attribute [Reflect] DOMString min;
+ attribute [Reflect] boolean multiple;
+ attribute [Reflect] DOMString name;
+ attribute [Reflect] DOMString pattern;
+ attribute [Reflect] DOMString placeholder;
+ attribute [Reflect] boolean readOnly;
+ attribute [Reflect] boolean required;
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
- [ObjCImplementedAsUnsignedLong] attribute DOMString size; // DOM level 2 changed this to a long, but ObjC API is a string
+ attribute [ObjCImplementedAsUnsignedLong] DOMString size; // DOM level 2 changed this to a long, but ObjC API is a string
#else
- attribute unsigned long size setter raises(DOMException); // Changed string -> long -> unsigned long
+ attribute unsigned long size; // Changed string -> long -> unsigned long
#endif
- [Reflect, URL] attribute DOMString src;
- [Reflect] attribute DOMString step;
- [TreatNullAs=NullString] attribute DOMString type; // readonly dropped as part of DOM level 2
- [TreatNullAs=NullString] attribute DOMString defaultValue;
- [TreatNullAs=NullString] attribute DOMString value;
+ attribute [Reflect, URL] DOMString src;
+ attribute [Reflect] DOMString step;
+ attribute [TreatNullAs=NullString] DOMString type; // readonly dropped as part of DOM level 2
+ attribute [TreatNullAs=NullString] DOMString defaultValue;
+ attribute [TreatNullAs=NullString] DOMString value;
#if !defined(LANGUAGE_CPP) || !LANGUAGE_CPP
- attribute Date valueAsDate setter raises(DOMException);
+ attribute Date valueAsDate setter raises(DOMException);
#endif
- attribute double valueAsNumber setter raises(DOMException);
+ attribute double valueAsNumber setter raises(DOMException);
- void stepUp(in [Optional] long n) raises(DOMException);
- void stepDown(in [Optional] long n) raises(DOMException);
+ void stepUp(in [Optional] long n) raises(DOMException);
+ void stepDown(in [Optional] long n) raises(DOMException);
- attribute unsigned long width;
- readonly attribute boolean willValidate;
- readonly attribute ValidityState validity;
- readonly attribute DOMString validationMessage;
- boolean checkValidity();
- void setCustomValidity(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString error);
+ attribute unsigned long width;
+ readonly attribute boolean willValidate;
+ readonly attribute ValidityState validity;
+ readonly attribute DOMString validationMessage;
+ boolean checkValidity();
+ void setCustomValidity(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString error);
- readonly attribute NodeList labels;
+ readonly attribute NodeList labels;
- void select();
- [Custom] attribute long selectionStart;
- [Custom] attribute long selectionEnd;
- [Custom] attribute DOMString selectionDirection;
+ void select();
+ attribute [Custom] long selectionStart;
+ attribute [Custom] long selectionEnd;
+ attribute [Custom] DOMString selectionDirection;
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
- [Custom] void setSelectionRange(in long start, in long end);
+ [Custom] void setSelectionRange(in long start, in long end);
#else
- [Custom] void setSelectionRange(in [Optional=DefaultIsUndefined] long start,
- in [Optional=DefaultIsUndefined] long end,
- in [Optional] DOMString direction);
+ [Custom] void setSelectionRange(in [Optional=DefaultIsUndefined] long start,
+ in [Optional=DefaultIsUndefined] long end,
+ in [Optional] DOMString direction);
#endif
- // Non-standard attributes
- [Reflect] attribute DOMString align;
- [Conditional=DIRECTORY_UPLOAD, Reflect] attribute boolean webkitdirectory;
- [Reflect] attribute DOMString useMap;
- [Reflect] attribute boolean incremental;
- [Conditional=INPUT_SPEECH, Reflect, V8EnabledAtRuntime] attribute boolean webkitSpeech;
- [Conditional=INPUT_SPEECH, Reflect, V8EnabledAtRuntime] attribute boolean webkitGrammar;
- [Conditional=INPUT_SPEECH, NotEnumerable] attribute EventListener onwebkitspeechchange;
+ // Non-standard attributes
+ attribute [Reflect] DOMString align;
+ attribute [Conditional=DIRECTORY_UPLOAD, Reflect] boolean webkitdirectory;
+ attribute [Reflect] DOMString useMap;
+ attribute [Reflect] boolean incremental;
+ attribute [Conditional=INPUT_SPEECH, Reflect, V8EnabledAtRuntime] boolean webkitSpeech;
+ attribute [Conditional=INPUT_SPEECH, Reflect, V8EnabledAtRuntime] boolean webkitGrammar;
+ attribute [Conditional=INPUT_SPEECH, NotEnumerable] EventListener onwebkitspeechchange;
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
- [Reflect] attribute DOMString accessKey;
+ attribute [Reflect] DOMString accessKey;
#endif
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
- void click();
+ void click();
#endif
#if !defined(LANGUAGE_JAVASCRIPT) || !LANGUAGE_JAVASCRIPT
- void setValueForUser(in [TreatNullAs=NullString] DOMString value);
+ void setValueForUser(in [TreatNullAs=NullString] DOMString value);
#endif
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
- // Objective-C extension:
- readonly attribute DOMString altDisplayString;
- readonly attribute URL absoluteImageURL;
+ // Objective-C extension:
+ readonly attribute DOMString altDisplayString;
+ readonly attribute URL absoluteImageURL;
#endif
- // See http://www.w3.org/TR/html-media-capture/
- [Conditional=MEDIA_CAPTURE] attribute DOMString capture;
-};
+ // See http://www.w3.org/TR/html-media-capture/
+ attribute [Conditional=MEDIA_CAPTURE] DOMString capture;
+ };
+}
diff --git a/Source/WebCore/html/HTMLIntentElement.idl b/Source/WebCore/html/HTMLIntentElement.idl
index f1df9be90..608c5acdd 100644
--- a/Source/WebCore/html/HTMLIntentElement.idl
+++ b/Source/WebCore/html/HTMLIntentElement.idl
@@ -23,13 +23,16 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- Conditional=WEB_INTENTS_TAG
-] interface HTMLIntentElement : HTMLElement {
- [Reflect] attribute DOMString action;
- [Reflect] attribute DOMString type;
- [Reflect, URL] attribute DOMString href;
- [Reflect] attribute DOMString title;
- [Reflect] attribute DOMString disposition;
-};
+module html {
+ interface [
+ Conditional=WEB_INTENTS_TAG
+ ] HTMLIntentElement : HTMLElement {
+ attribute [Reflect] DOMString action;
+ attribute [Reflect] DOMString type;
+ attribute [Reflect, URL] DOMString href;
+ attribute [Reflect] DOMString title;
+ attribute [Reflect] DOMString disposition;
+ };
+
+}
diff --git a/Source/WebCore/html/HTMLKeygenElement.idl b/Source/WebCore/html/HTMLKeygenElement.idl
index 466d7925f..fc6f25c81 100644
--- a/Source/WebCore/html/HTMLKeygenElement.idl
+++ b/Source/WebCore/html/HTMLKeygenElement.idl
@@ -28,22 +28,25 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-interface HTMLKeygenElement : HTMLElement {
- [Reflect] attribute boolean autofocus;
- [Reflect] attribute DOMString challenge;
- [Reflect] attribute boolean disabled;
- readonly attribute HTMLFormElement form;
- [Reflect] attribute DOMString keytype;
- [Reflect] attribute DOMString name;
+module html {
- readonly attribute DOMString type;
+ interface HTMLKeygenElement : HTMLElement {
+ attribute [Reflect] boolean autofocus;
+ attribute [Reflect] DOMString challenge;
+ attribute [Reflect] boolean disabled;
+ readonly attribute HTMLFormElement form;
+ attribute [Reflect] DOMString keytype;
+ attribute [Reflect] DOMString name;
- readonly attribute boolean willValidate;
- readonly attribute ValidityState validity;
- readonly attribute DOMString validationMessage;
- boolean checkValidity();
- void setCustomValidity(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString error);
+ readonly attribute DOMString type;
- readonly attribute NodeList labels;
-};
+ readonly attribute boolean willValidate;
+ readonly attribute ValidityState validity;
+ readonly attribute DOMString validationMessage;
+ boolean checkValidity();
+ void setCustomValidity(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString error);
+ readonly attribute NodeList labels;
+ };
+
+}
diff --git a/Source/WebCore/html/HTMLLIElement.cpp b/Source/WebCore/html/HTMLLIElement.cpp
index 189342099..65f65dc9e 100644
--- a/Source/WebCore/html/HTMLLIElement.cpp
+++ b/Source/WebCore/html/HTMLLIElement.cpp
@@ -96,9 +96,9 @@ void HTMLLIElement::attach()
// Find the enclosing list node.
Node* listNode = 0;
- ComposedShadowTreeWalker walker(this);
+ ComposedShadowTreeParentWalker walker(this);
while (!listNode) {
- walker.parent();
+ walker.parentIncludingInsertionPointAndShadowRoot();
if (!walker.get())
break;
if (walker.get()->hasTagName(ulTag) || walker.get()->hasTagName(olTag))
diff --git a/Source/WebCore/html/HTMLLIElement.idl b/Source/WebCore/html/HTMLLIElement.idl
index ba3eaaebd..2dc541b18 100644
--- a/Source/WebCore/html/HTMLLIElement.idl
+++ b/Source/WebCore/html/HTMLLIElement.idl
@@ -17,8 +17,11 @@
* Boston, MA 02110-1301, USA.
*/
-interface HTMLLIElement : HTMLElement {
- [Reflect] attribute DOMString type;
- [Reflect] attribute long value;
-};
+module html {
+ interface HTMLLIElement : HTMLElement {
+ attribute [Reflect] DOMString type;
+ attribute [Reflect] long value;
+ };
+
+}
diff --git a/Source/WebCore/html/HTMLLabelElement.idl b/Source/WebCore/html/HTMLLabelElement.idl
index 92e5f4ba7..bf79680f8 100644
--- a/Source/WebCore/html/HTMLLabelElement.idl
+++ b/Source/WebCore/html/HTMLLabelElement.idl
@@ -18,12 +18,15 @@
* Boston, MA 02110-1301, USA.
*/
-interface HTMLLabelElement : HTMLElement {
- readonly attribute HTMLFormElement form;
- [Reflect=for] attribute DOMString htmlFor;
- readonly attribute HTMLElement control;
+module html {
+
+ interface HTMLLabelElement : HTMLElement {
+ readonly attribute HTMLFormElement form;
+ attribute [Reflect=for] DOMString htmlFor;
+ readonly attribute HTMLElement control;
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
- [Reflect] attribute DOMString accessKey;
+ attribute [Reflect] DOMString accessKey;
#endif
-};
+ };
+}
diff --git a/Source/WebCore/html/HTMLLegendElement.idl b/Source/WebCore/html/HTMLLegendElement.idl
index 749745e4b..bf755a5bb 100644
--- a/Source/WebCore/html/HTMLLegendElement.idl
+++ b/Source/WebCore/html/HTMLLegendElement.idl
@@ -18,11 +18,14 @@
* Boston, MA 02110-1301, USA.
*/
-interface HTMLLegendElement : HTMLElement {
- readonly attribute HTMLFormElement form;
- [Reflect] attribute DOMString align;
+module html {
+
+ interface HTMLLegendElement : HTMLElement {
+ readonly attribute HTMLFormElement form;
+ attribute [Reflect] DOMString align;
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
- [Reflect] attribute DOMString accessKey;
+ attribute [Reflect] DOMString accessKey;
#endif
-};
+ };
+}
diff --git a/Source/WebCore/html/HTMLLinkElement.idl b/Source/WebCore/html/HTMLLinkElement.idl
index 0a4e34759..8d16f25e8 100644
--- a/Source/WebCore/html/HTMLLinkElement.idl
+++ b/Source/WebCore/html/HTMLLinkElement.idl
@@ -19,26 +19,29 @@
* Boston, MA 02110-1301, USA.
*/
-interface HTMLLinkElement : HTMLElement {
- [Reflect] attribute boolean disabled;
- [Reflect] attribute DOMString charset;
- [Reflect, URL] attribute DOMString href;
- [Reflect] attribute DOMString hreflang;
- [Reflect] attribute DOMString media;
- [Reflect] attribute DOMString rel;
- [Reflect] attribute DOMString rev;
+module html {
+
+ interface HTMLLinkElement : HTMLElement {
+ attribute [Reflect] boolean disabled;
+ attribute [Reflect] DOMString charset;
+ attribute [Reflect, URL] DOMString href;
+ attribute [Reflect] DOMString hreflang;
+ attribute [Reflect] DOMString media;
+ attribute [Reflect] DOMString rel;
+ attribute [Reflect] DOMString rev;
#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
- [Custom] attribute DOMSettableTokenList sizes;
+ attribute [Custom] DOMSettableTokenList sizes;
#endif
- [Reflect] attribute DOMString target;
- [Reflect] attribute DOMString type;
+ attribute [Reflect] DOMString target;
+ attribute [Reflect] DOMString type;
- // DOM Level 2 Style
- readonly attribute StyleSheet sheet;
+ // DOM Level 2 Style
+ readonly attribute StyleSheet sheet;
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
- // Objective-C extension:
- readonly attribute URL absoluteLinkURL;
+ // Objective-C extension:
+ readonly attribute URL absoluteLinkURL;
#endif
-};
+ };
+}
diff --git a/Source/WebCore/html/HTMLMapElement.idl b/Source/WebCore/html/HTMLMapElement.idl
index 01dcae007..7811c9a9f 100644
--- a/Source/WebCore/html/HTMLMapElement.idl
+++ b/Source/WebCore/html/HTMLMapElement.idl
@@ -18,8 +18,11 @@
* Boston, MA 02110-1301, USA.
*/
-interface HTMLMapElement : HTMLElement {
- readonly attribute HTMLCollection areas;
- [Reflect] attribute DOMString name;
-};
+module html {
+ interface HTMLMapElement : HTMLElement {
+ readonly attribute HTMLCollection areas;
+ attribute [Reflect] DOMString name;
+ };
+
+}
diff --git a/Source/WebCore/html/HTMLMarqueeElement.idl b/Source/WebCore/html/HTMLMarqueeElement.idl
index 41bd01906..3174facbc 100644
--- a/Source/WebCore/html/HTMLMarqueeElement.idl
+++ b/Source/WebCore/html/HTMLMarqueeElement.idl
@@ -17,25 +17,28 @@
* Boston, MA 02110-1301, USA.
*/
-interface HTMLMarqueeElement : HTMLElement {
- void start();
- void stop();
-
- [Reflect] attribute DOMString behavior;
- [Reflect] attribute DOMString bgColor;
- [Reflect] attribute DOMString direction;
- [Reflect] attribute DOMString height;
- [Reflect] attribute unsigned long hspace;
- attribute long loop setter raises(DOMException);
- attribute long scrollAmount setter raises(DOMException);
- attribute long scrollDelay setter raises(DOMException);
- [Reflect] attribute boolean trueSpeed;
- [Reflect] attribute unsigned long vspace;
- [Reflect] attribute DOMString width;
+module html {
- // FIXME: Implement the following event handler attributes
- // https://bugs.webkit.org/show_bug.cgi?id=49788
- // attribute EventListener onbounce;
- // attribute EventListener onfinish;
- // attribute EventListener onstart;
-};
+ interface HTMLMarqueeElement : HTMLElement {
+ void start();
+ void stop();
+
+ attribute [Reflect] DOMString behavior;
+ attribute [Reflect] DOMString bgColor;
+ attribute [Reflect] DOMString direction;
+ attribute [Reflect] DOMString height;
+ attribute [Reflect] unsigned long hspace;
+ attribute long loop setter raises(DOMException);
+ attribute long scrollAmount setter raises(DOMException);
+ attribute long scrollDelay setter raises(DOMException);
+ attribute [Reflect] boolean trueSpeed;
+ attribute [Reflect] unsigned long vspace;
+ attribute [Reflect] DOMString width;
+
+ // FIXME: Implement the following event handler attributes
+ // https://bugs.webkit.org/show_bug.cgi?id=49788
+ // attribute EventListener onbounce;
+ // attribute EventListener onfinish;
+ // attribute EventListener onstart;
+ };
+}
diff --git a/Source/WebCore/html/HTMLMediaElement.cpp b/Source/WebCore/html/HTMLMediaElement.cpp
index ebeee1b40..66b8c4655 100644
--- a/Source/WebCore/html/HTMLMediaElement.cpp
+++ b/Source/WebCore/html/HTMLMediaElement.cpp
@@ -756,7 +756,7 @@ void HTMLMediaElement::loadInternal()
// Some of the code paths below this function dispatch the BeforeLoad event. This ASSERT helps
// us catch those bugs more quickly without needing all the branches to align to actually
// trigger the event.
- ASSERT(!NoEventDispatchAssertion::isEventDispatchForbidden());
+ ASSERT(!eventDispatchForbidden());
// If we can't start a load right away, start it later.
Page* page = document()->page();
@@ -1834,14 +1834,8 @@ void HTMLMediaElement::mediaPlayerKeyMessage(MediaPlayer*, const String& keySyst
m_asyncEventQueue->enqueueEvent(event.release());
}
-bool HTMLMediaElement::mediaPlayerKeyNeeded(MediaPlayer*, const String& keySystem, const String& sessionId, const unsigned char* initData, unsigned initDataLength)
+void HTMLMediaElement::mediaPlayerKeyNeeded(MediaPlayer*, const String& keySystem, const String& sessionId, const unsigned char* initData, unsigned initDataLength)
{
- if (!hasEventListeners(eventNames().webkitneedkeyEvent)) {
- m_error = MediaError::create(MediaError::MEDIA_ERR_ENCRYPTED);
- scheduleEvent(eventNames().errorEvent);
- return false;
- }
-
MediaKeyEventInit initializer;
initializer.keySystem = keySystem;
initializer.sessionId = sessionId;
@@ -1852,7 +1846,6 @@ bool HTMLMediaElement::mediaPlayerKeyNeeded(MediaPlayer*, const String& keySyste
RefPtr<Event> event = MediaKeyEvent::create(eventNames().webkitneedkeyEvent, initializer);
event->setTarget(this);
m_asyncEventQueue->enqueueEvent(event.release());
- return true;
}
#endif
diff --git a/Source/WebCore/html/HTMLMediaElement.h b/Source/WebCore/html/HTMLMediaElement.h
index b698c6b2d..821e2285b 100644
--- a/Source/WebCore/html/HTMLMediaElement.h
+++ b/Source/WebCore/html/HTMLMediaElement.h
@@ -415,7 +415,7 @@ private:
virtual void mediaPlayerKeyAdded(MediaPlayer*, const String& keySystem, const String& sessionId) OVERRIDE;
virtual void mediaPlayerKeyError(MediaPlayer*, const String& keySystem, const String& sessionId, MediaPlayerClient::MediaKeyErrorCode, unsigned short systemCode) OVERRIDE;
virtual void mediaPlayerKeyMessage(MediaPlayer*, const String& keySystem, const String& sessionId, const unsigned char* message, unsigned messageLength) OVERRIDE;
- virtual bool mediaPlayerKeyNeeded(MediaPlayer*, const String& keySystem, const String& sessionId, const unsigned char* initData, unsigned initDataLength) OVERRIDE;
+ virtual void mediaPlayerKeyNeeded(MediaPlayer*, const String& keySystem, const String& sessionId, const unsigned char* initData, unsigned initDataLength) OVERRIDE;
#endif
virtual String mediaPlayerReferrer() const OVERRIDE;
diff --git a/Source/WebCore/html/HTMLMediaElement.idl b/Source/WebCore/html/HTMLMediaElement.idl
index ece0f5348..b6a0a636f 100644
--- a/Source/WebCore/html/HTMLMediaElement.idl
+++ b/Source/WebCore/html/HTMLMediaElement.idl
@@ -23,97 +23,99 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- Conditional=VIDEO,
- JSGenerateToNativeObject
-] interface HTMLMediaElement : HTMLElement {
+module html {
+ interface [
+ Conditional=VIDEO,
+ JSGenerateToNativeObject
+ ] HTMLMediaElement : HTMLElement {
-// error state
-readonly attribute MediaError error;
+ // error state
+ readonly attribute MediaError error;
-// network state
-attribute [Reflect, URL] DOMString src;
-readonly attribute [URL] DOMString currentSrc;
+ // network state
+ attribute [Reflect, URL] DOMString src;
+ readonly attribute [URL] DOMString currentSrc;
+
+ const unsigned short NETWORK_EMPTY = 0;
+ const unsigned short NETWORK_IDLE = 1;
+ const unsigned short NETWORK_LOADING = 2;
+ const unsigned short NETWORK_NO_SOURCE = 3;
+ readonly attribute unsigned short networkState;
+ attribute DOMString preload;
-const unsigned short NETWORK_EMPTY = 0;
-const unsigned short NETWORK_IDLE = 1;
-const unsigned short NETWORK_LOADING = 2;
-const unsigned short NETWORK_NO_SOURCE = 3;
-readonly attribute unsigned short networkState;
-attribute DOMString preload;
-
-readonly attribute TimeRanges buffered;
-void load()
- raises (DOMException);
+ readonly attribute TimeRanges buffered;
+ void load()
+ raises (DOMException);
#if defined(ENABLE_ENCRYPTED_MEDIA) && ENABLE_ENCRYPTED_MEDIA
-DOMString canPlayType(in [Optional=DefaultIsUndefined] DOMString type, in [Optional=DefaultIsUndefined, TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString keySystem);
+ DOMString canPlayType(in [Optional=DefaultIsUndefined] DOMString type, in [Optional=DefaultIsNullString, TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString keySystem);
#else
-DOMString canPlayType(in [Optional=DefaultIsUndefined] DOMString type);
+ DOMString canPlayType(in [Optional=DefaultIsUndefined] DOMString type);
#endif
-// ready state
-const unsigned short HAVE_NOTHING = 0;
-const unsigned short HAVE_METADATA = 1;
-const unsigned short HAVE_CURRENT_DATA = 2;
-const unsigned short HAVE_FUTURE_DATA = 3;
-const unsigned short HAVE_ENOUGH_DATA = 4;
-readonly attribute unsigned short readyState;
-readonly attribute boolean seeking;
+ // ready state
+ const unsigned short HAVE_NOTHING = 0;
+ const unsigned short HAVE_METADATA = 1;
+ const unsigned short HAVE_CURRENT_DATA = 2;
+ const unsigned short HAVE_FUTURE_DATA = 3;
+ const unsigned short HAVE_ENOUGH_DATA = 4;
+ readonly attribute unsigned short readyState;
+ readonly attribute boolean seeking;
-// playback state
-attribute float currentTime
- setter raises (DOMException);
-readonly attribute double initialTime;
-readonly attribute float startTime;
-readonly attribute float duration;
-readonly attribute boolean paused;
-attribute float defaultPlaybackRate;
-attribute float playbackRate;
-readonly attribute TimeRanges played;
-readonly attribute TimeRanges seekable;
-readonly attribute boolean ended;
-attribute [Reflect] boolean autoplay;
-attribute [Reflect] boolean loop;
-void play();
-void pause();
+ // playback state
+ attribute float currentTime
+ setter raises (DOMException);
+ readonly attribute double initialTime;
+ readonly attribute float startTime;
+ readonly attribute float duration;
+ readonly attribute boolean paused;
+ attribute float defaultPlaybackRate;
+ attribute float playbackRate;
+ readonly attribute TimeRanges played;
+ readonly attribute TimeRanges seekable;
+ readonly attribute boolean ended;
+ attribute [Reflect] boolean autoplay;
+ attribute [Reflect] boolean loop;
+ void play();
+ void pause();
-// controls
-attribute boolean controls;
-attribute float volume
- setter raises (DOMException);
-attribute boolean muted;
-attribute [Reflect=muted] boolean defaultMuted;
+ // controls
+ attribute boolean controls;
+ attribute float volume
+ setter raises (DOMException);
+ attribute boolean muted;
+ attribute [Reflect=muted] boolean defaultMuted;
-// WebKit extensions
-attribute boolean webkitPreservesPitch;
+ // WebKit extensions
+ attribute boolean webkitPreservesPitch;
-readonly attribute boolean webkitHasClosedCaptions;
-attribute boolean webkitClosedCaptionsVisible;
+ readonly attribute boolean webkitHasClosedCaptions;
+ attribute boolean webkitClosedCaptionsVisible;
-// The number of bytes consumed by the media decoder.
-readonly attribute [Conditional=MEDIA_STATISTICS] unsigned long webkitAudioDecodedByteCount;
-readonly attribute [Conditional=MEDIA_STATISTICS] unsigned long webkitVideoDecodedByteCount;
+ // The number of bytes consumed by the media decoder.
+ readonly attribute [Conditional=MEDIA_STATISTICS] unsigned long webkitAudioDecodedByteCount;
+ readonly attribute [Conditional=MEDIA_STATISTICS] unsigned long webkitVideoDecodedByteCount;
#if defined(ENABLE_ENCRYPTED_MEDIA) && ENABLE_ENCRYPTED_MEDIA
-[V8EnabledAtRuntime=encryptedMedia] void webkitGenerateKeyRequest(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString keySystem, in [Optional] Uint8Array initData)
- raises (DOMException);
-[V8EnabledAtRuntime=encryptedMedia] void webkitAddKey(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString keySystem, in Uint8Array key, in [Optional] Uint8Array initData, in [Optional=DefaultIsNullString] DOMString sessionId)
- raises (DOMException);
-[V8EnabledAtRuntime=encryptedMedia] void webkitCancelKeyRequest(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString keySystem, in [Optional=DefaultIsNullString] DOMString sessionId)
- raises (DOMException);
+ [V8EnabledAtRuntime=encryptedMedia] void webkitGenerateKeyRequest(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString keySystem, in [Optional] Uint8Array initData)
+ raises (DOMException);
+ [V8EnabledAtRuntime=encryptedMedia] void webkitAddKey(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString keySystem, in Uint8Array key, in [Optional] Uint8Array initData, in [Optional=DefaultIsNullString] DOMString sessionId)
+ raises (DOMException);
+ [V8EnabledAtRuntime=encryptedMedia] void webkitCancelKeyRequest(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString keySystem, in [Optional=DefaultIsNullString] DOMString sessionId)
+ raises (DOMException);
-[V8EnabledAtRuntime=encryptedMedia] attribute EventListener onwebkitkeyadded;
-attribute [V8EnabledAtRuntime=encryptedMedia] EventListener onwebkitkeyerror;
-attribute [V8EnabledAtRuntime=encryptedMedia] EventListener onwebkitkeymessage;
-attribute [V8EnabledAtRuntime=encryptedMedia] EventListener onwebkitneedkey;
+ attribute [V8EnabledAtRuntime=encryptedMedia] EventListener onwebkitkeyadded;
+ attribute [V8EnabledAtRuntime=encryptedMedia] EventListener onwebkitkeyerror;
+ attribute [V8EnabledAtRuntime=encryptedMedia] EventListener onwebkitkeymessage;
+ attribute [V8EnabledAtRuntime=encryptedMedia] EventListener onwebkitneedkey;
#endif
#if defined(ENABLE_VIDEO_TRACK) && ENABLE_VIDEO_TRACK
-[V8EnabledAtRuntime=webkitVideoTrack] TextTrack addTextTrack(in DOMString kind, in [Optional] DOMString label, in [Optional] DOMString language)
- raises (DOMException);
-readonly attribute [V8EnabledAtRuntime=webkitVideoTrack] TextTrackList textTracks;
+ [V8EnabledAtRuntime=webkitVideoTrack] TextTrack addTextTrack(in DOMString kind, in [Optional] DOMString label, in [Optional] DOMString language)
+ raises (DOMException);
+ readonly attribute [V8EnabledAtRuntime=webkitVideoTrack] TextTrackList textTracks;
#endif
-[Reflect, TreatNullAs=NullString] attribute DOMString mediaGroup;
-attribute [CustomSetter] MediaController controller;
+ attribute [Reflect, TreatNullAs=NullString] DOMString mediaGroup;
+ attribute [CustomSetter] MediaController controller;
};
+}
diff --git a/Source/WebCore/html/HTMLMenuElement.idl b/Source/WebCore/html/HTMLMenuElement.idl
index ea756fcae..ff14754c0 100644
--- a/Source/WebCore/html/HTMLMenuElement.idl
+++ b/Source/WebCore/html/HTMLMenuElement.idl
@@ -17,7 +17,10 @@
* Boston, MA 02110-1301, USA.
*/
-interface HTMLMenuElement : HTMLElement {
- [Reflect] attribute boolean compact;
-};
+module html {
+ interface HTMLMenuElement : HTMLElement {
+ attribute [Reflect] boolean compact;
+ };
+
+}
diff --git a/Source/WebCore/html/HTMLMetaElement.idl b/Source/WebCore/html/HTMLMetaElement.idl
index 4f7e9cd00..f4ffb2d42 100644
--- a/Source/WebCore/html/HTMLMetaElement.idl
+++ b/Source/WebCore/html/HTMLMetaElement.idl
@@ -17,10 +17,13 @@
* Boston, MA 02110-1301, USA.
*/
-interface HTMLMetaElement : HTMLElement {
- [Reflect] attribute DOMString content;
- [Reflect=http_equiv] attribute DOMString httpEquiv;
- [Reflect] attribute DOMString name;
- [Reflect] attribute DOMString scheme;
-};
+module html {
+ interface HTMLMetaElement : HTMLElement {
+ attribute [Reflect] DOMString content;
+ attribute [Reflect=http_equiv] DOMString httpEquiv;
+ attribute [Reflect] DOMString name;
+ attribute [Reflect] DOMString scheme;
+ };
+
+}
diff --git a/Source/WebCore/html/HTMLMeterElement.idl b/Source/WebCore/html/HTMLMeterElement.idl
index 85d1b5104..8d3e1074c 100644
--- a/Source/WebCore/html/HTMLMeterElement.idl
+++ b/Source/WebCore/html/HTMLMeterElement.idl
@@ -17,20 +17,23 @@
* Boston, MA 02110-1301, USA.
*/
-[
- Conditional=METER_ELEMENT
-] interface HTMLMeterElement : HTMLElement {
- attribute double value
- setter raises(DOMException);
- attribute double min
- setter raises(DOMException);
- attribute double max
- setter raises(DOMException);
- attribute double low
- setter raises(DOMException);
- attribute double high
- setter raises(DOMException);
- attribute double optimum
- setter raises(DOMException);
- readonly attribute NodeList labels;
-};
+module html {
+ interface [
+ Conditional=METER_ELEMENT
+ ] HTMLMeterElement : HTMLElement {
+ attribute double value
+ setter raises(DOMException);
+ attribute double min
+ setter raises(DOMException);
+ attribute double max
+ setter raises(DOMException);
+ attribute double low
+ setter raises(DOMException);
+ attribute double high
+ setter raises(DOMException);
+ attribute double optimum
+ setter raises(DOMException);
+ readonly attribute NodeList labels;
+ };
+}
+
diff --git a/Source/WebCore/html/HTMLModElement.idl b/Source/WebCore/html/HTMLModElement.idl
index ccb8da466..ad8281c45 100644
--- a/Source/WebCore/html/HTMLModElement.idl
+++ b/Source/WebCore/html/HTMLModElement.idl
@@ -17,8 +17,11 @@
* Boston, MA 02110-1301, USA.
*/
-interface HTMLModElement : HTMLElement {
- [Reflect, URL] attribute DOMString cite;
- [Reflect] attribute DOMString dateTime;
-};
+module html {
+ interface HTMLModElement : HTMLElement {
+ attribute [Reflect, URL] DOMString cite;
+ attribute [Reflect] DOMString dateTime;
+ };
+
+}
diff --git a/Source/WebCore/html/HTMLOListElement.idl b/Source/WebCore/html/HTMLOListElement.idl
index 1e5161556..8d1d3a46f 100644
--- a/Source/WebCore/html/HTMLOListElement.idl
+++ b/Source/WebCore/html/HTMLOListElement.idl
@@ -17,10 +17,13 @@
* Boston, MA 02110-1301, USA.
*/
-interface HTMLOListElement : HTMLElement {
- [Reflect] attribute boolean compact;
- attribute long start;
- [Reflect] attribute boolean reversed;
- [Reflect] attribute DOMString type;
-};
+module html {
+ interface HTMLOListElement : HTMLElement {
+ attribute [Reflect] boolean compact;
+ attribute long start;
+ attribute [Reflect] boolean reversed;
+ attribute [Reflect] DOMString type;
+ };
+
+}
diff --git a/Source/WebCore/html/HTMLObjectElement.idl b/Source/WebCore/html/HTMLObjectElement.idl
index c3c9cad7a..f1055fdb8 100644
--- a/Source/WebCore/html/HTMLObjectElement.idl
+++ b/Source/WebCore/html/HTMLObjectElement.idl
@@ -18,46 +18,49 @@
* Boston, MA 02110-1301, USA.
*/
-[
- CustomNamedSetter,
- JSCustomGetOwnPropertySlotAndDescriptor,
- CustomCall
-] interface HTMLObjectElement : HTMLElement {
- readonly attribute HTMLFormElement form;
- [Reflect] attribute DOMString code;
- [Reflect] attribute DOMString align;
- [Reflect] attribute DOMString archive;
- [Reflect] attribute DOMString border;
- [Reflect] attribute DOMString codeBase;
- [Reflect] attribute DOMString codeType;
- [Reflect, URL] attribute DOMString data;
- [Reflect] attribute boolean declare;
- [Reflect] attribute DOMString height;
- [Reflect] attribute long hspace;
- [Reflect] attribute DOMString name;
- [Reflect] attribute DOMString standby;
- [Reflect] attribute DOMString type;
- [Reflect] attribute DOMString useMap;
- [Reflect] attribute long vspace;
- [Reflect] attribute DOMString width;
- readonly attribute boolean willValidate;
- readonly attribute ValidityState validity;
- readonly attribute DOMString validationMessage;
- boolean checkValidity();
- void setCustomValidity(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString error);
+module html {
- // Introduced in DOM Level 2:
- [CheckSecurityForNode] readonly attribute Document contentDocument;
+ interface [
+ CustomNamedSetter,
+ JSCustomGetOwnPropertySlotAndDescriptor,
+ CustomCall
+ ] HTMLObjectElement : HTMLElement {
+ readonly attribute HTMLFormElement form;
+ attribute [Reflect] DOMString code;
+ attribute [Reflect] DOMString align;
+ attribute [Reflect] DOMString archive;
+ attribute [Reflect] DOMString border;
+ attribute [Reflect] DOMString codeBase;
+ attribute [Reflect] DOMString codeType;
+ attribute [Reflect, URL] DOMString data;
+ attribute [Reflect] boolean declare;
+ attribute [Reflect] DOMString height;
+ attribute [Reflect] long hspace;
+ attribute [Reflect] DOMString name;
+ attribute [Reflect] DOMString standby;
+ attribute [Reflect] DOMString type;
+ attribute [Reflect] DOMString useMap;
+ attribute [Reflect] long vspace;
+ attribute [Reflect] DOMString width;
+ readonly attribute boolean willValidate;
+ readonly attribute ValidityState validity;
+ readonly attribute DOMString validationMessage;
+ boolean checkValidity();
+ void setCustomValidity(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString error);
+
+ // Introduced in DOM Level 2:
+ readonly attribute [CheckSecurityForNode] Document contentDocument;
#if defined(ENABLE_SVG) && ENABLE_SVG
#if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C || defined(ENABLE_SVG_DOM_OBJC_BINDINGS) && ENABLE_SVG_DOM_OBJC_BINDINGS
- [CheckSecurityForNode] SVGDocument getSVGDocument() raises(DOMException);
+ [CheckSecurityForNode] SVGDocument getSVGDocument() raises(DOMException);
#endif
#endif
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
- // Objective-C extension:
- readonly attribute URL absoluteImageURL;
+ // Objective-C extension:
+ readonly attribute URL absoluteImageURL;
#endif
-};
+ };
+}
diff --git a/Source/WebCore/html/HTMLOptGroupElement.idl b/Source/WebCore/html/HTMLOptGroupElement.idl
index 26a782fd5..75cead0fb 100644
--- a/Source/WebCore/html/HTMLOptGroupElement.idl
+++ b/Source/WebCore/html/HTMLOptGroupElement.idl
@@ -17,8 +17,11 @@
* Boston, MA 02110-1301, USA.
*/
-interface HTMLOptGroupElement : HTMLElement {
- [Reflect] attribute boolean disabled;
- [Reflect] attribute DOMString label;
-};
+module html {
+ interface HTMLOptGroupElement : HTMLElement {
+ attribute [Reflect] boolean disabled;
+ attribute [Reflect] DOMString label;
+ };
+
+}
diff --git a/Source/WebCore/html/HTMLOptionElement.idl b/Source/WebCore/html/HTMLOptionElement.idl
index d805392a0..b7b3489ea 100644
--- a/Source/WebCore/html/HTMLOptionElement.idl
+++ b/Source/WebCore/html/HTMLOptionElement.idl
@@ -18,22 +18,25 @@
* Boston, MA 02110-1301, USA.
*/
-[
- JSGenerateToNativeObject,
- NamedConstructor=Option(in [Optional=DefaultIsNullString] DOMString data, in [Optional=DefaultIsNullString] DOMString value, in [Optional=DefaultIsUndefined] boolean defaultSelected, in [Optional=DefaultIsUndefined] boolean selected),
- ConstructorRaisesException
-] interface HTMLOptionElement : HTMLElement {
- [Reflect] attribute boolean disabled;
- readonly attribute HTMLFormElement form;
- attribute DOMString label;
- [Reflect=selected] attribute boolean defaultSelected;
- attribute boolean selected;
- attribute DOMString value;
+module html {
+
+ interface [
+ JSGenerateToNativeObject,
+ NamedConstructor=Option(in [Optional=DefaultIsNullString] DOMString data, in [Optional=DefaultIsNullString] DOMString value, in [Optional=DefaultIsUndefined] boolean defaultSelected, in [Optional=DefaultIsUndefined] boolean selected),
+ ConstructorRaisesException
+ ] HTMLOptionElement : HTMLElement {
+ attribute [Reflect] boolean disabled;
+ readonly attribute HTMLFormElement form;
+ attribute DOMString label;
+ attribute [Reflect=selected] boolean defaultSelected;
+ attribute boolean selected;
+ attribute DOMString value;
#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
- attribute DOMString text setter raises(DOMException);
+ attribute DOMString text setter raises(DOMException);
#else
- readonly attribute DOMString text;
+ readonly attribute DOMString text;
#endif
- readonly attribute long index;
-};
+ readonly attribute long index;
+ };
+}
diff --git a/Source/WebCore/html/HTMLOptionsCollection.idl b/Source/WebCore/html/HTMLOptionsCollection.idl
index b1dc9f1dd..0476e65fc 100644
--- a/Source/WebCore/html/HTMLOptionsCollection.idl
+++ b/Source/WebCore/html/HTMLOptionsCollection.idl
@@ -18,22 +18,25 @@
* Boston, MA 02110-1301, USA.
*/
-[
- JSGenerateToNativeObject,
- CustomIndexedSetter
-] interface HTMLOptionsCollection : HTMLCollection {
- attribute long selectedIndex;
- [Custom] attribute unsigned long length
- setter raises (DOMException);
+module html {
- [Custom] void add(in [Optional=DefaultIsUndefined] HTMLOptionElement option,
- in [Optional] unsigned long index)
- raises (DOMException);
- [Custom] void remove(in [Optional=DefaultIsUndefined] unsigned long index);
+ interface [
+ JSGenerateToNativeObject,
+ CustomIndexedSetter
+ ] HTMLOptionsCollection : HTMLCollection {
+ attribute long selectedIndex;
+ attribute [Custom] unsigned long length
+ setter raises (DOMException);
+
+ [Custom] void add(in [Optional=DefaultIsUndefined] HTMLOptionElement option,
+ in [Optional] unsigned long index)
+ raises (DOMException);
+ [Custom] void remove(in [Optional=DefaultIsUndefined] unsigned long index);
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
- Node item(in unsigned long index);
- Node namedItem(in DOMString name);
+ Node item(in unsigned long index);
+ Node namedItem(in DOMString name);
#endif
-};
+ };
+}
diff --git a/Source/WebCore/html/HTMLOutputElement.idl b/Source/WebCore/html/HTMLOutputElement.idl
index ea8312abc..35761c335 100644
--- a/Source/WebCore/html/HTMLOutputElement.idl
+++ b/Source/WebCore/html/HTMLOutputElement.idl
@@ -22,20 +22,22 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-interface HTMLOutputElement : HTMLElement {
- [Custom] attribute DOMSettableTokenList htmlFor;
- readonly attribute HTMLFormElement form;
- [Reflect] attribute DOMString name;
+module html {
+ interface HTMLOutputElement : HTMLElement {
+ attribute [Custom] DOMSettableTokenList htmlFor;
+ readonly attribute HTMLFormElement form;
+ attribute [Reflect] DOMString name;
- readonly attribute DOMString type;
- [TreatNullAs=NullString] attribute DOMString defaultValue;
- [TreatNullAs=NullString] attribute DOMString value;
+ readonly attribute DOMString type;
+ attribute [TreatNullAs=NullString] DOMString defaultValue;
+ attribute [TreatNullAs=NullString] DOMString value;
- readonly attribute boolean willValidate;
- readonly attribute ValidityState validity;
- readonly attribute DOMString validationMessage;
- boolean checkValidity();
- void setCustomValidity(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString error);
+ readonly attribute boolean willValidate;
+ readonly attribute ValidityState validity;
+ readonly attribute DOMString validationMessage;
+ boolean checkValidity();
+ void setCustomValidity(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString error);
- readonly attribute NodeList labels;
-};
+ readonly attribute NodeList labels;
+ };
+}
diff --git a/Source/WebCore/html/HTMLParagraphElement.idl b/Source/WebCore/html/HTMLParagraphElement.idl
index e6bd9e8bd..246e9e99e 100644
--- a/Source/WebCore/html/HTMLParagraphElement.idl
+++ b/Source/WebCore/html/HTMLParagraphElement.idl
@@ -17,7 +17,10 @@
* Boston, MA 02110-1301, USA.
*/
-interface HTMLParagraphElement : HTMLElement {
- [Reflect] attribute DOMString align;
-};
+module html {
+ interface HTMLParagraphElement : HTMLElement {
+ attribute [Reflect] DOMString align;
+ };
+
+}
diff --git a/Source/WebCore/html/HTMLParamElement.idl b/Source/WebCore/html/HTMLParamElement.idl
index fea259445..1f0c0ded6 100644
--- a/Source/WebCore/html/HTMLParamElement.idl
+++ b/Source/WebCore/html/HTMLParamElement.idl
@@ -17,10 +17,13 @@
* Boston, MA 02110-1301, USA.
*/
-interface HTMLParamElement : HTMLElement {
- [Reflect] attribute DOMString name;
- [Reflect] attribute DOMString type;
- [Reflect] attribute DOMString value;
- [Reflect] attribute DOMString valueType;
-};
+module html {
+ interface HTMLParamElement : HTMLElement {
+ attribute [Reflect] DOMString name;
+ attribute [Reflect] DOMString type;
+ attribute [Reflect] DOMString value;
+ attribute [Reflect] DOMString valueType;
+ };
+
+}
diff --git a/Source/WebCore/html/HTMLPlugInElement.cpp b/Source/WebCore/html/HTMLPlugInElement.cpp
index 9947a736e..1b5843483 100644
--- a/Source/WebCore/html/HTMLPlugInElement.cpp
+++ b/Source/WebCore/html/HTMLPlugInElement.cpp
@@ -35,7 +35,6 @@
#include "Page.h"
#include "PluginViewBase.h"
#include "RenderEmbeddedObject.h"
-#include "RenderSnapshottedPlugIn.h"
#include "RenderWidget.h"
#include "Settings.h"
#include "Widget.h"
@@ -56,7 +55,6 @@ HTMLPlugInElement::HTMLPlugInElement(const QualifiedName& tagName, Document* doc
, m_NPObject(0)
#endif
, m_isCapturingMouseEvents(false)
- , m_displayState(Playing)
{
}
@@ -178,15 +176,9 @@ void HTMLPlugInElement::defaultEventHandler(Event* event)
// FIXME: Mouse down and scroll events are passed down to plug-in via custom code in EventHandler; these code paths should be united.
RenderObject* r = renderer();
- if (r && r->isEmbeddedObject()) {
- if (toRenderEmbeddedObject(r)->showsUnavailablePluginIndicator()) {
- toRenderEmbeddedObject(r)->handleUnavailablePluginIndicatorEvent(event);
- return;
- }
- if (r->isSnapshottedPlugIn() && displayState() < Playing) {
- toRenderSnapshottedPlugIn(r)->handleEvent(event);
- return;
- }
+ if (r && r->isEmbeddedObject() && toRenderEmbeddedObject(r)->showsUnavailablePluginIndicator()) {
+ toRenderEmbeddedObject(r)->handleUnavailablePluginIndicatorEvent(event);
+ return;
}
if (!r || !r->isWidget())
diff --git a/Source/WebCore/html/HTMLPlugInElement.h b/Source/WebCore/html/HTMLPlugInElement.h
index d7bcb166e..eeec60cb5 100644
--- a/Source/WebCore/html/HTMLPlugInElement.h
+++ b/Source/WebCore/html/HTMLPlugInElement.h
@@ -1,7 +1,7 @@
/*
* Copyright (C) 1999 Lars Knoll (knoll@kde.org)
* (C) 1999 Antti Koivisto (koivisto@kde.org)
- * Copyright (C) 2004, 2006, 2007, 2008, 2009, 2012 Apple Inc. All rights reserved.
+ * Copyright (C) 2004, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -24,7 +24,6 @@
#define HTMLPlugInElement_h
#include "HTMLFrameOwnerElement.h"
-#include "Image.h"
#include "ImageLoaderClient.h"
#include "ScriptInstance.h"
@@ -38,7 +37,7 @@ class RenderEmbeddedObject;
class RenderWidget;
class Widget;
-class HTMLPlugInElement : public HTMLFrameOwnerElement {
+class HTMLPlugInElement : public HTMLFrameOwnerElement, public ImageLoaderClientBase<HTMLPlugInElement> {
public:
virtual ~HTMLPlugInElement();
@@ -48,15 +47,6 @@ public:
Widget* pluginWidget() const;
- enum DisplayState {
- WaitingForSnapshot,
- DisplayingSnapshot,
- Playing
- };
- DisplayState displayState() const { return m_displayState; }
- void setDisplayState(DisplayState state) { m_displayState = state; }
- virtual void updateSnapshot(PassRefPtr<Image>) { }
-
#if ENABLE(NETSCAPE_PLUGIN_API)
NPObject* getNPObject();
#endif
@@ -94,8 +84,6 @@ private:
NPObject* m_NPObject;
#endif
bool m_isCapturingMouseEvents;
-
- DisplayState m_displayState;
};
} // namespace WebCore
diff --git a/Source/WebCore/html/HTMLPlugInImageElement.cpp b/Source/WebCore/html/HTMLPlugInImageElement.cpp
index 7e7c27513..4954e36d5 100644
--- a/Source/WebCore/html/HTMLPlugInImageElement.cpp
+++ b/Source/WebCore/html/HTMLPlugInImageElement.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008, 2011, 2012 Apple Inc. All rights reserved.
+ * Copyright (C) 2008, 2011 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -31,9 +31,7 @@
#include "Page.h"
#include "RenderEmbeddedObject.h"
#include "RenderImage.h"
-#include "RenderSnapshottedPlugIn.h"
#include "SecurityOrigin.h"
-#include "Settings.h"
#include "StyleResolver.h"
namespace WebCore {
@@ -49,9 +47,6 @@ HTMLPlugInImageElement::HTMLPlugInImageElement(const QualifiedName& tagName, Doc
, m_needsDocumentActivationCallbacks(false)
{
setHasCustomCallbacks();
-
- if (document->page() && document->page()->settings()->plugInSnapshottingEnabled())
- setDisplayState(WaitingForSnapshot);
}
HTMLPlugInImageElement::~HTMLPlugInImageElement()
@@ -88,7 +83,7 @@ bool HTMLPlugInImageElement::allowedToLoadFrameURL(const String& url)
{
ASSERT(document());
ASSERT(document()->frame());
- if (document()->frame()->page()->subframeCount() >= Page::maxNumberOfFrames)
+ if (document()->frame()->page()->frameCount() >= Page::maxNumberOfFrames)
return false;
KURL completeURL = document()->completeURL(url);
@@ -146,9 +141,6 @@ RenderObject* HTMLPlugInImageElement::createRenderer(RenderArena* arena, RenderS
image->setImageResource(RenderImageResource::create());
return image;
}
-
- if (document()->page() && document()->page()->settings()->plugInSnapshottingEnabled())
- return new (arena) RenderSnapshottedPlugIn(this);
return new (arena) RenderEmbeddedObject(this);
}
@@ -261,13 +253,4 @@ void HTMLPlugInImageElement::updateWidgetCallback(Node* n, unsigned)
static_cast<HTMLPlugInImageElement*>(n)->updateWidgetIfNecessary();
}
-void HTMLPlugInImageElement::updateSnapshot(PassRefPtr<Image> image)
-{
- if (displayState() > WaitingForSnapshot || !renderer()->isSnapshottedPlugIn())
- return;
-
- toRenderSnapshottedPlugIn(renderer())->updateSnapshot(image);
- setDisplayState(DisplayingSnapshot);
-}
-
} // namespace WebCore
diff --git a/Source/WebCore/html/HTMLPlugInImageElement.h b/Source/WebCore/html/HTMLPlugInImageElement.h
index 95fbd8a79..168ed4634 100644
--- a/Source/WebCore/html/HTMLPlugInImageElement.h
+++ b/Source/WebCore/html/HTMLPlugInImageElement.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008, 2009, 2011, 2012 Apple Inc. All rights reserved.
+ * Copyright (C) 2008, 2009, 2011 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -42,7 +42,7 @@ enum PreferPlugInsForImagesOption {
};
// Base class for HTMLObjectElement and HTMLEmbedElement
-class HTMLPlugInImageElement : public HTMLPlugInElement, public ImageLoaderClientBase<HTMLPlugInImageElement> {
+class HTMLPlugInImageElement : public HTMLPlugInElement {
public:
virtual ~HTMLPlugInImageElement();
@@ -90,8 +90,6 @@ private:
void updateWidgetIfNecessary();
virtual bool useFallbackContent() const { return false; }
- virtual void updateSnapshot(PassRefPtr<Image>) OVERRIDE;
-
bool m_needsWidgetUpdate;
bool m_shouldPreferPlugInsForImages;
bool m_needsDocumentActivationCallbacks;
diff --git a/Source/WebCore/html/HTMLPreElement.idl b/Source/WebCore/html/HTMLPreElement.idl
index 807248c0c..ae137f024 100644
--- a/Source/WebCore/html/HTMLPreElement.idl
+++ b/Source/WebCore/html/HTMLPreElement.idl
@@ -18,12 +18,15 @@
* Boston, MA 02110-1301, USA.
*/
-interface HTMLPreElement : HTMLElement {
- // FIXME: DOM spec says that width should be of type DOMString
- // see http://bugs.webkit.org/show_bug.cgi?id=8992
- [Reflect] attribute long width;
-
- // Extensions
- [Reflect] attribute boolean wrap;
-};
+module html {
+ interface HTMLPreElement : HTMLElement {
+ // FIXME: DOM spec says that width should be of type DOMString
+ // see http://bugs.webkit.org/show_bug.cgi?id=8992
+ attribute [Reflect] long width;
+
+ // Extensions
+ attribute [Reflect] boolean wrap;
+ };
+
+}
diff --git a/Source/WebCore/html/HTMLProgressElement.idl b/Source/WebCore/html/HTMLProgressElement.idl
index 23a94fadc..6ad1ab53e 100644
--- a/Source/WebCore/html/HTMLProgressElement.idl
+++ b/Source/WebCore/html/HTMLProgressElement.idl
@@ -17,14 +17,16 @@
* Boston, MA 02110-1301, USA.
*/
-[
- Conditional=PROGRESS_ELEMENT
-] interface HTMLProgressElement : HTMLElement {
- attribute double value
- setter raises(DOMException);
- attribute double max
- setter raises(DOMException);
- readonly attribute double position;
- readonly attribute NodeList labels;
-};
+module html {
+ interface [
+ Conditional=PROGRESS_ELEMENT
+ ] HTMLProgressElement : HTMLElement {
+ attribute double value
+ setter raises(DOMException);
+ attribute double max
+ setter raises(DOMException);
+ readonly attribute double position;
+ readonly attribute NodeList labels;
+ };
+}
diff --git a/Source/WebCore/html/HTMLPropertiesCollection.idl b/Source/WebCore/html/HTMLPropertiesCollection.idl
index 05acae119..760f53acf 100644
--- a/Source/WebCore/html/HTMLPropertiesCollection.idl
+++ b/Source/WebCore/html/HTMLPropertiesCollection.idl
@@ -28,15 +28,18 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- Conditional=MICRODATA,
- JSGenerateToJSObject,
- IndexedGetter,
- NamedGetter
-] interface HTMLPropertiesCollection : HTMLCollection {
- readonly attribute unsigned long length;
- Node item(in unsigned long index);
+module html {
- readonly attribute DOMStringList names;
- PropertyNodeList namedItem(in DOMString name);
-};
+ interface [
+ Conditional=MICRODATA,
+ JSGenerateToJSObject,
+ IndexedGetter,
+ NamedGetter
+ ] HTMLPropertiesCollection : HTMLCollection {
+ readonly attribute unsigned long length;
+ Node item(in unsigned long index);
+
+ readonly attribute DOMStringList names;
+ PropertyNodeList namedItem(in DOMString name);
+ };
+}
diff --git a/Source/WebCore/html/HTMLQuoteElement.idl b/Source/WebCore/html/HTMLQuoteElement.idl
index c53a1a2f1..fa1bcdb57 100644
--- a/Source/WebCore/html/HTMLQuoteElement.idl
+++ b/Source/WebCore/html/HTMLQuoteElement.idl
@@ -17,6 +17,9 @@
* Boston, MA 02110-1301, USA.
*/
-interface HTMLQuoteElement : HTMLElement {
- [Reflect, URL] attribute DOMString cite;
-};
+module html {
+
+ interface HTMLQuoteElement : HTMLElement {
+ attribute [Reflect, URL] DOMString cite;
+ };
+}
diff --git a/Source/WebCore/html/HTMLScriptElement.idl b/Source/WebCore/html/HTMLScriptElement.idl
index 1365d12bf..ba16e851c 100644
--- a/Source/WebCore/html/HTMLScriptElement.idl
+++ b/Source/WebCore/html/HTMLScriptElement.idl
@@ -17,15 +17,18 @@
* Boston, MA 02110-1301, USA.
*/
-interface HTMLScriptElement : HTMLElement {
- [TreatNullAs=NullString] attribute DOMString text;
- [Reflect=for] attribute DOMString htmlFor;
- [Reflect] attribute DOMString event;
- [Reflect] attribute DOMString charset;
- attribute boolean async;
- [Reflect] attribute boolean defer;
- [Reflect, URL] attribute DOMString src;
- [Reflect] attribute DOMString type;
- [Reflect] attribute DOMString crossOrigin;
- [Reflect, Conditional=CSP_NEXT] attribute DOMString nonce;
-};
+module html {
+
+ interface HTMLScriptElement : HTMLElement {
+ attribute [TreatNullAs=NullString] DOMString text;
+ attribute [Reflect=for] DOMString htmlFor;
+ attribute [Reflect] DOMString event;
+ attribute [Reflect] DOMString charset;
+ attribute boolean async;
+ attribute [Reflect] boolean defer;
+ attribute [Reflect, URL] DOMString src;
+ attribute [Reflect] DOMString type;
+ attribute [Reflect] DOMString crossOrigin;
+ attribute [Reflect, Conditional=CSP_NEXT] DOMString nonce;
+ };
+}
diff --git a/Source/WebCore/html/HTMLSelectElement.cpp b/Source/WebCore/html/HTMLSelectElement.cpp
index 04e624feb..914b55de8 100644
--- a/Source/WebCore/html/HTMLSelectElement.cpp
+++ b/Source/WebCore/html/HTMLSelectElement.cpp
@@ -1289,7 +1289,7 @@ void HTMLSelectElement::listBoxDefaultEventHandler(Event* event)
// Convert to coords relative to the list box if needed.
MouseEvent* mouseEvent = static_cast<MouseEvent*>(event);
- IntPoint localOffset = roundedIntPoint(renderer()->absoluteToLocal(mouseEvent->absoluteLocation(), UseTransforms | SnapOffsetForTransforms));
+ IntPoint localOffset = roundedIntPoint(renderer()->absoluteToLocal(mouseEvent->absoluteLocation(), false, true));
int listIndex = toRenderListBox(renderer())->listIndexAtOffset(toSize(localOffset));
if (listIndex >= 0) {
if (!disabled()) {
@@ -1309,7 +1309,7 @@ void HTMLSelectElement::listBoxDefaultEventHandler(Event* event)
if (mouseEvent->button() != LeftButton || !mouseEvent->buttonDown())
return;
- IntPoint localOffset = roundedIntPoint(renderer()->absoluteToLocal(mouseEvent->absoluteLocation(), UseTransforms | SnapOffsetForTransforms));
+ IntPoint localOffset = roundedIntPoint(renderer()->absoluteToLocal(mouseEvent->absoluteLocation(), false, true));
int listIndex = toRenderListBox(renderer())->listIndexAtOffset(toSize(localOffset));
if (listIndex >= 0) {
if (!disabled()) {
@@ -1514,10 +1514,8 @@ void HTMLSelectElement::typeAheadFind(KeyboardEvent* event)
return;
int selected = selectedIndex();
- int index = optionToListIndex(selected >= 0 ? selected : 0) + searchStartOffset;
- if (index < 0)
- return;
- index %= itemCount;
+ int index = (optionToListIndex(selected >= 0 ? selected : 0) + searchStartOffset) % itemCount;
+ ASSERT(index >= 0);
// Compute a case-folded copy of the prefix string before beginning the search for
// a matching element. This code uses foldCase to work around the fact that
diff --git a/Source/WebCore/html/HTMLSelectElement.idl b/Source/WebCore/html/HTMLSelectElement.idl
index ac7f98904..6a1ae03d1 100644
--- a/Source/WebCore/html/HTMLSelectElement.idl
+++ b/Source/WebCore/html/HTMLSelectElement.idl
@@ -18,48 +18,51 @@
* Boston, MA 02110-1301, USA.
*/
-[
- IndexedGetter,
- CustomIndexedSetter
-] interface HTMLSelectElement : HTMLElement {
- attribute [Reflect] boolean autofocus;
- attribute [Reflect] boolean disabled;
- readonly attribute HTMLFormElement form;
- attribute boolean multiple;
- attribute [Reflect] DOMString name;
- attribute [Reflect] boolean required;
- attribute long size;
+module html {
- readonly attribute DOMString type;
+ interface [
+ IndexedGetter,
+ CustomIndexedSetter
+ ] HTMLSelectElement : HTMLElement {
+ attribute [Reflect] boolean autofocus;
+ attribute [Reflect] boolean disabled;
+ readonly attribute HTMLFormElement form;
+ attribute boolean multiple;
+ attribute [Reflect] DOMString name;
+ attribute [Reflect] boolean required;
+ attribute long size;
- readonly attribute HTMLOptionsCollection options;
+ readonly attribute DOMString type;
+
+ readonly attribute HTMLOptionsCollection options;
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
- // DOM Level 2 changes type of length attribute to unsigned long,
- // for compatibility we keep DOM Level 1 definition.
- readonly attribute long length;
+ // DOM Level 2 changes type of length attribute to unsigned long,
+ // for compatibility we keep DOM Level 1 definition.
+ readonly attribute long length;
#else
- attribute unsigned long length setter raises (DOMException);
+ attribute unsigned long length setter raises (DOMException);
#endif
- Node item(in [IsIndex,Optional=DefaultIsUndefined] unsigned long index);
- Node namedItem(in [Optional=DefaultIsUndefined] DOMString name);
- [ObjCLegacyUnnamedParameters] void add(in [Optional=DefaultIsUndefined] HTMLElement element,
- in [Optional=DefaultIsUndefined] HTMLElement before) raises(DOMException);
+ Node item(in [IsIndex,Optional=DefaultIsUndefined] unsigned long index);
+ Node namedItem(in [Optional=DefaultIsUndefined] DOMString name);
+ [ObjCLegacyUnnamedParameters] void add(in [Optional=DefaultIsUndefined] HTMLElement element,
+ in [Optional=DefaultIsUndefined] HTMLElement before) raises(DOMException);
#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
- // In JavaScript, we support both option index and option object parameters.
- // As of this writing this cannot be auto-generated.
- [Custom] void remove(/* indexOrOption */);
+ // In JavaScript, we support both option index and option object parameters.
+ // As of this writing this cannot be auto-generated.
+ [Custom] void remove(/* indexOrOption */);
#else
- void remove(in long index);
+ void remove(in long index);
#endif
- readonly attribute HTMLCollection selectedOptions;
- attribute long selectedIndex;
- [TreatNullAs=NullString] attribute DOMString value;
+ readonly attribute HTMLCollection selectedOptions;
+ attribute long selectedIndex;
+ attribute [TreatNullAs=NullString] DOMString value;
- readonly attribute boolean willValidate;
- readonly attribute ValidityState validity;
- readonly attribute DOMString validationMessage;
- boolean checkValidity();
- void setCustomValidity(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString error);
+ readonly attribute boolean willValidate;
+ readonly attribute ValidityState validity;
+ readonly attribute DOMString validationMessage;
+ boolean checkValidity();
+ void setCustomValidity(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString error);
- readonly attribute NodeList labels;
-};
+ readonly attribute NodeList labels;
+ };
+}
diff --git a/Source/WebCore/html/HTMLSourceElement.idl b/Source/WebCore/html/HTMLSourceElement.idl
index d7880e45d..dc707140a 100644
--- a/Source/WebCore/html/HTMLSourceElement.idl
+++ b/Source/WebCore/html/HTMLSourceElement.idl
@@ -23,10 +23,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- Conditional=VIDEO,
-] interface HTMLSourceElement : HTMLElement {
-attribute [Reflect, URL] DOMString src;
-attribute DOMString type;
-attribute DOMString media;
+module html {
+ interface [
+ Conditional=VIDEO,
+ ] HTMLSourceElement : HTMLElement {
+ attribute [Reflect, URL] DOMString src;
+ attribute DOMString type;
+ attribute DOMString media;
};
+}
diff --git a/Source/WebCore/html/HTMLSpanElement.idl b/Source/WebCore/html/HTMLSpanElement.idl
index e47cfd797..d6d4e59eb 100644
--- a/Source/WebCore/html/HTMLSpanElement.idl
+++ b/Source/WebCore/html/HTMLSpanElement.idl
@@ -23,7 +23,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.whatwg.org/specs/web-apps/current-work/#htmlspanelement
-interface HTMLSpanElement : HTMLElement {
-};
+module html {
+ // http://www.whatwg.org/specs/web-apps/current-work/#htmlspanelement
+ interface HTMLSpanElement : HTMLElement {
+ };
+
+}
diff --git a/Source/WebCore/html/HTMLStyleElement.cpp b/Source/WebCore/html/HTMLStyleElement.cpp
index 228c392df..9bfc91a43 100644
--- a/Source/WebCore/html/HTMLStyleElement.cpp
+++ b/Source/WebCore/html/HTMLStyleElement.cpp
@@ -30,7 +30,6 @@
#include "Event.h"
#include "EventSender.h"
#include "HTMLNames.h"
-#include "MediaList.h"
#include "ScriptEventListener.h"
#include "ScriptableDocumentParser.h"
#include "ShadowRoot.h"
@@ -51,7 +50,9 @@ inline HTMLStyleElement::HTMLStyleElement(const QualifiedName& tagName, Document
, StyleElement(document, createdByParser)
, m_firedLoad(false)
, m_loadedSheet(false)
+#if ENABLE(STYLE_SCOPED)
, m_scopedStyleRegistrationState(NotRegistered)
+#endif
{
ASSERT(hasTagName(styleTag));
}
@@ -78,19 +79,17 @@ void HTMLStyleElement::parseAttribute(const Attribute& attribute)
setAttributeEventListener(eventNames().loadEvent, createAttributeEventListener(this, attribute));
else if (attribute.name() == onerrorAttr)
setAttributeEventListener(eventNames().errorEvent, createAttributeEventListener(this, attribute));
- else if (attribute.name() == scopedAttr && ContextFeatures::styleScopedEnabled(document()))
+#if ENABLE(STYLE_SCOPED)
+ else if (attribute.name() == scopedAttr)
scopedAttributeChanged(!attribute.isNull());
- else if (attribute.name() == mediaAttr && inDocument() && document()->renderer() && m_sheet) {
- m_sheet->setMediaQueries(MediaQuerySet::createAllowingDescriptionSyntax(attribute.value()));
- document()->styleResolverChanged(RecalcStyleImmediately);
- } else
+#endif
+ else
HTMLElement::parseAttribute(attribute);
}
+#if ENABLE(STYLE_SCOPED)
void HTMLStyleElement::scopedAttributeChanged(bool scoped)
{
- ASSERT(ContextFeatures::styleScopedEnabled(document()));
-
if (!inDocument())
return;
@@ -115,6 +114,7 @@ void HTMLStyleElement::scopedAttributeChanged(bool scoped)
if (isInShadowTree() && m_scopedStyleRegistrationState != RegisteredInShadowRoot)
registerWithScopingNode(false);
}
+#endif
void HTMLStyleElement::finishParsingChildren()
{
@@ -122,12 +122,15 @@ void HTMLStyleElement::finishParsingChildren()
HTMLElement::finishParsingChildren();
}
+#if ENABLE(STYLE_SCOPED)
inline bool HTMLStyleElement::isRegisteredAsScoped() const
{
// Note: We cannot rely on the 'scoped' attribute still being present when this method is invoked.
// Therefore we cannot rely on scoped()!
if (m_scopedStyleRegistrationState == NotRegistered)
return false;
+ if (!ContextFeatures::styleScopedEnabled(document()))
+ return false;
return true;
}
@@ -164,6 +167,8 @@ void HTMLStyleElement::registerWithScopingNode(bool scoped)
ASSERT(inDocument());
if (m_scopedStyleRegistrationState != NotRegistered)
return;
+ if (!ContextFeatures::styleScopedEnabled(document()))
+ return;
ContainerNode* scope = scoped ? parentNode() : shadowRoot();
if (!scope)
@@ -200,14 +205,22 @@ void HTMLStyleElement::unregisterWithScopingNode(ContainerNode* scope)
m_scopedStyleRegistrationState = NotRegistered;
}
+#else
+size_t Node::numberOfScopedHTMLStyleChildren() const
+{
+ return 0;
+}
+#endif
Node::InsertionNotificationRequest HTMLStyleElement::insertedInto(ContainerNode* insertionPoint)
{
HTMLElement::insertedInto(insertionPoint);
if (insertionPoint->inDocument()) {
StyleElement::insertedIntoDocument(document(), this);
+#if ENABLE(STYLE_SCOPED)
if (m_scopedStyleRegistrationState == NotRegistered && (scoped() || isInShadowTree()))
registerWithScopingNode(scoped());
+#endif
}
return InsertionDone;
@@ -217,6 +230,7 @@ void HTMLStyleElement::removedFrom(ContainerNode* insertionPoint)
{
HTMLElement::removedFrom(insertionPoint);
+#if ENABLE(STYLE_SCOPED)
// In the current implementation, <style scoped> is only registered if the node is in the document.
// That is, because willRemove() is also called if an ancestor is removed from the document.
// Now, if we want to register <style scoped> even if it's not inDocument,
@@ -231,6 +245,7 @@ void HTMLStyleElement::removedFrom(ContainerNode* insertionPoint)
scope = parentNode() ? parentNode() : insertionPoint;
unregisterWithScopingNode(scope);
}
+#endif
if (insertionPoint->inDocument())
StyleElement::removedFromDocument(document(), this);
@@ -252,9 +267,10 @@ const AtomicString& HTMLStyleElement::type() const
return getAttribute(typeAttr);
}
+#if ENABLE(STYLE_SCOPED)
bool HTMLStyleElement::scoped() const
{
- return fastHasAttribute(scopedAttr) && ContextFeatures::styleScopedEnabled(document());
+ return fastHasAttribute(scopedAttr);
}
void HTMLStyleElement::setScoped(bool scopedValue)
@@ -276,6 +292,7 @@ Element* HTMLStyleElement::scopingElement() const
return toElement(parentOrHost);
}
+#endif // ENABLE(STYLE_SCOPED)
void HTMLStyleElement::dispatchPendingLoadEvents()
{
diff --git a/Source/WebCore/html/HTMLStyleElement.h b/Source/WebCore/html/HTMLStyleElement.h
index 76b28d4cf..8476c648f 100644
--- a/Source/WebCore/html/HTMLStyleElement.h
+++ b/Source/WebCore/html/HTMLStyleElement.h
@@ -41,10 +41,12 @@ public:
void setType(const AtomicString&);
+#if ENABLE(STYLE_SCOPED)
bool scoped() const;
void setScoped(bool);
Element* scopingElement() const;
bool isRegisteredAsScoped() const;
+#endif
using StyleElement::sheet;
@@ -75,19 +77,23 @@ private:
virtual const AtomicString& media() const;
virtual const AtomicString& type() const;
+#if ENABLE(STYLE_SCOPED)
void scopedAttributeChanged(bool);
void registerWithScopingNode(bool);
void unregisterWithScopingNode(ContainerNode*);
+#endif
bool m_firedLoad;
bool m_loadedSheet;
+#if ENABLE(STYLE_SCOPED)
enum ScopedStyleRegistrationState {
NotRegistered,
RegisteredAsScoped,
RegisteredInShadowRoot
};
ScopedStyleRegistrationState m_scopedStyleRegistrationState;
+#endif
};
} //namespace
diff --git a/Source/WebCore/html/HTMLStyleElement.idl b/Source/WebCore/html/HTMLStyleElement.idl
index a14165d4e..1b9abd47a 100644
--- a/Source/WebCore/html/HTMLStyleElement.idl
+++ b/Source/WebCore/html/HTMLStyleElement.idl
@@ -18,13 +18,16 @@
* Boston, MA 02110-1301, USA.
*/
-interface HTMLStyleElement : HTMLElement {
- attribute boolean disabled;
- [Conditional=STYLE_SCOPED, V8EnabledAtRuntime=styleScoped] attribute boolean scoped;
- [Reflect] attribute DOMString media;
- [Reflect] attribute DOMString type;
+module html {
- // DOM Level 2 Style
- readonly attribute StyleSheet sheet;
-};
+ interface HTMLStyleElement : HTMLElement {
+ attribute boolean disabled;
+ attribute [Conditional=STYLE_SCOPED, V8EnabledAtRuntime=styleScoped] boolean scoped;
+ attribute [Reflect] DOMString media;
+ attribute [Reflect] DOMString type;
+ // DOM Level 2 Style
+ readonly attribute StyleSheet sheet;
+ };
+
+}
diff --git a/Source/WebCore/html/HTMLTableCaptionElement.idl b/Source/WebCore/html/HTMLTableCaptionElement.idl
index d9b3aa548..075953978 100644
--- a/Source/WebCore/html/HTMLTableCaptionElement.idl
+++ b/Source/WebCore/html/HTMLTableCaptionElement.idl
@@ -18,9 +18,12 @@
* Boston, MA 02110-1301, USA.
*/
-[
- JSGenerateToNativeObject
-] interface HTMLTableCaptionElement : HTMLElement {
- [Reflect] attribute DOMString align;
-};
+module html {
+ interface [
+ JSGenerateToNativeObject
+ ] HTMLTableCaptionElement : HTMLElement {
+ attribute [Reflect] DOMString align;
+ };
+
+}
diff --git a/Source/WebCore/html/HTMLTableCellElement.idl b/Source/WebCore/html/HTMLTableCellElement.idl
index 3b949f390..ae286f4d6 100644
--- a/Source/WebCore/html/HTMLTableCellElement.idl
+++ b/Source/WebCore/html/HTMLTableCellElement.idl
@@ -18,21 +18,24 @@
* Boston, MA 02110-1301, USA.
*/
-interface HTMLTableCellElement : HTMLElement {
- readonly attribute long cellIndex;
- [Reflect] attribute DOMString abbr;
- [Reflect] attribute DOMString align;
- [Reflect] attribute DOMString axis;
- [Reflect] attribute DOMString bgColor;
- [Reflect=char] attribute DOMString ch;
- [Reflect=charoff] attribute DOMString chOff;
- attribute long colSpan;
- [Reflect] attribute DOMString headers;
- [Reflect] attribute DOMString height;
- [Reflect] attribute boolean noWrap;
- attribute long rowSpan;
- [Reflect] attribute DOMString scope;
- [Reflect] attribute DOMString vAlign;
- [Reflect] attribute DOMString width;
-};
+module html {
+ interface HTMLTableCellElement : HTMLElement {
+ readonly attribute long cellIndex;
+ attribute [Reflect] DOMString abbr;
+ attribute [Reflect] DOMString align;
+ attribute [Reflect] DOMString axis;
+ attribute [Reflect] DOMString bgColor;
+ attribute [Reflect=char] DOMString ch;
+ attribute [Reflect=charoff] DOMString chOff;
+ attribute long colSpan;
+ attribute [Reflect] DOMString headers;
+ attribute [Reflect] DOMString height;
+ attribute [Reflect] boolean noWrap;
+ attribute long rowSpan;
+ attribute [Reflect] DOMString scope;
+ attribute [Reflect] DOMString vAlign;
+ attribute [Reflect] DOMString width;
+ };
+
+}
diff --git a/Source/WebCore/html/HTMLTableColElement.idl b/Source/WebCore/html/HTMLTableColElement.idl
index 725e05dec..a6e665401 100644
--- a/Source/WebCore/html/HTMLTableColElement.idl
+++ b/Source/WebCore/html/HTMLTableColElement.idl
@@ -18,12 +18,15 @@
* Boston, MA 02110-1301, USA.
*/
-interface HTMLTableColElement : HTMLElement {
- [Reflect] attribute DOMString align;
- [Reflect=char] attribute DOMString ch;
- [Reflect=charoff] attribute DOMString chOff;
- attribute long span;
- [Reflect] attribute DOMString vAlign;
- [Reflect] attribute DOMString width;
-};
+module html {
+ interface HTMLTableColElement : HTMLElement {
+ attribute [Reflect] DOMString align;
+ attribute [Reflect=char] DOMString ch;
+ attribute [Reflect=charoff] DOMString chOff;
+ attribute long span;
+ attribute [Reflect] DOMString vAlign;
+ attribute [Reflect] DOMString width;
+ };
+
+}
diff --git a/Source/WebCore/html/HTMLTableElement.idl b/Source/WebCore/html/HTMLTableElement.idl
index 470af5658..190861a7f 100644
--- a/Source/WebCore/html/HTMLTableElement.idl
+++ b/Source/WebCore/html/HTMLTableElement.idl
@@ -18,34 +18,37 @@
* Boston, MA 02110-1301, USA.
*/
-interface HTMLTableElement : HTMLElement {
- attribute HTMLTableCaptionElement caption setter raises(DOMException);
- attribute HTMLTableSectionElement tHead setter raises(DOMException);
- attribute HTMLTableSectionElement tFoot setter raises(DOMException);
-
- readonly attribute HTMLCollection rows;
- readonly attribute HTMLCollection tBodies;
- [Reflect] attribute DOMString align;
- [Reflect] attribute DOMString bgColor;
- [Reflect] attribute DOMString border;
- [Reflect] attribute DOMString cellPadding;
- [Reflect] attribute DOMString cellSpacing;
-
- [Reflect] attribute DOMString frame;
-
- [Reflect] attribute DOMString rules;
- [Reflect] attribute DOMString summary;
- [Reflect] attribute DOMString width;
-
- HTMLElement createTHead();
- void deleteTHead();
- HTMLElement createTFoot();
- void deleteTFoot();
- HTMLElement createTBody();
- HTMLElement createCaption();
- void deleteCaption();
-
- HTMLElement insertRow(in [Optional=DefaultIsUndefined] long index) raises(DOMException);
- void deleteRow(in [Optional=DefaultIsUndefined] long index) raises(DOMException);
-};
+module html {
+ interface HTMLTableElement : HTMLElement {
+ attribute HTMLTableCaptionElement caption setter raises(DOMException);
+ attribute HTMLTableSectionElement tHead setter raises(DOMException);
+ attribute HTMLTableSectionElement tFoot setter raises(DOMException);
+
+ readonly attribute HTMLCollection rows;
+ readonly attribute HTMLCollection tBodies;
+ attribute [Reflect] DOMString align;
+ attribute [Reflect] DOMString bgColor;
+ attribute [Reflect] DOMString border;
+ attribute [Reflect] DOMString cellPadding;
+ attribute [Reflect] DOMString cellSpacing;
+
+ attribute [Reflect] DOMString frame;
+
+ attribute [Reflect] DOMString rules;
+ attribute [Reflect] DOMString summary;
+ attribute [Reflect] DOMString width;
+
+ HTMLElement createTHead();
+ void deleteTHead();
+ HTMLElement createTFoot();
+ void deleteTFoot();
+ HTMLElement createTBody();
+ HTMLElement createCaption();
+ void deleteCaption();
+
+ HTMLElement insertRow(in [Optional=DefaultIsUndefined] long index) raises(DOMException);
+ void deleteRow(in [Optional=DefaultIsUndefined] long index) raises(DOMException);
+ };
+
+}
diff --git a/Source/WebCore/html/HTMLTableRowElement.idl b/Source/WebCore/html/HTMLTableRowElement.idl
index 15f054f9c..b16d754af 100644
--- a/Source/WebCore/html/HTMLTableRowElement.idl
+++ b/Source/WebCore/html/HTMLTableRowElement.idl
@@ -18,16 +18,19 @@
* Boston, MA 02110-1301, USA.
*/
-interface HTMLTableRowElement : HTMLElement {
- readonly attribute long rowIndex;
- readonly attribute long sectionRowIndex;
- readonly attribute HTMLCollection cells;
- [Reflect] attribute DOMString align;
- [Reflect] attribute DOMString bgColor;
- [Reflect=char] attribute DOMString ch;
- [Reflect=charoff] attribute DOMString chOff;
- [Reflect] attribute DOMString vAlign;
- HTMLElement insertCell(in [Optional=DefaultIsUndefined] long index) raises(DOMException);
- void deleteCell(in [Optional=DefaultIsUndefined] long index) raises(DOMException);
-};
+module html {
+ interface HTMLTableRowElement : HTMLElement {
+ readonly attribute long rowIndex;
+ readonly attribute long sectionRowIndex;
+ readonly attribute HTMLCollection cells;
+ attribute [Reflect] DOMString align;
+ attribute [Reflect] DOMString bgColor;
+ attribute [Reflect=char] DOMString ch;
+ attribute [Reflect=charoff] DOMString chOff;
+ attribute [Reflect] DOMString vAlign;
+ HTMLElement insertCell(in [Optional=DefaultIsUndefined] long index) raises(DOMException);
+ void deleteCell(in [Optional=DefaultIsUndefined] long index) raises(DOMException);
+ };
+
+}
diff --git a/Source/WebCore/html/HTMLTableSectionElement.idl b/Source/WebCore/html/HTMLTableSectionElement.idl
index d11f429cc..88f53369b 100644
--- a/Source/WebCore/html/HTMLTableSectionElement.idl
+++ b/Source/WebCore/html/HTMLTableSectionElement.idl
@@ -18,15 +18,18 @@
* Boston, MA 02110-1301, USA.
*/
-[
- JSGenerateToNativeObject
-] interface HTMLTableSectionElement : HTMLElement {
- [Reflect] attribute DOMString align;
- [Reflect=char] attribute DOMString ch;
- [Reflect=charoff] attribute DOMString chOff;
- [Reflect] attribute DOMString vAlign;
- readonly attribute HTMLCollection rows;
- HTMLElement insertRow(in [Optional=DefaultIsUndefined] long index) raises(DOMException);
- void deleteRow(in [Optional=DefaultIsUndefined] long index) raises(DOMException);
-};
+module html {
+ interface [
+ JSGenerateToNativeObject
+ ] HTMLTableSectionElement : HTMLElement {
+ attribute [Reflect] DOMString align;
+ attribute [Reflect=char] DOMString ch;
+ attribute [Reflect=charoff] DOMString chOff;
+ attribute [Reflect] DOMString vAlign;
+ readonly attribute HTMLCollection rows;
+ HTMLElement insertRow(in [Optional=DefaultIsUndefined] long index) raises(DOMException);
+ void deleteRow(in [Optional=DefaultIsUndefined] long index) raises(DOMException);
+ };
+
+}
diff --git a/Source/WebCore/html/HTMLTextAreaElement.cpp b/Source/WebCore/html/HTMLTextAreaElement.cpp
index db98ccc9f..a42aa7831 100644
--- a/Source/WebCore/html/HTMLTextAreaElement.cpp
+++ b/Source/WebCore/html/HTMLTextAreaElement.cpp
@@ -56,15 +56,10 @@ static const int defaultCols = 20;
// On submission, LF characters are converted into CRLF.
// This function returns number of characters considering this.
-static inline unsigned computeLengthForSubmission(const String& text, unsigned numberOfLineBreaks)
-{
- return numGraphemeClusters(text) + numberOfLineBreaks;
-}
-
-static unsigned numberOfLineBreaks(const String& text)
+static unsigned computeLengthForSubmission(const String& text)
{
+ unsigned count = numGraphemeClusters(text);
unsigned length = text.length();
- unsigned count = 0;
for (unsigned i = 0; i < length; i++) {
if (text[i] == '\n')
count++;
@@ -72,16 +67,6 @@ static unsigned numberOfLineBreaks(const String& text)
return count;
}
-static inline unsigned computeLengthForSubmission(const String& text)
-{
- return numGraphemeClusters(text) + numberOfLineBreaks(text);
-}
-
-static inline unsigned upperBoundForLengthForSubmission(const String& text, unsigned numberOfLineBreaks)
-{
- return text.length() + numberOfLineBreaks;
-}
-
HTMLTextAreaElement::HTMLTextAreaElement(const QualifiedName& tagName, Document* document, HTMLFormElement* form)
: HTMLTextFormControlElement(tagName, document, form)
, m_rows(defaultRows)
@@ -295,13 +280,7 @@ void HTMLTextAreaElement::handleBeforeTextInsertedEvent(BeforeTextInsertedEvent*
return;
unsigned unsignedMaxLength = static_cast<unsigned>(signedMaxLength);
- const String& currentValue = innerTextValue();
- unsigned numberOfLineBreaksInCurrentValue = numberOfLineBreaks(currentValue);
- if (upperBoundForLengthForSubmission(currentValue, numberOfLineBreaksInCurrentValue)
- + upperBoundForLengthForSubmission(event->text(), numberOfLineBreaks(event->text())) < unsignedMaxLength)
- return;
-
- unsigned currentLength = computeLengthForSubmission(currentValue, numberOfLineBreaksInCurrentValue);
+ unsigned currentLength = computeLengthForSubmission(innerTextValue());
// selectionLength represents the selection length of this text field to be
// removed by this insertion.
// If the text field has no focus, we don't need to take account of the
@@ -487,10 +466,7 @@ bool HTMLTextAreaElement::tooLong(const String& value, NeedsToCheckDirtyFlag che
int max = maxLength();
if (max < 0)
return false;
- unsigned unsignedMax = static_cast<unsigned>(max);
- unsigned numberOfLineBreaksInValue = numberOfLineBreaks(value);
- return upperBoundForLengthForSubmission(value, numberOfLineBreaksInValue) > unsignedMax
- && computeLengthForSubmission(value, numberOfLineBreaksInValue) > unsignedMax;
+ return computeLengthForSubmission(value) > static_cast<unsigned>(max);
}
bool HTMLTextAreaElement::isValidValue(const String& candidate) const
diff --git a/Source/WebCore/html/HTMLTextAreaElement.idl b/Source/WebCore/html/HTMLTextAreaElement.idl
index df8867ace..729e6dae6 100644
--- a/Source/WebCore/html/HTMLTextAreaElement.idl
+++ b/Source/WebCore/html/HTMLTextAreaElement.idl
@@ -19,46 +19,49 @@
* Boston, MA 02110-1301, USA.
*/
-interface HTMLTextAreaElement : HTMLElement {
- [Reflect] attribute boolean autofocus;
- attribute long cols;
- [Reflect] attribute DOMString dirName;
- [Reflect] attribute boolean disabled;
- readonly attribute HTMLFormElement form;
- attribute long maxLength setter raises(DOMException);
- [Reflect] attribute DOMString name;
- [Reflect] attribute DOMString placeholder;
- [Reflect] attribute boolean readOnly;
- [Reflect] attribute boolean required;
- attribute long rows;
- [Reflect] attribute DOMString wrap;
+module html {
- readonly attribute DOMString type;
- [TreatNullAs=NullString] attribute DOMString defaultValue;
- [TreatNullAs=NullString] attribute DOMString value;
- readonly attribute unsigned long textLength;
+ interface HTMLTextAreaElement : HTMLElement {
+ attribute [Reflect] boolean autofocus;
+ attribute long cols;
+ attribute [Reflect] DOMString dirName;
+ attribute [Reflect] boolean disabled;
+ readonly attribute HTMLFormElement form;
+ attribute long maxLength setter raises(DOMException);
+ attribute [Reflect] DOMString name;
+ attribute [Reflect] DOMString placeholder;
+ attribute [Reflect] boolean readOnly;
+ attribute [Reflect] boolean required;
+ attribute long rows;
+ attribute [Reflect] DOMString wrap;
- readonly attribute boolean willValidate;
- readonly attribute ValidityState validity;
- readonly attribute DOMString validationMessage;
- boolean checkValidity();
- void setCustomValidity(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString error);
+ readonly attribute DOMString type;
+ attribute [TreatNullAs=NullString] DOMString defaultValue;
+ attribute [TreatNullAs=NullString] DOMString value;
+ readonly attribute unsigned long textLength;
- readonly attribute NodeList labels;
+ readonly attribute boolean willValidate;
+ readonly attribute ValidityState validity;
+ readonly attribute DOMString validationMessage;
+ boolean checkValidity();
+ void setCustomValidity(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString error);
- void select();
- attribute long selectionStart;
- attribute long selectionEnd;
- attribute DOMString selectionDirection;
+ readonly attribute NodeList labels;
+
+ void select();
+ attribute long selectionStart;
+ attribute long selectionEnd;
+ attribute DOMString selectionDirection;
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
- void setSelectionRange(in long start, in long end);
+ void setSelectionRange(in long start, in long end);
#else
- void setSelectionRange(in [Optional=DefaultIsUndefined] long start,
- in [Optional=DefaultIsUndefined] long end,
- in [Optional] DOMString direction);
+ void setSelectionRange(in [Optional=DefaultIsUndefined] long start,
+ in [Optional=DefaultIsUndefined] long end,
+ in [Optional] DOMString direction);
#endif
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
- [Reflect] attribute DOMString accessKey;
+ attribute [Reflect] DOMString accessKey;
#endif
-};
+ };
+}
diff --git a/Source/WebCore/html/HTMLTextFormControlElement.cpp b/Source/WebCore/html/HTMLTextFormControlElement.cpp
index fcde35ae6..70c06191e 100644
--- a/Source/WebCore/html/HTMLTextFormControlElement.cpp
+++ b/Source/WebCore/html/HTMLTextFormControlElement.cpp
@@ -159,7 +159,9 @@ void HTMLTextFormControlElement::updatePlaceholderVisibility(bool placeholderVal
HTMLElement* placeholder = placeholderElement();
if (!placeholder)
return;
- placeholder->setInlineStyleProperty(CSSPropertyVisibility, placeholderShouldBeVisible() ? "visible" : "hidden");
+ ExceptionCode ec = 0;
+ placeholder->setInlineStyleProperty(CSSPropertyVisibility, placeholderShouldBeVisible() ? "visible" : "hidden", ec);
+ ASSERT(!ec);
}
void HTMLTextFormControlElement::fixPlaceholderRenderer(HTMLElement* placeholder, HTMLElement* siblingElement)
diff --git a/Source/WebCore/html/HTMLTitleElement.idl b/Source/WebCore/html/HTMLTitleElement.idl
index f5639fe17..e691f7b13 100644
--- a/Source/WebCore/html/HTMLTitleElement.idl
+++ b/Source/WebCore/html/HTMLTitleElement.idl
@@ -17,7 +17,10 @@
* Boston, MA 02110-1301, USA.
*/
-interface HTMLTitleElement : HTMLElement {
- [TreatNullAs=NullString] attribute DOMString text;
-};
+module html {
+ interface HTMLTitleElement : HTMLElement {
+ attribute [TreatNullAs=NullString] DOMString text;
+ };
+
+}
diff --git a/Source/WebCore/html/HTMLTrackElement.idl b/Source/WebCore/html/HTMLTrackElement.idl
index 07b781bba..3e98fed66 100644
--- a/Source/WebCore/html/HTMLTrackElement.idl
+++ b/Source/WebCore/html/HTMLTrackElement.idl
@@ -23,22 +23,24 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- Conditional=VIDEO_TRACK,
- V8EnabledAtRuntime=webkitVideoTrack
-] interface HTMLTrackElement : HTMLElement {
- attribute DOMString kind;
- [Reflect, URL] attribute DOMString src;
- attribute DOMString srclang;
- attribute DOMString label;
- [Reflect] attribute boolean default;
+module html {
+ interface [
+ Conditional=VIDEO_TRACK,
+ V8EnabledAtRuntime=webkitVideoTrack
+ ] HTMLTrackElement : HTMLElement {
+ attribute DOMString kind;
+ attribute [Reflect, URL] DOMString src;
+ attribute DOMString srclang;
+ attribute DOMString label;
+ attribute [Reflect] boolean default;
- const unsigned short NONE = 0;
- const unsigned short LOADING = 1;
- const unsigned short LOADED = 2;
- // Reflect is used for ERROR because it conflicts with a windows define.
- [Reflect=TRACK_ERROR] const unsigned short ERROR = 3;
- readonly attribute unsigned short readyState;
+ const unsigned short NONE = 0;
+ const unsigned short LOADING = 1;
+ const unsigned short LOADED = 2;
+ // Reflect is used for ERROR because it conflicts with a windows define.
+ [Reflect=TRACK_ERROR] const unsigned short ERROR = 3;
+ readonly attribute unsigned short readyState;
- readonly attribute TextTrack track;
+ readonly attribute TextTrack track;
};
+}
diff --git a/Source/WebCore/html/HTMLUListElement.idl b/Source/WebCore/html/HTMLUListElement.idl
index e40350d83..221dcca58 100644
--- a/Source/WebCore/html/HTMLUListElement.idl
+++ b/Source/WebCore/html/HTMLUListElement.idl
@@ -17,8 +17,11 @@
* Boston, MA 02110-1301, USA.
*/
-interface HTMLUListElement : HTMLElement {
- [Reflect] attribute boolean compact;
- [Reflect] attribute DOMString type;
-};
+module html {
+ interface HTMLUListElement : HTMLElement {
+ attribute [Reflect] boolean compact;
+ attribute [Reflect] DOMString type;
+ };
+
+}
diff --git a/Source/WebCore/html/HTMLUnknownElement.idl b/Source/WebCore/html/HTMLUnknownElement.idl
index fe1ca9eda..9e4f90afa 100644
--- a/Source/WebCore/html/HTMLUnknownElement.idl
+++ b/Source/WebCore/html/HTMLUnknownElement.idl
@@ -27,6 +27,9 @@
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-interface HTMLUnknownElement : HTMLElement {
-};
+module html {
+ interface HTMLUnknownElement : HTMLElement {
+ };
+
+}
diff --git a/Source/WebCore/html/HTMLVideoElement.idl b/Source/WebCore/html/HTMLVideoElement.idl
index dba44083b..97a17796e 100644
--- a/Source/WebCore/html/HTMLVideoElement.idl
+++ b/Source/WebCore/html/HTMLVideoElement.idl
@@ -23,31 +23,33 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- Conditional=VIDEO,
- JSGenerateToNativeObject
-] interface HTMLVideoElement : HTMLMediaElement {
- [Reflect] attribute unsigned long width;
- [Reflect] attribute unsigned long height;
- readonly attribute unsigned long videoWidth;
- readonly attribute unsigned long videoHeight;
- [Reflect, URL] attribute DOMString poster;
+module html {
+ interface [
+ Conditional=VIDEO,
+ JSGenerateToNativeObject
+ ] HTMLVideoElement : HTMLMediaElement {
+ attribute [Reflect] unsigned long width;
+ attribute [Reflect] unsigned long height;
+ readonly attribute unsigned long videoWidth;
+ readonly attribute unsigned long videoHeight;
+ attribute [Reflect, URL] DOMString poster;
- readonly attribute boolean webkitSupportsFullscreen;
- readonly attribute boolean webkitDisplayingFullscreen;
+ readonly attribute boolean webkitSupportsFullscreen;
+ readonly attribute boolean webkitDisplayingFullscreen;
- void webkitEnterFullscreen() raises (DOMException);
- void webkitExitFullscreen();
+ void webkitEnterFullscreen() raises (DOMException);
+ void webkitExitFullscreen();
- // Note the different capitalization of the "S" in FullScreen.
- void webkitEnterFullScreen() raises (DOMException);
- void webkitExitFullScreen();
+ // Note the different capitalization of the "S" in FullScreen.
+ void webkitEnterFullScreen() raises (DOMException);
+ void webkitExitFullScreen();
- // The number of frames that have been decoded and made available for
- // playback.
- [Conditional=MEDIA_STATISTICS] readonly attribute unsigned long webkitDecodedFrameCount;
+ // The number of frames that have been decoded and made available for
+ // playback.
+ readonly attribute [Conditional=MEDIA_STATISTICS] unsigned long webkitDecodedFrameCount;
- // The number of decoded frames that have been dropped by the player
- // for performance reasons during playback.
- [Conditional=MEDIA_STATISTICS] readonly attribute unsigned long webkitDroppedFrameCount;
-};
+ // The number of decoded frames that have been dropped by the player
+ // for performance reasons during playback.
+ readonly attribute [Conditional=MEDIA_STATISTICS] unsigned long webkitDroppedFrameCount;
+ };
+}
diff --git a/Source/WebCore/html/ImageData.idl b/Source/WebCore/html/ImageData.idl
index ca3195f3b..f2ea0ca6b 100644
--- a/Source/WebCore/html/ImageData.idl
+++ b/Source/WebCore/html/ImageData.idl
@@ -26,13 +26,16 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- CustomToJSObject
-] interface ImageData {
- readonly attribute long width;
- readonly attribute long height;
+module html {
+
+ interface [
+ CustomToJSObject
+ ] ImageData {
+ readonly attribute long width;
+ readonly attribute long height;
#if !defined(LANGUAGE_JAVASCRIPT) || !LANGUAGE_JAVASCRIPT
- readonly attribute Uint8ClampedArray data;
+ readonly attribute Uint8ClampedArray data;
#endif
-};
+ };
+}
diff --git a/Source/WebCore/html/ImageDocument.cpp b/Source/WebCore/html/ImageDocument.cpp
index 5fc9268fb..0afd276c1 100644
--- a/Source/WebCore/html/ImageDocument.cpp
+++ b/Source/WebCore/html/ImageDocument.cpp
@@ -40,7 +40,6 @@
#include "NotImplemented.h"
#include "Page.h"
#include "RawDataDocumentParser.h"
-#include "ResourceBuffer.h"
#include "Settings.h"
using std::min;
@@ -142,7 +141,7 @@ void ImageDocumentParser::finish()
{
if (!isStopped() && document()->imageElement()) {
CachedImage* cachedImage = document()->cachedImage();
- RefPtr<ResourceBuffer> data = document()->frame()->loader()->documentLoader()->mainResourceData();
+ RefPtr<SharedBuffer> data = document()->frame()->loader()->documentLoader()->mainResourceData();
// If this is a multipart image, make a copy of the current part, since the resource data
// will be overwritten by the next part.
diff --git a/Source/WebCore/html/MediaController.idl b/Source/WebCore/html/MediaController.idl
index 31443a1db..d3f33485b 100644
--- a/Source/WebCore/html/MediaController.idl
+++ b/Source/WebCore/html/MediaController.idl
@@ -23,39 +23,41 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- Conditional=VIDEO,
- Constructor,
- CallWith=ScriptExecutionContext,
- JSGenerateToJSObject,
- EventTarget
-] interface MediaController {
- readonly attribute TimeRanges buffered;
- readonly attribute TimeRanges seekable;
+module html {
+ interface [
+ Conditional=VIDEO,
+ Constructor,
+ CallWith=ScriptExecutionContext,
+ JSGenerateToJSObject,
+ EventTarget
+ ] MediaController {
+ readonly attribute TimeRanges buffered;
+ readonly attribute TimeRanges seekable;
- readonly attribute double duration;
- attribute double currentTime
- setter raises (DOMException);
+ readonly attribute double duration;
+ attribute double currentTime
+ setter raises (DOMException);
- readonly attribute boolean paused;
- readonly attribute TimeRanges played;
- void play();
- void pause();
+ readonly attribute boolean paused;
+ readonly attribute TimeRanges played;
+ void play();
+ void pause();
- attribute double defaultPlaybackRate;
- attribute double playbackRate;
+ attribute double defaultPlaybackRate;
+ attribute double playbackRate;
- attribute double volume
- setter raises (DOMException);
- attribute boolean muted;
+ attribute double volume
+ setter raises (DOMException);
+ attribute boolean muted;
- // EventTarget interface
- void addEventListener(in DOMString type,
- in EventListener listener,
- in [Optional] boolean useCapture);
- void removeEventListener(in DOMString type,
- in EventListener listener,
- in [Optional] boolean useCapture);
- boolean dispatchEvent(in Event evt)
- raises(EventException);
-};
+ // EventTarget interface
+ void addEventListener(in DOMString type,
+ in EventListener listener,
+ in [Optional] boolean useCapture);
+ void removeEventListener(in DOMString type,
+ in EventListener listener,
+ in [Optional] boolean useCapture);
+ boolean dispatchEvent(in Event evt)
+ raises(EventException);
+ };
+}
diff --git a/Source/WebCore/html/MediaError.idl b/Source/WebCore/html/MediaError.idl
index 95e7c84ce..8eb9d5402 100644
--- a/Source/WebCore/html/MediaError.idl
+++ b/Source/WebCore/html/MediaError.idl
@@ -23,15 +23,17 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- Conditional=VIDEO
-] interface MediaError {
- const unsigned short MEDIA_ERR_ABORTED = 1;
- const unsigned short MEDIA_ERR_NETWORK = 2;
- const unsigned short MEDIA_ERR_DECODE = 3;
- const unsigned short MEDIA_ERR_SRC_NOT_SUPPORTED = 4;
+module html {
+ interface [
+ Conditional=VIDEO
+ ] MediaError {
+ const unsigned short MEDIA_ERR_ABORTED = 1;
+ const unsigned short MEDIA_ERR_NETWORK = 2;
+ const unsigned short MEDIA_ERR_DECODE = 3;
+ const unsigned short MEDIA_ERR_SRC_NOT_SUPPORTED = 4;
#if defined(ENABLE_ENCRYPTED_MEDIA) && ENABLE_ENCRYPTED_MEDIA
- const unsigned short MEDIA_ERR_ENCRYPTED = 5;
+ const unsigned short MEDIA_ERR_ENCRYPTED = 5;
#endif
- readonly attribute unsigned short code;
-};
+ readonly attribute unsigned short code;
+ };
+}
diff --git a/Source/WebCore/html/MediaKeyError.idl b/Source/WebCore/html/MediaKeyError.idl
index 5877d5255..55b9b04d0 100644
--- a/Source/WebCore/html/MediaKeyError.idl
+++ b/Source/WebCore/html/MediaKeyError.idl
@@ -23,15 +23,17 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- Conditional=ENCRYPTED_MEDIA,
- V8EnabledAtRuntime=encryptedMedia,
-] interface MediaKeyError {
- const unsigned short MEDIA_KEYERR_UNKNOWN = 1;
- const unsigned short MEDIA_KEYERR_CLIENT = 2;
- const unsigned short MEDIA_KEYERR_SERVICE = 3;
- const unsigned short MEDIA_KEYERR_OUTPUT = 4;
- const unsigned short MEDIA_KEYERR_HARDWARECHANGE = 5;
- const unsigned short MEDIA_KEYERR_DOMAIN = 6;
- readonly attribute unsigned short code;
-};
+module html {
+ interface [
+ Conditional=ENCRYPTED_MEDIA,
+ V8EnabledAtRuntime=encryptedMedia,
+ ] MediaKeyError {
+ const unsigned short MEDIA_KEYERR_UNKNOWN = 1;
+ const unsigned short MEDIA_KEYERR_CLIENT = 2;
+ const unsigned short MEDIA_KEYERR_SERVICE = 3;
+ const unsigned short MEDIA_KEYERR_OUTPUT = 4;
+ const unsigned short MEDIA_KEYERR_HARDWARECHANGE = 5;
+ const unsigned short MEDIA_KEYERR_DOMAIN = 6;
+ readonly attribute unsigned short code;
+ };
+}
diff --git a/Source/WebCore/html/MediaKeyEvent.idl b/Source/WebCore/html/MediaKeyEvent.idl
index f4d0d8605..b1387dcfc 100644
--- a/Source/WebCore/html/MediaKeyEvent.idl
+++ b/Source/WebCore/html/MediaKeyEvent.idl
@@ -23,17 +23,20 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- Conditional=ENCRYPTED_MEDIA,
- V8EnabledAtRuntime=encryptedMedia,
- ConstructorTemplate=Event
-] interface MediaKeyEvent : Event {
- [InitializedByEventConstructor] readonly attribute DOMString keySystem;
- [InitializedByEventConstructor] readonly attribute DOMString sessionId;
- [InitializedByEventConstructor] readonly attribute Uint8Array initData;
- [InitializedByEventConstructor] readonly attribute Uint8Array message;
- [InitializedByEventConstructor] readonly attribute DOMString defaultURL;
- [InitializedByEventConstructor] readonly attribute MediaKeyError errorCode;
- [InitializedByEventConstructor] readonly attribute unsigned short systemCode;
-};
+module html {
+ interface [
+ Conditional=ENCRYPTED_MEDIA,
+ V8EnabledAtRuntime=encryptedMedia,
+ ConstructorTemplate=Event
+ ] MediaKeyEvent : Event {
+ readonly attribute [InitializedByEventConstructor] DOMString keySystem;
+ readonly attribute [InitializedByEventConstructor] DOMString sessionId;
+ readonly attribute [InitializedByEventConstructor] Uint8Array initData;
+ readonly attribute [InitializedByEventConstructor] Uint8Array message;
+ readonly attribute [InitializedByEventConstructor] DOMString defaultURL;
+ readonly attribute [InitializedByEventConstructor] MediaKeyError errorCode;
+ readonly attribute [InitializedByEventConstructor] unsigned short systemCode;
+ };
+
+}
diff --git a/Source/WebCore/html/MicroDataItemValue.idl b/Source/WebCore/html/MicroDataItemValue.idl
index 5b29ed542..5522b4fff 100644
--- a/Source/WebCore/html/MicroDataItemValue.idl
+++ b/Source/WebCore/html/MicroDataItemValue.idl
@@ -28,9 +28,12 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- Conditional=MICRODATA,
- CustomToJSObject,
- OmitConstructor
-] interface MicroDataItemValue {
-};
+module html {
+ interface [
+ Conditional=MICRODATA,
+ CustomToJSObject,
+ OmitConstructor
+ ] MicroDataItemValue {
+ };
+}
+
diff --git a/Source/WebCore/html/MonthInputType.cpp b/Source/WebCore/html/MonthInputType.cpp
index b58743878..fc672e3ee 100644
--- a/Source/WebCore/html/MonthInputType.cpp
+++ b/Source/WebCore/html/MonthInputType.cpp
@@ -42,13 +42,6 @@
#if ENABLE(INPUT_TYPE_MONTH)
-#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
-#include "DateTimeFieldsState.h"
-#include "LocalizedStrings.h"
-#include "Localizer.h"
-#include <wtf/text/WTFString.h>
-#endif
-
namespace WebCore {
using namespace HTMLNames;
@@ -144,24 +137,6 @@ bool MonthInputType::isMonthField() const
return true;
}
-#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
-String MonthInputType::formatDateTimeFieldsState(const DateTimeFieldsState& dateTimeFieldsState) const
-{
- if (!dateTimeFieldsState.hasMonth() || !dateTimeFieldsState.hasYear())
- return emptyString();
- return String::format("%04u-%02u", dateTimeFieldsState.year(), dateTimeFieldsState.month());
-}
-
-void MonthInputType::setupLayoutParameters(DateTimeEditElement::LayoutParameters& layoutParameters, const DateComponents& date) const
-{
- layoutParameters.dateTimeFormat = monthFormatInLDML();
- layoutParameters.fallbackDateTimeFormat = "MM/yyyy";
- layoutParameters.minimumYear = fullYear(element()->fastGetAttribute(minAttr));
- layoutParameters.maximumYear = fullYear(element()->fastGetAttribute(maxAttr));
- layoutParameters.placeholderForMonth = "--";
- layoutParameters.placeholderForYear = "----";
-}
-#endif
} // namespace WebCore
#endif
diff --git a/Source/WebCore/html/MonthInputType.h b/Source/WebCore/html/MonthInputType.h
index 3d4f59c6c..8f24fa785 100644
--- a/Source/WebCore/html/MonthInputType.h
+++ b/Source/WebCore/html/MonthInputType.h
@@ -31,23 +31,18 @@
#ifndef MonthInputType_h
#define MonthInputType_h
+#include "BaseDateAndTimeInputType.h"
+
#if ENABLE(INPUT_TYPE_MONTH)
-#include "BaseMultipleFieldsDateAndTimeInputType.h"
namespace WebCore {
-#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
-typedef BaseMultipleFieldsDateAndTimeInputType BaseMonthInputType;
-#else
-typedef BaseDateAndTimeInputType BaseMonthInputType;
-#endif
-
-class MonthInputType : public BaseMonthInputType {
+class MonthInputType : public BaseDateAndTimeInputType {
public:
static PassOwnPtr<InputType> create(HTMLInputElement*);
private:
- MonthInputType(HTMLInputElement* element) : BaseMonthInputType(element) { }
+ MonthInputType(HTMLInputElement* element) : BaseDateAndTimeInputType(element) { }
virtual const AtomicString& formControlType() const OVERRIDE;
virtual DateComponents::Type dateType() const OVERRIDE;
virtual double valueAsDate() const OVERRIDE;
@@ -58,12 +53,6 @@ private:
virtual bool parseToDateComponentsInternal(const UChar*, unsigned length, DateComponents*) const OVERRIDE;
virtual bool setMillisecondToDateComponents(double, DateComponents*) const OVERRIDE;
virtual bool isMonthField() const OVERRIDE;
-
-#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
- // BaseMultipleFieldsDateAndTimeInputType functions
- virtual String formatDateTimeFieldsState(const DateTimeFieldsState&) const OVERRIDE FINAL;
- virtual void setupLayoutParameters(DateTimeEditElement::LayoutParameters&, const DateComponents&) const OVERRIDE FINAL;
-#endif
};
} // namespace WebCore
diff --git a/Source/WebCore/html/NumberInputType.cpp b/Source/WebCore/html/NumberInputType.cpp
index 306bf8fb6..794545dc9 100644
--- a/Source/WebCore/html/NumberInputType.cpp
+++ b/Source/WebCore/html/NumberInputType.cpp
@@ -39,7 +39,7 @@
#include "HTMLParserIdioms.h"
#include "InputTypeNames.h"
#include "KeyboardEvent.h"
-#include "Localizer.h"
+#include "LocalizedNumber.h"
#include "RenderTextControl.h"
#include <limits>
#include <wtf/ASCIICType.h>
@@ -235,7 +235,7 @@ String NumberInputType::localizeValue(const String& proposedValue) const
// We don't localize scientific notations.
if (proposedValue.find(isE) != notFound)
return proposedValue;
- return element()->localizer().convertToLocalizedNumber(proposedValue);
+ return convertToLocalizedNumber(proposedValue);
}
String NumberInputType::visibleValue() const
@@ -250,7 +250,7 @@ String NumberInputType::convertFromVisibleValue(const String& visibleValue) cons
// We don't localize scientific notations.
if (visibleValue.find(isE) != notFound)
return visibleValue;
- return element()->localizer().convertFromLocalizedNumber(visibleValue);
+ return convertFromLocalizedNumber(visibleValue);
}
bool NumberInputType::isAcceptableValue(const String& proposedValue)
diff --git a/Source/WebCore/html/RadioNodeList.idl b/Source/WebCore/html/RadioNodeList.idl
index 7cae4859c..8ed57bacd 100644
--- a/Source/WebCore/html/RadioNodeList.idl
+++ b/Source/WebCore/html/RadioNodeList.idl
@@ -23,9 +23,13 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- JSGenerateToJSObject,
- IndexedGetter,
-] interface RadioNodeList : NodeList {
- attribute DOMString value;
-};
+module html {
+
+ interface [
+ JSGenerateToJSObject,
+ IndexedGetter,
+ ] RadioNodeList : NodeList {
+ attribute DOMString value;
+ };
+}
+
diff --git a/Source/WebCore/html/TextFieldInputType.cpp b/Source/WebCore/html/TextFieldInputType.cpp
index 3e6c1ee7c..692121e5c 100644
--- a/Source/WebCore/html/TextFieldInputType.cpp
+++ b/Source/WebCore/html/TextFieldInputType.cpp
@@ -381,10 +381,6 @@ void TextFieldInputType::handleBeforeTextInsertedEvent(BeforeTextInsertedEvent*
// Truncate the inserted text to avoid violating the maxLength and other constraints.
String eventText = event->text();
- unsigned textLength = eventText.length();
- while (textLength > 0 && isASCIILineBreak(eventText[textLength - 1]))
- textLength--;
- eventText.truncate(textLength);
eventText.replace("\r\n", " ");
eventText.replace('\r', ' ');
eventText.replace('\n', ' ');
diff --git a/Source/WebCore/html/TextMetrics.idl b/Source/WebCore/html/TextMetrics.idl
index eb015a7fe..1a315bac2 100644
--- a/Source/WebCore/html/TextMetrics.idl
+++ b/Source/WebCore/html/TextMetrics.idl
@@ -23,7 +23,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-interface TextMetrics {
- readonly attribute float width;
-};
+module html {
+ interface TextMetrics {
+ readonly attribute float width;
+ };
+
+}
diff --git a/Source/WebCore/html/TimeInputType.cpp b/Source/WebCore/html/TimeInputType.cpp
index 789cd3fee..a0051513a 100644
--- a/Source/WebCore/html/TimeInputType.cpp
+++ b/Source/WebCore/html/TimeInputType.cpp
@@ -41,10 +41,13 @@
#include <wtf/PassOwnPtr.h>
#if ENABLE(INPUT_TYPE_TIME)
-
-#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
+#if ENABLE(INPUT_TYPE_TIME_MULTIPLE_FIELDS)
#include "DateTimeFieldsState.h"
+#include "ElementShadow.h"
+#include "FormController.h"
+#include "KeyboardEvent.h"
#include "Localizer.h"
+#include "ShadowRoot.h"
#include <wtf/text/WTFString.h>
#endif
@@ -56,11 +59,6 @@ static const int timeDefaultStep = 60;
static const int timeDefaultStepBase = 0;
static const int timeStepScaleFactor = 1000;
-TimeInputType::TimeInputType(HTMLInputElement* element)
- : BaseTimeInputType(element)
-{
-}
-
PassOwnPtr<InputType> TimeInputType::create(HTMLInputElement* element)
{
return adoptPtr(new TimeInputType(element));
@@ -120,21 +118,47 @@ bool TimeInputType::isTimeField() const
return true;
}
-#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
+#if ENABLE(INPUT_TYPE_TIME_MULTIPLE_FIELDS)
-String TimeInputType::localizeValue(const String& proposedValue) const
+TimeInputType::DateTimeEditControlOwnerImpl::DateTimeEditControlOwnerImpl(TimeInputType& timeInputType)
+ : m_timeInputType(timeInputType)
{
- DateComponents date;
- if (!parseToDateComponents(proposedValue, &date))
- return proposedValue;
+}
- Localizer::FormatType formatType = shouldHaveSecondField(date) ? Localizer::FormatTypeMedium : Localizer::FormatTypeShort;
+TimeInputType::DateTimeEditControlOwnerImpl::~DateTimeEditControlOwnerImpl()
+{
+}
+
+void TimeInputType::DateTimeEditControlOwnerImpl::didBlurFromControl()
+{
+ // We don't need to call blur(). This function is called when control
+ // lost focus.
- String localized = element()->localizer().formatDateTime(date, formatType);
- return localized.isEmpty() ? proposedValue : localized;
+ // Remove focus ring by CSS "focus" pseudo class.
+ m_timeInputType.element()->setFocus(false);
}
-String TimeInputType::formatDateTimeFieldsState(const DateTimeFieldsState& dateTimeFieldsState) const
+void TimeInputType::DateTimeEditControlOwnerImpl::didFocusOnControl()
+{
+ // We don't need to call focus(). This function is called when control
+ // got focus.
+
+ // Add focus ring by CSS "focus" pseudo class.
+ m_timeInputType.element()->setFocus(true);
+}
+
+void TimeInputType::DateTimeEditControlOwnerImpl::editControlValueChanged()
+{
+ RefPtr<HTMLInputElement> input(m_timeInputType.element());
+ input->setValueInternal(m_timeInputType.m_dateTimeEditElement->value(), DispatchNoEvent);
+ input->setNeedsStyleRecalc();
+ input->dispatchFormControlInputEvent();
+ input->dispatchFormControlChangeEvent();
+ input->notifyFormStateChanged();
+}
+
+
+String TimeInputType::DateTimeEditControlOwnerImpl::formatDateTimeFieldsState(const DateTimeFieldsState& dateTimeFieldsState) const
{
if (!dateTimeFieldsState.hasHour() || !dateTimeFieldsState.hasMinute() || !dateTimeFieldsState.hasAMPM())
return emptyString();
@@ -152,15 +176,179 @@ String TimeInputType::formatDateTimeFieldsState(const DateTimeFieldsState& dateT
return String::format("%02u:%02u", dateTimeFieldsState.hour23(), dateTimeFieldsState.minute());
}
-void TimeInputType::setupLayoutParameters(DateTimeEditElement::LayoutParameters& layoutParameters, const DateComponents& date) const
+bool TimeInputType::hasCustomFocusLogic() const
+{
+ return false;
+}
+
+bool TimeInputType::DateTimeEditControlOwnerImpl::isEditControlOwnerDisabled() const
+{
+ return m_timeInputType.element()->readOnly();
+}
+
+bool TimeInputType::DateTimeEditControlOwnerImpl::isEditControlOwnerReadOnly() const
+{
+ return m_timeInputType.element()->disabled();
+}
+
+TimeInputType::TimeInputType(HTMLInputElement* element)
+ : BaseDateAndTimeInputType(element)
+ , m_dateTimeEditElement(0)
+ , m_dateTimeEditControlOwnerImpl(*this)
+{
+}
+
+TimeInputType::~TimeInputType()
+{
+ if (m_dateTimeEditElement)
+ m_dateTimeEditElement->removeEditControlOwner();
+}
+
+void TimeInputType::blur()
+{
+ if (m_dateTimeEditElement)
+ m_dateTimeEditElement->blurByOwner();
+}
+
+RenderObject* TimeInputType::createRenderer(RenderArena* arena, RenderStyle* style) const
+{
+ return InputType::createRenderer(arena, style);
+}
+
+void TimeInputType::createShadowSubtree()
+{
+ ASSERT(element()->shadow());
+
+ RefPtr<DateTimeEditElement> dateTimeEditElement(DateTimeEditElement::create(element()->document(), m_dateTimeEditControlOwnerImpl));
+ m_dateTimeEditElement = dateTimeEditElement.get();
+ element()->userAgentShadowRoot()->appendChild(m_dateTimeEditElement);
+ updateInnerTextValue();
+}
+
+void TimeInputType::destroyShadowSubtree()
+{
+ if (m_dateTimeEditElement) {
+ m_dateTimeEditElement->removeEditControlOwner();
+ m_dateTimeEditElement = 0;
+ }
+ BaseDateAndTimeInputType::destroyShadowSubtree();
+}
+
+void TimeInputType::focus(bool)
+{
+ if (m_dateTimeEditElement)
+ m_dateTimeEditElement->focusByOwner();
+}
+
+void TimeInputType::forwardEvent(Event* event)
+{
+ if (m_dateTimeEditElement)
+ m_dateTimeEditElement->defaultEventHandler(event);
+}
+
+void TimeInputType::disabledAttributeChanged()
+{
+ if (m_dateTimeEditElement)
+ m_dateTimeEditElement->disabledStateChanged();
+}
+
+void TimeInputType::handleKeydownEvent(KeyboardEvent* event)
+{
+ forwardEvent(event);
+}
+
+bool TimeInputType::isKeyboardFocusable(KeyboardEvent*) const
+{
+ return false;
+}
+
+bool TimeInputType::isMouseFocusable() const
+{
+ return false;
+}
+
+void TimeInputType::minOrMaxAttributeChanged()
+{
+ updateInnerTextValue();
+}
+
+void TimeInputType::readonlyAttributeChanged()
+{
+ if (m_dateTimeEditElement)
+ m_dateTimeEditElement->readOnlyStateChanged();
+}
+
+bool TimeInputType::isTextField() const
+{
+ return false;
+}
+
+void TimeInputType::restoreFormControlState(const FormControlState& state)
{
- if (shouldHaveSecondField(date)) {
- layoutParameters.dateTimeFormat = layoutParameters.localizer.timeFormat();
+ if (!m_dateTimeEditElement)
+ return;
+ DateComponents date;
+ setMillisecondToDateComponents(createStepRange(AnyIsDefaultStep).minimum().toDouble(), &date);
+ DateTimeFieldsState dateTimeFieldsState = DateTimeFieldsState::restoreFormControlState(state);
+ m_dateTimeEditElement->setValueAsDateTimeFieldsState(dateTimeFieldsState, date);
+ element()->setValueInternal(m_dateTimeEditElement->value(), DispatchNoEvent);
+}
+
+FormControlState TimeInputType::saveFormControlState() const
+{
+ if (!m_dateTimeEditElement)
+ return FormControlState();
+
+ return m_dateTimeEditElement->valueAsDateTimeFieldsState().saveFormControlState();
+}
+
+void TimeInputType::setValue(const String& sanitizedValue, bool valueChanged, TextFieldEventBehavior eventBehavior)
+{
+ InputType::setValue(sanitizedValue, valueChanged, eventBehavior);
+ if (valueChanged)
+ updateInnerTextValue();
+}
+
+bool TimeInputType::shouldUseInputMethod() const
+{
+ return false;
+}
+
+void TimeInputType::stepAttributeChanged()
+{
+ updateInnerTextValue();
+}
+
+void TimeInputType::updateInnerTextValue()
+{
+ if (!m_dateTimeEditElement)
+ return;
+
+ Localizer& localizer = element()->document()->getLocalizer(element()->computeInheritedLanguage());
+ DateTimeEditElement::LayoutParameters layoutParameters(localizer, createStepRange(AnyIsDefaultStep));
+
+ DateComponents date;
+ const bool hasValue = parseToDateComponents(element()->value(), &date);
+ if (!hasValue)
+ setMillisecondToDateComponents(layoutParameters.stepRange.minimum().toDouble(), &date);
+
+ if (date.second() || layoutParameters.shouldHaveSecondField()) {
+ layoutParameters.dateTimeFormat = localizer.timeFormat();
layoutParameters.fallbackDateTimeFormat = "HH:mm:ss";
} else {
- layoutParameters.dateTimeFormat = layoutParameters.localizer.shortTimeFormat();
+ layoutParameters.dateTimeFormat = localizer.shortTimeFormat();
layoutParameters.fallbackDateTimeFormat = "HH:mm";
}
+
+ if (hasValue)
+ m_dateTimeEditElement->setValueAsDate(layoutParameters, date);
+ else
+ m_dateTimeEditElement->setEmptyValue(layoutParameters, date);
+}
+#else
+TimeInputType::TimeInputType(HTMLInputElement* element)
+ : BaseDateAndTimeInputType(element)
+{
}
#endif
diff --git a/Source/WebCore/html/TimeInputType.h b/Source/WebCore/html/TimeInputType.h
index dafd58dfb..59e272102 100644
--- a/Source/WebCore/html/TimeInputType.h
+++ b/Source/WebCore/html/TimeInputType.h
@@ -31,21 +31,24 @@
#ifndef TimeInputType_h
#define TimeInputType_h
-#if ENABLE(INPUT_TYPE_TIME)
-#include "BaseMultipleFieldsDateAndTimeInputType.h"
+#include "BaseDateAndTimeInputType.h"
-namespace WebCore {
+#if ENABLE(INPUT_TYPE_TIME)
-#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
-typedef BaseMultipleFieldsDateAndTimeInputType BaseTimeInputType;
-#else
-typedef BaseDateAndTimeInputType BaseTimeInputType;
+#if ENABLE(INPUT_TYPE_TIME_MULTIPLE_FIELDS)
+#include "DateTimeEditElement.h"
#endif
-class TimeInputType : public BaseTimeInputType {
+namespace WebCore {
+
+class TimeInputType : public BaseDateAndTimeInputType {
public:
static PassOwnPtr<InputType> create(HTMLInputElement*);
+#if ENABLE(INPUT_TYPE_TIME_MULTIPLE_FIELDS)
+ virtual ~TimeInputType();
+#endif
+
private:
TimeInputType(HTMLInputElement*);
virtual const AtomicString& formControlType() const OVERRIDE;
@@ -55,12 +58,52 @@ private:
virtual bool parseToDateComponentsInternal(const UChar*, unsigned length, DateComponents*) const OVERRIDE;
virtual bool setMillisecondToDateComponents(double, DateComponents*) const OVERRIDE;
virtual bool isTimeField() const OVERRIDE;
-#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
- virtual String localizeValue(const String&) const OVERRIDE;
- // BaseMultipleFieldsDateAndTimeInputType functions
- virtual String formatDateTimeFieldsState(const DateTimeFieldsState&) const OVERRIDE FINAL;
- virtual void setupLayoutParameters(DateTimeEditElement::LayoutParameters&, const DateComponents&) const OVERRIDE FINAL;
+#if ENABLE(INPUT_TYPE_TIME_MULTIPLE_FIELDS)
+ class DateTimeEditControlOwnerImpl : public DateTimeEditElement::EditControlOwner {
+ WTF_MAKE_NONCOPYABLE(DateTimeEditControlOwnerImpl);
+
+ public:
+ DateTimeEditControlOwnerImpl(TimeInputType&);
+ virtual ~DateTimeEditControlOwnerImpl();
+
+ private:
+ virtual void didBlurFromControl() OVERRIDE FINAL;
+ virtual void didFocusOnControl() OVERRIDE FINAL;
+ virtual void editControlValueChanged() OVERRIDE FINAL;
+ virtual String formatDateTimeFieldsState(const DateTimeFieldsState&) const OVERRIDE FINAL;
+ virtual bool isEditControlOwnerDisabled() const OVERRIDE FINAL;
+ virtual bool isEditControlOwnerReadOnly() const OVERRIDE FINAL;
+
+ TimeInputType& m_timeInputType;
+ };
+
+ friend class DateTimeEditControlOwnerImpl;
+
+ // InputType functions
+ virtual void blur() OVERRIDE FINAL;
+ virtual RenderObject* createRenderer(RenderArena*, RenderStyle*) const OVERRIDE FINAL;
+ virtual void createShadowSubtree() OVERRIDE FINAL;
+ virtual void destroyShadowSubtree() OVERRIDE FINAL;
+ virtual void disabledAttributeChanged() OVERRIDE FINAL;
+ virtual void focus(bool restorePreviousSelection) OVERRIDE FINAL;
+ virtual void forwardEvent(Event*) OVERRIDE FINAL;
+ virtual void handleKeydownEvent(KeyboardEvent*) OVERRIDE FINAL;
+ virtual bool hasCustomFocusLogic() const OVERRIDE FINAL;
+ virtual bool isKeyboardFocusable(KeyboardEvent*) const OVERRIDE FINAL;
+ virtual bool isMouseFocusable() const OVERRIDE FINAL;
+ virtual bool isTextField() const OVERRIDE FINAL;
+ virtual void minOrMaxAttributeChanged() OVERRIDE FINAL;
+ virtual void readonlyAttributeChanged() OVERRIDE FINAL;
+ virtual void restoreFormControlState(const FormControlState&) OVERRIDE FINAL;
+ virtual FormControlState saveFormControlState() const OVERRIDE FINAL;
+ virtual void setValue(const String&, bool valueChanged, TextFieldEventBehavior) OVERRIDE FINAL;
+ virtual bool shouldUseInputMethod() const OVERRIDE FINAL;
+ virtual void stepAttributeChanged() OVERRIDE FINAL;
+ virtual void updateInnerTextValue() OVERRIDE FINAL;
+
+ DateTimeEditElement* m_dateTimeEditElement;
+ DateTimeEditControlOwnerImpl m_dateTimeEditControlOwnerImpl;
#endif
};
diff --git a/Source/WebCore/html/TimeRanges.idl b/Source/WebCore/html/TimeRanges.idl
index 97cd46194..c37c360db 100644
--- a/Source/WebCore/html/TimeRanges.idl
+++ b/Source/WebCore/html/TimeRanges.idl
@@ -23,13 +23,16 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- Conditional=VIDEO
-] interface TimeRanges {
- readonly attribute unsigned long length;
- float start(in unsigned long index)
- raises (DOMException);
- float end(in unsigned long index)
- raises (DOMException);
-};
+module html {
+ interface [
+ Conditional=VIDEO
+ ] TimeRanges {
+ readonly attribute unsigned long length;
+ float start(in unsigned long index)
+ raises (DOMException);
+ float end(in unsigned long index)
+ raises (DOMException);
+ };
+
+}
diff --git a/Source/WebCore/html/ValidityState.idl b/Source/WebCore/html/ValidityState.idl
index dae343b9a..601bfafed 100644
--- a/Source/WebCore/html/ValidityState.idl
+++ b/Source/WebCore/html/ValidityState.idl
@@ -20,16 +20,19 @@
*
*/
-[
- OmitConstructor
-] interface ValidityState {
- readonly attribute boolean valueMissing;
- readonly attribute boolean typeMismatch;
- readonly attribute boolean patternMismatch;
- readonly attribute boolean tooLong;
- readonly attribute boolean rangeUnderflow;
- readonly attribute boolean rangeOverflow;
- readonly attribute boolean stepMismatch;
- readonly attribute boolean customError;
- readonly attribute boolean valid;
-};
+module html {
+
+ interface [
+ OmitConstructor
+ ] ValidityState {
+ readonly attribute boolean valueMissing;
+ readonly attribute boolean typeMismatch;
+ readonly attribute boolean patternMismatch;
+ readonly attribute boolean tooLong;
+ readonly attribute boolean rangeUnderflow;
+ readonly attribute boolean rangeOverflow;
+ readonly attribute boolean stepMismatch;
+ readonly attribute boolean customError;
+ readonly attribute boolean valid;
+ };
+}
diff --git a/Source/WebCore/html/VoidCallback.idl b/Source/WebCore/html/VoidCallback.idl
index 31a221510..f1b0779e4 100644
--- a/Source/WebCore/html/VoidCallback.idl
+++ b/Source/WebCore/html/VoidCallback.idl
@@ -23,8 +23,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- Callback
-] interface VoidCallback {
- boolean handleEvent();
-};
+module html {
+ interface [
+ Callback
+ ] VoidCallback {
+ boolean handleEvent();
+ };
+}
diff --git a/Source/WebCore/html/WeekInputType.cpp b/Source/WebCore/html/WeekInputType.cpp
index b16ac2856..adbb87591 100644
--- a/Source/WebCore/html/WeekInputType.cpp
+++ b/Source/WebCore/html/WeekInputType.cpp
@@ -39,12 +39,6 @@
#if ENABLE(INPUT_TYPE_WEEK)
-#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
-#include "DateTimeFieldsState.h"
-#include "LocalizedStrings.h"
-#include <wtf/text/WTFString.h>
-#endif
-
namespace WebCore {
using namespace HTMLNames;
@@ -97,25 +91,6 @@ bool WeekInputType::isWeekField() const
return true;
}
-
-#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
-String WeekInputType::formatDateTimeFieldsState(const DateTimeFieldsState& dateTimeFieldsState) const
-{
- if (!dateTimeFieldsState.hasYear() || !dateTimeFieldsState.hasWeekOfYear())
- return emptyString();
- return String::format("%04u-W%02u", dateTimeFieldsState.year(), dateTimeFieldsState.weekOfYear());
-}
-
-void WeekInputType::setupLayoutParameters(DateTimeEditElement::LayoutParameters& layoutParameters, const DateComponents&) const
-{
- layoutParameters.dateTimeFormat = weekFormatInLDML();
- layoutParameters.fallbackDateTimeFormat = "'Week' ww-yyyy";
- layoutParameters.minimumYear = fullYear(element()->fastGetAttribute(minAttr));
- layoutParameters.maximumYear = fullYear(element()->fastGetAttribute(maxAttr));
- layoutParameters.placeholderForYear = "----";
-}
-#endif
-
} // namespace WebCore
#endif
diff --git a/Source/WebCore/html/WeekInputType.h b/Source/WebCore/html/WeekInputType.h
index a88172009..cc58ab7d0 100644
--- a/Source/WebCore/html/WeekInputType.h
+++ b/Source/WebCore/html/WeekInputType.h
@@ -31,36 +31,24 @@
#ifndef WeekInputType_h
#define WeekInputType_h
-#include "BaseMultipleFieldsDateAndTimeInputType.h"
+#include "BaseDateAndTimeInputType.h"
#if ENABLE(INPUT_TYPE_WEEK)
namespace WebCore {
-#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
-typedef BaseMultipleFieldsDateAndTimeInputType BaseWeekInputType;
-#else
-typedef BaseDateAndTimeInputType BaseWeekInputType;
-#endif
-
-class WeekInputType : public BaseWeekInputType {
+class WeekInputType : public BaseDateAndTimeInputType {
public:
static PassOwnPtr<InputType> create(HTMLInputElement*);
private:
- WeekInputType(HTMLInputElement* element) : BaseWeekInputType(element) { }
+ WeekInputType(HTMLInputElement* element) : BaseDateAndTimeInputType(element) { }
virtual const AtomicString& formControlType() const OVERRIDE;
virtual DateComponents::Type dateType() const OVERRIDE;
virtual StepRange createStepRange(AnyStepHandling) const OVERRIDE;
virtual bool parseToDateComponentsInternal(const UChar*, unsigned length, DateComponents*) const OVERRIDE;
virtual bool setMillisecondToDateComponents(double, DateComponents*) const OVERRIDE;
virtual bool isWeekField() const OVERRIDE;
-
-#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
- // BaseMultipleFieldsDateAndTimeInputType functions
- virtual String formatDateTimeFieldsState(const DateTimeFieldsState&) const OVERRIDE FINAL;
- virtual void setupLayoutParameters(DateTimeEditElement::LayoutParameters&, const DateComponents&) const OVERRIDE FINAL;
-#endif
};
} // namespace WebCore
diff --git a/Source/WebCore/html/canvas/ArrayBuffer.idl b/Source/WebCore/html/canvas/ArrayBuffer.idl
index b3f013be5..6e7663dba 100644
--- a/Source/WebCore/html/canvas/ArrayBuffer.idl
+++ b/Source/WebCore/html/canvas/ArrayBuffer.idl
@@ -23,13 +23,16 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- JSGenerateIsReachable=Impl,
- CustomConstructor,
- ConstructorParameters=1,
- JSNoStaticTables
-] interface ArrayBuffer {
- readonly attribute unsigned long byteLength;
- ArrayBuffer slice(in long begin, in [Optional] long end);
-};
+module html {
+ interface [
+ JSGenerateIsReachable=Impl,
+ CustomConstructor,
+ ConstructorParameters=1,
+ JSNoStaticTables
+ ] ArrayBuffer {
+ readonly attribute unsigned long byteLength;
+ ArrayBuffer slice(in long begin, in [Optional] long end);
+ };
+
+}
diff --git a/Source/WebCore/html/canvas/ArrayBufferView.idl b/Source/WebCore/html/canvas/ArrayBufferView.idl
index 1c18e186b..0e934e6cb 100644
--- a/Source/WebCore/html/canvas/ArrayBufferView.idl
+++ b/Source/WebCore/html/canvas/ArrayBufferView.idl
@@ -23,12 +23,14 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- CustomToJSObject,
- JSNoStaticTables,
- OmitConstructor
-] interface ArrayBufferView {
- readonly attribute ArrayBuffer buffer;
- readonly attribute unsigned long byteOffset;
- readonly attribute unsigned long byteLength;
-};
+module html {
+ interface [
+ CustomToJSObject,
+ JSNoStaticTables,
+ OmitConstructor
+ ] ArrayBufferView {
+ readonly attribute ArrayBuffer buffer;
+ readonly attribute unsigned long byteOffset;
+ readonly attribute unsigned long byteLength;
+ };
+}
diff --git a/Source/WebCore/html/canvas/CanvasGradient.idl b/Source/WebCore/html/canvas/CanvasGradient.idl
index f35a68b40..496d4c1b1 100644
--- a/Source/WebCore/html/canvas/CanvasGradient.idl
+++ b/Source/WebCore/html/canvas/CanvasGradient.idl
@@ -23,11 +23,15 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-interface CanvasGradient {
+module html {
- void addColorStop(in [Optional=DefaultIsUndefined] float offset,
- in [Optional=DefaultIsUndefined] DOMString color)
- raises (DOMException);
+ interface CanvasGradient {
-};
+ void addColorStop(in [Optional=DefaultIsUndefined] float offset,
+ in [Optional=DefaultIsUndefined] DOMString color)
+ raises (DOMException);
+
+ };
+
+}
diff --git a/Source/WebCore/html/canvas/CanvasPattern.idl b/Source/WebCore/html/canvas/CanvasPattern.idl
index 7bcab17ac..e5aa0360b 100644
--- a/Source/WebCore/html/canvas/CanvasPattern.idl
+++ b/Source/WebCore/html/canvas/CanvasPattern.idl
@@ -23,6 +23,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-interface CanvasPattern {
-};
+module html {
+
+ interface CanvasPattern {
+ };
+
+}
diff --git a/Source/WebCore/html/canvas/CanvasRenderingContext.idl b/Source/WebCore/html/canvas/CanvasRenderingContext.idl
index c48e68161..ab5beb189 100644
--- a/Source/WebCore/html/canvas/CanvasRenderingContext.idl
+++ b/Source/WebCore/html/canvas/CanvasRenderingContext.idl
@@ -23,11 +23,14 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- JSCustomMarkFunction,
- JSGenerateIsReachable,
- CustomToJSObject
-] interface CanvasRenderingContext {
- readonly attribute HTMLCanvasElement canvas;
-};
+module html {
+ interface [
+ JSCustomMarkFunction,
+ JSGenerateIsReachable,
+ CustomToJSObject
+ ] CanvasRenderingContext {
+ readonly attribute HTMLCanvasElement canvas;
+ };
+
+}
diff --git a/Source/WebCore/html/canvas/CanvasRenderingContext2D.idl b/Source/WebCore/html/canvas/CanvasRenderingContext2D.idl
index 6bfc594db..a8569487a 100644
--- a/Source/WebCore/html/canvas/CanvasRenderingContext2D.idl
+++ b/Source/WebCore/html/canvas/CanvasRenderingContext2D.idl
@@ -23,217 +23,221 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-interface CanvasRenderingContext2D : CanvasRenderingContext {
-
- void save();
- void restore();
-
- void scale(in [Optional=DefaultIsUndefined] float sx,
- in [Optional=DefaultIsUndefined] float sy);
- void rotate(in [Optional=DefaultIsUndefined] float angle);
- void translate(in [Optional=DefaultIsUndefined] float tx,
- in [Optional=DefaultIsUndefined] float ty);
- void transform(in [Optional=DefaultIsUndefined] float m11,
- in [Optional=DefaultIsUndefined] float m12,
- in [Optional=DefaultIsUndefined] float m21,
- in [Optional=DefaultIsUndefined] float m22,
- in [Optional=DefaultIsUndefined] float dx,
- in [Optional=DefaultIsUndefined] float dy);
- void setTransform(in [Optional=DefaultIsUndefined] float m11,
- in [Optional=DefaultIsUndefined] float m12,
- in [Optional=DefaultIsUndefined] float m21,
- in [Optional=DefaultIsUndefined] float m22,
- in [Optional=DefaultIsUndefined] float dx,
- in [Optional=DefaultIsUndefined] float dy);
-
- attribute float globalAlpha;
- [TreatNullAs=NullString] attribute DOMString globalCompositeOperation;
-
- CanvasGradient createLinearGradient(in [Optional=DefaultIsUndefined] float x0,
- in [Optional=DefaultIsUndefined] float y0,
- in [Optional=DefaultIsUndefined] float x1,
- in [Optional=DefaultIsUndefined] float y1)
- raises (DOMException);
- CanvasGradient createRadialGradient(in [Optional=DefaultIsUndefined] float x0,
- in [Optional=DefaultIsUndefined] float y0,
- in [Optional=DefaultIsUndefined] float r0,
- in [Optional=DefaultIsUndefined] float x1,
- in [Optional=DefaultIsUndefined] float y1,
- in [Optional=DefaultIsUndefined] float r1)
- raises (DOMException);
-
- attribute float lineWidth;
- [TreatNullAs=NullString] attribute DOMString lineCap;
- [TreatNullAs=NullString] attribute DOMString lineJoin;
- attribute float miterLimit;
-
- attribute float shadowOffsetX;
- attribute float shadowOffsetY;
- attribute float shadowBlur;
- [TreatNullAs=NullString] attribute DOMString shadowColor;
-
- void setLineDash(in sequence<float> dash);
- sequence<float> getLineDash();
- attribute float lineDashOffset;
-
- // FIXME: These attributes should also be implemented for V8.
+module html {
+
+ interface CanvasRenderingContext2D : CanvasRenderingContext {
+
+ void save();
+ void restore();
+
+ void scale(in [Optional=DefaultIsUndefined] float sx,
+ in [Optional=DefaultIsUndefined] float sy);
+ void rotate(in [Optional=DefaultIsUndefined] float angle);
+ void translate(in [Optional=DefaultIsUndefined] float tx,
+ in [Optional=DefaultIsUndefined] float ty);
+ void transform(in [Optional=DefaultIsUndefined] float m11,
+ in [Optional=DefaultIsUndefined] float m12,
+ in [Optional=DefaultIsUndefined] float m21,
+ in [Optional=DefaultIsUndefined] float m22,
+ in [Optional=DefaultIsUndefined] float dx,
+ in [Optional=DefaultIsUndefined] float dy);
+ void setTransform(in [Optional=DefaultIsUndefined] float m11,
+ in [Optional=DefaultIsUndefined] float m12,
+ in [Optional=DefaultIsUndefined] float m21,
+ in [Optional=DefaultIsUndefined] float m22,
+ in [Optional=DefaultIsUndefined] float dx,
+ in [Optional=DefaultIsUndefined] float dy);
+
+ attribute float globalAlpha;
+ attribute [TreatNullAs=NullString] DOMString globalCompositeOperation;
+
+ CanvasGradient createLinearGradient(in [Optional=DefaultIsUndefined] float x0,
+ in [Optional=DefaultIsUndefined] float y0,
+ in [Optional=DefaultIsUndefined] float x1,
+ in [Optional=DefaultIsUndefined] float y1)
+ raises (DOMException);
+ CanvasGradient createRadialGradient(in [Optional=DefaultIsUndefined] float x0,
+ in [Optional=DefaultIsUndefined] float y0,
+ in [Optional=DefaultIsUndefined] float r0,
+ in [Optional=DefaultIsUndefined] float x1,
+ in [Optional=DefaultIsUndefined] float y1,
+ in [Optional=DefaultIsUndefined] float r1)
+ raises (DOMException);
+
+ attribute float lineWidth;
+ attribute [TreatNullAs=NullString] DOMString lineCap;
+ attribute [TreatNullAs=NullString] DOMString lineJoin;
+ attribute float miterLimit;
+
+ attribute float shadowOffsetX;
+ attribute float shadowOffsetY;
+ attribute float shadowBlur;
+ attribute [TreatNullAs=NullString] DOMString shadowColor;
+
+ void setLineDash(in sequence<float> dash);
+ sequence<float> getLineDash();
+ attribute float lineDashOffset;
+
+ // FIXME: These attributes should also be implemented for V8.
#if !(defined(V8_BINDING) && V8_BINDING)
- [Custom] attribute Array webkitLineDash;
- attribute float webkitLineDashOffset;
+ attribute [Custom] Array webkitLineDash;
+ attribute float webkitLineDashOffset;
#endif
- void clearRect(in [Optional=DefaultIsUndefined] float x,
- in [Optional=DefaultIsUndefined] float y,
- in [Optional=DefaultIsUndefined] float width,
- in [Optional=DefaultIsUndefined] float height);
- void fillRect(in [Optional=DefaultIsUndefined] float x,
+ void clearRect(in [Optional=DefaultIsUndefined] float x,
+ in [Optional=DefaultIsUndefined] float y,
+ in [Optional=DefaultIsUndefined] float width,
+ in [Optional=DefaultIsUndefined] float height);
+ void fillRect(in [Optional=DefaultIsUndefined] float x,
+ in [Optional=DefaultIsUndefined] float y,
+ in [Optional=DefaultIsUndefined] float width,
+ in [Optional=DefaultIsUndefined] float height);
+
+ void beginPath();
+ void closePath();
+ void moveTo(in [Optional=DefaultIsUndefined] float x,
+ in [Optional=DefaultIsUndefined] float y);
+ void lineTo(in [Optional=DefaultIsUndefined] float x,
+ in [Optional=DefaultIsUndefined] float y);
+ void quadraticCurveTo(in [Optional=DefaultIsUndefined] float cpx,
+ in [Optional=DefaultIsUndefined] float cpy,
+ in [Optional=DefaultIsUndefined] float x,
+ in [Optional=DefaultIsUndefined] float y);
+ void bezierCurveTo(in [Optional=DefaultIsUndefined] float cp1x,
+ in [Optional=DefaultIsUndefined] float cp1y,
+ in [Optional=DefaultIsUndefined] float cp2x,
+ in [Optional=DefaultIsUndefined] float cp2y,
+ in [Optional=DefaultIsUndefined] float x,
+ in [Optional=DefaultIsUndefined] float y);
+ void arcTo(in [Optional=DefaultIsUndefined] float x1,
+ in [Optional=DefaultIsUndefined] float y1,
+ in [Optional=DefaultIsUndefined] float x2,
+ in [Optional=DefaultIsUndefined] float y2,
+ in [Optional=DefaultIsUndefined] float radius)
+ raises (DOMException);
+ void rect(in [Optional=DefaultIsUndefined] float x,
in [Optional=DefaultIsUndefined] float y,
in [Optional=DefaultIsUndefined] float width,
in [Optional=DefaultIsUndefined] float height);
-
- void beginPath();
- void closePath();
- void moveTo(in [Optional=DefaultIsUndefined] float x,
- in [Optional=DefaultIsUndefined] float y);
- void lineTo(in [Optional=DefaultIsUndefined] float x,
- in [Optional=DefaultIsUndefined] float y);
- void quadraticCurveTo(in [Optional=DefaultIsUndefined] float cpx,
- in [Optional=DefaultIsUndefined] float cpy,
- in [Optional=DefaultIsUndefined] float x,
- in [Optional=DefaultIsUndefined] float y);
- void bezierCurveTo(in [Optional=DefaultIsUndefined] float cp1x,
- in [Optional=DefaultIsUndefined] float cp1y,
- in [Optional=DefaultIsUndefined] float cp2x,
- in [Optional=DefaultIsUndefined] float cp2y,
- in [Optional=DefaultIsUndefined] float x,
- in [Optional=DefaultIsUndefined] float y);
- void arcTo(in [Optional=DefaultIsUndefined] float x1,
- in [Optional=DefaultIsUndefined] float y1,
- in [Optional=DefaultIsUndefined] float x2,
- in [Optional=DefaultIsUndefined] float y2,
- in [Optional=DefaultIsUndefined] float radius)
- raises (DOMException);
- void rect(in [Optional=DefaultIsUndefined] float x,
- in [Optional=DefaultIsUndefined] float y,
- in [Optional=DefaultIsUndefined] float width,
- in [Optional=DefaultIsUndefined] float height);
- void arc(in [Optional=DefaultIsUndefined] float x,
- in [Optional=DefaultIsUndefined] float y,
- in [Optional=DefaultIsUndefined] float radius,
- in [Optional=DefaultIsUndefined] float startAngle,
- in [Optional=DefaultIsUndefined] float endAngle,
- in [Optional=DefaultIsUndefined] boolean anticlockwise)
- raises (DOMException);
- void fill();
- void stroke();
- void clip();
- boolean isPointInPath(in [Optional=DefaultIsUndefined] float x,
- in [Optional=DefaultIsUndefined] float y);
-
- // text
- attribute DOMString font;
- attribute DOMString textAlign;
- attribute DOMString textBaseline;
-
- TextMetrics measureText(in [Optional=DefaultIsUndefined] DOMString text);
-
- // other
-
- void setAlpha(in [Optional=DefaultIsUndefined] float alpha);
- void setCompositeOperation(in [Optional=DefaultIsUndefined] DOMString compositeOperation);
+ void arc(in [Optional=DefaultIsUndefined] float x,
+ in [Optional=DefaultIsUndefined] float y,
+ in [Optional=DefaultIsUndefined] float radius,
+ in [Optional=DefaultIsUndefined] float startAngle,
+ in [Optional=DefaultIsUndefined] float endAngle,
+ in [Optional=DefaultIsUndefined] boolean anticlockwise)
+ raises (DOMException);
+ void fill();
+ void stroke();
+ void clip();
+ boolean isPointInPath(in [Optional=DefaultIsUndefined] float x,
+ in [Optional=DefaultIsUndefined] float y);
+
+ // text
+ attribute DOMString font;
+ attribute DOMString textAlign;
+ attribute DOMString textBaseline;
+
+ TextMetrics measureText(in [Optional=DefaultIsUndefined] DOMString text);
+
+ // other
+
+ void setAlpha(in [Optional=DefaultIsUndefined] float alpha);
+ void setCompositeOperation(in [Optional=DefaultIsUndefined] DOMString compositeOperation);
#if !defined(LANGUAGE_CPP) || !LANGUAGE_CPP
- void setLineWidth(in [Optional=DefaultIsUndefined] float width);
- void setLineCap(in [Optional=DefaultIsUndefined] DOMString cap);
- void setLineJoin(in [Optional=DefaultIsUndefined] DOMString join);
- void setMiterLimit(in [Optional=DefaultIsUndefined] float limit);
+ void setLineWidth(in [Optional=DefaultIsUndefined] float width);
+ void setLineCap(in [Optional=DefaultIsUndefined] DOMString cap);
+ void setLineJoin(in [Optional=DefaultIsUndefined] DOMString join);
+ void setMiterLimit(in [Optional=DefaultIsUndefined] float limit);
#endif
- void clearShadow();
-
- void fillText(in DOMString text, in float x, in float y, in [Optional] float maxWidth);
- void strokeText(in DOMString text, in float x, in float y, in [Optional] float maxWidth);
-
- void setStrokeColor(in [StrictTypeChecking] DOMString color, in [Optional] float alpha);
- void setStrokeColor(in float grayLevel, in [Optional] float alpha);
- void setStrokeColor(in float r, in float g, in float b, in float a);
- void setStrokeColor(in float c, in float m, in float y, in float k, in float a);
-
- void setFillColor(in [StrictTypeChecking] DOMString color, in [Optional] float alpha);
- void setFillColor(in float grayLevel, in [Optional] float alpha);
- void setFillColor(in float r, in float g, in float b, in float a);
- void setFillColor(in float c, in float m, in float y, in float k, in float a);
-
- void strokeRect(in [Optional=DefaultIsUndefined] float x,
- in [Optional=DefaultIsUndefined] float y,
- in [Optional=DefaultIsUndefined] float width,
- in [Optional=DefaultIsUndefined] float height,
- in [Optional] float lineWidth);
-
- void drawImage(in HTMLImageElement? image, in float x, in float y)
- raises (DOMException);
- void drawImage(in HTMLImageElement? image, in float x, in float y, in float width, in float height)
- raises (DOMException);
- void drawImage(in HTMLImageElement? image, in float sx, in float sy, in float sw, in float sh, in float dx, in float dy, in float dw, in float dh)
- raises (DOMException);
- void drawImage(in HTMLCanvasElement? canvas, in float x, in float y)
- raises (DOMException);
- void drawImage(in HTMLCanvasElement? canvas, in float x, in float y, in float width, in float height)
- raises (DOMException);
- void drawImage(in HTMLCanvasElement? canvas, in float sx, in float sy, in float sw, in float sh, in float dx, in float dy, in float dw, in float dh)
- raises (DOMException);
+ void clearShadow();
+
+ void fillText(in DOMString text, in float x, in float y, in [Optional] float maxWidth);
+ void strokeText(in DOMString text, in float x, in float y, in [Optional] float maxWidth);
+
+ void setStrokeColor(in DOMString color, in [Optional] float alpha);
+ void setStrokeColor(in float grayLevel, in [Optional] float alpha);
+ void setStrokeColor(in float r, in float g, in float b, in float a);
+ void setStrokeColor(in float c, in float m, in float y, in float k, in float a);
+
+ void setFillColor(in DOMString color, in [Optional] float alpha);
+ void setFillColor(in float grayLevel, in [Optional] float alpha);
+ void setFillColor(in float r, in float g, in float b, in float a);
+ void setFillColor(in float c, in float m, in float y, in float k, in float a);
+
+ void strokeRect(in [Optional=DefaultIsUndefined] float x,
+ in [Optional=DefaultIsUndefined] float y,
+ in [Optional=DefaultIsUndefined] float width,
+ in [Optional=DefaultIsUndefined] float height,
+ in [Optional] float lineWidth);
+
+ void drawImage(in HTMLImageElement? image, in float x, in float y)
+ raises (DOMException);
+ void drawImage(in HTMLImageElement? image, in float x, in float y, in float width, in float height)
+ raises (DOMException);
+ void drawImage(in HTMLImageElement? image, in float sx, in float sy, in float sw, in float sh, in float dx, in float dy, in float dw, in float dh)
+ raises (DOMException);
+ void drawImage(in HTMLCanvasElement? canvas, in float x, in float y)
+ raises (DOMException);
+ void drawImage(in HTMLCanvasElement? canvas, in float x, in float y, in float width, in float height)
+ raises (DOMException);
+ void drawImage(in HTMLCanvasElement? canvas, in float sx, in float sy, in float sw, in float sh, in float dx, in float dy, in float dw, in float dh)
+ raises (DOMException);
#if defined(ENABLE_VIDEO) && ENABLE_VIDEO
- void drawImage(in HTMLVideoElement? video, in float x, in float y)
- raises (DOMException);
- void drawImage(in HTMLVideoElement? video, in float x, in float y, in float width, in float height)
- raises (DOMException);
- void drawImage(in HTMLVideoElement? video, in float sx, in float sy, in float sw, in float sh, in float dx, in float dy, in float dw, in float dh)
- raises (DOMException);
+ void drawImage(in HTMLVideoElement? video, in float x, in float y)
+ raises (DOMException);
+ void drawImage(in HTMLVideoElement? video, in float x, in float y, in float width, in float height)
+ raises (DOMException);
+ void drawImage(in HTMLVideoElement? video, in float sx, in float sy, in float sw, in float sh, in float dx, in float dy, in float dw, in float dh)
+ raises (DOMException);
#endif
- void drawImageFromRect(in HTMLImageElement image,
- in [Optional] float sx, in [Optional] float sy, in [Optional] float sw, in [Optional] float sh,
- in [Optional] float dx, in [Optional] float dy, in [Optional] float dw, in [Optional] float dh,
- in [Optional] DOMString compositeOperation);
-
- void setShadow(in float width, in float height, in float blur, in [Optional, StrictTypeChecking] DOMString color, in [Optional] float alpha);
- void setShadow(in float width, in float height, in float blur, in float grayLevel, in [Optional] float alpha);
- void setShadow(in float width, in float height, in float blur, in float r, in float g, in float b, in float a);
- void setShadow(in float width, in float height, in float blur, in float c, in float m, in float y, in float k, in float a);
-
- void putImageData(in ImageData? imagedata, in float dx, in float dy)
- raises(DOMException);
- void putImageData(in ImageData? imagedata, in float dx, in float dy, in float dirtyX, in float dirtyY, in float dirtyWidth, in float dirtyHeight)
- raises(DOMException);
-
- void webkitPutImageDataHD(in ImageData? imagedata, in float dx, in float dy)
- raises(DOMException);
- void webkitPutImageDataHD(in ImageData? imagedata, in float dx, in float dy, in float dirtyX, in float dirtyY, in float dirtyWidth, in float dirtyHeight)
- raises(DOMException);
-
- CanvasPattern createPattern(in HTMLCanvasElement? canvas, in [TreatNullAs=NullString] DOMString repetitionType)
- raises (DOMException);
- CanvasPattern createPattern(in HTMLImageElement? image, in [TreatNullAs=NullString] DOMString repetitionType)
- raises (DOMException);
- ImageData createImageData(in ImageData? imagedata)
- raises (DOMException);
- ImageData createImageData(in float sw, in float sh)
- raises (DOMException);
-
- [Custom] attribute custom strokeStyle;
- [Custom] attribute custom fillStyle;
-
- // pixel manipulation
- ImageData getImageData(in [Optional=DefaultIsUndefined] float sx, in [Optional=DefaultIsUndefined] float sy,
- in [Optional=DefaultIsUndefined] float sw, in [Optional=DefaultIsUndefined] float sh)
- raises(DOMException);
-
- ImageData webkitGetImageDataHD(in [Optional=DefaultIsUndefined] float sx, in [Optional=DefaultIsUndefined] float sy,
- in [Optional=DefaultIsUndefined] float sw, in [Optional=DefaultIsUndefined] float sh)
- raises(DOMException);
-
- readonly attribute float webkitBackingStorePixelRatio;
-
- attribute boolean webkitImageSmoothingEnabled;
-};
+ void drawImageFromRect(in HTMLImageElement image,
+ in [Optional] float sx, in [Optional] float sy, in [Optional] float sw, in [Optional] float sh,
+ in [Optional] float dx, in [Optional] float dy, in [Optional] float dw, in [Optional] float dh,
+ in [Optional] DOMString compositeOperation);
+
+ void setShadow(in float width, in float height, in float blur, in [Optional] DOMString color, in [Optional] float alpha);
+ void setShadow(in float width, in float height, in float blur, in float grayLevel, in [Optional] float alpha);
+ void setShadow(in float width, in float height, in float blur, in float r, in float g, in float b, in float a);
+ void setShadow(in float width, in float height, in float blur, in float c, in float m, in float y, in float k, in float a);
+
+ void putImageData(in ImageData? imagedata, in float dx, in float dy)
+ raises(DOMException);
+ void putImageData(in ImageData? imagedata, in float dx, in float dy, in float dirtyX, in float dirtyY, in float dirtyWidth, in float dirtyHeight)
+ raises(DOMException);
+
+ void webkitPutImageDataHD(in ImageData? imagedata, in float dx, in float dy)
+ raises(DOMException);
+ void webkitPutImageDataHD(in ImageData? imagedata, in float dx, in float dy, in float dirtyX, in float dirtyY, in float dirtyWidth, in float dirtyHeight)
+ raises(DOMException);
+
+ CanvasPattern createPattern(in HTMLCanvasElement? canvas, in [TreatNullAs=NullString] DOMString repetitionType)
+ raises (DOMException);
+ CanvasPattern createPattern(in HTMLImageElement? image, in [TreatNullAs=NullString] DOMString repetitionType)
+ raises (DOMException);
+ ImageData createImageData(in ImageData? imagedata)
+ raises (DOMException);
+ ImageData createImageData(in float sw, in float sh)
+ raises (DOMException);
+
+ attribute [Custom] custom strokeStyle;
+ attribute [Custom] custom fillStyle;
+
+ // pixel manipulation
+ ImageData getImageData(in [Optional=DefaultIsUndefined] float sx, in [Optional=DefaultIsUndefined] float sy,
+ in [Optional=DefaultIsUndefined] float sw, in [Optional=DefaultIsUndefined] float sh)
+ raises(DOMException);
+
+ ImageData webkitGetImageDataHD(in [Optional=DefaultIsUndefined] float sx, in [Optional=DefaultIsUndefined] float sy,
+ in [Optional=DefaultIsUndefined] float sw, in [Optional=DefaultIsUndefined] float sh)
+ raises(DOMException);
+
+ readonly attribute float webkitBackingStorePixelRatio;
+
+ attribute boolean webkitImageSmoothingEnabled;
+ };
+
+}
diff --git a/Source/WebCore/html/canvas/DataView.idl b/Source/WebCore/html/canvas/DataView.idl
index e4ad072ab..3f4dcdf4d 100755
--- a/Source/WebCore/html/canvas/DataView.idl
+++ b/Source/WebCore/html/canvas/DataView.idl
@@ -23,56 +23,59 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- CustomConstructor,
- ConstructorParameters=3,
- CustomToJSObject,
- JSNoStaticTables
-] interface DataView : ArrayBufferView {
- // All these methods raise an exception if they would read or write beyond the end of the view.
+module html {
- // We have to use custom code because our code generator does not support int8_t type.
- // int8_t getInt8(in unsigned long byteOffset);
- // uint8_t getUint8(in unsigned long byteOffset);
- [Custom] DOMObject getInt8()
- raises (DOMException);
- [Custom] DOMObject getUint8()
- raises (DOMException);
+ interface [
+ CustomConstructor,
+ ConstructorParameters=3,
+ CustomToJSObject,
+ JSNoStaticTables
+ ] DataView : ArrayBufferView {
+ // All these methods raise an exception if they would read or write beyond the end of the view.
- [StrictTypeChecking] short getInt16(in unsigned long byteOffset, in [Optional] boolean littleEndian)
- raises (DOMException);
- [StrictTypeChecking] unsigned short getUint16(in unsigned long byteOffset, in [Optional] boolean littleEndian)
- raises (DOMException);
- [StrictTypeChecking] long getInt32(in unsigned long byteOffset, in [Optional] boolean littleEndian)
- raises (DOMException);
- [StrictTypeChecking] unsigned long getUint32(in unsigned long byteOffset, in [Optional] boolean littleEndian)
- raises (DOMException);
+ // We have to use custom code because our code generator does not support int8_t type.
+ // int8_t getInt8(in unsigned long byteOffset);
+ // uint8_t getUint8(in unsigned long byteOffset);
+ [Custom] DOMObject getInt8()
+ raises (DOMException);
+ [Custom] DOMObject getUint8()
+ raises (DOMException);
- // Use custom code to handle NaN case for JSC.
- [JSCustom, StrictTypeChecking] float getFloat32(in unsigned long byteOffset, in [Optional] boolean littleEndian)
- raises (DOMException);
- [JSCustom, StrictTypeChecking] double getFloat64(in unsigned long byteOffset, in [Optional] boolean littleEndian)
- raises (DOMException);
+ [StrictTypeChecking] short getInt16(in unsigned long byteOffset, in [Optional] boolean littleEndian)
+ raises (DOMException);
+ [StrictTypeChecking] unsigned short getUint16(in unsigned long byteOffset, in [Optional] boolean littleEndian)
+ raises (DOMException);
+ [StrictTypeChecking] long getInt32(in unsigned long byteOffset, in [Optional] boolean littleEndian)
+ raises (DOMException);
+ [StrictTypeChecking] unsigned long getUint32(in unsigned long byteOffset, in [Optional] boolean littleEndian)
+ raises (DOMException);
- // We have to use custom code because our code generator does not support uint8_t type.
- // void setInt8(in unsigned long byteOffset, in int8_t value);
- // void setUint8(in unsigned long byteOffset, in uint8_t value);
- [Custom] void setInt8()
- raises (DOMException);
- [Custom] void setUint8()
- raises (DOMException);
+ // Use custom code to handle NaN case for JSC.
+ [JSCustom, StrictTypeChecking] float getFloat32(in unsigned long byteOffset, in [Optional] boolean littleEndian)
+ raises (DOMException);
+ [JSCustom, StrictTypeChecking] double getFloat64(in unsigned long byteOffset, in [Optional] boolean littleEndian)
+ raises (DOMException);
- [StrictTypeChecking] void setInt16(in unsigned long byteOffset, in short value, in [Optional] boolean littleEndian)
- raises (DOMException);
- [StrictTypeChecking] void setUint16(in unsigned long byteOffset, in unsigned short value, in [Optional] boolean littleEndian)
- raises (DOMException);
- [StrictTypeChecking] void setInt32(in unsigned long byteOffset, in long value, in [Optional] boolean littleEndian)
- raises (DOMException);
- [StrictTypeChecking] void setUint32(in unsigned long byteOffset, in unsigned long value, in [Optional] boolean littleEndian)
- raises (DOMException);
- [StrictTypeChecking] void setFloat32(in unsigned long byteOffset, in float value, in [Optional] boolean littleEndian)
- raises (DOMException);
- [StrictTypeChecking] void setFloat64(in unsigned long byteOffset, in double value, in [Optional] boolean littleEndian)
- raises (DOMException);
-};
+ // We have to use custom code because our code generator does not support uint8_t type.
+ // void setInt8(in unsigned long byteOffset, in int8_t value);
+ // void setUint8(in unsigned long byteOffset, in uint8_t value);
+ [Custom] void setInt8()
+ raises (DOMException);
+ [Custom] void setUint8()
+ raises (DOMException);
+ [StrictTypeChecking] void setInt16(in unsigned long byteOffset, in short value, in [Optional] boolean littleEndian)
+ raises (DOMException);
+ [StrictTypeChecking] void setUint16(in unsigned long byteOffset, in unsigned short value, in [Optional] boolean littleEndian)
+ raises (DOMException);
+ [StrictTypeChecking] void setInt32(in unsigned long byteOffset, in long value, in [Optional] boolean littleEndian)
+ raises (DOMException);
+ [StrictTypeChecking] void setUint32(in unsigned long byteOffset, in unsigned long value, in [Optional] boolean littleEndian)
+ raises (DOMException);
+ [StrictTypeChecking] void setFloat32(in unsigned long byteOffset, in float value, in [Optional] boolean littleEndian)
+ raises (DOMException);
+ [StrictTypeChecking] void setFloat64(in unsigned long byteOffset, in double value, in [Optional] boolean littleEndian)
+ raises (DOMException);
+ };
+
+}
diff --git a/Source/WebCore/html/canvas/EXTTextureFilterAnisotropic.idl b/Source/WebCore/html/canvas/EXTTextureFilterAnisotropic.idl
index 07668e737..568aa9a3d 100644
--- a/Source/WebCore/html/canvas/EXTTextureFilterAnisotropic.idl
+++ b/Source/WebCore/html/canvas/EXTTextureFilterAnisotropic.idl
@@ -23,12 +23,14 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- Conditional=WEBGL,
- JSGenerateIsReachable=ImplContext,
- OmitConstructor,
- DoNotCheckConstants
-] interface EXTTextureFilterAnisotropic {
- const unsigned int TEXTURE_MAX_ANISOTROPY_EXT = 0x84FE;
- const unsigned int MAX_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FF;
-};
+module html {
+ interface [
+ Conditional=WEBGL,
+ JSGenerateIsReachable=ImplContext,
+ OmitConstructor,
+ DoNotCheckConstants
+ ] EXTTextureFilterAnisotropic {
+ const unsigned int TEXTURE_MAX_ANISOTROPY_EXT = 0x84FE;
+ const unsigned int MAX_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FF;
+ };
+}
diff --git a/Source/WebCore/html/canvas/Float32Array.idl b/Source/WebCore/html/canvas/Float32Array.idl
index e37f42d43..b445eb40d 100644
--- a/Source/WebCore/html/canvas/Float32Array.idl
+++ b/Source/WebCore/html/canvas/Float32Array.idl
@@ -24,24 +24,26 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- ConstructorTemplate=TypedArray,
- ConstructorParameters=1,
- NumericIndexedGetter,
- CustomIndexedSetter,
- JSGenerateToNativeObject,
- JSNoStaticTables,
- CustomToJSObject,
- DoNotCheckConstants,
- TypedArray=float
-] interface Float32Array : ArrayBufferView {
- const unsigned long BYTES_PER_ELEMENT = 4;
+module html {
+ interface [
+ ConstructorTemplate=TypedArray,
+ ConstructorParameters=1,
+ NumericIndexedGetter,
+ CustomIndexedSetter,
+ JSGenerateToNativeObject,
+ JSNoStaticTables,
+ CustomToJSObject,
+ DoNotCheckConstants,
+ TypedArray=float
+ ] Float32Array : ArrayBufferView {
+ const unsigned long BYTES_PER_ELEMENT = 4;
- readonly attribute unsigned long length;
- Float32Array subarray(in [Optional=DefaultIsUndefined] long start,
- in [Optional] long end);
+ readonly attribute unsigned long length;
+ Float32Array subarray(in [Optional=DefaultIsUndefined] long start,
+ in [Optional] long end);
- // void set(in Float32Array array, [Optional] in unsigned long offset);
- // void set(in sequence<long> array, [Optional] in unsigned long offset);
- void set();
-};
+ // void set(in Float32Array array, [Optional] in unsigned long offset);
+ // void set(in sequence<long> array, [Optional] in unsigned long offset);
+ void set();
+ };
+}
diff --git a/Source/WebCore/html/canvas/Float64Array.idl b/Source/WebCore/html/canvas/Float64Array.idl
index 0b938b53b..da4b483a1 100644
--- a/Source/WebCore/html/canvas/Float64Array.idl
+++ b/Source/WebCore/html/canvas/Float64Array.idl
@@ -24,24 +24,26 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- ConstructorTemplate=TypedArray,
- ConstructorParameters=1,
- NumericIndexedGetter,
- CustomIndexedSetter,
- JSGenerateToNativeObject,
- JSNoStaticTables,
- CustomToJSObject,
- DoNotCheckConstants,
- TypedArray=double
-] interface Float64Array : ArrayBufferView {
- const unsigned long BYTES_PER_ELEMENT = 8;
+module html {
+ interface [
+ ConstructorTemplate=TypedArray,
+ ConstructorParameters=1,
+ NumericIndexedGetter,
+ CustomIndexedSetter,
+ JSGenerateToNativeObject,
+ JSNoStaticTables,
+ CustomToJSObject,
+ DoNotCheckConstants,
+ TypedArray=double
+ ] Float64Array : ArrayBufferView {
+ const unsigned long BYTES_PER_ELEMENT = 8;
- readonly attribute unsigned long length;
- Float64Array subarray(in [Optional=DefaultIsUndefined] long start,
- in [Optional] long end);
+ readonly attribute unsigned long length;
+ Float64Array subarray(in [Optional=DefaultIsUndefined] long start,
+ in [Optional] long end);
- // void set(in Float64Array array, [Optional] in unsigned long offset);
- // void set(in sequence<long> array, [Optional] in unsigned long offset);
- void set();
-};
+ // void set(in Float64Array array, [Optional] in unsigned long offset);
+ // void set(in sequence<long> array, [Optional] in unsigned long offset);
+ void set();
+ };
+}
diff --git a/Source/WebCore/html/canvas/Int16Array.idl b/Source/WebCore/html/canvas/Int16Array.idl
index 07789d37d..9f98bea93 100644
--- a/Source/WebCore/html/canvas/Int16Array.idl
+++ b/Source/WebCore/html/canvas/Int16Array.idl
@@ -23,24 +23,26 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- ConstructorTemplate=TypedArray,
- ConstructorParameters=1,
- NumericIndexedGetter,
- CustomIndexedSetter,
- JSGenerateToNativeObject,
- JSNoStaticTables,
- CustomToJSObject,
- DoNotCheckConstants,
- TypedArray=short
-] interface Int16Array : ArrayBufferView {
- const unsigned long BYTES_PER_ELEMENT = 2;
+module html {
+ interface [
+ ConstructorTemplate=TypedArray,
+ ConstructorParameters=1,
+ NumericIndexedGetter,
+ CustomIndexedSetter,
+ JSGenerateToNativeObject,
+ JSNoStaticTables,
+ CustomToJSObject,
+ DoNotCheckConstants,
+ TypedArray=short
+ ] Int16Array : ArrayBufferView {
+ const unsigned long BYTES_PER_ELEMENT = 2;
- readonly attribute unsigned long length;
- Int16Array subarray(in [Optional=DefaultIsUndefined] long start,
- in [Optional] long end);
+ readonly attribute unsigned long length;
+ Int16Array subarray(in [Optional=DefaultIsUndefined] long start,
+ in [Optional] long end);
- // void set(in Int16Array array, [Optional] in unsigned long offset);
- // void set(in sequence<long> array, [Optional] in unsigned long offset);
- void set();
-};
+ // void set(in Int16Array array, [Optional] in unsigned long offset);
+ // void set(in sequence<long> array, [Optional] in unsigned long offset);
+ void set();
+ };
+}
diff --git a/Source/WebCore/html/canvas/Int32Array.idl b/Source/WebCore/html/canvas/Int32Array.idl
index 6ef836aa3..87cd7587c 100644
--- a/Source/WebCore/html/canvas/Int32Array.idl
+++ b/Source/WebCore/html/canvas/Int32Array.idl
@@ -24,24 +24,26 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- ConstructorTemplate=TypedArray,
- ConstructorParameters=1,
- NumericIndexedGetter,
- CustomIndexedSetter,
- JSGenerateToNativeObject,
- JSNoStaticTables,
- CustomToJSObject,
- DoNotCheckConstants,
- TypedArray=int
-] interface Int32Array : ArrayBufferView {
- const unsigned long BYTES_PER_ELEMENT = 4;
+module html {
+ interface [
+ ConstructorTemplate=TypedArray,
+ ConstructorParameters=1,
+ NumericIndexedGetter,
+ CustomIndexedSetter,
+ JSGenerateToNativeObject,
+ JSNoStaticTables,
+ CustomToJSObject,
+ DoNotCheckConstants,
+ TypedArray=int
+ ] Int32Array : ArrayBufferView {
+ const unsigned long BYTES_PER_ELEMENT = 4;
- readonly attribute unsigned long length;
- Int32Array subarray(in [Optional=DefaultIsUndefined] long start,
- in [Optional] long end);
+ readonly attribute unsigned long length;
+ Int32Array subarray(in [Optional=DefaultIsUndefined] long start,
+ in [Optional] long end);
- // void set(in Int32Array array, [Optional] in unsigned long offset);
- // void set(in sequence<long> array, [Optional] in unsigned long offset);
- void set();
-};
+ // void set(in Int32Array array, [Optional] in unsigned long offset);
+ // void set(in sequence<long> array, [Optional] in unsigned long offset);
+ void set();
+ };
+}
diff --git a/Source/WebCore/html/canvas/Int8Array.idl b/Source/WebCore/html/canvas/Int8Array.idl
index 8b38ca3b8..10cf12003 100644
--- a/Source/WebCore/html/canvas/Int8Array.idl
+++ b/Source/WebCore/html/canvas/Int8Array.idl
@@ -24,24 +24,26 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- ConstructorTemplate=TypedArray,
- ConstructorParameters=1,
- NumericIndexedGetter,
- CustomIndexedSetter,
- JSGenerateToNativeObject,
- JSNoStaticTables,
- CustomToJSObject,
- DoNotCheckConstants,
- TypedArray=signed char
-] interface Int8Array : ArrayBufferView {
- const unsigned long BYTES_PER_ELEMENT = 1;
+module html {
+ interface [
+ ConstructorTemplate=TypedArray,
+ ConstructorParameters=1,
+ NumericIndexedGetter,
+ CustomIndexedSetter,
+ JSGenerateToNativeObject,
+ JSNoStaticTables,
+ CustomToJSObject,
+ DoNotCheckConstants,
+ TypedArray=signed char
+ ] Int8Array : ArrayBufferView {
+ const unsigned long BYTES_PER_ELEMENT = 1;
- readonly attribute unsigned long length;
- Int8Array subarray(in [Optional=DefaultIsUndefined] long start,
- in [Optional] long end);
+ readonly attribute unsigned long length;
+ Int8Array subarray(in [Optional=DefaultIsUndefined] long start,
+ in [Optional] long end);
- // void set(in Int8Array array, [Optional] in unsigned long offset);
- // void set(in sequence<long> array, [Optional] in unsigned long offset);
- void set();
-};
+ // void set(in Int8Array array, [Optional] in unsigned long offset);
+ // void set(in sequence<long> array, [Optional] in unsigned long offset);
+ void set();
+ };
+}
diff --git a/Source/WebCore/html/canvas/OESStandardDerivatives.idl b/Source/WebCore/html/canvas/OESStandardDerivatives.idl
index c4eb48da4..93f0a01d8 100644
--- a/Source/WebCore/html/canvas/OESStandardDerivatives.idl
+++ b/Source/WebCore/html/canvas/OESStandardDerivatives.idl
@@ -23,11 +23,13 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- Conditional=WEBGL,
- JSGenerateIsReachable=ImplContext,
- OmitConstructor,
- DoNotCheckConstants
-] interface OESStandardDerivatives {
- const unsigned int FRAGMENT_SHADER_DERIVATIVE_HINT_OES = 0x8B8B;
-};
+module html {
+ interface [
+ Conditional=WEBGL,
+ JSGenerateIsReachable=ImplContext,
+ OmitConstructor,
+ DoNotCheckConstants
+ ] OESStandardDerivatives {
+ const unsigned int FRAGMENT_SHADER_DERIVATIVE_HINT_OES = 0x8B8B;
+ };
+}
diff --git a/Source/WebCore/html/canvas/OESTextureFloat.idl b/Source/WebCore/html/canvas/OESTextureFloat.idl
index 2d1b3c5f7..6537f4707 100644
--- a/Source/WebCore/html/canvas/OESTextureFloat.idl
+++ b/Source/WebCore/html/canvas/OESTextureFloat.idl
@@ -23,9 +23,11 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- Conditional=WEBGL,
- JSGenerateIsReachable=ImplContext,
- OmitConstructor
-] interface OESTextureFloat {
-};
+module html {
+ interface [
+ Conditional=WEBGL,
+ JSGenerateIsReachable=ImplContext,
+ OmitConstructor
+ ] OESTextureFloat {
+ };
+}
diff --git a/Source/WebCore/html/canvas/OESVertexArrayObject.idl b/Source/WebCore/html/canvas/OESVertexArrayObject.idl
index f2339067d..c3d366676 100644
--- a/Source/WebCore/html/canvas/OESVertexArrayObject.idl
+++ b/Source/WebCore/html/canvas/OESVertexArrayObject.idl
@@ -23,16 +23,18 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- Conditional=WEBGL,
- JSGenerateIsReachable=ImplContext,
- OmitConstructor,
- DoNotCheckConstants
-] interface OESVertexArrayObject {
- const unsigned int VERTEX_ARRAY_BINDING_OES = 0x85B5;
-
- [StrictTypeChecking] WebGLVertexArrayObjectOES createVertexArrayOES();
- [StrictTypeChecking] void deleteVertexArrayOES(in [Optional=DefaultIsUndefined] WebGLVertexArrayObjectOES arrayObject);
- [StrictTypeChecking] boolean isVertexArrayOES(in [Optional=DefaultIsUndefined] WebGLVertexArrayObjectOES arrayObject);
- [StrictTypeChecking] void bindVertexArrayOES(in [Optional=DefaultIsUndefined] WebGLVertexArrayObjectOES arrayObject) raises(DOMException);
-};
+module html {
+ interface [
+ Conditional=WEBGL,
+ JSGenerateIsReachable=ImplContext,
+ OmitConstructor,
+ DoNotCheckConstants
+ ] OESVertexArrayObject {
+ const unsigned int VERTEX_ARRAY_BINDING_OES = 0x85B5;
+
+ [StrictTypeChecking] WebGLVertexArrayObjectOES createVertexArrayOES();
+ [StrictTypeChecking] void deleteVertexArrayOES(in [Optional=DefaultIsUndefined] WebGLVertexArrayObjectOES arrayObject);
+ [StrictTypeChecking] boolean isVertexArrayOES(in [Optional=DefaultIsUndefined] WebGLVertexArrayObjectOES arrayObject);
+ [StrictTypeChecking] void bindVertexArrayOES(in [Optional=DefaultIsUndefined] WebGLVertexArrayObjectOES arrayObject) raises(DOMException);
+ };
+}
diff --git a/Source/WebCore/html/canvas/Uint16Array.idl b/Source/WebCore/html/canvas/Uint16Array.idl
index 4e0802258..72998a35d 100644
--- a/Source/WebCore/html/canvas/Uint16Array.idl
+++ b/Source/WebCore/html/canvas/Uint16Array.idl
@@ -24,23 +24,25 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- ConstructorTemplate=TypedArray,
- ConstructorParameters=1,
- NumericIndexedGetter,
- CustomIndexedSetter,
- JSGenerateToNativeObject,
- JSNoStaticTables,
- CustomToJSObject,
- DoNotCheckConstants,
- TypedArray=unsigned short
-] interface Uint16Array : ArrayBufferView {
- const unsigned long BYTES_PER_ELEMENT = 2;
+module html {
+ interface [
+ ConstructorTemplate=TypedArray,
+ ConstructorParameters=1,
+ NumericIndexedGetter,
+ CustomIndexedSetter,
+ JSGenerateToNativeObject,
+ JSNoStaticTables,
+ CustomToJSObject,
+ DoNotCheckConstants,
+ TypedArray=unsigned short
+ ] Uint16Array : ArrayBufferView {
+ const unsigned long BYTES_PER_ELEMENT = 2;
- readonly attribute unsigned long length;
- Uint16Array subarray(in [Optional=DefaultIsUndefined] long start, in [Optional] long end);
+ readonly attribute unsigned long length;
+ Uint16Array subarray(in [Optional=DefaultIsUndefined] long start, in [Optional] long end);
- // void set(in Uint16Array array, [Optional] in unsigned long offset);
- // void set(in sequence<long> array, [Optional] in unsigned long offset);
- void set();
-};
+ // void set(in Uint16Array array, [Optional] in unsigned long offset);
+ // void set(in sequence<long> array, [Optional] in unsigned long offset);
+ void set();
+ };
+}
diff --git a/Source/WebCore/html/canvas/Uint32Array.idl b/Source/WebCore/html/canvas/Uint32Array.idl
index 8d34293f9..65c44bef9 100644
--- a/Source/WebCore/html/canvas/Uint32Array.idl
+++ b/Source/WebCore/html/canvas/Uint32Array.idl
@@ -24,23 +24,25 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- ConstructorTemplate=TypedArray,
- ConstructorParameters=1,
- NumericIndexedGetter,
- CustomIndexedSetter,
- JSGenerateToNativeObject,
- JSNoStaticTables,
- CustomToJSObject,
- DoNotCheckConstants,
- TypedArray=unsigned int
-] interface Uint32Array : ArrayBufferView {
- const unsigned long BYTES_PER_ELEMENT = 4;
+module html {
+ interface [
+ ConstructorTemplate=TypedArray,
+ ConstructorParameters=1,
+ NumericIndexedGetter,
+ CustomIndexedSetter,
+ JSGenerateToNativeObject,
+ JSNoStaticTables,
+ CustomToJSObject,
+ DoNotCheckConstants,
+ TypedArray=unsigned int
+ ] Uint32Array : ArrayBufferView {
+ const unsigned long BYTES_PER_ELEMENT = 4;
- readonly attribute unsigned long length;
- Uint32Array subarray(in [Optional=DefaultIsUndefined] long start, in [Optional] long end);
+ readonly attribute unsigned long length;
+ Uint32Array subarray(in [Optional=DefaultIsUndefined] long start, in [Optional] long end);
- // void set(in Uint32Array array, [Optional] in unsigned long offset);
- // void set(in sequence<long> array, [Optional] in unsigned long offset);
- void set();
-};
+ // void set(in Uint32Array array, [Optional] in unsigned long offset);
+ // void set(in sequence<long> array, [Optional] in unsigned long offset);
+ void set();
+ };
+}
diff --git a/Source/WebCore/html/canvas/Uint8Array.idl b/Source/WebCore/html/canvas/Uint8Array.idl
index 65d2312cf..f6ef9377d 100644
--- a/Source/WebCore/html/canvas/Uint8Array.idl
+++ b/Source/WebCore/html/canvas/Uint8Array.idl
@@ -24,23 +24,25 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- ConstructorTemplate=TypedArray,
- ConstructorParameters=1,
- NumericIndexedGetter,
- CustomIndexedSetter,
- JSGenerateToNativeObject,
- JSNoStaticTables,
- CustomToJSObject,
- DoNotCheckConstants,
- TypedArray=unsigned char
-] interface Uint8Array : ArrayBufferView {
- const unsigned long BYTES_PER_ELEMENT = 1;
+module html {
+ interface [
+ ConstructorTemplate=TypedArray,
+ ConstructorParameters=1,
+ NumericIndexedGetter,
+ CustomIndexedSetter,
+ JSGenerateToNativeObject,
+ JSNoStaticTables,
+ CustomToJSObject,
+ DoNotCheckConstants,
+ TypedArray=unsigned char
+ ] Uint8Array : ArrayBufferView {
+ const unsigned long BYTES_PER_ELEMENT = 1;
- readonly attribute unsigned long length;
- Uint8Array subarray(in [Optional=DefaultIsUndefined] long start, in [Optional] long end);
+ readonly attribute unsigned long length;
+ Uint8Array subarray(in [Optional=DefaultIsUndefined] long start, in [Optional] long end);
- // void set(in Uint8Array array, [Optional] in unsigned long offset);
- // void set(in sequence<long> array, [Optional] in unsigned long offset);
- void set();
-};
+ // void set(in Uint8Array array, [Optional] in unsigned long offset);
+ // void set(in sequence<long> array, [Optional] in unsigned long offset);
+ void set();
+ };
+}
diff --git a/Source/WebCore/html/canvas/Uint8ClampedArray.idl b/Source/WebCore/html/canvas/Uint8ClampedArray.idl
index efcc98a38..c646e57e9 100644
--- a/Source/WebCore/html/canvas/Uint8ClampedArray.idl
+++ b/Source/WebCore/html/canvas/Uint8ClampedArray.idl
@@ -24,24 +24,26 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- ConstructorTemplate=TypedArray,
- ConstructorParameters=1,
- NumericIndexedGetter,
- CustomIndexedSetter,
- JSGenerateToNativeObject,
- JSNoStaticTables,
- CustomToJSObject,
- DoNotCheckConstants,
- TypedArray=unsigned char
-] interface Uint8ClampedArray : Uint8Array {
- const unsigned long BYTES_PER_ELEMENT = 1;
+module html {
+ interface [
+ ConstructorTemplate=TypedArray,
+ ConstructorParameters=1,
+ NumericIndexedGetter,
+ CustomIndexedSetter,
+ JSGenerateToNativeObject,
+ JSNoStaticTables,
+ CustomToJSObject,
+ DoNotCheckConstants,
+ TypedArray=unsigned char
+ ] Uint8ClampedArray : Uint8Array {
+ const unsigned long BYTES_PER_ELEMENT = 1;
- readonly attribute unsigned long length;
- Uint8ClampedArray subarray(in [Optional=DefaultIsUndefined] long start, in [Optional] long end);
+ readonly attribute unsigned long length;
+ Uint8ClampedArray subarray(in [Optional=DefaultIsUndefined] long start, in [Optional] long end);
- // FIXME: Missing other setters!
- // void set(in Uint8ClampedArray array, [Optional] in unsigned long offset);
- // void set(in sequence<long> array, [Optional] in unsigned long offset);
- void set();
-};
+ // FIXME: Missing other setters!
+ // void set(in Uint8ClampedArray array, [Optional] in unsigned long offset);
+ // void set(in sequence<long> array, [Optional] in unsigned long offset);
+ void set();
+ };
+}
diff --git a/Source/WebCore/html/canvas/WebGLActiveInfo.idl b/Source/WebCore/html/canvas/WebGLActiveInfo.idl
index 47789bd50..e9fef93b3 100644
--- a/Source/WebCore/html/canvas/WebGLActiveInfo.idl
+++ b/Source/WebCore/html/canvas/WebGLActiveInfo.idl
@@ -23,11 +23,14 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- Conditional=WEBGL,
-] interface WebGLActiveInfo {
- readonly attribute long size;
- readonly attribute unsigned long type;
- readonly attribute DOMString name;
-};
+module html {
+ interface [
+ Conditional=WEBGL,
+ ] WebGLActiveInfo {
+ readonly attribute long size;
+ readonly attribute unsigned long type;
+ readonly attribute DOMString name;
+ };
+
+}
diff --git a/Source/WebCore/html/canvas/WebGLBuffer.idl b/Source/WebCore/html/canvas/WebGLBuffer.idl
index f43cd6353..312b00911 100644
--- a/Source/WebCore/html/canvas/WebGLBuffer.idl
+++ b/Source/WebCore/html/canvas/WebGLBuffer.idl
@@ -23,7 +23,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- Conditional=WEBGL,
-] interface WebGLBuffer {
-};
+module html {
+ interface [
+ Conditional=WEBGL,
+ ] WebGLBuffer {
+ };
+}
diff --git a/Source/WebCore/html/canvas/WebGLCompressedTextureS3TC.idl b/Source/WebCore/html/canvas/WebGLCompressedTextureS3TC.idl
index 6642d28a5..7fde5bba9 100644
--- a/Source/WebCore/html/canvas/WebGLCompressedTextureS3TC.idl
+++ b/Source/WebCore/html/canvas/WebGLCompressedTextureS3TC.idl
@@ -23,15 +23,17 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- Conditional=WEBGL,
- JSGenerateIsReachable=ImplContext,
- OmitConstructor,
- DoNotCheckConstants
-] interface WebGLCompressedTextureS3TC {
- /* Compressed Texture Formats */
- const unsigned int COMPRESSED_RGB_S3TC_DXT1_EXT = 0x83F0;
- const unsigned int COMPRESSED_RGBA_S3TC_DXT1_EXT = 0x83F1;
- const unsigned int COMPRESSED_RGBA_S3TC_DXT3_EXT = 0x83F2;
- const unsigned int COMPRESSED_RGBA_S3TC_DXT5_EXT = 0x83F3;
-};
+module html {
+ interface [
+ Conditional=WEBGL,
+ JSGenerateIsReachable=ImplContext,
+ OmitConstructor,
+ DoNotCheckConstants
+ ] WebGLCompressedTextureS3TC {
+ /* Compressed Texture Formats */
+ const unsigned int COMPRESSED_RGB_S3TC_DXT1_EXT = 0x83F0;
+ const unsigned int COMPRESSED_RGBA_S3TC_DXT1_EXT = 0x83F1;
+ const unsigned int COMPRESSED_RGBA_S3TC_DXT3_EXT = 0x83F2;
+ const unsigned int COMPRESSED_RGBA_S3TC_DXT5_EXT = 0x83F3;
+ };
+}
diff --git a/Source/WebCore/html/canvas/WebGLContextAttributes.idl b/Source/WebCore/html/canvas/WebGLContextAttributes.idl
index 52dd041d8..56da1c61e 100644
--- a/Source/WebCore/html/canvas/WebGLContextAttributes.idl
+++ b/Source/WebCore/html/canvas/WebGLContextAttributes.idl
@@ -24,14 +24,16 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- Conditional=WEBGL,
- OmitConstructor
-] interface WebGLContextAttributes {
- attribute boolean alpha;
- attribute boolean depth;
- attribute boolean stencil;
- attribute boolean antialias;
- attribute boolean premultipliedAlpha;
- attribute boolean preserveDrawingBuffer;
-};
+module html {
+ interface [
+ Conditional=WEBGL,
+ OmitConstructor
+ ] WebGLContextAttributes {
+ attribute boolean alpha;
+ attribute boolean depth;
+ attribute boolean stencil;
+ attribute boolean antialias;
+ attribute boolean premultipliedAlpha;
+ attribute boolean preserveDrawingBuffer;
+ };
+}
diff --git a/Source/WebCore/html/canvas/WebGLContextEvent.idl b/Source/WebCore/html/canvas/WebGLContextEvent.idl
index c3eba1029..3735f1245 100644
--- a/Source/WebCore/html/canvas/WebGLContextEvent.idl
+++ b/Source/WebCore/html/canvas/WebGLContextEvent.idl
@@ -23,10 +23,13 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- Conditional=WEBGL,
- ConstructorTemplate=Event
-] interface WebGLContextEvent : Event {
- [InitializedByEventConstructor] readonly attribute DOMString statusMessage;
-};
+module html {
+ interface [
+ Conditional=WEBGL,
+ ConstructorTemplate=Event
+ ] WebGLContextEvent : Event {
+ readonly attribute [InitializedByEventConstructor] DOMString statusMessage;
+ };
+
+}
diff --git a/Source/WebCore/html/canvas/WebGLDebugRendererInfo.idl b/Source/WebCore/html/canvas/WebGLDebugRendererInfo.idl
index c7ae7f80d..b307a1498 100644
--- a/Source/WebCore/html/canvas/WebGLDebugRendererInfo.idl
+++ b/Source/WebCore/html/canvas/WebGLDebugRendererInfo.idl
@@ -23,12 +23,14 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- Conditional=WEBGL,
- JSGenerateIsReachable=ImplContext,
- OmitConstructor,
- DoNotCheckConstants
-] interface WebGLDebugRendererInfo {
- const unsigned int UNMASKED_VENDOR_WEBGL = 0x9245;
- const unsigned int UNMASKED_RENDERER_WEBGL = 0x9246;
-};
+module html {
+ interface [
+ Conditional=WEBGL,
+ JSGenerateIsReachable=ImplContext,
+ OmitConstructor,
+ DoNotCheckConstants
+ ] WebGLDebugRendererInfo {
+ const unsigned int UNMASKED_VENDOR_WEBGL = 0x9245;
+ const unsigned int UNMASKED_RENDERER_WEBGL = 0x9246;
+ };
+}
diff --git a/Source/WebCore/html/canvas/WebGLDebugShaders.idl b/Source/WebCore/html/canvas/WebGLDebugShaders.idl
index ed52d4d5b..ee330b6ae 100644
--- a/Source/WebCore/html/canvas/WebGLDebugShaders.idl
+++ b/Source/WebCore/html/canvas/WebGLDebugShaders.idl
@@ -23,10 +23,12 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- Conditional=WEBGL,
- JSGenerateIsReachable=ImplContext,
- OmitConstructor
-] interface WebGLDebugShaders {
- [StrictTypeChecking, TreatReturnedNullStringAs=Null] DOMString getTranslatedShaderSource(in WebGLShader shader) raises(DOMException);
-};
+module html {
+ interface [
+ Conditional=WEBGL,
+ JSGenerateIsReachable=ImplContext,
+ OmitConstructor
+ ] WebGLDebugShaders {
+ [StrictTypeChecking, TreatReturnedNullStringAs=Null] DOMString getTranslatedShaderSource(in WebGLShader shader) raises(DOMException);
+ };
+}
diff --git a/Source/WebCore/html/canvas/WebGLDepthTexture.idl b/Source/WebCore/html/canvas/WebGLDepthTexture.idl
index 45069ac4e..56ef537c0 100644
--- a/Source/WebCore/html/canvas/WebGLDepthTexture.idl
+++ b/Source/WebCore/html/canvas/WebGLDepthTexture.idl
@@ -23,11 +23,13 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- Conditional=WEBGL,
- JSGenerateIsReachable=ImplContext,
- OmitConstructor,
- DoNotCheckConstants
-] interface WebGLDepthTexture {
- const unsigned int UNSIGNED_INT_24_8_WEBGL = 0x84FA;
-};
+module html {
+ interface [
+ Conditional=WEBGL,
+ JSGenerateIsReachable=ImplContext,
+ OmitConstructor,
+ DoNotCheckConstants
+ ] WebGLDepthTexture {
+ const unsigned int UNSIGNED_INT_24_8_WEBGL = 0x84FA;
+ };
+}
diff --git a/Source/WebCore/html/canvas/WebGLFramebuffer.cpp b/Source/WebCore/html/canvas/WebGLFramebuffer.cpp
index d081e2490..b91ae506e 100644
--- a/Source/WebCore/html/canvas/WebGLFramebuffer.cpp
+++ b/Source/WebCore/html/canvas/WebGLFramebuffer.cpp
@@ -327,7 +327,7 @@ WebGLSharedObject* WebGLFramebuffer::getAttachmentObject(GC3Denum attachment) co
WebGLFramebuffer::WebGLAttachment* WebGLFramebuffer::getAttachment(GC3Denum attachment) const
{
const AttachmentMap::const_iterator it = m_attachments.find(attachment);
- return (it != m_attachments.end()) ? it->value.get() : 0;
+ return (it != m_attachments.end()) ? it->second.get() : 0;
}
void WebGLFramebuffer::removeAttachmentFromBoundFramebuffer(GC3Denum attachment)
@@ -367,9 +367,9 @@ void WebGLFramebuffer::removeAttachmentFromBoundFramebuffer(WebGLSharedObject* a
while (checkMore) {
checkMore = false;
for (AttachmentMap::iterator it = m_attachments.begin(); it != m_attachments.end(); ++it) {
- WebGLAttachment* attachmentObject = it->value.get();
+ WebGLAttachment* attachmentObject = it->second.get();
if (attachmentObject->isSharedObject(attachment)) {
- GC3Denum attachmentType = it->key;
+ GC3Denum attachmentType = it->first;
attachmentObject->unattach(context()->graphicsContext3D(), attachmentType);
removeAttachmentFromBoundFramebuffer(attachmentType);
checkMore = true;
@@ -419,8 +419,8 @@ GC3Denum WebGLFramebuffer::checkStatus(const char** reason) const
bool haveStencil = false;
bool haveDepthStencil = false;
for (AttachmentMap::const_iterator it = m_attachments.begin(); it != m_attachments.end(); ++it) {
- WebGLAttachment* attachment = it->value.get();
- if (!isAttachmentComplete(attachment, it->key, reason))
+ WebGLAttachment* attachment = it->second.get();
+ if (!isAttachmentComplete(attachment, it->first, reason))
return GraphicsContext3D::FRAMEBUFFER_INCOMPLETE_ATTACHMENT;
if (!attachment->isValid()) {
*reason = "attachment is not valid";
@@ -430,7 +430,7 @@ GC3Denum WebGLFramebuffer::checkStatus(const char** reason) const
*reason = "attachment is an unsupported format";
return GraphicsContext3D::FRAMEBUFFER_INCOMPLETE_ATTACHMENT;
}
- switch (it->key) {
+ switch (it->first) {
case GraphicsContext3D::DEPTH_ATTACHMENT:
haveDepth = true;
break;
@@ -488,7 +488,7 @@ bool WebGLFramebuffer::hasStencilBuffer() const
void WebGLFramebuffer::deleteObjectImpl(GraphicsContext3D* context3d, Platform3DObject object)
{
for (AttachmentMap::iterator it = m_attachments.begin(); it != m_attachments.end(); ++it)
- it->value->onDetached(context3d);
+ it->second->onDetached(context3d);
context3d->deleteFramebuffer(object);
}
@@ -499,8 +499,8 @@ bool WebGLFramebuffer::initializeAttachments(GraphicsContext3D* g3d, const char*
GC3Dbitfield mask = 0;
for (AttachmentMap::iterator it = m_attachments.begin(); it != m_attachments.end(); ++it) {
- GC3Denum attachmentType = it->key;
- WebGLAttachment* attachment = it->value.get();
+ GC3Denum attachmentType = it->first;
+ WebGLAttachment* attachment = it->second.get();
if (!attachment->isInitialized())
mask |= GraphicsContext3D::getClearBitsByAttachmentType(attachmentType);
}
@@ -571,8 +571,8 @@ bool WebGLFramebuffer::initializeAttachments(GraphicsContext3D* g3d, const char*
g3d->disable(GraphicsContext3D::DITHER);
for (AttachmentMap::iterator it = m_attachments.begin(); it != m_attachments.end(); ++it) {
- GC3Denum attachmentType = it->key;
- WebGLAttachment* attachment = it->value.get();
+ GC3Denum attachmentType = it->first;
+ WebGLAttachment* attachment = it->second.get();
GC3Dbitfield bits = GraphicsContext3D::getClearBitsByAttachmentType(attachmentType);
if (bits & mask)
attachment->setInitialized();
diff --git a/Source/WebCore/html/canvas/WebGLFramebuffer.idl b/Source/WebCore/html/canvas/WebGLFramebuffer.idl
index e609513b2..d0caa917f 100644
--- a/Source/WebCore/html/canvas/WebGLFramebuffer.idl
+++ b/Source/WebCore/html/canvas/WebGLFramebuffer.idl
@@ -23,7 +23,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- Conditional=WEBGL
-] interface WebGLFramebuffer {
-};
+module html {
+ interface [
+ Conditional=WEBGL
+ ] WebGLFramebuffer {
+ };
+}
diff --git a/Source/WebCore/html/canvas/WebGLLoseContext.idl b/Source/WebCore/html/canvas/WebGLLoseContext.idl
index fcdd907c0..390da2638 100644
--- a/Source/WebCore/html/canvas/WebGLLoseContext.idl
+++ b/Source/WebCore/html/canvas/WebGLLoseContext.idl
@@ -23,11 +23,13 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- Conditional=WEBGL,
- JSGenerateIsReachable=ImplContext,
- OmitConstructor
-] interface WebGLLoseContext {
- [StrictTypeChecking] void loseContext();
- [StrictTypeChecking] void restoreContext();
-};
+module html {
+ interface [
+ Conditional=WEBGL,
+ JSGenerateIsReachable=ImplContext,
+ OmitConstructor
+ ] WebGLLoseContext {
+ [StrictTypeChecking] void loseContext();
+ [StrictTypeChecking] void restoreContext();
+ };
+}
diff --git a/Source/WebCore/html/canvas/WebGLProgram.idl b/Source/WebCore/html/canvas/WebGLProgram.idl
index d404ebdb8..326f1c376 100644
--- a/Source/WebCore/html/canvas/WebGLProgram.idl
+++ b/Source/WebCore/html/canvas/WebGLProgram.idl
@@ -23,7 +23,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- Conditional=WEBGL
-] interface WebGLProgram {
-};
+module html {
+ interface [
+ Conditional=WEBGL
+ ] WebGLProgram {
+ };
+}
diff --git a/Source/WebCore/html/canvas/WebGLRenderbuffer.idl b/Source/WebCore/html/canvas/WebGLRenderbuffer.idl
index 618f9c472..a6518ea2e 100644
--- a/Source/WebCore/html/canvas/WebGLRenderbuffer.idl
+++ b/Source/WebCore/html/canvas/WebGLRenderbuffer.idl
@@ -23,7 +23,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- Conditional=WEBGL
-] interface WebGLRenderbuffer {
-};
+module html {
+ interface [
+ Conditional=WEBGL
+ ] WebGLRenderbuffer {
+ };
+}
diff --git a/Source/WebCore/html/canvas/WebGLRenderingContext.cpp b/Source/WebCore/html/canvas/WebGLRenderingContext.cpp
index 749d51914..582ed5d39 100644
--- a/Source/WebCore/html/canvas/WebGLRenderingContext.cpp
+++ b/Source/WebCore/html/canvas/WebGLRenderingContext.cpp
@@ -1911,12 +1911,12 @@ void WebGLRenderingContext::drawArrays(GC3Denum mode, GC3Dint first, GC3Dsizei c
if (!isGLES2Compliant())
vertexAttrib0Simulated = simulateVertexAttrib0(first + count - 1);
if (!isGLES2NPOTStrict())
- handleNPOTTextures("drawArrays", true);
+ handleNPOTTextures(true);
m_context->drawArrays(mode, first, count);
if (!isGLES2Compliant() && vertexAttrib0Simulated)
restoreStatesAfterVertexAttrib0Simulation();
if (!isGLES2NPOTStrict())
- handleNPOTTextures("drawArrays", false);
+ handleNPOTTextures(false);
cleanupAfterGraphicsCall(true);
}
@@ -1990,12 +1990,12 @@ void WebGLRenderingContext::drawElements(GC3Denum mode, GC3Dsizei count, GC3Denu
vertexAttrib0Simulated = simulateVertexAttrib0(numElements);
}
if (!isGLES2NPOTStrict())
- handleNPOTTextures("drawElements", true);
+ handleNPOTTextures(true);
m_context->drawElements(mode, count, type, static_cast<GC3Dintptr>(offset));
if (!isGLES2Compliant() && vertexAttrib0Simulated)
restoreStatesAfterVertexAttrib0Simulation();
if (!isGLES2NPOTStrict())
- handleNPOTTextures("drawElements", false);
+ handleNPOTTextures(false);
cleanupAfterGraphicsCall(true);
}
@@ -4570,7 +4570,7 @@ WebGLGetInfo WebGLRenderingContext::getWebGLIntArrayParameter(GC3Denum pname)
return WebGLGetInfo(Int32Array::create(value, length));
}
-void WebGLRenderingContext::handleNPOTTextures(const char* functionName, bool prepareToDraw)
+void WebGLRenderingContext::handleNPOTTextures(bool prepareToDraw)
{
bool resetActiveUnit = false;
for (unsigned ii = 0; ii < m_textureUnits.size(); ++ii) {
@@ -4586,9 +4586,6 @@ void WebGLRenderingContext::handleNPOTTextures(const char* functionName, bool pr
WebGLTexture* tex2D;
WebGLTexture* texCubeMap;
if (prepareToDraw) {
- String msg(String("texture bound to texture unit ") + String::number(ii)
- + " is not renderable. It maybe non-power-of-2 and have incompatible texture filtering or is not 'texture complete'");
- printGLWarningToConsole(functionName, msg.utf8().data());
tex2D = m_blackTexture2D.get();
texCubeMap = m_blackTextureCubeMap.get();
} else {
diff --git a/Source/WebCore/html/canvas/WebGLRenderingContext.h b/Source/WebCore/html/canvas/WebGLRenderingContext.h
index 26fc66c5b..45df6a582 100644
--- a/Source/WebCore/html/canvas/WebGLRenderingContext.h
+++ b/Source/WebCore/html/canvas/WebGLRenderingContext.h
@@ -541,7 +541,7 @@ public:
GC3Denum format, GC3Denum type,
Image* image, bool flipY, bool premultiplyAlpha, ExceptionCode&);
- void handleNPOTTextures(const char*, bool);
+ void handleNPOTTextures(bool prepareToDraw);
void createFallbackBlackTextures1x1();
diff --git a/Source/WebCore/html/canvas/WebGLRenderingContext.idl b/Source/WebCore/html/canvas/WebGLRenderingContext.idl
index 31fa54c3d..9bf6ff544 100644
--- a/Source/WebCore/html/canvas/WebGLRenderingContext.idl
+++ b/Source/WebCore/html/canvas/WebGLRenderingContext.idl
@@ -23,643 +23,647 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- Conditional=WEBGL,
- JSCustomMarkFunction,
- DoNotCheckConstants
-] interface WebGLRenderingContext : CanvasRenderingContext {
-
- /* ClearBufferMask */
- const unsigned int DEPTH_BUFFER_BIT = 0x00000100;
- const unsigned int STENCIL_BUFFER_BIT = 0x00000400;
- const unsigned int COLOR_BUFFER_BIT = 0x00004000;
-
- /* BeginMode */
- const unsigned int POINTS = 0x0000;
- const unsigned int LINES = 0x0001;
- const unsigned int LINE_LOOP = 0x0002;
- const unsigned int LINE_STRIP = 0x0003;
- const unsigned int TRIANGLES = 0x0004;
- const unsigned int TRIANGLE_STRIP = 0x0005;
- const unsigned int TRIANGLE_FAN = 0x0006;
-
- /* AlphaFunction (not supported in ES20) */
- /* NEVER */
- /* LESS */
- /* EQUAL */
- /* LEQUAL */
- /* GREATER */
- /* NOTEQUAL */
- /* GEQUAL */
- /* ALWAYS */
-
- /* BlendingFactorDest */
- const unsigned int ZERO = 0;
- const unsigned int ONE = 1;
- const unsigned int SRC_COLOR = 0x0300;
- const unsigned int ONE_MINUS_SRC_COLOR = 0x0301;
- const unsigned int SRC_ALPHA = 0x0302;
- const unsigned int ONE_MINUS_SRC_ALPHA = 0x0303;
- const unsigned int DST_ALPHA = 0x0304;
- const unsigned int ONE_MINUS_DST_ALPHA = 0x0305;
-
- /* BlendingFactorSrc */
- /* ZERO */
- /* ONE */
- const unsigned int DST_COLOR = 0x0306;
- const unsigned int ONE_MINUS_DST_COLOR = 0x0307;
- const unsigned int SRC_ALPHA_SATURATE = 0x0308;
- /* SRC_ALPHA */
- /* ONE_MINUS_SRC_ALPHA */
- /* DST_ALPHA */
- /* ONE_MINUS_DST_ALPHA */
-
- /* BlendEquationSeparate */
- const unsigned int FUNC_ADD = 0x8006;
- const unsigned int BLEND_EQUATION = 0x8009;
- const unsigned int BLEND_EQUATION_RGB = 0x8009; /* same as BLEND_EQUATION */
- const unsigned int BLEND_EQUATION_ALPHA = 0x883D;
-
- /* BlendSubtract */
- const unsigned int FUNC_SUBTRACT = 0x800A;
- const unsigned int FUNC_REVERSE_SUBTRACT = 0x800B;
-
- /* Separate Blend Functions */
- const unsigned int BLEND_DST_RGB = 0x80C8;
- const unsigned int BLEND_SRC_RGB = 0x80C9;
- const unsigned int BLEND_DST_ALPHA = 0x80CA;
- const unsigned int BLEND_SRC_ALPHA = 0x80CB;
- const unsigned int CONSTANT_COLOR = 0x8001;
- const unsigned int ONE_MINUS_CONSTANT_COLOR = 0x8002;
- const unsigned int CONSTANT_ALPHA = 0x8003;
- const unsigned int ONE_MINUS_CONSTANT_ALPHA = 0x8004;
- const unsigned int BLEND_COLOR = 0x8005;
-
- /* Buffer Objects */
- const unsigned int ARRAY_BUFFER = 0x8892;
- const unsigned int ELEMENT_ARRAY_BUFFER = 0x8893;
- const unsigned int ARRAY_BUFFER_BINDING = 0x8894;
- const unsigned int ELEMENT_ARRAY_BUFFER_BINDING = 0x8895;
-
- const unsigned int STREAM_DRAW = 0x88E0;
- const unsigned int STATIC_DRAW = 0x88E4;
- const unsigned int DYNAMIC_DRAW = 0x88E8;
-
- const unsigned int BUFFER_SIZE = 0x8764;
- const unsigned int BUFFER_USAGE = 0x8765;
-
- const unsigned int CURRENT_VERTEX_ATTRIB = 0x8626;
-
- /* CullFaceMode */
- const unsigned int FRONT = 0x0404;
- const unsigned int BACK = 0x0405;
- const unsigned int FRONT_AND_BACK = 0x0408;
-
- /* DepthFunction */
- /* NEVER */
- /* LESS */
- /* EQUAL */
- /* LEQUAL */
- /* GREATER */
- /* NOTEQUAL */
- /* GEQUAL */
- /* ALWAYS */
-
- /* EnableCap */
- const unsigned int TEXTURE_2D = 0x0DE1;
- const unsigned int CULL_FACE = 0x0B44;
- const unsigned int BLEND = 0x0BE2;
- const unsigned int DITHER = 0x0BD0;
- const unsigned int STENCIL_TEST = 0x0B90;
- const unsigned int DEPTH_TEST = 0x0B71;
- const unsigned int SCISSOR_TEST = 0x0C11;
- const unsigned int POLYGON_OFFSET_FILL = 0x8037;
- const unsigned int SAMPLE_ALPHA_TO_COVERAGE = 0x809E;
- const unsigned int SAMPLE_COVERAGE = 0x80A0;
-
- /* ErrorCode */
- const unsigned int NO_ERROR = 0;
- const unsigned int INVALID_ENUM = 0x0500;
- const unsigned int INVALID_VALUE = 0x0501;
- const unsigned int INVALID_OPERATION = 0x0502;
- const unsigned int OUT_OF_MEMORY = 0x0505;
-
- /* FrontFaceDirection */
- const unsigned int CW = 0x0900;
- const unsigned int CCW = 0x0901;
-
- /* GetPName */
- const unsigned int LINE_WIDTH = 0x0B21;
- const unsigned int ALIASED_POINT_SIZE_RANGE = 0x846D;
- const unsigned int ALIASED_LINE_WIDTH_RANGE = 0x846E;
- const unsigned int CULL_FACE_MODE = 0x0B45;
- const unsigned int FRONT_FACE = 0x0B46;
- const unsigned int DEPTH_RANGE = 0x0B70;
- const unsigned int DEPTH_WRITEMASK = 0x0B72;
- const unsigned int DEPTH_CLEAR_VALUE = 0x0B73;
- const unsigned int DEPTH_FUNC = 0x0B74;
- const unsigned int STENCIL_CLEAR_VALUE = 0x0B91;
- const unsigned int STENCIL_FUNC = 0x0B92;
- const unsigned int STENCIL_FAIL = 0x0B94;
- const unsigned int STENCIL_PASS_DEPTH_FAIL = 0x0B95;
- const unsigned int STENCIL_PASS_DEPTH_PASS = 0x0B96;
- const unsigned int STENCIL_REF = 0x0B97;
- const unsigned int STENCIL_VALUE_MASK = 0x0B93;
- const unsigned int STENCIL_WRITEMASK = 0x0B98;
- const unsigned int STENCIL_BACK_FUNC = 0x8800;
- const unsigned int STENCIL_BACK_FAIL = 0x8801;
- const unsigned int STENCIL_BACK_PASS_DEPTH_FAIL = 0x8802;
- const unsigned int STENCIL_BACK_PASS_DEPTH_PASS = 0x8803;
- const unsigned int STENCIL_BACK_REF = 0x8CA3;
- const unsigned int STENCIL_BACK_VALUE_MASK = 0x8CA4;
- const unsigned int STENCIL_BACK_WRITEMASK = 0x8CA5;
- const unsigned int VIEWPORT = 0x0BA2;
- const unsigned int SCISSOR_BOX = 0x0C10;
- /* SCISSOR_TEST */
- const unsigned int COLOR_CLEAR_VALUE = 0x0C22;
- const unsigned int COLOR_WRITEMASK = 0x0C23;
- const unsigned int UNPACK_ALIGNMENT = 0x0CF5;
- const unsigned int PACK_ALIGNMENT = 0x0D05;
- const unsigned int MAX_TEXTURE_SIZE = 0x0D33;
- const unsigned int MAX_VIEWPORT_DIMS = 0x0D3A;
- const unsigned int SUBPIXEL_BITS = 0x0D50;
- const unsigned int RED_BITS = 0x0D52;
- const unsigned int GREEN_BITS = 0x0D53;
- const unsigned int BLUE_BITS = 0x0D54;
- const unsigned int ALPHA_BITS = 0x0D55;
- const unsigned int DEPTH_BITS = 0x0D56;
- const unsigned int STENCIL_BITS = 0x0D57;
- const unsigned int POLYGON_OFFSET_UNITS = 0x2A00;
- /* POLYGON_OFFSET_FILL */
- const unsigned int POLYGON_OFFSET_FACTOR = 0x8038;
- const unsigned int TEXTURE_BINDING_2D = 0x8069;
- const unsigned int SAMPLE_BUFFERS = 0x80A8;
- const unsigned int SAMPLES = 0x80A9;
- const unsigned int SAMPLE_COVERAGE_VALUE = 0x80AA;
- const unsigned int SAMPLE_COVERAGE_INVERT = 0x80AB;
-
- /* GetTextureParameter */
- /* TEXTURE_MAG_FILTER */
- /* TEXTURE_MIN_FILTER */
- /* TEXTURE_WRAP_S */
- /* TEXTURE_WRAP_T */
-
- const unsigned int COMPRESSED_TEXTURE_FORMATS = 0x86A3;
-
- /* HintMode */
- const unsigned int DONT_CARE = 0x1100;
- const unsigned int FASTEST = 0x1101;
- const unsigned int NICEST = 0x1102;
-
- /* HintTarget */
- const unsigned int GENERATE_MIPMAP_HINT = 0x8192;
-
- /* DataType */
- const unsigned int BYTE = 0x1400;
- const unsigned int UNSIGNED_BYTE = 0x1401;
- const unsigned int SHORT = 0x1402;
- const unsigned int UNSIGNED_SHORT = 0x1403;
- const unsigned int INT = 0x1404;
- const unsigned int UNSIGNED_INT = 0x1405;
- const unsigned int FLOAT = 0x1406;
-
- /* PixelFormat */
- const unsigned int DEPTH_COMPONENT = 0x1902;
- const unsigned int ALPHA = 0x1906;
- const unsigned int RGB = 0x1907;
- const unsigned int RGBA = 0x1908;
- const unsigned int LUMINANCE = 0x1909;
- const unsigned int LUMINANCE_ALPHA = 0x190A;
-
- /* PixelType */
- /* UNSIGNED_BYTE */
- const unsigned int UNSIGNED_SHORT_4_4_4_4 = 0x8033;
- const unsigned int UNSIGNED_SHORT_5_5_5_1 = 0x8034;
- const unsigned int UNSIGNED_SHORT_5_6_5 = 0x8363;
-
- /* Shaders */
- const unsigned int FRAGMENT_SHADER = 0x8B30;
- const unsigned int VERTEX_SHADER = 0x8B31;
- const unsigned int MAX_VERTEX_ATTRIBS = 0x8869;
- const unsigned int MAX_VERTEX_UNIFORM_VECTORS = 0x8DFB;
- const unsigned int MAX_VARYING_VECTORS = 0x8DFC;
- const unsigned int MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D;
- const unsigned int MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C;
- const unsigned int MAX_TEXTURE_IMAGE_UNITS = 0x8872;
- const unsigned int MAX_FRAGMENT_UNIFORM_VECTORS = 0x8DFD;
- const unsigned int SHADER_TYPE = 0x8B4F;
- const unsigned int DELETE_STATUS = 0x8B80;
- const unsigned int LINK_STATUS = 0x8B82;
- const unsigned int VALIDATE_STATUS = 0x8B83;
- const unsigned int ATTACHED_SHADERS = 0x8B85;
- const unsigned int ACTIVE_UNIFORMS = 0x8B86;
- const unsigned int ACTIVE_ATTRIBUTES = 0x8B89;
- const unsigned int SHADING_LANGUAGE_VERSION = 0x8B8C;
- const unsigned int CURRENT_PROGRAM = 0x8B8D;
-
- /* StencilFunction */
- const unsigned int NEVER = 0x0200;
- const unsigned int LESS = 0x0201;
- const unsigned int EQUAL = 0x0202;
- const unsigned int LEQUAL = 0x0203;
- const unsigned int GREATER = 0x0204;
- const unsigned int NOTEQUAL = 0x0205;
- const unsigned int GEQUAL = 0x0206;
- const unsigned int ALWAYS = 0x0207;
-
- /* StencilOp */
- /* ZERO */
- const unsigned int KEEP = 0x1E00;
- const unsigned int REPLACE = 0x1E01;
- const unsigned int INCR = 0x1E02;
- const unsigned int DECR = 0x1E03;
- const unsigned int INVERT = 0x150A;
- const unsigned int INCR_WRAP = 0x8507;
- const unsigned int DECR_WRAP = 0x8508;
-
- /* StringName */
- const unsigned int VENDOR = 0x1F00;
- const unsigned int RENDERER = 0x1F01;
- const unsigned int VERSION = 0x1F02;
-
- /* TextureMagFilter */
- const unsigned int NEAREST = 0x2600;
- const unsigned int LINEAR = 0x2601;
-
- /* TextureMinFilter */
- /* NEAREST */
- /* LINEAR */
- const unsigned int NEAREST_MIPMAP_NEAREST = 0x2700;
- const unsigned int LINEAR_MIPMAP_NEAREST = 0x2701;
- const unsigned int NEAREST_MIPMAP_LINEAR = 0x2702;
- const unsigned int LINEAR_MIPMAP_LINEAR = 0x2703;
-
- /* TextureParameterName */
- const unsigned int TEXTURE_MAG_FILTER = 0x2800;
- const unsigned int TEXTURE_MIN_FILTER = 0x2801;
- const unsigned int TEXTURE_WRAP_S = 0x2802;
- const unsigned int TEXTURE_WRAP_T = 0x2803;
-
- /* TextureTarget */
- /* TEXTURE_2D */
- const unsigned int TEXTURE = 0x1702;
-
- const unsigned int TEXTURE_CUBE_MAP = 0x8513;
- const unsigned int TEXTURE_BINDING_CUBE_MAP = 0x8514;
- const unsigned int TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515;
- const unsigned int TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516;
- const unsigned int TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517;
- const unsigned int TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518;
- const unsigned int TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519;
- const unsigned int TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A;
- const unsigned int MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C;
-
- /* TextureUnit */
- const unsigned int TEXTURE0 = 0x84C0;
- const unsigned int TEXTURE1 = 0x84C1;
- const unsigned int TEXTURE2 = 0x84C2;
- const unsigned int TEXTURE3 = 0x84C3;
- const unsigned int TEXTURE4 = 0x84C4;
- const unsigned int TEXTURE5 = 0x84C5;
- const unsigned int TEXTURE6 = 0x84C6;
- const unsigned int TEXTURE7 = 0x84C7;
- const unsigned int TEXTURE8 = 0x84C8;
- const unsigned int TEXTURE9 = 0x84C9;
- const unsigned int TEXTURE10 = 0x84CA;
- const unsigned int TEXTURE11 = 0x84CB;
- const unsigned int TEXTURE12 = 0x84CC;
- const unsigned int TEXTURE13 = 0x84CD;
- const unsigned int TEXTURE14 = 0x84CE;
- const unsigned int TEXTURE15 = 0x84CF;
- const unsigned int TEXTURE16 = 0x84D0;
- const unsigned int TEXTURE17 = 0x84D1;
- const unsigned int TEXTURE18 = 0x84D2;
- const unsigned int TEXTURE19 = 0x84D3;
- const unsigned int TEXTURE20 = 0x84D4;
- const unsigned int TEXTURE21 = 0x84D5;
- const unsigned int TEXTURE22 = 0x84D6;
- const unsigned int TEXTURE23 = 0x84D7;
- const unsigned int TEXTURE24 = 0x84D8;
- const unsigned int TEXTURE25 = 0x84D9;
- const unsigned int TEXTURE26 = 0x84DA;
- const unsigned int TEXTURE27 = 0x84DB;
- const unsigned int TEXTURE28 = 0x84DC;
- const unsigned int TEXTURE29 = 0x84DD;
- const unsigned int TEXTURE30 = 0x84DE;
- const unsigned int TEXTURE31 = 0x84DF;
- const unsigned int ACTIVE_TEXTURE = 0x84E0;
-
- /* TextureWrapMode */
- const unsigned int REPEAT = 0x2901;
- const unsigned int CLAMP_TO_EDGE = 0x812F;
- const unsigned int MIRRORED_REPEAT = 0x8370;
-
- /* Uniform Types */
- const unsigned int FLOAT_VEC2 = 0x8B50;
- const unsigned int FLOAT_VEC3 = 0x8B51;
- const unsigned int FLOAT_VEC4 = 0x8B52;
- const unsigned int INT_VEC2 = 0x8B53;
- const unsigned int INT_VEC3 = 0x8B54;
- const unsigned int INT_VEC4 = 0x8B55;
- const unsigned int BOOL = 0x8B56;
- const unsigned int BOOL_VEC2 = 0x8B57;
- const unsigned int BOOL_VEC3 = 0x8B58;
- const unsigned int BOOL_VEC4 = 0x8B59;
- const unsigned int FLOAT_MAT2 = 0x8B5A;
- const unsigned int FLOAT_MAT3 = 0x8B5B;
- const unsigned int FLOAT_MAT4 = 0x8B5C;
- const unsigned int SAMPLER_2D = 0x8B5E;
- const unsigned int SAMPLER_CUBE = 0x8B60;
-
- /* Vertex Arrays */
- const unsigned int VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622;
- const unsigned int VERTEX_ATTRIB_ARRAY_SIZE = 0x8623;
- const unsigned int VERTEX_ATTRIB_ARRAY_STRIDE = 0x8624;
- const unsigned int VERTEX_ATTRIB_ARRAY_TYPE = 0x8625;
- const unsigned int VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886A;
- const unsigned int VERTEX_ATTRIB_ARRAY_POINTER = 0x8645;
- const unsigned int VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F;
-
- /* Shader Source */
- const unsigned int COMPILE_STATUS = 0x8B81;
-
- /* Shader Precision-Specified Types */
- const unsigned int LOW_FLOAT = 0x8DF0;
- const unsigned int MEDIUM_FLOAT = 0x8DF1;
- const unsigned int HIGH_FLOAT = 0x8DF2;
- const unsigned int LOW_INT = 0x8DF3;
- const unsigned int MEDIUM_INT = 0x8DF4;
- const unsigned int HIGH_INT = 0x8DF5;
-
- /* Framebuffer Object. */
- const unsigned int FRAMEBUFFER = 0x8D40;
- const unsigned int RENDERBUFFER = 0x8D41;
-
- const unsigned int RGBA4 = 0x8056;
- const unsigned int RGB5_A1 = 0x8057;
- const unsigned int RGB565 = 0x8D62;
- const unsigned int DEPTH_COMPONENT16 = 0x81A5;
- const unsigned int STENCIL_INDEX = 0x1901;
- const unsigned int STENCIL_INDEX8 = 0x8D48;
- const unsigned int DEPTH_STENCIL = 0x84F9;
-
- const unsigned int RENDERBUFFER_WIDTH = 0x8D42;
- const unsigned int RENDERBUFFER_HEIGHT = 0x8D43;
- const unsigned int RENDERBUFFER_INTERNAL_FORMAT = 0x8D44;
- const unsigned int RENDERBUFFER_RED_SIZE = 0x8D50;
- const unsigned int RENDERBUFFER_GREEN_SIZE = 0x8D51;
- const unsigned int RENDERBUFFER_BLUE_SIZE = 0x8D52;
- const unsigned int RENDERBUFFER_ALPHA_SIZE = 0x8D53;
- const unsigned int RENDERBUFFER_DEPTH_SIZE = 0x8D54;
- const unsigned int RENDERBUFFER_STENCIL_SIZE = 0x8D55;
-
- const unsigned int FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 0x8CD0;
- const unsigned int FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 0x8CD1;
- const unsigned int FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8CD2;
- const unsigned int FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3;
-
- const unsigned int COLOR_ATTACHMENT0 = 0x8CE0;
- const unsigned int DEPTH_ATTACHMENT = 0x8D00;
- const unsigned int STENCIL_ATTACHMENT = 0x8D20;
- const unsigned int DEPTH_STENCIL_ATTACHMENT = 0x821A;
-
- const unsigned int NONE = 0;
-
- const unsigned int FRAMEBUFFER_COMPLETE = 0x8CD5;
- const unsigned int FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6;
- const unsigned int FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7;
- const unsigned int FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 0x8CD9;
- const unsigned int FRAMEBUFFER_UNSUPPORTED = 0x8CDD;
-
- const unsigned int FRAMEBUFFER_BINDING = 0x8CA6;
- const unsigned int RENDERBUFFER_BINDING = 0x8CA7;
- const unsigned int MAX_RENDERBUFFER_SIZE = 0x84E8;
-
- const unsigned int INVALID_FRAMEBUFFER_OPERATION = 0x0506;
-
- /* WebGL-specific enums */
- const unsigned int UNPACK_FLIP_Y_WEBGL = 0x9240;
- const unsigned int UNPACK_PREMULTIPLY_ALPHA_WEBGL = 0x9241;
- const unsigned int CONTEXT_LOST_WEBGL = 0x9242;
- const unsigned int UNPACK_COLORSPACE_CONVERSION_WEBGL = 0x9243;
- const unsigned int BROWSER_DEFAULT_WEBGL = 0x9244;
-
- readonly attribute long drawingBufferWidth;
- readonly attribute long drawingBufferHeight;
-
- [StrictTypeChecking] void activeTexture(in unsigned long texture) raises(DOMException);
- [StrictTypeChecking] void attachShader(in WebGLProgram program, in WebGLShader shader) raises(DOMException);
- [StrictTypeChecking] void bindAttribLocation(in WebGLProgram program, in unsigned long index, in DOMString name) raises(DOMException);
- [StrictTypeChecking] void bindBuffer(in unsigned long target, in WebGLBuffer buffer) raises(DOMException);
- [StrictTypeChecking] void bindFramebuffer(in unsigned long target, in WebGLFramebuffer framebuffer) raises(DOMException);
- [StrictTypeChecking] void bindRenderbuffer(in unsigned long target, in WebGLRenderbuffer renderbuffer) raises(DOMException);
- [StrictTypeChecking] void bindTexture(in unsigned long target, in WebGLTexture texture) raises(DOMException);
- [StrictTypeChecking] void blendColor(in float red, in float green, in float blue, in float alpha);
- [StrictTypeChecking] void blendEquation( in unsigned long mode );
- [StrictTypeChecking] void blendEquationSeparate(in unsigned long modeRGB, in unsigned long modeAlpha);
- [StrictTypeChecking] void blendFunc(in unsigned long sfactor, in unsigned long dfactor);
- [StrictTypeChecking] void blendFuncSeparate(in unsigned long srcRGB, in unsigned long dstRGB, in unsigned long srcAlpha, in unsigned long dstAlpha);
- [StrictTypeChecking] void bufferData(in unsigned long target, in ArrayBuffer? data, in unsigned long usage) raises (DOMException);
- [StrictTypeChecking] void bufferData(in unsigned long target, in ArrayBufferView? data, in unsigned long usage) raises (DOMException);
- [StrictTypeChecking] void bufferData(in unsigned long target, in long long size, in unsigned long usage) raises (DOMException);
- [StrictTypeChecking] void bufferSubData(in unsigned long target, in long long offset, in ArrayBuffer? data) raises (DOMException);
- [StrictTypeChecking] void bufferSubData(in unsigned long target, in long long offset, in ArrayBufferView? data) raises (DOMException);
-
- [StrictTypeChecking] unsigned long checkFramebufferStatus(in unsigned long target);
- [StrictTypeChecking] void clear(in unsigned long mask);
- [StrictTypeChecking] void clearColor(in float red, in float green, in float blue, in float alpha);
- [StrictTypeChecking] void clearDepth(in float depth);
- [StrictTypeChecking] void clearStencil(in long s);
- [StrictTypeChecking] void colorMask(in boolean red, in boolean green, in boolean blue, in boolean alpha);
- [StrictTypeChecking] void compileShader(in WebGLShader shader) raises(DOMException);
-
- [StrictTypeChecking] void compressedTexImage2D(in unsigned long target, in long level, in unsigned long internalformat,
- in long width, in long height, in long border, in ArrayBufferView data);
- [StrictTypeChecking] void compressedTexSubImage2D(in unsigned long target, in long level, in long xoffset, in long yoffset,
- in long width, in long height, in unsigned long format, in ArrayBufferView data);
-
- [StrictTypeChecking] void copyTexImage2D(in unsigned long target, in long level, in unsigned long internalformat, in long x, in long y, in long width, in long height, in long border);
- [StrictTypeChecking] void copyTexSubImage2D(in unsigned long target, in long level, in long xoffset, in long yoffset, in long x, in long y, in long width, in long height);
-
- [StrictTypeChecking] WebGLBuffer createBuffer();
- [StrictTypeChecking] WebGLFramebuffer createFramebuffer();
- [StrictTypeChecking] WebGLProgram createProgram();
- [StrictTypeChecking] WebGLRenderbuffer createRenderbuffer();
- [StrictTypeChecking] WebGLShader createShader(in unsigned long type) raises(DOMException);
- [StrictTypeChecking] WebGLTexture createTexture();
-
- [StrictTypeChecking] void cullFace(in unsigned long mode);
-
- [StrictTypeChecking] void deleteBuffer(in WebGLBuffer buffer);
- [StrictTypeChecking] void deleteFramebuffer(in WebGLFramebuffer framebuffer);
- [StrictTypeChecking] void deleteProgram(in WebGLProgram program);
- [StrictTypeChecking] void deleteRenderbuffer(in WebGLRenderbuffer renderbuffer);
- [StrictTypeChecking] void deleteShader(in WebGLShader shader);
- [StrictTypeChecking] void deleteTexture(in WebGLTexture texture);
-
- [StrictTypeChecking] void depthFunc(in unsigned long func);
- [StrictTypeChecking] void depthMask(in boolean flag);
- // FIXME: this differs from the current WebGL spec (depthRangef)
- [StrictTypeChecking] void depthRange(in float zNear, in float zFar);
- [StrictTypeChecking] void detachShader(in WebGLProgram program, in WebGLShader shader) raises(DOMException);
- [StrictTypeChecking] void disable(in unsigned long cap);
- [StrictTypeChecking] void disableVertexAttribArray(in unsigned long index) raises(DOMException);
- [StrictTypeChecking] void drawArrays(in unsigned long mode, in long first, in long count) raises(DOMException);
- [StrictTypeChecking] void drawElements(in unsigned long mode, in long count, in unsigned long type, in long long offset) raises(DOMException);
-
- [StrictTypeChecking] void enable(in unsigned long cap);
- [StrictTypeChecking] void enableVertexAttribArray(in unsigned long index) raises(DOMException);
- [StrictTypeChecking] void finish();
- [StrictTypeChecking] void flush();
- [StrictTypeChecking] void framebufferRenderbuffer(in unsigned long target, in unsigned long attachment, in unsigned long renderbuffertarget, in WebGLRenderbuffer renderbuffer) raises(DOMException);
- [StrictTypeChecking] void framebufferTexture2D(in unsigned long target, in unsigned long attachment, in unsigned long textarget, in WebGLTexture texture, in long level) raises(DOMException);
- [StrictTypeChecking] void frontFace(in unsigned long mode);
- [StrictTypeChecking] void generateMipmap(in unsigned long target);
-
- [StrictTypeChecking] WebGLActiveInfo getActiveAttrib(in WebGLProgram program, in unsigned long index) raises (DOMException);
- [StrictTypeChecking] WebGLActiveInfo getActiveUniform(in WebGLProgram program, in unsigned long index) raises (DOMException);
-
- [StrictTypeChecking, Custom] void getAttachedShaders(in WebGLProgram program) raises (DOMException);
-
- [StrictTypeChecking] int getAttribLocation(in WebGLProgram program, in DOMString name);
-
- // any getBufferParameter(in unsigned long target, in unsigned long pname) raises(DOMException);
- [StrictTypeChecking, Custom] void getBufferParameter();
-
- [StrictTypeChecking] WebGLContextAttributes getContextAttributes();
-
- [StrictTypeChecking] unsigned long getError();
-
- // object getExtension(in DOMString name);
- [StrictTypeChecking, Custom] void getExtension(in DOMString name);
-
- // any getFramebufferAttachmentParameter(in unsigned long target, in unsigned long attachment, in unsigned long pname) raises(DOMException);
- [StrictTypeChecking, Custom] void getFramebufferAttachmentParameter();
- // any getParameter(in unsigned long pname) raises(DOMException);
- [StrictTypeChecking, Custom] void getParameter();
- // any getProgramParameter(in WebGLProgram program, in unsigned long pname) raises(DOMException);
- [StrictTypeChecking, Custom] void getProgramParameter();
- [StrictTypeChecking, TreatReturnedNullStringAs=Null] DOMString getProgramInfoLog(in WebGLProgram program) raises(DOMException);
- // any getRenderbufferParameter(in unsigned long target, in unsigned long pname) raises(DOMException);
- [StrictTypeChecking, Custom] void getRenderbufferParameter();
- // any getShaderParameter(in WebGLShader shader, in unsigned long pname) raises(DOMException);
- [StrictTypeChecking, Custom] void getShaderParameter() raises(DOMException);
-
- [StrictTypeChecking, TreatReturnedNullStringAs=Null] DOMString getShaderInfoLog(in WebGLShader shader) raises(DOMException);
-
- [StrictTypeChecking] WebGLShaderPrecisionFormat getShaderPrecisionFormat(in unsigned long shadertype, in unsigned long precisiontype) raises(DOMException);
-
- [StrictTypeChecking, TreatReturnedNullStringAs=Null] DOMString getShaderSource(in WebGLShader shader) raises(DOMException);
-
- // DOMString[] getSupportedExtensions()
- [StrictTypeChecking, Custom] void getSupportedExtensions();
-
- // any getTexParameter(in unsigned long target, in unsigned long pname) raises(DOMException);
- [StrictTypeChecking, Custom] void getTexParameter();
-
- // any getUniform(in WebGLProgram program, in WebGLUniformLocation location) raises(DOMException);
- [StrictTypeChecking, Custom] void getUniform();
-
- [StrictTypeChecking] WebGLUniformLocation getUniformLocation(in WebGLProgram program, in DOMString name) raises(DOMException);
-
- // any getVertexAttrib(in unsigned long index, in unsigned long pname) raises(DOMException);
- [StrictTypeChecking, Custom] void getVertexAttrib();
-
- [StrictTypeChecking] long long getVertexAttribOffset(in unsigned long index, in unsigned long pname);
-
- [StrictTypeChecking] void hint(in unsigned long target, in unsigned long mode);
- [StrictTypeChecking] boolean isBuffer(in WebGLBuffer buffer);
- [StrictTypeChecking] boolean isContextLost();
- [StrictTypeChecking] boolean isEnabled(in unsigned long cap);
- [StrictTypeChecking] boolean isFramebuffer(in WebGLFramebuffer framebuffer);
- [StrictTypeChecking] boolean isProgram(in WebGLProgram program);
- [StrictTypeChecking] boolean isRenderbuffer(in WebGLRenderbuffer renderbuffer);
- [StrictTypeChecking] boolean isShader(in WebGLShader shader);
- [StrictTypeChecking] boolean isTexture(in WebGLTexture texture);
- [StrictTypeChecking] void lineWidth(in float width);
- [StrictTypeChecking] void linkProgram(in WebGLProgram program) raises(DOMException);
- [StrictTypeChecking] void pixelStorei(in unsigned long pname, in long param);
- [StrictTypeChecking] void polygonOffset(in float factor, in float units);
-
- [StrictTypeChecking] void readPixels(in long x, in long y, in long width, in long height, in unsigned long format, in unsigned long type, in ArrayBufferView pixels) raises(DOMException);
-
- [StrictTypeChecking] void releaseShaderCompiler();
- [StrictTypeChecking] void renderbufferStorage(in unsigned long target, in unsigned long internalformat, in long width, in long height);
- [StrictTypeChecking] void sampleCoverage(in float value, in boolean invert);
- [StrictTypeChecking] void scissor(in long x, in long y, in long width, in long height);
- [StrictTypeChecking] void shaderSource(in WebGLShader shader, in DOMString string) raises(DOMException);
- [StrictTypeChecking] void stencilFunc(in unsigned long func, in long ref, in unsigned long mask);
- [StrictTypeChecking] void stencilFuncSeparate(in unsigned long face, in unsigned long func, in long ref, in unsigned long mask);
- [StrictTypeChecking] void stencilMask(in unsigned long mask);
- [StrictTypeChecking] void stencilMaskSeparate(in unsigned long face, in unsigned long mask);
- [StrictTypeChecking] void stencilOp(in unsigned long fail, in unsigned long zfail, in unsigned long zpass);
- [StrictTypeChecking] void stencilOpSeparate(in unsigned long face, in unsigned long fail, in unsigned long zfail, in unsigned long zpass);
-
- [StrictTypeChecking] void texParameterf(in unsigned long target, in unsigned long pname, in float param);
- [StrictTypeChecking] void texParameteri(in unsigned long target, in unsigned long pname, in long param);
-
- // Supported forms:
- [StrictTypeChecking] void texImage2D(in unsigned long target, in long level, in unsigned long internalformat, in long width, in long height,
- in long border, in unsigned long format, in unsigned long type, in ArrayBufferView? pixels) raises (DOMException);
- [StrictTypeChecking] void texImage2D(in unsigned long target, in long level, in unsigned long internalformat,
- in unsigned long format, in unsigned long type, in ImageData? pixels) raises (DOMException);
- [StrictTypeChecking] void texImage2D(in unsigned long target, in long level, in unsigned long internalformat,
- in unsigned long format, in unsigned long type, in HTMLImageElement? image) raises (DOMException);
- [StrictTypeChecking] void texImage2D(in unsigned long target, in long level, in unsigned long internalformat,
- in unsigned long format, in unsigned long type, in HTMLCanvasElement? canvas) raises (DOMException);
+module html {
+
+ interface [
+ Conditional=WEBGL,
+ JSCustomMarkFunction,
+ DoNotCheckConstants
+ ] WebGLRenderingContext : CanvasRenderingContext {
+
+ /* ClearBufferMask */
+ const unsigned int DEPTH_BUFFER_BIT = 0x00000100;
+ const unsigned int STENCIL_BUFFER_BIT = 0x00000400;
+ const unsigned int COLOR_BUFFER_BIT = 0x00004000;
+
+ /* BeginMode */
+ const unsigned int POINTS = 0x0000;
+ const unsigned int LINES = 0x0001;
+ const unsigned int LINE_LOOP = 0x0002;
+ const unsigned int LINE_STRIP = 0x0003;
+ const unsigned int TRIANGLES = 0x0004;
+ const unsigned int TRIANGLE_STRIP = 0x0005;
+ const unsigned int TRIANGLE_FAN = 0x0006;
+
+ /* AlphaFunction (not supported in ES20) */
+ /* NEVER */
+ /* LESS */
+ /* EQUAL */
+ /* LEQUAL */
+ /* GREATER */
+ /* NOTEQUAL */
+ /* GEQUAL */
+ /* ALWAYS */
+
+ /* BlendingFactorDest */
+ const unsigned int ZERO = 0;
+ const unsigned int ONE = 1;
+ const unsigned int SRC_COLOR = 0x0300;
+ const unsigned int ONE_MINUS_SRC_COLOR = 0x0301;
+ const unsigned int SRC_ALPHA = 0x0302;
+ const unsigned int ONE_MINUS_SRC_ALPHA = 0x0303;
+ const unsigned int DST_ALPHA = 0x0304;
+ const unsigned int ONE_MINUS_DST_ALPHA = 0x0305;
+
+ /* BlendingFactorSrc */
+ /* ZERO */
+ /* ONE */
+ const unsigned int DST_COLOR = 0x0306;
+ const unsigned int ONE_MINUS_DST_COLOR = 0x0307;
+ const unsigned int SRC_ALPHA_SATURATE = 0x0308;
+ /* SRC_ALPHA */
+ /* ONE_MINUS_SRC_ALPHA */
+ /* DST_ALPHA */
+ /* ONE_MINUS_DST_ALPHA */
+
+ /* BlendEquationSeparate */
+ const unsigned int FUNC_ADD = 0x8006;
+ const unsigned int BLEND_EQUATION = 0x8009;
+ const unsigned int BLEND_EQUATION_RGB = 0x8009; /* same as BLEND_EQUATION */
+ const unsigned int BLEND_EQUATION_ALPHA = 0x883D;
+
+ /* BlendSubtract */
+ const unsigned int FUNC_SUBTRACT = 0x800A;
+ const unsigned int FUNC_REVERSE_SUBTRACT = 0x800B;
+
+ /* Separate Blend Functions */
+ const unsigned int BLEND_DST_RGB = 0x80C8;
+ const unsigned int BLEND_SRC_RGB = 0x80C9;
+ const unsigned int BLEND_DST_ALPHA = 0x80CA;
+ const unsigned int BLEND_SRC_ALPHA = 0x80CB;
+ const unsigned int CONSTANT_COLOR = 0x8001;
+ const unsigned int ONE_MINUS_CONSTANT_COLOR = 0x8002;
+ const unsigned int CONSTANT_ALPHA = 0x8003;
+ const unsigned int ONE_MINUS_CONSTANT_ALPHA = 0x8004;
+ const unsigned int BLEND_COLOR = 0x8005;
+
+ /* Buffer Objects */
+ const unsigned int ARRAY_BUFFER = 0x8892;
+ const unsigned int ELEMENT_ARRAY_BUFFER = 0x8893;
+ const unsigned int ARRAY_BUFFER_BINDING = 0x8894;
+ const unsigned int ELEMENT_ARRAY_BUFFER_BINDING = 0x8895;
+
+ const unsigned int STREAM_DRAW = 0x88E0;
+ const unsigned int STATIC_DRAW = 0x88E4;
+ const unsigned int DYNAMIC_DRAW = 0x88E8;
+
+ const unsigned int BUFFER_SIZE = 0x8764;
+ const unsigned int BUFFER_USAGE = 0x8765;
+
+ const unsigned int CURRENT_VERTEX_ATTRIB = 0x8626;
+
+ /* CullFaceMode */
+ const unsigned int FRONT = 0x0404;
+ const unsigned int BACK = 0x0405;
+ const unsigned int FRONT_AND_BACK = 0x0408;
+
+ /* DepthFunction */
+ /* NEVER */
+ /* LESS */
+ /* EQUAL */
+ /* LEQUAL */
+ /* GREATER */
+ /* NOTEQUAL */
+ /* GEQUAL */
+ /* ALWAYS */
+
+ /* EnableCap */
+ const unsigned int TEXTURE_2D = 0x0DE1;
+ const unsigned int CULL_FACE = 0x0B44;
+ const unsigned int BLEND = 0x0BE2;
+ const unsigned int DITHER = 0x0BD0;
+ const unsigned int STENCIL_TEST = 0x0B90;
+ const unsigned int DEPTH_TEST = 0x0B71;
+ const unsigned int SCISSOR_TEST = 0x0C11;
+ const unsigned int POLYGON_OFFSET_FILL = 0x8037;
+ const unsigned int SAMPLE_ALPHA_TO_COVERAGE = 0x809E;
+ const unsigned int SAMPLE_COVERAGE = 0x80A0;
+
+ /* ErrorCode */
+ const unsigned int NO_ERROR = 0;
+ const unsigned int INVALID_ENUM = 0x0500;
+ const unsigned int INVALID_VALUE = 0x0501;
+ const unsigned int INVALID_OPERATION = 0x0502;
+ const unsigned int OUT_OF_MEMORY = 0x0505;
+
+ /* FrontFaceDirection */
+ const unsigned int CW = 0x0900;
+ const unsigned int CCW = 0x0901;
+
+ /* GetPName */
+ const unsigned int LINE_WIDTH = 0x0B21;
+ const unsigned int ALIASED_POINT_SIZE_RANGE = 0x846D;
+ const unsigned int ALIASED_LINE_WIDTH_RANGE = 0x846E;
+ const unsigned int CULL_FACE_MODE = 0x0B45;
+ const unsigned int FRONT_FACE = 0x0B46;
+ const unsigned int DEPTH_RANGE = 0x0B70;
+ const unsigned int DEPTH_WRITEMASK = 0x0B72;
+ const unsigned int DEPTH_CLEAR_VALUE = 0x0B73;
+ const unsigned int DEPTH_FUNC = 0x0B74;
+ const unsigned int STENCIL_CLEAR_VALUE = 0x0B91;
+ const unsigned int STENCIL_FUNC = 0x0B92;
+ const unsigned int STENCIL_FAIL = 0x0B94;
+ const unsigned int STENCIL_PASS_DEPTH_FAIL = 0x0B95;
+ const unsigned int STENCIL_PASS_DEPTH_PASS = 0x0B96;
+ const unsigned int STENCIL_REF = 0x0B97;
+ const unsigned int STENCIL_VALUE_MASK = 0x0B93;
+ const unsigned int STENCIL_WRITEMASK = 0x0B98;
+ const unsigned int STENCIL_BACK_FUNC = 0x8800;
+ const unsigned int STENCIL_BACK_FAIL = 0x8801;
+ const unsigned int STENCIL_BACK_PASS_DEPTH_FAIL = 0x8802;
+ const unsigned int STENCIL_BACK_PASS_DEPTH_PASS = 0x8803;
+ const unsigned int STENCIL_BACK_REF = 0x8CA3;
+ const unsigned int STENCIL_BACK_VALUE_MASK = 0x8CA4;
+ const unsigned int STENCIL_BACK_WRITEMASK = 0x8CA5;
+ const unsigned int VIEWPORT = 0x0BA2;
+ const unsigned int SCISSOR_BOX = 0x0C10;
+ /* SCISSOR_TEST */
+ const unsigned int COLOR_CLEAR_VALUE = 0x0C22;
+ const unsigned int COLOR_WRITEMASK = 0x0C23;
+ const unsigned int UNPACK_ALIGNMENT = 0x0CF5;
+ const unsigned int PACK_ALIGNMENT = 0x0D05;
+ const unsigned int MAX_TEXTURE_SIZE = 0x0D33;
+ const unsigned int MAX_VIEWPORT_DIMS = 0x0D3A;
+ const unsigned int SUBPIXEL_BITS = 0x0D50;
+ const unsigned int RED_BITS = 0x0D52;
+ const unsigned int GREEN_BITS = 0x0D53;
+ const unsigned int BLUE_BITS = 0x0D54;
+ const unsigned int ALPHA_BITS = 0x0D55;
+ const unsigned int DEPTH_BITS = 0x0D56;
+ const unsigned int STENCIL_BITS = 0x0D57;
+ const unsigned int POLYGON_OFFSET_UNITS = 0x2A00;
+ /* POLYGON_OFFSET_FILL */
+ const unsigned int POLYGON_OFFSET_FACTOR = 0x8038;
+ const unsigned int TEXTURE_BINDING_2D = 0x8069;
+ const unsigned int SAMPLE_BUFFERS = 0x80A8;
+ const unsigned int SAMPLES = 0x80A9;
+ const unsigned int SAMPLE_COVERAGE_VALUE = 0x80AA;
+ const unsigned int SAMPLE_COVERAGE_INVERT = 0x80AB;
+
+ /* GetTextureParameter */
+ /* TEXTURE_MAG_FILTER */
+ /* TEXTURE_MIN_FILTER */
+ /* TEXTURE_WRAP_S */
+ /* TEXTURE_WRAP_T */
+
+ const unsigned int COMPRESSED_TEXTURE_FORMATS = 0x86A3;
+
+ /* HintMode */
+ const unsigned int DONT_CARE = 0x1100;
+ const unsigned int FASTEST = 0x1101;
+ const unsigned int NICEST = 0x1102;
+
+ /* HintTarget */
+ const unsigned int GENERATE_MIPMAP_HINT = 0x8192;
+
+ /* DataType */
+ const unsigned int BYTE = 0x1400;
+ const unsigned int UNSIGNED_BYTE = 0x1401;
+ const unsigned int SHORT = 0x1402;
+ const unsigned int UNSIGNED_SHORT = 0x1403;
+ const unsigned int INT = 0x1404;
+ const unsigned int UNSIGNED_INT = 0x1405;
+ const unsigned int FLOAT = 0x1406;
+
+ /* PixelFormat */
+ const unsigned int DEPTH_COMPONENT = 0x1902;
+ const unsigned int ALPHA = 0x1906;
+ const unsigned int RGB = 0x1907;
+ const unsigned int RGBA = 0x1908;
+ const unsigned int LUMINANCE = 0x1909;
+ const unsigned int LUMINANCE_ALPHA = 0x190A;
+
+ /* PixelType */
+ /* UNSIGNED_BYTE */
+ const unsigned int UNSIGNED_SHORT_4_4_4_4 = 0x8033;
+ const unsigned int UNSIGNED_SHORT_5_5_5_1 = 0x8034;
+ const unsigned int UNSIGNED_SHORT_5_6_5 = 0x8363;
+
+ /* Shaders */
+ const unsigned int FRAGMENT_SHADER = 0x8B30;
+ const unsigned int VERTEX_SHADER = 0x8B31;
+ const unsigned int MAX_VERTEX_ATTRIBS = 0x8869;
+ const unsigned int MAX_VERTEX_UNIFORM_VECTORS = 0x8DFB;
+ const unsigned int MAX_VARYING_VECTORS = 0x8DFC;
+ const unsigned int MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D;
+ const unsigned int MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C;
+ const unsigned int MAX_TEXTURE_IMAGE_UNITS = 0x8872;
+ const unsigned int MAX_FRAGMENT_UNIFORM_VECTORS = 0x8DFD;
+ const unsigned int SHADER_TYPE = 0x8B4F;
+ const unsigned int DELETE_STATUS = 0x8B80;
+ const unsigned int LINK_STATUS = 0x8B82;
+ const unsigned int VALIDATE_STATUS = 0x8B83;
+ const unsigned int ATTACHED_SHADERS = 0x8B85;
+ const unsigned int ACTIVE_UNIFORMS = 0x8B86;
+ const unsigned int ACTIVE_ATTRIBUTES = 0x8B89;
+ const unsigned int SHADING_LANGUAGE_VERSION = 0x8B8C;
+ const unsigned int CURRENT_PROGRAM = 0x8B8D;
+
+ /* StencilFunction */
+ const unsigned int NEVER = 0x0200;
+ const unsigned int LESS = 0x0201;
+ const unsigned int EQUAL = 0x0202;
+ const unsigned int LEQUAL = 0x0203;
+ const unsigned int GREATER = 0x0204;
+ const unsigned int NOTEQUAL = 0x0205;
+ const unsigned int GEQUAL = 0x0206;
+ const unsigned int ALWAYS = 0x0207;
+
+ /* StencilOp */
+ /* ZERO */
+ const unsigned int KEEP = 0x1E00;
+ const unsigned int REPLACE = 0x1E01;
+ const unsigned int INCR = 0x1E02;
+ const unsigned int DECR = 0x1E03;
+ const unsigned int INVERT = 0x150A;
+ const unsigned int INCR_WRAP = 0x8507;
+ const unsigned int DECR_WRAP = 0x8508;
+
+ /* StringName */
+ const unsigned int VENDOR = 0x1F00;
+ const unsigned int RENDERER = 0x1F01;
+ const unsigned int VERSION = 0x1F02;
+
+ /* TextureMagFilter */
+ const unsigned int NEAREST = 0x2600;
+ const unsigned int LINEAR = 0x2601;
+
+ /* TextureMinFilter */
+ /* NEAREST */
+ /* LINEAR */
+ const unsigned int NEAREST_MIPMAP_NEAREST = 0x2700;
+ const unsigned int LINEAR_MIPMAP_NEAREST = 0x2701;
+ const unsigned int NEAREST_MIPMAP_LINEAR = 0x2702;
+ const unsigned int LINEAR_MIPMAP_LINEAR = 0x2703;
+
+ /* TextureParameterName */
+ const unsigned int TEXTURE_MAG_FILTER = 0x2800;
+ const unsigned int TEXTURE_MIN_FILTER = 0x2801;
+ const unsigned int TEXTURE_WRAP_S = 0x2802;
+ const unsigned int TEXTURE_WRAP_T = 0x2803;
+
+ /* TextureTarget */
+ /* TEXTURE_2D */
+ const unsigned int TEXTURE = 0x1702;
+
+ const unsigned int TEXTURE_CUBE_MAP = 0x8513;
+ const unsigned int TEXTURE_BINDING_CUBE_MAP = 0x8514;
+ const unsigned int TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515;
+ const unsigned int TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516;
+ const unsigned int TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517;
+ const unsigned int TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518;
+ const unsigned int TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519;
+ const unsigned int TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A;
+ const unsigned int MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C;
+
+ /* TextureUnit */
+ const unsigned int TEXTURE0 = 0x84C0;
+ const unsigned int TEXTURE1 = 0x84C1;
+ const unsigned int TEXTURE2 = 0x84C2;
+ const unsigned int TEXTURE3 = 0x84C3;
+ const unsigned int TEXTURE4 = 0x84C4;
+ const unsigned int TEXTURE5 = 0x84C5;
+ const unsigned int TEXTURE6 = 0x84C6;
+ const unsigned int TEXTURE7 = 0x84C7;
+ const unsigned int TEXTURE8 = 0x84C8;
+ const unsigned int TEXTURE9 = 0x84C9;
+ const unsigned int TEXTURE10 = 0x84CA;
+ const unsigned int TEXTURE11 = 0x84CB;
+ const unsigned int TEXTURE12 = 0x84CC;
+ const unsigned int TEXTURE13 = 0x84CD;
+ const unsigned int TEXTURE14 = 0x84CE;
+ const unsigned int TEXTURE15 = 0x84CF;
+ const unsigned int TEXTURE16 = 0x84D0;
+ const unsigned int TEXTURE17 = 0x84D1;
+ const unsigned int TEXTURE18 = 0x84D2;
+ const unsigned int TEXTURE19 = 0x84D3;
+ const unsigned int TEXTURE20 = 0x84D4;
+ const unsigned int TEXTURE21 = 0x84D5;
+ const unsigned int TEXTURE22 = 0x84D6;
+ const unsigned int TEXTURE23 = 0x84D7;
+ const unsigned int TEXTURE24 = 0x84D8;
+ const unsigned int TEXTURE25 = 0x84D9;
+ const unsigned int TEXTURE26 = 0x84DA;
+ const unsigned int TEXTURE27 = 0x84DB;
+ const unsigned int TEXTURE28 = 0x84DC;
+ const unsigned int TEXTURE29 = 0x84DD;
+ const unsigned int TEXTURE30 = 0x84DE;
+ const unsigned int TEXTURE31 = 0x84DF;
+ const unsigned int ACTIVE_TEXTURE = 0x84E0;
+
+ /* TextureWrapMode */
+ const unsigned int REPEAT = 0x2901;
+ const unsigned int CLAMP_TO_EDGE = 0x812F;
+ const unsigned int MIRRORED_REPEAT = 0x8370;
+
+ /* Uniform Types */
+ const unsigned int FLOAT_VEC2 = 0x8B50;
+ const unsigned int FLOAT_VEC3 = 0x8B51;
+ const unsigned int FLOAT_VEC4 = 0x8B52;
+ const unsigned int INT_VEC2 = 0x8B53;
+ const unsigned int INT_VEC3 = 0x8B54;
+ const unsigned int INT_VEC4 = 0x8B55;
+ const unsigned int BOOL = 0x8B56;
+ const unsigned int BOOL_VEC2 = 0x8B57;
+ const unsigned int BOOL_VEC3 = 0x8B58;
+ const unsigned int BOOL_VEC4 = 0x8B59;
+ const unsigned int FLOAT_MAT2 = 0x8B5A;
+ const unsigned int FLOAT_MAT3 = 0x8B5B;
+ const unsigned int FLOAT_MAT4 = 0x8B5C;
+ const unsigned int SAMPLER_2D = 0x8B5E;
+ const unsigned int SAMPLER_CUBE = 0x8B60;
+
+ /* Vertex Arrays */
+ const unsigned int VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622;
+ const unsigned int VERTEX_ATTRIB_ARRAY_SIZE = 0x8623;
+ const unsigned int VERTEX_ATTRIB_ARRAY_STRIDE = 0x8624;
+ const unsigned int VERTEX_ATTRIB_ARRAY_TYPE = 0x8625;
+ const unsigned int VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886A;
+ const unsigned int VERTEX_ATTRIB_ARRAY_POINTER = 0x8645;
+ const unsigned int VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F;
+
+ /* Shader Source */
+ const unsigned int COMPILE_STATUS = 0x8B81;
+
+ /* Shader Precision-Specified Types */
+ const unsigned int LOW_FLOAT = 0x8DF0;
+ const unsigned int MEDIUM_FLOAT = 0x8DF1;
+ const unsigned int HIGH_FLOAT = 0x8DF2;
+ const unsigned int LOW_INT = 0x8DF3;
+ const unsigned int MEDIUM_INT = 0x8DF4;
+ const unsigned int HIGH_INT = 0x8DF5;
+
+ /* Framebuffer Object. */
+ const unsigned int FRAMEBUFFER = 0x8D40;
+ const unsigned int RENDERBUFFER = 0x8D41;
+
+ const unsigned int RGBA4 = 0x8056;
+ const unsigned int RGB5_A1 = 0x8057;
+ const unsigned int RGB565 = 0x8D62;
+ const unsigned int DEPTH_COMPONENT16 = 0x81A5;
+ const unsigned int STENCIL_INDEX = 0x1901;
+ const unsigned int STENCIL_INDEX8 = 0x8D48;
+ const unsigned int DEPTH_STENCIL = 0x84F9;
+
+ const unsigned int RENDERBUFFER_WIDTH = 0x8D42;
+ const unsigned int RENDERBUFFER_HEIGHT = 0x8D43;
+ const unsigned int RENDERBUFFER_INTERNAL_FORMAT = 0x8D44;
+ const unsigned int RENDERBUFFER_RED_SIZE = 0x8D50;
+ const unsigned int RENDERBUFFER_GREEN_SIZE = 0x8D51;
+ const unsigned int RENDERBUFFER_BLUE_SIZE = 0x8D52;
+ const unsigned int RENDERBUFFER_ALPHA_SIZE = 0x8D53;
+ const unsigned int RENDERBUFFER_DEPTH_SIZE = 0x8D54;
+ const unsigned int RENDERBUFFER_STENCIL_SIZE = 0x8D55;
+
+ const unsigned int FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 0x8CD0;
+ const unsigned int FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 0x8CD1;
+ const unsigned int FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8CD2;
+ const unsigned int FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3;
+
+ const unsigned int COLOR_ATTACHMENT0 = 0x8CE0;
+ const unsigned int DEPTH_ATTACHMENT = 0x8D00;
+ const unsigned int STENCIL_ATTACHMENT = 0x8D20;
+ const unsigned int DEPTH_STENCIL_ATTACHMENT = 0x821A;
+
+ const unsigned int NONE = 0;
+
+ const unsigned int FRAMEBUFFER_COMPLETE = 0x8CD5;
+ const unsigned int FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6;
+ const unsigned int FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7;
+ const unsigned int FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 0x8CD9;
+ const unsigned int FRAMEBUFFER_UNSUPPORTED = 0x8CDD;
+
+ const unsigned int FRAMEBUFFER_BINDING = 0x8CA6;
+ const unsigned int RENDERBUFFER_BINDING = 0x8CA7;
+ const unsigned int MAX_RENDERBUFFER_SIZE = 0x84E8;
+
+ const unsigned int INVALID_FRAMEBUFFER_OPERATION = 0x0506;
+
+ /* WebGL-specific enums */
+ const unsigned int UNPACK_FLIP_Y_WEBGL = 0x9240;
+ const unsigned int UNPACK_PREMULTIPLY_ALPHA_WEBGL = 0x9241;
+ const unsigned int CONTEXT_LOST_WEBGL = 0x9242;
+ const unsigned int UNPACK_COLORSPACE_CONVERSION_WEBGL = 0x9243;
+ const unsigned int BROWSER_DEFAULT_WEBGL = 0x9244;
+
+ readonly attribute long drawingBufferWidth;
+ readonly attribute long drawingBufferHeight;
+
+ [StrictTypeChecking] void activeTexture(in unsigned long texture) raises(DOMException);
+ [StrictTypeChecking] void attachShader(in WebGLProgram program, in WebGLShader shader) raises(DOMException);
+ [StrictTypeChecking] void bindAttribLocation(in WebGLProgram program, in unsigned long index, in DOMString name) raises(DOMException);
+ [StrictTypeChecking] void bindBuffer(in unsigned long target, in WebGLBuffer buffer) raises(DOMException);
+ [StrictTypeChecking] void bindFramebuffer(in unsigned long target, in WebGLFramebuffer framebuffer) raises(DOMException);
+ [StrictTypeChecking] void bindRenderbuffer(in unsigned long target, in WebGLRenderbuffer renderbuffer) raises(DOMException);
+ [StrictTypeChecking] void bindTexture(in unsigned long target, in WebGLTexture texture) raises(DOMException);
+ [StrictTypeChecking] void blendColor(in float red, in float green, in float blue, in float alpha);
+ [StrictTypeChecking] void blendEquation( in unsigned long mode );
+ [StrictTypeChecking] void blendEquationSeparate(in unsigned long modeRGB, in unsigned long modeAlpha);
+ [StrictTypeChecking] void blendFunc(in unsigned long sfactor, in unsigned long dfactor);
+ [StrictTypeChecking] void blendFuncSeparate(in unsigned long srcRGB, in unsigned long dstRGB, in unsigned long srcAlpha, in unsigned long dstAlpha);
+ [StrictTypeChecking] void bufferData(in unsigned long target, in ArrayBuffer? data, in unsigned long usage) raises (DOMException);
+ [StrictTypeChecking] void bufferData(in unsigned long target, in ArrayBufferView? data, in unsigned long usage) raises (DOMException);
+ [StrictTypeChecking] void bufferData(in unsigned long target, in long long size, in unsigned long usage) raises (DOMException);
+ [StrictTypeChecking] void bufferSubData(in unsigned long target, in long long offset, in ArrayBuffer? data) raises (DOMException);
+ [StrictTypeChecking] void bufferSubData(in unsigned long target, in long long offset, in ArrayBufferView? data) raises (DOMException);
+
+ [StrictTypeChecking] unsigned long checkFramebufferStatus(in unsigned long target);
+ [StrictTypeChecking] void clear(in unsigned long mask);
+ [StrictTypeChecking] void clearColor(in float red, in float green, in float blue, in float alpha);
+ [StrictTypeChecking] void clearDepth(in float depth);
+ [StrictTypeChecking] void clearStencil(in long s);
+ [StrictTypeChecking] void colorMask(in boolean red, in boolean green, in boolean blue, in boolean alpha);
+ [StrictTypeChecking] void compileShader(in WebGLShader shader) raises(DOMException);
+
+ [StrictTypeChecking] void compressedTexImage2D(in unsigned long target, in long level, in unsigned long internalformat,
+ in long width, in long height, in long border, in ArrayBufferView data);
+ [StrictTypeChecking] void compressedTexSubImage2D(in unsigned long target, in long level, in long xoffset, in long yoffset,
+ in long width, in long height, in unsigned long format, in ArrayBufferView data);
+
+ [StrictTypeChecking] void copyTexImage2D(in unsigned long target, in long level, in unsigned long internalformat, in long x, in long y, in long width, in long height, in long border);
+ [StrictTypeChecking] void copyTexSubImage2D(in unsigned long target, in long level, in long xoffset, in long yoffset, in long x, in long y, in long width, in long height);
+
+ [StrictTypeChecking] WebGLBuffer createBuffer();
+ [StrictTypeChecking] WebGLFramebuffer createFramebuffer();
+ [StrictTypeChecking] WebGLProgram createProgram();
+ [StrictTypeChecking] WebGLRenderbuffer createRenderbuffer();
+ [StrictTypeChecking] WebGLShader createShader(in unsigned long type) raises(DOMException);
+ [StrictTypeChecking] WebGLTexture createTexture();
+
+ [StrictTypeChecking] void cullFace(in unsigned long mode);
+
+ [StrictTypeChecking] void deleteBuffer(in WebGLBuffer buffer);
+ [StrictTypeChecking] void deleteFramebuffer(in WebGLFramebuffer framebuffer);
+ [StrictTypeChecking] void deleteProgram(in WebGLProgram program);
+ [StrictTypeChecking] void deleteRenderbuffer(in WebGLRenderbuffer renderbuffer);
+ [StrictTypeChecking] void deleteShader(in WebGLShader shader);
+ [StrictTypeChecking] void deleteTexture(in WebGLTexture texture);
+
+ [StrictTypeChecking] void depthFunc(in unsigned long func);
+ [StrictTypeChecking] void depthMask(in boolean flag);
+ // FIXME: this differs from the current WebGL spec (depthRangef)
+ [StrictTypeChecking] void depthRange(in float zNear, in float zFar);
+ [StrictTypeChecking] void detachShader(in WebGLProgram program, in WebGLShader shader) raises(DOMException);
+ [StrictTypeChecking] void disable(in unsigned long cap);
+ [StrictTypeChecking] void disableVertexAttribArray(in unsigned long index) raises(DOMException);
+ [StrictTypeChecking] void drawArrays(in unsigned long mode, in long first, in long count) raises(DOMException);
+ [StrictTypeChecking] void drawElements(in unsigned long mode, in long count, in unsigned long type, in long long offset) raises(DOMException);
+
+ [StrictTypeChecking] void enable(in unsigned long cap);
+ [StrictTypeChecking] void enableVertexAttribArray(in unsigned long index) raises(DOMException);
+ [StrictTypeChecking] void finish();
+ [StrictTypeChecking] void flush();
+ [StrictTypeChecking] void framebufferRenderbuffer(in unsigned long target, in unsigned long attachment, in unsigned long renderbuffertarget, in WebGLRenderbuffer renderbuffer) raises(DOMException);
+ [StrictTypeChecking] void framebufferTexture2D(in unsigned long target, in unsigned long attachment, in unsigned long textarget, in WebGLTexture texture, in long level) raises(DOMException);
+ [StrictTypeChecking] void frontFace(in unsigned long mode);
+ [StrictTypeChecking] void generateMipmap(in unsigned long target);
+
+ [StrictTypeChecking] WebGLActiveInfo getActiveAttrib(in WebGLProgram program, in unsigned long index) raises (DOMException);
+ [StrictTypeChecking] WebGLActiveInfo getActiveUniform(in WebGLProgram program, in unsigned long index) raises (DOMException);
+
+ [StrictTypeChecking, Custom] void getAttachedShaders(in WebGLProgram program) raises (DOMException);
+
+ [StrictTypeChecking] int getAttribLocation(in WebGLProgram program, in DOMString name);
+
+ // any getBufferParameter(in unsigned long target, in unsigned long pname) raises(DOMException);
+ [StrictTypeChecking, Custom] void getBufferParameter();
+
+ [StrictTypeChecking] WebGLContextAttributes getContextAttributes();
+
+ [StrictTypeChecking] unsigned long getError();
+
+ // object getExtension(in DOMString name);
+ [StrictTypeChecking, Custom] void getExtension(in DOMString name);
+
+ // any getFramebufferAttachmentParameter(in unsigned long target, in unsigned long attachment, in unsigned long pname) raises(DOMException);
+ [StrictTypeChecking, Custom] void getFramebufferAttachmentParameter();
+ // any getParameter(in unsigned long pname) raises(DOMException);
+ [StrictTypeChecking, Custom] void getParameter();
+ // any getProgramParameter(in WebGLProgram program, in unsigned long pname) raises(DOMException);
+ [StrictTypeChecking, Custom] void getProgramParameter();
+ [StrictTypeChecking, TreatReturnedNullStringAs=Null] DOMString getProgramInfoLog(in WebGLProgram program) raises(DOMException);
+ // any getRenderbufferParameter(in unsigned long target, in unsigned long pname) raises(DOMException);
+ [StrictTypeChecking, Custom] void getRenderbufferParameter();
+ // any getShaderParameter(in WebGLShader shader, in unsigned long pname) raises(DOMException);
+ [StrictTypeChecking, Custom] void getShaderParameter() raises(DOMException);
+
+ [StrictTypeChecking, TreatReturnedNullStringAs=Null] DOMString getShaderInfoLog(in WebGLShader shader) raises(DOMException);
+
+ [StrictTypeChecking] WebGLShaderPrecisionFormat getShaderPrecisionFormat(in unsigned long shadertype, in unsigned long precisiontype) raises(DOMException);
+
+ [StrictTypeChecking, TreatReturnedNullStringAs=Null] DOMString getShaderSource(in WebGLShader shader) raises(DOMException);
+
+ // DOMString[] getSupportedExtensions()
+ [StrictTypeChecking, Custom] void getSupportedExtensions();
+
+ // any getTexParameter(in unsigned long target, in unsigned long pname) raises(DOMException);
+ [StrictTypeChecking, Custom] void getTexParameter();
+
+ // any getUniform(in WebGLProgram program, in WebGLUniformLocation location) raises(DOMException);
+ [StrictTypeChecking, Custom] void getUniform();
+
+ [StrictTypeChecking] WebGLUniformLocation getUniformLocation(in WebGLProgram program, in DOMString name) raises(DOMException);
+
+ // any getVertexAttrib(in unsigned long index, in unsigned long pname) raises(DOMException);
+ [StrictTypeChecking, Custom] void getVertexAttrib();
+
+ [StrictTypeChecking] long long getVertexAttribOffset(in unsigned long index, in unsigned long pname);
+
+ [StrictTypeChecking] void hint(in unsigned long target, in unsigned long mode);
+ [StrictTypeChecking] boolean isBuffer(in WebGLBuffer buffer);
+ [StrictTypeChecking] boolean isContextLost();
+ [StrictTypeChecking] boolean isEnabled(in unsigned long cap);
+ [StrictTypeChecking] boolean isFramebuffer(in WebGLFramebuffer framebuffer);
+ [StrictTypeChecking] boolean isProgram(in WebGLProgram program);
+ [StrictTypeChecking] boolean isRenderbuffer(in WebGLRenderbuffer renderbuffer);
+ [StrictTypeChecking] boolean isShader(in WebGLShader shader);
+ [StrictTypeChecking] boolean isTexture(in WebGLTexture texture);
+ [StrictTypeChecking] void lineWidth(in float width);
+ [StrictTypeChecking] void linkProgram(in WebGLProgram program) raises(DOMException);
+ [StrictTypeChecking] void pixelStorei(in unsigned long pname, in long param);
+ [StrictTypeChecking] void polygonOffset(in float factor, in float units);
+
+ [StrictTypeChecking] void readPixels(in long x, in long y, in long width, in long height, in unsigned long format, in unsigned long type, in ArrayBufferView pixels) raises(DOMException);
+
+ [StrictTypeChecking] void releaseShaderCompiler();
+ [StrictTypeChecking] void renderbufferStorage(in unsigned long target, in unsigned long internalformat, in long width, in long height);
+ [StrictTypeChecking] void sampleCoverage(in float value, in boolean invert);
+ [StrictTypeChecking] void scissor(in long x, in long y, in long width, in long height);
+ [StrictTypeChecking] void shaderSource(in WebGLShader shader, in DOMString string) raises(DOMException);
+ [StrictTypeChecking] void stencilFunc(in unsigned long func, in long ref, in unsigned long mask);
+ [StrictTypeChecking] void stencilFuncSeparate(in unsigned long face, in unsigned long func, in long ref, in unsigned long mask);
+ [StrictTypeChecking] void stencilMask(in unsigned long mask);
+ [StrictTypeChecking] void stencilMaskSeparate(in unsigned long face, in unsigned long mask);
+ [StrictTypeChecking] void stencilOp(in unsigned long fail, in unsigned long zfail, in unsigned long zpass);
+ [StrictTypeChecking] void stencilOpSeparate(in unsigned long face, in unsigned long fail, in unsigned long zfail, in unsigned long zpass);
+
+ [StrictTypeChecking] void texParameterf(in unsigned long target, in unsigned long pname, in float param);
+ [StrictTypeChecking] void texParameteri(in unsigned long target, in unsigned long pname, in long param);
+
+ // Supported forms:
+ [StrictTypeChecking] void texImage2D(in unsigned long target, in long level, in unsigned long internalformat, in long width, in long height,
+ in long border, in unsigned long format, in unsigned long type, in ArrayBufferView? pixels) raises (DOMException);
+ [StrictTypeChecking] void texImage2D(in unsigned long target, in long level, in unsigned long internalformat,
+ in unsigned long format, in unsigned long type, in ImageData? pixels) raises (DOMException);
+ [StrictTypeChecking] void texImage2D(in unsigned long target, in long level, in unsigned long internalformat,
+ in unsigned long format, in unsigned long type, in HTMLImageElement? image) raises (DOMException);
+ [StrictTypeChecking] void texImage2D(in unsigned long target, in long level, in unsigned long internalformat,
+ in unsigned long format, in unsigned long type, in HTMLCanvasElement? canvas) raises (DOMException);
#if defined(ENABLE_VIDEO) && ENABLE_VIDEO
- [StrictTypeChecking] void texImage2D(in unsigned long target, in long level, in unsigned long internalformat,
- in unsigned long format, in unsigned long type, in HTMLVideoElement? video) raises (DOMException);
+ [StrictTypeChecking] void texImage2D(in unsigned long target, in long level, in unsigned long internalformat,
+ in unsigned long format, in unsigned long type, in HTMLVideoElement? video) raises (DOMException);
#endif
- [StrictTypeChecking] void texSubImage2D(in unsigned long target, in long level, in long xoffset, in long yoffset,
- in long width, in long height,
- in unsigned long format, in unsigned long type, in ArrayBufferView? pixels) raises (DOMException);
- [StrictTypeChecking] void texSubImage2D(in unsigned long target, in long level, in long xoffset, in long yoffset,
- in unsigned long format, in unsigned long type, in ImageData? pixels) raises (DOMException);
- [StrictTypeChecking] void texSubImage2D(in unsigned long target, in long level, in long xoffset, in long yoffset,
- in unsigned long format, in unsigned long type, in HTMLImageElement? image) raises (DOMException);
- [StrictTypeChecking] void texSubImage2D(in unsigned long target, in long level, in long xoffset, in long yoffset,
- in unsigned long format, in unsigned long type, in HTMLCanvasElement? canvas) raises (DOMException);
+ [StrictTypeChecking] void texSubImage2D(in unsigned long target, in long level, in long xoffset, in long yoffset,
+ in long width, in long height,
+ in unsigned long format, in unsigned long type, in ArrayBufferView? pixels) raises (DOMException);
+ [StrictTypeChecking] void texSubImage2D(in unsigned long target, in long level, in long xoffset, in long yoffset,
+ in unsigned long format, in unsigned long type, in ImageData? pixels) raises (DOMException);
+ [StrictTypeChecking] void texSubImage2D(in unsigned long target, in long level, in long xoffset, in long yoffset,
+ in unsigned long format, in unsigned long type, in HTMLImageElement? image) raises (DOMException);
+ [StrictTypeChecking] void texSubImage2D(in unsigned long target, in long level, in long xoffset, in long yoffset,
+ in unsigned long format, in unsigned long type, in HTMLCanvasElement? canvas) raises (DOMException);
#if defined(ENABLE_VIDEO) && ENABLE_VIDEO
- [StrictTypeChecking] void texSubImage2D(in unsigned long target, in long level, in long xoffset, in long yoffset,
- in unsigned long format, in unsigned long type, in HTMLVideoElement? video) raises (DOMException);
+ [StrictTypeChecking] void texSubImage2D(in unsigned long target, in long level, in long xoffset, in long yoffset,
+ in unsigned long format, in unsigned long type, in HTMLVideoElement? video) raises (DOMException);
#endif
- [StrictTypeChecking] void uniform1f(in WebGLUniformLocation location, in float x) raises(DOMException);
- [StrictTypeChecking, Custom] void uniform1fv(in WebGLUniformLocation location, in Float32Array v) raises(DOMException);
- [StrictTypeChecking] void uniform1i(in WebGLUniformLocation location, in long x) raises(DOMException);
- [StrictTypeChecking, Custom] void uniform1iv(in WebGLUniformLocation location, in Int32Array v) raises(DOMException);
- [StrictTypeChecking] void uniform2f(in WebGLUniformLocation location, in float x, in float y) raises(DOMException);
- [StrictTypeChecking, Custom] void uniform2fv(in WebGLUniformLocation location, in Float32Array v) raises(DOMException);
- [StrictTypeChecking] void uniform2i(in WebGLUniformLocation location, in long x, in long y) raises(DOMException);
- [StrictTypeChecking, Custom] void uniform2iv(in WebGLUniformLocation location, in Int32Array v) raises(DOMException);
- [StrictTypeChecking] void uniform3f(in WebGLUniformLocation location, in float x, in float y, in float z) raises(DOMException);
- [StrictTypeChecking, Custom] void uniform3fv(in WebGLUniformLocation location, in Float32Array v) raises(DOMException);
- [StrictTypeChecking] void uniform3i(in WebGLUniformLocation location, in long x, in long y, in long z) raises(DOMException);
- [StrictTypeChecking, Custom] void uniform3iv(in WebGLUniformLocation location, in Int32Array v) raises(DOMException);
- [StrictTypeChecking] void uniform4f(in WebGLUniformLocation location, in float x, in float y, in float z, in float w) raises(DOMException);
- [StrictTypeChecking, Custom] void uniform4fv(in WebGLUniformLocation location, in Float32Array v) raises(DOMException);
- [StrictTypeChecking] void uniform4i(in WebGLUniformLocation location, in long x, in long y, in long z, in long w) raises(DOMException);
- [StrictTypeChecking, Custom] void uniform4iv(in WebGLUniformLocation location, in Int32Array v) raises(DOMException);
-
- [StrictTypeChecking, Custom] void uniformMatrix2fv(in WebGLUniformLocation location, in boolean transpose, in Float32Array array) raises(DOMException);
- [StrictTypeChecking, Custom] void uniformMatrix3fv(in WebGLUniformLocation location, in boolean transpose, in Float32Array array) raises(DOMException);
- [StrictTypeChecking, Custom] void uniformMatrix4fv(in WebGLUniformLocation location, in boolean transpose, in Float32Array array) raises(DOMException);
-
- [StrictTypeChecking] void useProgram(in WebGLProgram program) raises(DOMException);
- [StrictTypeChecking] void validateProgram(in WebGLProgram program) raises(DOMException);
-
- [StrictTypeChecking] void vertexAttrib1f(in unsigned long indx, in float x);
- [StrictTypeChecking, Custom] void vertexAttrib1fv(in unsigned long indx, in Float32Array values);
- [StrictTypeChecking] void vertexAttrib2f(in unsigned long indx, in float x, in float y);
- [StrictTypeChecking, Custom] void vertexAttrib2fv(in unsigned long indx, in Float32Array values);
- [StrictTypeChecking] void vertexAttrib3f(in unsigned long indx, in float x, in float y, in float z);
- [StrictTypeChecking, Custom] void vertexAttrib3fv(in unsigned long indx, in Float32Array values);
- [StrictTypeChecking] void vertexAttrib4f(in unsigned long indx, in float x, in float y, in float z, in float w);
- [StrictTypeChecking, Custom] void vertexAttrib4fv(in unsigned long indx, in Float32Array values);
- [StrictTypeChecking] void vertexAttribPointer(in unsigned long indx, in long size, in unsigned long type, in boolean normalized,
- in long stride, in long long offset) raises(DOMException);
-
- [StrictTypeChecking] void viewport(in long x, in long y, in long width, in long height);
-};
+ [StrictTypeChecking] void uniform1f(in WebGLUniformLocation location, in float x) raises(DOMException);
+ [StrictTypeChecking, Custom] void uniform1fv(in WebGLUniformLocation location, in Float32Array v) raises(DOMException);
+ [StrictTypeChecking] void uniform1i(in WebGLUniformLocation location, in long x) raises(DOMException);
+ [StrictTypeChecking, Custom] void uniform1iv(in WebGLUniformLocation location, in Int32Array v) raises(DOMException);
+ [StrictTypeChecking] void uniform2f(in WebGLUniformLocation location, in float x, in float y) raises(DOMException);
+ [StrictTypeChecking, Custom] void uniform2fv(in WebGLUniformLocation location, in Float32Array v) raises(DOMException);
+ [StrictTypeChecking] void uniform2i(in WebGLUniformLocation location, in long x, in long y) raises(DOMException);
+ [StrictTypeChecking, Custom] void uniform2iv(in WebGLUniformLocation location, in Int32Array v) raises(DOMException);
+ [StrictTypeChecking] void uniform3f(in WebGLUniformLocation location, in float x, in float y, in float z) raises(DOMException);
+ [StrictTypeChecking, Custom] void uniform3fv(in WebGLUniformLocation location, in Float32Array v) raises(DOMException);
+ [StrictTypeChecking] void uniform3i(in WebGLUniformLocation location, in long x, in long y, in long z) raises(DOMException);
+ [StrictTypeChecking, Custom] void uniform3iv(in WebGLUniformLocation location, in Int32Array v) raises(DOMException);
+ [StrictTypeChecking] void uniform4f(in WebGLUniformLocation location, in float x, in float y, in float z, in float w) raises(DOMException);
+ [StrictTypeChecking, Custom] void uniform4fv(in WebGLUniformLocation location, in Float32Array v) raises(DOMException);
+ [StrictTypeChecking] void uniform4i(in WebGLUniformLocation location, in long x, in long y, in long z, in long w) raises(DOMException);
+ [StrictTypeChecking, Custom] void uniform4iv(in WebGLUniformLocation location, in Int32Array v) raises(DOMException);
+
+ [StrictTypeChecking, Custom] void uniformMatrix2fv(in WebGLUniformLocation location, in boolean transpose, in Float32Array array) raises(DOMException);
+ [StrictTypeChecking, Custom] void uniformMatrix3fv(in WebGLUniformLocation location, in boolean transpose, in Float32Array array) raises(DOMException);
+ [StrictTypeChecking, Custom] void uniformMatrix4fv(in WebGLUniformLocation location, in boolean transpose, in Float32Array array) raises(DOMException);
+
+ [StrictTypeChecking] void useProgram(in WebGLProgram program) raises(DOMException);
+ [StrictTypeChecking] void validateProgram(in WebGLProgram program) raises(DOMException);
+
+ [StrictTypeChecking] void vertexAttrib1f(in unsigned long indx, in float x);
+ [StrictTypeChecking, Custom] void vertexAttrib1fv(in unsigned long indx, in Float32Array values);
+ [StrictTypeChecking] void vertexAttrib2f(in unsigned long indx, in float x, in float y);
+ [StrictTypeChecking, Custom] void vertexAttrib2fv(in unsigned long indx, in Float32Array values);
+ [StrictTypeChecking] void vertexAttrib3f(in unsigned long indx, in float x, in float y, in float z);
+ [StrictTypeChecking, Custom] void vertexAttrib3fv(in unsigned long indx, in Float32Array values);
+ [StrictTypeChecking] void vertexAttrib4f(in unsigned long indx, in float x, in float y, in float z, in float w);
+ [StrictTypeChecking, Custom] void vertexAttrib4fv(in unsigned long indx, in Float32Array values);
+ [StrictTypeChecking] void vertexAttribPointer(in unsigned long indx, in long size, in unsigned long type, in boolean normalized,
+ in long stride, in long long offset) raises(DOMException);
+
+ [StrictTypeChecking] void viewport(in long x, in long y, in long width, in long height);
+ };
+}
+
diff --git a/Source/WebCore/html/canvas/WebGLShader.idl b/Source/WebCore/html/canvas/WebGLShader.idl
index 0ebae3829..2aeb704d6 100644
--- a/Source/WebCore/html/canvas/WebGLShader.idl
+++ b/Source/WebCore/html/canvas/WebGLShader.idl
@@ -23,7 +23,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- Conditional=WEBGL
-] interface WebGLShader {
-};
+module html {
+ interface [
+ Conditional=WEBGL
+ ] WebGLShader {
+ };
+}
diff --git a/Source/WebCore/html/canvas/WebGLShaderPrecisionFormat.idl b/Source/WebCore/html/canvas/WebGLShaderPrecisionFormat.idl
index a217fcb89..95294f942 100644
--- a/Source/WebCore/html/canvas/WebGLShaderPrecisionFormat.idl
+++ b/Source/WebCore/html/canvas/WebGLShaderPrecisionFormat.idl
@@ -24,11 +24,14 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- Conditional=WEBGL,
-] interface WebGLShaderPrecisionFormat {
- readonly attribute long rangeMin;
- readonly attribute long rangeMax;
- readonly attribute long precision;
-};
+module html {
+ interface [
+ Conditional=WEBGL,
+ ] WebGLShaderPrecisionFormat {
+ readonly attribute long rangeMin;
+ readonly attribute long rangeMax;
+ readonly attribute long precision;
+ };
+
+}
diff --git a/Source/WebCore/html/canvas/WebGLTexture.idl b/Source/WebCore/html/canvas/WebGLTexture.idl
index 1ea2f2bca..8e72dd34d 100644
--- a/Source/WebCore/html/canvas/WebGLTexture.idl
+++ b/Source/WebCore/html/canvas/WebGLTexture.idl
@@ -23,7 +23,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- Conditional=WEBGL
-] interface WebGLTexture {
-};
+module html {
+ interface [
+ Conditional=WEBGL
+ ] WebGLTexture {
+ };
+}
diff --git a/Source/WebCore/html/canvas/WebGLUniformLocation.idl b/Source/WebCore/html/canvas/WebGLUniformLocation.idl
index c211189de..eb3167cd9 100644
--- a/Source/WebCore/html/canvas/WebGLUniformLocation.idl
+++ b/Source/WebCore/html/canvas/WebGLUniformLocation.idl
@@ -24,7 +24,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- Conditional=WEBGL
-] interface WebGLUniformLocation {
-};
+module html {
+ interface [
+ Conditional=WEBGL
+ ] WebGLUniformLocation {
+ };
+}
diff --git a/Source/WebCore/html/canvas/WebGLVertexArrayObjectOES.idl b/Source/WebCore/html/canvas/WebGLVertexArrayObjectOES.idl
index 1e78ddd37..0abbe0746 100644
--- a/Source/WebCore/html/canvas/WebGLVertexArrayObjectOES.idl
+++ b/Source/WebCore/html/canvas/WebGLVertexArrayObjectOES.idl
@@ -23,7 +23,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- Conditional=WEBGL
-] interface WebGLVertexArrayObjectOES {
-};
+module html {
+ interface [
+ Conditional=WEBGL
+ ] WebGLVertexArrayObjectOES {
+ };
+}
diff --git a/Source/WebCore/html/parser/HTMLConstructionSite.cpp b/Source/WebCore/html/parser/HTMLConstructionSite.cpp
index 2ea904dea..0d66be471 100644
--- a/Source/WebCore/html/parser/HTMLConstructionSite.cpp
+++ b/Source/WebCore/html/parser/HTMLConstructionSite.cpp
@@ -368,7 +368,7 @@ void HTMLConstructionSite::insertTextNode(const String& characters, WhitespaceMo
// FIXME: We're only supposed to append to this text node if it
// was the last text node inserted by the parser.
CharacterData* textNode = static_cast<CharacterData*>(previousChild);
- currentPosition = textNode->parserAppendData(characters, 0, Text::defaultLengthLimit);
+ currentPosition = textNode->parserAppendData(characters.characters(), characters.length(), Text::defaultLengthLimit);
}
while (currentPosition < characters.length()) {
diff --git a/Source/WebCore/html/shadow/PickerIndicatorElement.cpp b/Source/WebCore/html/shadow/CalendarPickerElement.cpp
index fa25bd673..7513f5b71 100644
--- a/Source/WebCore/html/shadow/PickerIndicatorElement.cpp
+++ b/Source/WebCore/html/shadow/CalendarPickerElement.cpp
@@ -29,7 +29,7 @@
*/
#include "config.h"
-#include "PickerIndicatorElement.h"
+#include "CalendarPickerElement.h"
#if ENABLE(CALENDAR_PICKER)
@@ -49,39 +49,39 @@ namespace WebCore {
using namespace HTMLNames;
-inline PickerIndicatorElement::PickerIndicatorElement(Document* document)
+inline CalendarPickerElement::CalendarPickerElement(Document* document)
: HTMLDivElement(divTag, document)
, m_chooser(nullptr)
{
setShadowPseudoId("-webkit-calendar-picker-indicator");
}
-PassRefPtr<PickerIndicatorElement> PickerIndicatorElement::create(Document* document)
+PassRefPtr<CalendarPickerElement> CalendarPickerElement::create(Document* document)
{
- return adoptRef(new PickerIndicatorElement(document));
+ return adoptRef(new CalendarPickerElement(document));
}
-PickerIndicatorElement::~PickerIndicatorElement()
+CalendarPickerElement::~CalendarPickerElement()
{
closePopup();
ASSERT(!m_chooser);
}
-RenderObject* PickerIndicatorElement::createRenderer(RenderArena* arena, RenderStyle*)
+RenderObject* CalendarPickerElement::createRenderer(RenderArena* arena, RenderStyle*)
{
return new (arena) RenderDetailsMarker(this);
}
-inline HTMLInputElement* PickerIndicatorElement::hostInput()
+inline HTMLInputElement* CalendarPickerElement::hostInput()
{
- // JavaScript code can't create PickerIndicatorElement objects. This is
+ // JavaScript code can't create CalendarPickerElement objects. This is
// always in shadow of <input>.
ASSERT(shadowHost());
ASSERT(shadowHost()->hasTagName(inputTag));
return static_cast<HTMLInputElement*>(shadowHost());
}
-void PickerIndicatorElement::defaultEventHandler(Event* event)
+void CalendarPickerElement::defaultEventHandler(Event* event)
{
if (!renderer())
return;
@@ -98,7 +98,7 @@ void PickerIndicatorElement::defaultEventHandler(Event* event)
HTMLDivElement::defaultEventHandler(event);
}
-bool PickerIndicatorElement::willRespondToMouseClickEvents()
+bool CalendarPickerElement::willRespondToMouseClickEvents()
{
const HTMLInputElement* input = hostInput();
if (renderer() && !input->readOnly() && !input->disabled())
@@ -107,17 +107,17 @@ bool PickerIndicatorElement::willRespondToMouseClickEvents()
return HTMLDivElement::willRespondToMouseClickEvents();
}
-void PickerIndicatorElement::didChooseValue(const String& value)
+void CalendarPickerElement::didChooseValue(const String& value)
{
hostInput()->setValue(value, DispatchChangeEvent);
}
-void PickerIndicatorElement::didEndChooser()
+void CalendarPickerElement::didEndChooser()
{
m_chooser.clear();
}
-void PickerIndicatorElement::openPopup()
+void CalendarPickerElement::openPopup()
{
if (m_chooser)
return;
@@ -135,19 +135,13 @@ void PickerIndicatorElement::openPopup()
parameters.minimum = input->minimum();
parameters.maximum = input->maximum();
parameters.required = input->required();
-
- StepRange stepRange = input->createStepRange(RejectAny);
- if (stepRange.hasStep()) {
- parameters.step = stepRange.step().toDouble();
- parameters.stepBase = stepRange.stepBase().toDouble();
- } else {
+ Decimal step;
+ if (hostInput()->getAllowedValueStep(&step))
parameters.step = 1.0;
- parameters.stepBase = 0;
- }
-
+ else
+ parameters.step = step.toDouble();
parameters.anchorRectInRootView = document()->view()->contentsToRootView(hostInput()->pixelSnappedBoundingBox());
parameters.currentValue = input->value();
- parameters.isAnchorElementRTL = input->computedStyle()->direction() == RTL;
if (HTMLDataListElement* dataList = input->dataList()) {
RefPtr<HTMLCollection> options = dataList->options();
for (unsigned i = 0; HTMLOptionElement* option = toHTMLOptionElement(options->item(i)); ++i) {
@@ -161,14 +155,14 @@ void PickerIndicatorElement::openPopup()
m_chooser = chrome->client()->openDateTimeChooser(this, parameters);
}
-void PickerIndicatorElement::closePopup()
+void CalendarPickerElement::closePopup()
{
if (!m_chooser)
return;
m_chooser->endChooser();
}
-void PickerIndicatorElement::detach()
+void CalendarPickerElement::detach()
{
closePopup();
HTMLDivElement::detach();
diff --git a/Source/WebCore/html/shadow/PickerIndicatorElement.h b/Source/WebCore/html/shadow/CalendarPickerElement.h
index 1d891c22a..f90347864 100644
--- a/Source/WebCore/html/shadow/PickerIndicatorElement.h
+++ b/Source/WebCore/html/shadow/CalendarPickerElement.h
@@ -28,8 +28,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef PickerIndicatorElement_h
-#define PickerIndicatorElement_h
+#ifndef CalendarPickerElement_h
+#define CalendarPickerElement_h
#if ENABLE(CALENDAR_PICKER)
@@ -43,10 +43,10 @@ namespace WebCore {
class HTMLInputElement;
class PagePopup;
-class PickerIndicatorElement : public HTMLDivElement, public DateTimeChooserClient {
+class CalendarPickerElement : public HTMLDivElement, public DateTimeChooserClient {
public:
- static PassRefPtr<PickerIndicatorElement> create(Document*);
- virtual ~PickerIndicatorElement();
+ static PassRefPtr<CalendarPickerElement> create(Document*);
+ virtual ~CalendarPickerElement();
void openPopup();
void closePopup();
virtual bool willRespondToMouseClickEvents() OVERRIDE;
@@ -56,7 +56,7 @@ public:
virtual void didEndChooser() OVERRIDE;
private:
- PickerIndicatorElement(Document*);
+ CalendarPickerElement(Document*);
virtual RenderObject* createRenderer(RenderArena*, RenderStyle*) OVERRIDE;
virtual void defaultEventHandler(Event*) OVERRIDE;
virtual void detach() OVERRIDE;
diff --git a/Source/WebCore/html/shadow/ContentDistributor.cpp b/Source/WebCore/html/shadow/ContentDistributor.cpp
index 40059c609..076a723c8 100644
--- a/Source/WebCore/html/shadow/ContentDistributor.cpp
+++ b/Source/WebCore/html/shadow/ContentDistributor.cpp
@@ -57,21 +57,8 @@ void ContentDistributor::distribute(Element* host)
m_validity = Valid;
ContentDistribution pool;
- for (Node* node = host->firstChild(); node; node = node->nextSibling()) {
- if (!isInsertionPoint(node)) {
- pool.append(node);
- continue;
- }
-
- InsertionPoint* insertionPoint = toInsertionPoint(node);
- if (insertionPoint->hasDistribution()) {
- for (size_t i = 0; i < insertionPoint->size(); ++i)
- pool.append(insertionPoint->at(i));
- } else {
- for (Node* fallbackNode = insertionPoint->firstChild(); fallbackNode; fallbackNode = fallbackNode->nextSibling())
- pool.append(fallbackNode);
- }
- }
+ for (Node* node = host->firstChild(); node; node = node->nextSibling())
+ pool.append(node);
Vector<bool> distributed(pool.size());
distributed.fill(false);
@@ -130,10 +117,10 @@ void ContentDistributor::distributeSelectionsTo(InsertionPoint* insertionPoint,
if (distributed[i])
continue;
- if (!query.matches(pool, i))
+ Node* child = pool[i].get();
+ if (!query.matches(child))
continue;
- Node* child = pool[i].get();
distribution.append(child);
m_nodeToInsertionPoint.add(child, insertionPoint);
distributed[i] = true;
diff --git a/Source/WebCore/html/shadow/ContentSelectorQuery.cpp b/Source/WebCore/html/shadow/ContentSelectorQuery.cpp
index 0a6ec32ee..f12c59925 100644
--- a/Source/WebCore/html/shadow/ContentSelectorQuery.cpp
+++ b/Source/WebCore/html/shadow/ContentSelectorQuery.cpp
@@ -30,45 +30,16 @@
#include "CSSParser.h"
#include "CSSSelectorList.h"
#include "InsertionPoint.h"
-#include "SelectorChecker.h"
#include "ShadowRoot.h"
-#include "SiblingTraversalStrategies.h"
namespace WebCore {
-ContentSelectorChecker::ContentSelectorChecker(Document* document, bool strictParsing)
- : m_selectorChecker(document, strictParsing)
-{
- m_selectorChecker.setMode(SelectorChecker::CollectingRules);
-}
-
-bool ContentSelectorChecker::checkContentSelector(CSSSelector* selector, const Vector<RefPtr<Node> >& siblings, int nth) const
-{
- SelectorChecker::SelectorCheckingContext context(selector, toElement(siblings[nth].get()), SelectorChecker::VisitedMatchEnabled);
- ShadowDOMSiblingTraversalStrategy strategy(siblings, nth);
- return m_selectorChecker.checkOneSelector(context, strategy);
-}
-
-void ContentSelectorDataList::initialize(const CSSSelectorList& selectors)
-{
- for (CSSSelector* selector = selectors.first(); selector; selector = CSSSelectorList::next(selector))
- m_selectors.append(selector);
-}
-
-bool ContentSelectorDataList::matches(const ContentSelectorChecker& selectorChecker, const Vector<RefPtr<Node> >& siblings, int nth) const
-{
- unsigned selectorCount = m_selectors.size();
- for (unsigned i = 0; i < selectorCount; ++i) {
- if (selectorChecker.checkContentSelector(m_selectors[i], siblings, nth))
- return true;
- }
- return false;
-}
-
ContentSelectorQuery::ContentSelectorQuery(const InsertionPoint* insertionPoint)
: m_insertionPoint(insertionPoint)
, m_selectorChecker(insertionPoint->document(), !insertionPoint->document()->inQuirksMode())
{
+ m_selectorChecker.setMode(SelectorChecker::CollectingRules);
+
if (insertionPoint->select().isNull() || insertionPoint->select().isEmpty()) {
m_isValidSelector = true;
return;
@@ -87,10 +58,13 @@ bool ContentSelectorQuery::isValidSelector() const
return m_isValidSelector;
}
-bool ContentSelectorQuery::matches(const Vector<RefPtr<Node> >& siblings, int nth) const
+bool ContentSelectorQuery::matches(Node* node) const
{
- Node* node = siblings[nth].get();
ASSERT(node);
+ if (!node)
+ return false;
+
+ ASSERT(node->parentNode() == m_insertionPoint->shadowRoot()->host());
if (m_insertionPoint->select().isNull() || m_insertionPoint->select().isEmpty())
return true;
@@ -101,7 +75,7 @@ bool ContentSelectorQuery::matches(const Vector<RefPtr<Node> >& siblings, int nt
if (!node->isElementNode())
return false;
- return m_selectors.matches(m_selectorChecker, siblings, nth);
+ return m_selectors.matches(m_selectorChecker, toElement(node));
}
static bool validateSubSelector(CSSSelector* selector)
diff --git a/Source/WebCore/html/shadow/ContentSelectorQuery.h b/Source/WebCore/html/shadow/ContentSelectorQuery.h
index 2c710a585..94fa3efcc 100644
--- a/Source/WebCore/html/shadow/ContentSelectorQuery.h
+++ b/Source/WebCore/html/shadow/ContentSelectorQuery.h
@@ -43,41 +43,25 @@ class Document;
class Node;
class InsertionPoint;
-class ContentSelectorChecker {
-public:
- ContentSelectorChecker(Document*, bool strictParsing);
-
- bool checkContentSelector(CSSSelector*, const Vector<RefPtr<Node> >& siblings, int nthNode) const;
-private:
- SelectorChecker m_selectorChecker;
-};
-
-class ContentSelectorDataList {
-public:
- void initialize(const CSSSelectorList&);
- bool matches(const ContentSelectorChecker&, const Vector<RefPtr<Node> >& siblings, int nthNode) const;
-
-private:
- Vector<CSSSelector*> m_selectors;
-};
-
class ContentSelectorQuery {
WTF_MAKE_NONCOPYABLE(ContentSelectorQuery);
public:
explicit ContentSelectorQuery(const InsertionPoint*);
bool isValidSelector() const;
- bool matches(const Vector<RefPtr<Node> >& siblings, int nthNode) const;
+ bool matches(Node*) const;
private:
bool validateSelectorList();
const InsertionPoint* m_insertionPoint;
- ContentSelectorDataList m_selectors;
+ SelectorDataList m_selectors;
CSSSelectorList m_selectorList;
- ContentSelectorChecker m_selectorChecker;
+ SelectorChecker m_selectorChecker;
bool m_isValidSelector;
};
}
+
+
#endif
diff --git a/Source/WebCore/html/shadow/DateTimeEditElement.cpp b/Source/WebCore/html/shadow/DateTimeEditElement.cpp
index 047ee3584..9a0d932bb 100644
--- a/Source/WebCore/html/shadow/DateTimeEditElement.cpp
+++ b/Source/WebCore/html/shadow/DateTimeEditElement.cpp
@@ -24,7 +24,7 @@
*/
#include "config.h"
-#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
+#if ENABLE(INPUT_TYPE_TIME_MULTIPLE_FIELDS)
#include "DateTimeEditElement.h"
#include "DateComponents.h"
@@ -49,7 +49,6 @@ class DateTimeEditBuilder : private DateTimeFormat::TokenHandler {
WTF_MAKE_NONCOPYABLE(DateTimeEditBuilder);
public:
- // The argument objects must be alive until this object dies.
DateTimeEditBuilder(DateTimeEditElement&, const DateTimeEditElement::LayoutParameters&, const DateComponents&);
bool build(const String&);
@@ -59,21 +58,22 @@ private:
bool shouldMillisecondFieldReadOnly() const;
bool shouldMinuteFieldReadOnly() const;
bool shouldSecondFieldReadOnly() const;
- inline const StepRange& stepRange() const { return m_parameters.stepRange; }
// DateTimeFormat::TokenHandler functions.
virtual void visitField(DateTimeFormat::FieldType, int) OVERRIDE FINAL;
virtual void visitLiteral(const String&) OVERRIDE FINAL;
DateTimeEditElement& m_editElement;
- const DateComponents m_dateValue;
- const DateTimeEditElement::LayoutParameters& m_parameters;
+ const DateComponents& m_dateValue;
+ const StepRange& m_stepRange;
+ Localizer& m_localizer;
};
DateTimeEditBuilder::DateTimeEditBuilder(DateTimeEditElement& elemnt, const DateTimeEditElement::LayoutParameters& layoutParameters, const DateComponents& dateValue)
: m_editElement(elemnt)
, m_dateValue(dateValue)
- , m_parameters(layoutParameters)
+ , m_stepRange(layoutParameters.stepRange)
+ , m_localizer(layoutParameters.localizer)
{
}
@@ -86,8 +86,8 @@ bool DateTimeEditBuilder::build(const String& formatString)
bool DateTimeEditBuilder::needMillisecondField() const
{
return m_dateValue.millisecond()
- || !stepRange().minimum().remainder(static_cast<int>(msPerSecond)).isZero()
- || !stepRange().step().remainder(static_cast<int>(msPerSecond)).isZero();
+ || !m_stepRange.minimum().remainder(static_cast<int>(msPerSecond)).isZero()
+ || !m_stepRange.step().remainder(static_cast<int>(msPerSecond)).isZero();
}
void DateTimeEditBuilder::visitField(DateTimeFormat::FieldType fieldType, int)
@@ -95,10 +95,6 @@ void DateTimeEditBuilder::visitField(DateTimeFormat::FieldType fieldType, int)
Document* const document = m_editElement.document();
switch (fieldType) {
- case DateTimeFormat::FieldTypeDayOfMonth:
- m_editElement.addField(DateTimeDayFieldElement::create(document, m_editElement, m_parameters.placeholderForDay));
- return;
-
case DateTimeFormat::FieldTypeHour11:
m_editElement.addField(DateTimeHourFieldElement::create(document, m_editElement, 0, 11));
return;
@@ -123,13 +119,8 @@ void DateTimeEditBuilder::visitField(DateTimeFormat::FieldType fieldType, int)
return;
}
- case DateTimeFormat::FieldTypeMonth:
- // We always use "MM", two digits month, even if "M", "MMM", "MMMM", or "MMMMM".
- m_editElement.addField(DateTimeMonthFieldElement::create(document, m_editElement, m_parameters.placeholderForMonth));
- return;
-
case DateTimeFormat::FieldTypePeriod:
- m_editElement.addField(DateTimeAMPMFieldElement::create(document, m_editElement, m_parameters.localizer.timeAMPMLabels()));
+ m_editElement.addField(DateTimeAMPMFieldElement::create(document, m_editElement, m_localizer.timeAMPMLabels()));
return;
case DateTimeFormat::FieldTypeSecond: {
@@ -139,7 +130,7 @@ void DateTimeEditBuilder::visitField(DateTimeFormat::FieldType fieldType, int)
field->setReadOnly();
if (needMillisecondField()) {
- visitLiteral(m_parameters.localizer.localizedDecimalSeparator());
+ visitLiteral(m_localizer.localizedDecimalSeparator());
visitField(DateTimeFormat::FieldTypeFractionalSecond, 3);
}
return;
@@ -153,35 +144,6 @@ void DateTimeEditBuilder::visitField(DateTimeFormat::FieldType fieldType, int)
return;
}
- case DateTimeFormat::FieldTypeWeekOfYear:
- m_editElement.addField(DateTimeWeekFieldElement::create(document, m_editElement));
- return;
-
- case DateTimeFormat::FieldTypeYear: {
- DateTimeYearFieldElement::Parameters yearParams;
- if (m_parameters.minimumYear == m_parameters.undefinedYear()) {
- yearParams.minimumYear = DateComponents::minimumYear();
- yearParams.minIsSpecified = false;
- } else {
- yearParams.minimumYear = m_parameters.minimumYear;
- yearParams.minIsSpecified = true;
- }
- if (m_parameters.maximumYear == m_parameters.undefinedYear()) {
- yearParams.maximumYear = DateComponents::maximumYear();
- yearParams.maxIsSpecified = false;
- } else {
- yearParams.maximumYear = m_parameters.maximumYear;
- yearParams.maxIsSpecified = true;
- }
- if (yearParams.minimumYear > yearParams.maximumYear) {
- std::swap(yearParams.minimumYear, yearParams.maximumYear);
- std::swap(yearParams.minIsSpecified, yearParams.maxIsSpecified);
- }
- yearParams.placeholder = m_parameters.placeholderForYear;
- m_editElement.addField(DateTimeYearFieldElement::create(document, m_editElement, yearParams));
- return;
- }
-
default:
return;
}
@@ -189,17 +151,17 @@ void DateTimeEditBuilder::visitField(DateTimeFormat::FieldType fieldType, int)
bool DateTimeEditBuilder::shouldMillisecondFieldReadOnly() const
{
- return !m_dateValue.millisecond() && stepRange().step().remainder(static_cast<int>(msPerSecond)).isZero();
+ return !m_dateValue.millisecond() && m_stepRange.step().remainder(static_cast<int>(msPerSecond)).isZero();
}
bool DateTimeEditBuilder::shouldMinuteFieldReadOnly() const
{
- return !m_dateValue.minute() && stepRange().step().remainder(static_cast<int>(msPerHour)).isZero();
+ return !m_dateValue.minute() && m_stepRange.step().remainder(static_cast<int>(msPerHour)).isZero();
}
bool DateTimeEditBuilder::shouldSecondFieldReadOnly() const
{
- return !m_dateValue.second() && stepRange().step().remainder(static_cast<int>(msPerMinute)).isZero();
+ return !m_dateValue.second() && m_stepRange.step().remainder(static_cast<int>(msPerMinute)).isZero();
}
void DateTimeEditBuilder::visitLiteral(const String& text)
@@ -210,6 +172,15 @@ void DateTimeEditBuilder::visitLiteral(const String& text)
// ----------------------------
+
+bool DateTimeEditElement::LayoutParameters::shouldHaveSecondField() const
+{
+ return !stepRange.minimum().remainder(static_cast<int>(msPerMinute)).isZero()
+ || !stepRange.step().remainder(static_cast<int>(msPerMinute)).isZero();
+}
+
+// ----------------------------
+
DateTimeEditElement::EditControlOwner::~EditControlOwner()
{
}
@@ -354,11 +325,6 @@ bool DateTimeEditElement::isDisabled() const
return m_editControlOwner && m_editControlOwner->isEditControlOwnerDisabled();
}
-bool DateTimeEditElement::isFieldOwnerDisabledOrReadOnly() const
-{
- return isDisabled() || isReadOnly();
-}
-
bool DateTimeEditElement::isReadOnly() const
{
return m_editControlOwner && m_editControlOwner->isEditControlOwnerReadOnly();
@@ -401,11 +367,6 @@ void DateTimeEditElement::layout(const LayoutParameters& layoutParameters, const
appendChild(spinButton);
}
-AtomicString DateTimeEditElement::localeIdentifier() const
-{
- return m_editControlOwner ? m_editControlOwner->localeIdentifier() : nullAtom;
-}
-
void DateTimeEditElement::readOnlyStateChanged()
{
updateUIState();
diff --git a/Source/WebCore/html/shadow/DateTimeEditElement.h b/Source/WebCore/html/shadow/DateTimeEditElement.h
index f039e9954..84cf229c6 100644
--- a/Source/WebCore/html/shadow/DateTimeEditElement.h
+++ b/Source/WebCore/html/shadow/DateTimeEditElement.h
@@ -26,7 +26,7 @@
#ifndef DateTimeEditElement_h
#define DateTimeEditElement_h
-#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
+#if ENABLE(INPUT_TYPE_TIME_MULTIPLE_FIELDS)
#include "DateTimeFieldElement.h"
#include "SpinButtonElement.h"
#include "StepRange.h"
@@ -58,29 +58,21 @@ public:
virtual String formatDateTimeFieldsState(const DateTimeFieldsState&) const = 0;
virtual bool isEditControlOwnerDisabled() const = 0;
virtual bool isEditControlOwnerReadOnly() const = 0;
- virtual AtomicString localeIdentifier() const = 0;
};
struct LayoutParameters {
String dateTimeFormat;
String fallbackDateTimeFormat;
Localizer& localizer;
- const StepRange stepRange;
- int minimumYear;
- int maximumYear;
- String placeholderForDay;
- String placeholderForMonth;
- String placeholderForYear;
+ const StepRange& stepRange;
LayoutParameters(Localizer& localizer, const StepRange& stepRange)
: localizer(localizer)
, stepRange(stepRange)
- , minimumYear(undefinedYear())
- , maximumYear(undefinedYear())
{
}
- static inline int undefinedYear() { return -1; }
+ bool shouldHaveSecondField() const;
};
static PassRefPtr<DateTimeEditElement> create(Document*, EditControlOwner&);
@@ -131,8 +123,6 @@ private:
virtual void fieldValueChanged() OVERRIDE FINAL;
virtual bool focusOnNextField(const DateTimeFieldElement&) OVERRIDE FINAL;
virtual bool focusOnPreviousField(const DateTimeFieldElement&) OVERRIDE FINAL;
- virtual bool isFieldOwnerDisabledOrReadOnly() const OVERRIDE FINAL;
- virtual AtomicString localeIdentifier() const OVERRIDE FINAL;
// SpinButtonElement::SpinButtonOwner functions.
virtual void focusAndSelectSpinButtonOwner() OVERRIDE FINAL;
diff --git a/Source/WebCore/html/shadow/DateTimeFieldElement.cpp b/Source/WebCore/html/shadow/DateTimeFieldElement.cpp
index 6512ac1cb..a0ec51e59 100644
--- a/Source/WebCore/html/shadow/DateTimeFieldElement.cpp
+++ b/Source/WebCore/html/shadow/DateTimeFieldElement.cpp
@@ -24,7 +24,7 @@
*/
#include "config.h"
-#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
+#if ENABLE(INPUT_TYPE_TIME_MULTIPLE_FIELDS)
#include "DateTimeFieldElement.h"
#include "DateComponents.h"
@@ -80,8 +80,6 @@ void DateTimeFieldElement::defaultKeyboardEventHandler(KeyboardEvent* keyboardEv
const String& keyIdentifier = keyboardEvent->keyIdentifier();
if (keyIdentifier == "Down") {
- if (keyboardEvent->getModifierState("Alt"))
- return;
keyboardEvent->setDefaultHandled();
stepDown();
return;
@@ -146,11 +144,7 @@ void DateTimeFieldElement::initialize(const AtomicString& shadowPseudoId, const
bool DateTimeFieldElement::isFocusable() const
{
- if (isReadOnly())
- return false;
- if (m_fieldOwner && m_fieldOwner->isFieldOwnerDisabledOrReadOnly())
- return false;
- return HTMLElement::isFocusable();
+ return !isReadOnly();
}
bool DateTimeFieldElement::isReadOnly() const
@@ -163,11 +157,6 @@ bool DateTimeFieldElement::isRTL() const
return renderer() && renderer()->style()->direction() == RTL;
}
-AtomicString DateTimeFieldElement::localeIdentifier() const
-{
- return m_fieldOwner ? m_fieldOwner->localeIdentifier() : nullAtom;
-}
-
void DateTimeFieldElement::setReadOnly()
{
// Set HTML attribute readonly to change apperance.
diff --git a/Source/WebCore/html/shadow/DateTimeFieldElement.h b/Source/WebCore/html/shadow/DateTimeFieldElement.h
index c926cbe11..f5c9810a1 100644
--- a/Source/WebCore/html/shadow/DateTimeFieldElement.h
+++ b/Source/WebCore/html/shadow/DateTimeFieldElement.h
@@ -26,7 +26,7 @@
#ifndef DateTimeFieldElement_h
#define DateTimeFieldElement_h
-#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
+#if ENABLE(INPUT_TYPE_TIME_MULTIPLE_FIELDS)
#include "HTMLDivElement.h"
@@ -55,8 +55,6 @@ public:
virtual void fieldValueChanged() = 0;
virtual bool focusOnNextField(const DateTimeFieldElement&) = 0;
virtual bool focusOnPreviousField(const DateTimeFieldElement&) = 0;
- virtual bool isFieldOwnerDisabledOrReadOnly() const = 0;
- virtual AtomicString localeIdentifier() const = 0;
};
virtual void defaultEventHandler(Event*) OVERRIDE;
@@ -82,7 +80,6 @@ protected:
void focusOnNextField();
virtual void handleKeyboardEvent(KeyboardEvent*) = 0;
void initialize(const AtomicString& shadowPseudoId, const String& axHelpText);
- AtomicString localeIdentifier() const;
virtual int maximum() const = 0;
virtual int minimum() const = 0;
void updateVisibleValue(EventBehavior);
diff --git a/Source/WebCore/html/shadow/DateTimeFieldElements.cpp b/Source/WebCore/html/shadow/DateTimeFieldElements.cpp
index adcc7227a..c2f458a21 100644
--- a/Source/WebCore/html/shadow/DateTimeFieldElements.cpp
+++ b/Source/WebCore/html/shadow/DateTimeFieldElements.cpp
@@ -24,14 +24,12 @@
*/
#include "config.h"
-#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
+#if ENABLE(INPUT_TYPE_TIME_MULTIPLE_FIELDS)
#include "DateTimeFieldElements.h"
#include "DateComponents.h"
#include "DateTimeFieldsState.h"
#include "LocalizedStrings.h"
-#include <wtf/CurrentTime.h>
-#include <wtf/DateMath.h>
namespace WebCore {
@@ -71,49 +69,8 @@ void DateTimeAMPMFieldElement::setValueAsDateTimeFieldsState(const DateTimeField
// ----------------------------
-DateTimeDayFieldElement::DateTimeDayFieldElement(Document* document, FieldOwner& fieldOwner, const String& placeholder)
- : DateTimeNumericFieldElement(document, fieldOwner, 1, 31, placeholder)
-{
-}
-
-PassRefPtr<DateTimeDayFieldElement> DateTimeDayFieldElement::create(Document* document, FieldOwner& fieldOwner, const String& placeholder)
-{
- DEFINE_STATIC_LOCAL(AtomicString, dayPsuedoId, ("-webkit-datetime-edit-day-field"));
- RefPtr<DateTimeDayFieldElement> field = adoptRef(new DateTimeDayFieldElement(document, fieldOwner, placeholder.isEmpty() ? ASCIILiteral("--") : placeholder));
- field->initialize(dayPsuedoId, AXDayOfMonthFieldText());
- return field.release();
-}
-
-void DateTimeDayFieldElement::populateDateTimeFieldsState(DateTimeFieldsState& dateTimeFieldsState)
-{
- dateTimeFieldsState.setDayOfMonth(hasValue() ? valueAsInteger() : DateTimeFieldsState::emptyValue);
-}
-
-void DateTimeDayFieldElement::setValueAsDate(const DateComponents& date)
-{
- setValueAsInteger(date.monthDay());
-}
-
-void DateTimeDayFieldElement::setValueAsDateTimeFieldsState(const DateTimeFieldsState& dateTimeFieldsState, const DateComponents& dateForReadOnlyField)
-{
- if (!dateTimeFieldsState.hasDayOfMonth()) {
- setEmptyValue(dateForReadOnlyField);
- return;
- }
-
- const unsigned value = dateTimeFieldsState.dayOfMonth();
- if (range().isInRange(static_cast<int>(value))) {
- setValueAsInteger(value);
- return;
- }
-
- setEmptyValue(dateForReadOnlyField);
-}
-
-// ----------------------------
-
DateTimeHourFieldElement::DateTimeHourFieldElement(Document* document, FieldOwner& fieldOwner, int minimum, int maximum)
- : DateTimeNumericFieldElement(document, fieldOwner, minimum, maximum, "--")
+ : DateTimeNumericFieldElement(document, fieldOwner, minimum, maximum)
, m_alignment(maximum + maximum % 2)
{
ASSERT((!minimum && (maximum == 11 || maximum == 23)) || (minimum == 1 && (maximum == 12 || maximum == 24)));
@@ -218,7 +175,7 @@ int DateTimeHourFieldElement::valueAsInteger() const
// ----------------------------
DateTimeMillisecondFieldElement::DateTimeMillisecondFieldElement(Document* document, FieldOwner& fieldOwner)
- : DateTimeNumericFieldElement(document, fieldOwner, 0, 999, "---")
+ : DateTimeNumericFieldElement(document, fieldOwner, 0, 999)
{
}
@@ -259,7 +216,7 @@ void DateTimeMillisecondFieldElement::setValueAsDateTimeFieldsState(const DateTi
// ----------------------------
DateTimeMinuteFieldElement::DateTimeMinuteFieldElement(Document* document, FieldOwner& fieldOwner)
- : DateTimeNumericFieldElement(document, fieldOwner, 0, 59, "--")
+ : DateTimeNumericFieldElement(document, fieldOwner, 0, 59)
{
}
@@ -299,49 +256,8 @@ void DateTimeMinuteFieldElement::setValueAsDateTimeFieldsState(const DateTimeFie
// ----------------------------
-DateTimeMonthFieldElement::DateTimeMonthFieldElement(Document* document, FieldOwner& fieldOwner, const String& placeholder)
- : DateTimeNumericFieldElement(document, fieldOwner, 1, 12, placeholder)
-{
-}
-
-PassRefPtr<DateTimeMonthFieldElement> DateTimeMonthFieldElement::create(Document* document, FieldOwner& fieldOwner, const String& placeholder)
-{
- DEFINE_STATIC_LOCAL(AtomicString, monthPsuedoId, ("-webkit-datetime-edit-month-field"));
- RefPtr<DateTimeMonthFieldElement> field = adoptRef(new DateTimeMonthFieldElement(document, fieldOwner, placeholder.isEmpty() ? ASCIILiteral("--") : placeholder));
- field->initialize(monthPsuedoId, AXMonthFieldText());
- return field.release();
-}
-
-void DateTimeMonthFieldElement::populateDateTimeFieldsState(DateTimeFieldsState& dateTimeFieldsState)
-{
- dateTimeFieldsState.setMonth(hasValue() ? valueAsInteger() : DateTimeFieldsState::emptyValue);
-}
-
-void DateTimeMonthFieldElement::setValueAsDate(const DateComponents& date)
-{
- setValueAsInteger(date.month() + 1);
-}
-
-void DateTimeMonthFieldElement::setValueAsDateTimeFieldsState(const DateTimeFieldsState& dateTimeFieldsState, const DateComponents& dateForReadOnlyField)
-{
- if (!dateTimeFieldsState.hasMonth()) {
- setEmptyValue(dateForReadOnlyField);
- return;
- }
-
- const unsigned value = dateTimeFieldsState.month();
- if (range().isInRange(static_cast<int>(value))) {
- setValueAsInteger(value);
- return;
- }
-
- setEmptyValue(dateForReadOnlyField);
-}
-
-// ----------------------------
-
DateTimeSecondFieldElement::DateTimeSecondFieldElement(Document* document, FieldOwner& fieldOwner)
- : DateTimeNumericFieldElement(document, fieldOwner, 0, 59, "--")
+ : DateTimeNumericFieldElement(document, fieldOwner, 0, 59)
{
}
@@ -379,120 +295,6 @@ void DateTimeSecondFieldElement::setValueAsDateTimeFieldsState(const DateTimeFie
setValueAsInteger(value);
}
-// ----------------------------
-
-DateTimeWeekFieldElement::DateTimeWeekFieldElement(Document* document, FieldOwner& fieldOwner)
- : DateTimeNumericFieldElement(document, fieldOwner, DateComponents::minimumWeekNumber, DateComponents::maximumWeekNumber, "--")
-{
-}
-
-PassRefPtr<DateTimeWeekFieldElement> DateTimeWeekFieldElement::create(Document* document, FieldOwner& fieldOwner)
-{
- DEFINE_STATIC_LOCAL(AtomicString, weekPsuedoId, ("-webkit-datetime-edit-week-field"));
- RefPtr<DateTimeWeekFieldElement> field = adoptRef(new DateTimeWeekFieldElement(document, fieldOwner));
- field->initialize(weekPsuedoId, AXWeekOfYearFieldText());
- return field.release();
-}
-
-void DateTimeWeekFieldElement::populateDateTimeFieldsState(DateTimeFieldsState& dateTimeFieldsState)
-{
- dateTimeFieldsState.setWeekOfYear(hasValue() ? valueAsInteger() : DateTimeFieldsState::emptyValue);
-}
-
-void DateTimeWeekFieldElement::setValueAsDate(const DateComponents& date)
-{
- setValueAsInteger(date.week());
-}
-
-void DateTimeWeekFieldElement::setValueAsDateTimeFieldsState(const DateTimeFieldsState& dateTimeFieldsState, const DateComponents& dateForReadOnlyField)
-{
- if (!dateTimeFieldsState.hasWeekOfYear()) {
- setEmptyValue(dateForReadOnlyField);
- return;
- }
-
- const unsigned value = dateTimeFieldsState.weekOfYear();
- if (range().isInRange(static_cast<int>(value))) {
- setValueAsInteger(value);
- return;
- }
-
- setEmptyValue(dateForReadOnlyField);
-}
-
-// ----------------------------
-
-DateTimeYearFieldElement::DateTimeYearFieldElement(Document* document, FieldOwner& fieldOwner, const DateTimeYearFieldElement::Parameters& parameters)
- : DateTimeNumericFieldElement(document, fieldOwner, parameters.minimumYear, parameters.maximumYear, parameters.placeholder.isEmpty() ? ASCIILiteral("----") : parameters.placeholder)
- , m_minIsSpecified(parameters.minIsSpecified)
- , m_maxIsSpecified(parameters.maxIsSpecified)
-{
- ASSERT(parameters.minimumYear >= DateComponents::minimumYear());
- ASSERT(parameters.maximumYear <= DateComponents::maximumYear());
-}
-
-PassRefPtr<DateTimeYearFieldElement> DateTimeYearFieldElement::create(Document* document, FieldOwner& fieldOwner, const DateTimeYearFieldElement::Parameters& parameters)
-{
- DEFINE_STATIC_LOCAL(AtomicString, yearPsuedoId, ("-webkit-datetime-edit-year-field"));
- RefPtr<DateTimeYearFieldElement> field = adoptRef(new DateTimeYearFieldElement(document, fieldOwner, parameters));
- field->initialize(yearPsuedoId, AXYearFieldText());
- return field.release();
-}
-
-int DateTimeYearFieldElement::clampValueForHardLimits(int value) const
-{
- return Range(DateComponents::minimumYear(), DateComponents::maximumYear()).clampValue(value);
-}
-
-static int currentFullYear()
-{
- double current = currentTimeMS();
- double utcOffset = calculateUTCOffset();
- double dstOffset = calculateDSTOffset(current, utcOffset);
- int offset = static_cast<int>((utcOffset + dstOffset) / msPerMinute);
- current += offset * msPerMinute;
-
- DateComponents date;
- date.setMillisecondsSinceEpochForMonth(current);
- return date.fullYear();
-}
-
-int DateTimeYearFieldElement::defaultValueForStepDown() const
-{
- return m_maxIsSpecified ? DateTimeNumericFieldElement::defaultValueForStepDown() : currentFullYear();
-}
-
-int DateTimeYearFieldElement::defaultValueForStepUp() const
-{
- return m_minIsSpecified ? DateTimeNumericFieldElement::defaultValueForStepUp() : currentFullYear();
-}
-
-void DateTimeYearFieldElement::populateDateTimeFieldsState(DateTimeFieldsState& dateTimeFieldsState)
-{
- dateTimeFieldsState.setYear(hasValue() ? valueAsInteger() : DateTimeFieldsState::emptyValue);
-}
-
-void DateTimeYearFieldElement::setValueAsDate(const DateComponents& date)
-{
- setValueAsInteger(date.fullYear());
-}
-
-void DateTimeYearFieldElement::setValueAsDateTimeFieldsState(const DateTimeFieldsState& dateTimeFieldsState, const DateComponents& dateForReadOnlyField)
-{
- if (!dateTimeFieldsState.hasYear()) {
- setEmptyValue(dateForReadOnlyField);
- return;
- }
-
- const unsigned value = dateTimeFieldsState.year();
- if (range().isInRange(static_cast<int>(value))) {
- setValueAsInteger(value);
- return;
- }
-
- setEmptyValue(dateForReadOnlyField);
-}
-
} // namespace WebCore
#endif
diff --git a/Source/WebCore/html/shadow/DateTimeFieldElements.h b/Source/WebCore/html/shadow/DateTimeFieldElements.h
index 46d51a786..23f3403ea 100644
--- a/Source/WebCore/html/shadow/DateTimeFieldElements.h
+++ b/Source/WebCore/html/shadow/DateTimeFieldElements.h
@@ -26,7 +26,7 @@
#ifndef DateTimeFieldElements_h
#define DateTimeFieldElements_h
-#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
+#if ENABLE(INPUT_TYPE_TIME_MULTIPLE_FIELDS)
#include "DateTimeNumericFieldElement.h"
#include "DateTimeSymbolicFieldElement.h"
@@ -47,20 +47,6 @@ private:
virtual void setValueAsDateTimeFieldsState(const DateTimeFieldsState&, const DateComponents& dateForReadOnlyField) OVERRIDE FINAL;
};
-class DateTimeDayFieldElement : public DateTimeNumericFieldElement {
- WTF_MAKE_NONCOPYABLE(DateTimeDayFieldElement);
-
-public:
- static PassRefPtr<DateTimeDayFieldElement> create(Document*, FieldOwner&, const String& placeholder);
-
-private:
- DateTimeDayFieldElement(Document*, FieldOwner&, const String& placeholder);
-
- // DateTimeFieldElement functions.
- virtual void populateDateTimeFieldsState(DateTimeFieldsState&) OVERRIDE FINAL;
- virtual void setValueAsDate(const DateComponents&) OVERRIDE FINAL;
- virtual void setValueAsDateTimeFieldsState(const DateTimeFieldsState&, const DateComponents& dateForReadOnlyField) OVERRIDE FINAL;
-};
// DateTimeHourFieldElement is used for hour field of date time format
// supporting following patterns:
@@ -117,21 +103,6 @@ private:
virtual void setValueAsDateTimeFieldsState(const DateTimeFieldsState&, const DateComponents& dateForReadOnlyField) OVERRIDE FINAL;
};
-class DateTimeMonthFieldElement : public DateTimeNumericFieldElement {
- WTF_MAKE_NONCOPYABLE(DateTimeMonthFieldElement);
-
-public:
- static PassRefPtr<DateTimeMonthFieldElement> create(Document*, FieldOwner&, const String& placeholder);
-
-private:
- DateTimeMonthFieldElement(Document*, FieldOwner&, const String& placeholder);
-
- // DateTimeFieldElement functions.
- virtual void populateDateTimeFieldsState(DateTimeFieldsState&) OVERRIDE FINAL;
- virtual void setValueAsDate(const DateComponents&) OVERRIDE FINAL;
- virtual void setValueAsDateTimeFieldsState(const DateTimeFieldsState&, const DateComponents& dateForReadOnlyField) OVERRIDE FINAL;
-};
-
class DateTimeSecondFieldElement : public DateTimeNumericFieldElement {
WTF_MAKE_NONCOPYABLE(DateTimeSecondFieldElement);
@@ -147,60 +118,6 @@ private:
virtual void setValueAsDateTimeFieldsState(const DateTimeFieldsState&, const DateComponents& dateForReadOnlyField) OVERRIDE FINAL;
};
-class DateTimeWeekFieldElement : public DateTimeNumericFieldElement {
- WTF_MAKE_NONCOPYABLE(DateTimeWeekFieldElement);
-
-public:
- static PassRefPtr<DateTimeWeekFieldElement> create(Document*, FieldOwner&);
-
-private:
- DateTimeWeekFieldElement(Document*, FieldOwner&);
-
- // DateTimeFieldElement functions.
- virtual void populateDateTimeFieldsState(DateTimeFieldsState&) OVERRIDE FINAL;
- virtual void setValueAsDate(const DateComponents&) OVERRIDE FINAL;
- virtual void setValueAsDateTimeFieldsState(const DateTimeFieldsState&, const DateComponents& dateForReadOnlyField) OVERRIDE FINAL;
-};
-
-class DateTimeYearFieldElement : public DateTimeNumericFieldElement {
- WTF_MAKE_NONCOPYABLE(DateTimeYearFieldElement);
-
-public:
- struct Parameters {
- int minimumYear;
- int maximumYear;
- bool minIsSpecified;
- bool maxIsSpecified;
- String placeholder;
-
- Parameters()
- : minimumYear(-1)
- , maximumYear(-1)
- , minIsSpecified(false)
- , maxIsSpecified(false)
- {
- }
- };
-
- static PassRefPtr<DateTimeYearFieldElement> create(Document*, FieldOwner&, const Parameters&);
-
-private:
- DateTimeYearFieldElement(Document*, FieldOwner&, const Parameters&);
-
- // DateTimeFieldElement functions.
- virtual void populateDateTimeFieldsState(DateTimeFieldsState&) OVERRIDE FINAL;
- virtual void setValueAsDate(const DateComponents&) OVERRIDE FINAL;
- virtual void setValueAsDateTimeFieldsState(const DateTimeFieldsState&, const DateComponents& dateForReadOnlyField) OVERRIDE FINAL;
-
- // DateTimeNumericFieldElement functions.
- virtual int clampValueForHardLimits(int) const OVERRIDE FINAL;
- virtual int defaultValueForStepDown() const OVERRIDE FINAL;
- virtual int defaultValueForStepUp() const OVERRIDE FINAL;
-
- bool m_minIsSpecified;
- bool m_maxIsSpecified;
-};
-
} // namespace WebCore
#endif
diff --git a/Source/WebCore/html/shadow/DateTimeNumericFieldElement.cpp b/Source/WebCore/html/shadow/DateTimeNumericFieldElement.cpp
index ffb03979d..cf8a4a338 100644
--- a/Source/WebCore/html/shadow/DateTimeNumericFieldElement.cpp
+++ b/Source/WebCore/html/shadow/DateTimeNumericFieldElement.cpp
@@ -24,21 +24,33 @@
*/
#include "config.h"
-#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
+#if ENABLE(INPUT_TYPE_TIME_MULTIPLE_FIELDS)
#include "DateTimeNumericFieldElement.h"
-#include "FontCache.h"
#include "KeyboardEvent.h"
-#include "Localizer.h"
-#include "RenderStyle.h"
-#include "StyleResolver.h"
-#include "TextRun.h"
+#include "LocalizedNumber.h"
#include <wtf/text/StringBuilder.h>
namespace WebCore {
static const DOMTimeStamp typeAheadTimeout = 1000;
+static size_t displaySizeOfNumber(int value)
+{
+ ASSERT(value >= 0);
+
+ if (!value)
+ return 1;
+
+ int numberOfDigits = 0;
+ while (value) {
+ value /= 10;
+ ++numberOfDigits;
+ }
+
+ return numberOfDigits;
+}
+
DateTimeNumericFieldElement::Range::Range(int minimum, int maximum)
: maximum(maximum)
, minimum(minimum)
@@ -51,49 +63,13 @@ int DateTimeNumericFieldElement::Range::clampValue(int value) const
return std::min(std::max(value, minimum), maximum);
}
-bool DateTimeNumericFieldElement::Range::isInRange(int value) const
-{
- return value >= minimum && value <= maximum;
-}
-
-// ----------------------------
-
-DateTimeNumericFieldElement::DateTimeNumericFieldElement(Document* document, FieldOwner& fieldOwner, int minimum, int maximum, const String& placeholder)
+DateTimeNumericFieldElement::DateTimeNumericFieldElement(Document* document, FieldOwner& fieldOwner, int minimum, int maximum)
: DateTimeFieldElement(document, fieldOwner)
, m_lastDigitCharTime(0)
- , m_placeholder(placeholder)
, m_range(minimum, maximum)
, m_value(0)
, m_hasValue(false)
{
- setHasCustomCallbacks();
-}
-
-int DateTimeNumericFieldElement::clampValueForHardLimits(int value) const
-{
- return clampValue(value);
-}
-
-PassRefPtr<RenderStyle> DateTimeNumericFieldElement::customStyleForRenderer()
-{
- FontCachePurgePreventer fontCachePurgePreventer;
- RefPtr<RenderStyle> originalStyle = document()->styleResolver()->styleForElement(this);
- RefPtr<RenderStyle> style = RenderStyle::clone(originalStyle.get());
- float maxiumWidth = style->font().width(m_placeholder);
- maxiumWidth = std::max(maxiumWidth, style->font().width(formatValue(maximum())));
- maxiumWidth = std::max(maxiumWidth, style->font().width(value()));
- style->setWidth(Length(maxiumWidth, Fixed));
- return style.release();
-}
-
-int DateTimeNumericFieldElement::defaultValueForStepDown() const
-{
- return m_range.maximum;
-}
-
-int DateTimeNumericFieldElement::defaultValueForStepUp() const
-{
- return m_range.minimum;
}
void DateTimeNumericFieldElement::didBlur()
@@ -102,16 +78,6 @@ void DateTimeNumericFieldElement::didBlur()
DateTimeFieldElement::didBlur();
}
-String DateTimeNumericFieldElement::formatValue(int value) const
-{
- Localizer& localizer = localizerForOwner();
- if (m_range.maximum > 999)
- return localizer.convertToLocalizedNumber(String::format("%04d", value));
- if (m_range.maximum > 99)
- return localizer.convertToLocalizedNumber(String::format("%03d", value));
- return localizer.convertToLocalizedNumber(String::format("%02d", value));
-}
-
void DateTimeNumericFieldElement::handleKeyboardEvent(KeyboardEvent* keyboardEvent)
{
if (isReadOnly())
@@ -127,7 +93,7 @@ void DateTimeNumericFieldElement::handleKeyboardEvent(KeyboardEvent* keyboardEve
DOMTimeStamp delta = keyboardEvent->timeStamp() - m_lastDigitCharTime;
m_lastDigitCharTime = 0;
- String number = localizerForOwner().convertFromLocalizedNumber(String(&charCode, 1));
+ String number = convertFromLocalizedNumber(String(&charCode, 1));
const int digit = number[0] - '0';
if (digit < 0 || digit > 9)
return;
@@ -145,11 +111,6 @@ bool DateTimeNumericFieldElement::hasValue() const
return m_hasValue;
}
-Localizer& DateTimeNumericFieldElement::localizerForOwner() const
-{
- return document()->getCachedLocalizer(localeIdentifier());
-}
-
int DateTimeNumericFieldElement::maximum() const
{
return m_range.maximum;
@@ -176,7 +137,7 @@ void DateTimeNumericFieldElement::setEmptyValue(const DateComponents& dateForRea
void DateTimeNumericFieldElement::setValueAsInteger(int value, EventBehavior eventBehavior)
{
- m_value = clampValueForHardLimits(value);
+ m_value = clampValue(value);
m_hasValue = true;
updateVisibleValue(eventBehavior);
m_lastDigitCharTime = 0;
@@ -187,7 +148,7 @@ void DateTimeNumericFieldElement::stepDown()
if (m_hasValue)
setValueAsInteger(m_value == m_range.minimum ? m_range.maximum : clampValue(m_value - 1), DispatchEvent);
else
- setValueAsInteger(defaultValueForStepDown(), DispatchEvent);
+ setValueAsInteger(m_range.maximum, DispatchEvent);
}
void DateTimeNumericFieldElement::stepUp()
@@ -195,12 +156,21 @@ void DateTimeNumericFieldElement::stepUp()
if (m_hasValue)
setValueAsInteger(m_value == m_range.maximum ? m_range.minimum : clampValue(m_value + 1), DispatchEvent);
else
- setValueAsInteger(defaultValueForStepUp(), DispatchEvent);
+ setValueAsInteger(m_range.minimum, DispatchEvent);
}
String DateTimeNumericFieldElement::value() const
{
- return m_hasValue ? formatValue(m_value) : emptyString();
+ if (!m_hasValue)
+ return emptyString();
+
+ if (m_range.maximum > 999)
+ return convertToLocalizedNumber(String::number(m_value));
+
+ if (m_range.maximum > 99)
+ return convertToLocalizedNumber(String::format("%03d", m_value));
+
+ return convertToLocalizedNumber(String::format("%02d", m_value));
}
int DateTimeNumericFieldElement::valueAsInteger() const
@@ -210,7 +180,13 @@ int DateTimeNumericFieldElement::valueAsInteger() const
String DateTimeNumericFieldElement::visibleValue() const
{
- return m_hasValue ? value() : m_placeholder;
+ if (m_hasValue)
+ return value();
+
+ StringBuilder builder;
+ for (int numberOfDashs = std::max(displaySizeOfNumber(m_range.maximum), displaySizeOfNumber(m_range.minimum)); numberOfDashs; --numberOfDashs)
+ builder.append('-');
+ return builder.toString();
}
} // namespace WebCore
diff --git a/Source/WebCore/html/shadow/DateTimeNumericFieldElement.h b/Source/WebCore/html/shadow/DateTimeNumericFieldElement.h
index 00eeef024..28f2b9e49 100644
--- a/Source/WebCore/html/shadow/DateTimeNumericFieldElement.h
+++ b/Source/WebCore/html/shadow/DateTimeNumericFieldElement.h
@@ -26,7 +26,7 @@
#ifndef DateTimeNumericFieldElement_h
#define DateTimeNumericFieldElement_h
-#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
+#if ENABLE(INPUT_TYPE_TIME_MULTIPLE_FIELDS)
#include "DateTimeFieldElement.h"
namespace WebCore {
@@ -45,18 +45,14 @@ protected:
struct Range {
Range(int minimum, int maximum);
int clampValue(int) const;
- bool isInRange(int) const;
int maximum;
int minimum;
};
- DateTimeNumericFieldElement(Document*, FieldOwner&, int minimum, int maximum, const String& placeholder);
+ DateTimeNumericFieldElement(Document*, FieldOwner&, int minimum, int maximum);
int clampValue(int value) const { return m_range.clampValue(value); }
- virtual int clampValueForHardLimits(int) const;
- virtual int defaultValueForStepDown() const;
- virtual int defaultValueForStepUp() const;
const Range& range() const { return m_range; }
// DateTimeFieldElement functions.
@@ -68,9 +64,6 @@ protected:
virtual String visibleValue() const OVERRIDE FINAL;
private:
- // Element function.
- virtual PassRefPtr<RenderStyle> customStyleForRenderer() OVERRIDE;
-
// DateTimeFieldElement functions.
virtual void didBlur() OVERRIDE FINAL;
virtual void handleKeyboardEvent(KeyboardEvent*) OVERRIDE FINAL;
@@ -79,11 +72,7 @@ private:
virtual void stepUp() OVERRIDE FINAL;
virtual String value() const OVERRIDE FINAL;
- String formatValue(int) const;
- Localizer& localizerForOwner() const;
-
DOMTimeStamp m_lastDigitCharTime;
- const String m_placeholder;
const Range m_range;
int m_value;
bool m_hasValue;
diff --git a/Source/WebCore/html/shadow/DateTimeSymbolicFieldElement.cpp b/Source/WebCore/html/shadow/DateTimeSymbolicFieldElement.cpp
index 742208f53..6cb4ec1e2 100644
--- a/Source/WebCore/html/shadow/DateTimeSymbolicFieldElement.cpp
+++ b/Source/WebCore/html/shadow/DateTimeSymbolicFieldElement.cpp
@@ -24,7 +24,7 @@
*/
#include "config.h"
-#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
+#if ENABLE(INPUT_TYPE_TIME_MULTIPLE_FIELDS)
#include "DateTimeSymbolicFieldElement.h"
#include "FontCache.h"
diff --git a/Source/WebCore/html/shadow/DateTimeSymbolicFieldElement.h b/Source/WebCore/html/shadow/DateTimeSymbolicFieldElement.h
index f1eab8eb4..cb0ac1e7b 100644
--- a/Source/WebCore/html/shadow/DateTimeSymbolicFieldElement.h
+++ b/Source/WebCore/html/shadow/DateTimeSymbolicFieldElement.h
@@ -26,7 +26,7 @@
#ifndef DateTimeSymbolicFieldElement_h
#define DateTimeSymbolicFieldElement_h
-#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
+#if ENABLE(INPUT_TYPE_TIME_MULTIPLE_FIELDS)
#include "DateTimeFieldElement.h"
namespace WebCore {
diff --git a/Source/WebCore/html/shadow/HTMLContentElement.idl b/Source/WebCore/html/shadow/HTMLContentElement.idl
index 448c979a3..c928d4494 100644
--- a/Source/WebCore/html/shadow/HTMLContentElement.idl
+++ b/Source/WebCore/html/shadow/HTMLContentElement.idl
@@ -24,10 +24,11 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- Conditional=SHADOW_DOM,
- V8EnabledAtRuntime=shadowDOM
-] interface HTMLContentElement : HTMLElement {
- [Reflect] attribute DOMString select;
- attribute boolean resetStyleInheritance;
-};
+module html {
+ interface [
+ Conditional=SHADOW_DOM,
+ V8EnabledAtRuntime=shadowDOM
+ ] HTMLContentElement : HTMLElement {
+ attribute [Reflect] DOMString select;
+ };
+}
diff --git a/Source/WebCore/html/shadow/HTMLShadowElement.cpp b/Source/WebCore/html/shadow/HTMLShadowElement.cpp
index 5c5dbe94f..938439612 100644
--- a/Source/WebCore/html/shadow/HTMLShadowElement.cpp
+++ b/Source/WebCore/html/shadow/HTMLShadowElement.cpp
@@ -41,7 +41,6 @@ class Document;
inline HTMLShadowElement::HTMLShadowElement(const QualifiedName& tagName, Document* document)
: InsertionPoint(tagName, document)
- , m_registeredWithShadowRoot(false)
{
ASSERT(hasTagName(HTMLNames::shadowTag));
}
@@ -69,31 +68,4 @@ bool HTMLShadowElement::doesSelectFromHostChildren() const
return false;
}
-Node::InsertionNotificationRequest HTMLShadowElement::insertedInto(ContainerNode* insertionPoint)
-{
- InsertionPoint::insertedInto(insertionPoint);
-
- if (insertionPoint->inDocument() && isActive()) {
- if (ShadowRoot* root = shadowRoot()) {
- root->registerShadowElement();
- m_registeredWithShadowRoot = true;
- }
- }
-
- return InsertionDone;
-}
-
-void HTMLShadowElement::removedFrom(ContainerNode* insertionPoint)
-{
- if (insertionPoint->inDocument() && m_registeredWithShadowRoot) {
- ShadowRoot* root = shadowRoot();
- if (!root)
- root = insertionPoint->shadowRoot();
- if (root)
- root->unregisterShadowElement();
- m_registeredWithShadowRoot = false;
- }
- InsertionPoint::removedFrom(insertionPoint);
-}
-
} // namespace WebCore
diff --git a/Source/WebCore/html/shadow/HTMLShadowElement.h b/Source/WebCore/html/shadow/HTMLShadowElement.h
index 119fa9f95..a4ecdb3ad 100644
--- a/Source/WebCore/html/shadow/HTMLShadowElement.h
+++ b/Source/WebCore/html/shadow/HTMLShadowElement.h
@@ -46,14 +46,8 @@ public:
bool isSelectValid() const OVERRIDE { return true; }
bool doesSelectFromHostChildren() const;
-protected:
- virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE;
- virtual void removedFrom(ContainerNode*) OVERRIDE;
-
private:
HTMLShadowElement(const QualifiedName&, Document*);
-
- bool m_registeredWithShadowRoot;
};
} // namespace WebCore
diff --git a/Source/WebCore/html/shadow/HTMLShadowElement.idl b/Source/WebCore/html/shadow/HTMLShadowElement.idl
index b50194503..94facb7be 100644
--- a/Source/WebCore/html/shadow/HTMLShadowElement.idl
+++ b/Source/WebCore/html/shadow/HTMLShadowElement.idl
@@ -28,9 +28,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- Conditional=SHADOW_DOM,
- V8EnabledAtRuntime=shadowDOM
-] interface HTMLShadowElement : HTMLElement {
- attribute boolean resetStyleInheritance;
-};
+module html {
+
+ interface [
+ Conditional=SHADOW_DOM,
+ V8EnabledAtRuntime=shadowDOM
+ ] HTMLShadowElement : HTMLElement {
+ };
+
+}
diff --git a/Source/WebCore/html/shadow/InsertionPoint.cpp b/Source/WebCore/html/shadow/InsertionPoint.cpp
index 7aecaa56e..435796677 100644
--- a/Source/WebCore/html/shadow/InsertionPoint.cpp
+++ b/Source/WebCore/html/shadow/InsertionPoint.cpp
@@ -33,13 +33,11 @@
#include "ElementShadow.h"
#include "ShadowRoot.h"
-#include "StaticNodeList.h"
namespace WebCore {
InsertionPoint::InsertionPoint(const QualifiedName& tagName, Document* document)
: HTMLElement(tagName, document)
- , m_shouldResetStyleInheritance(false)
{
}
@@ -88,19 +86,6 @@ bool InsertionPoint::isActive() const
return true;
}
-PassRefPtr<NodeList> InsertionPoint::distributedNodes() const
-{
- if (!attached())
- return 0;
-
- Vector<RefPtr<Node> > nodes;
-
- for (size_t i = 0; i < m_distribution.size(); ++i)
- nodes.append(m_distribution.at(i));
-
- return StaticNodeList::adopt(nodes);
-}
-
bool InsertionPoint::rendererIsNeeded(const NodeRenderingContext& context)
{
return !isShadowBoundary() && HTMLElement::rendererIsNeeded(context);
@@ -160,18 +145,4 @@ void InsertionPoint::removedFrom(ContainerNode* insertionPoint)
HTMLElement::removedFrom(insertionPoint);
}
-bool InsertionPoint::resetStyleInheritance() const
-{
- return m_shouldResetStyleInheritance;
-}
-
-void InsertionPoint::setResetStyleInheritance(bool value)
-{
- if (value != m_shouldResetStyleInheritance) {
- m_shouldResetStyleInheritance = value;
- if (attached() && isActive())
- shadowRoot()->host()->setNeedsStyleRecalc();
- }
-}
-
} // namespace WebCore
diff --git a/Source/WebCore/html/shadow/InsertionPoint.h b/Source/WebCore/html/shadow/InsertionPoint.h
index 2ef36c1c5..6237de2e6 100644
--- a/Source/WebCore/html/shadow/InsertionPoint.h
+++ b/Source/WebCore/html/shadow/InsertionPoint.h
@@ -49,15 +49,10 @@ public:
bool isShadowBoundary() const;
bool isActive() const;
- PassRefPtr<NodeList> distributedNodes() const;
-
virtual const AtomicString& select() const = 0;
virtual bool isSelectValid() const = 0;
virtual bool doesSelectFromHostChildren() const = 0;
- bool resetStyleInheritance() const;
- void setResetStyleInheritance(bool);
-
virtual void attach();
virtual void detach();
virtual bool isInsertionPoint() const OVERRIDE { return true; }
@@ -80,7 +75,6 @@ protected:
private:
ContentDistribution m_distribution;
- bool m_shouldResetStyleInheritance : 1;
};
inline bool isInsertionPoint(const Node* node)
diff --git a/Source/WebCore/html/shadow/SliderThumbElement.cpp b/Source/WebCore/html/shadow/SliderThumbElement.cpp
index d6920a913..d8bbd2bbb 100644
--- a/Source/WebCore/html/shadow/SliderThumbElement.cpp
+++ b/Source/WebCore/html/shadow/SliderThumbElement.cpp
@@ -256,7 +256,7 @@ void SliderThumbElement::setPositionFromPoint(const LayoutPoint& point)
return;
input->setTextAsOfLastFormControlChangeEvent(input->value());
- LayoutPoint offset = roundedLayoutPoint(input->renderer()->absoluteToLocal(point, UseTransforms | SnapOffsetForTransforms));
+ LayoutPoint offset = roundedLayoutPoint(input->renderer()->absoluteToLocal(point, false, true));
bool isVertical = hasVerticalAppearance(input);
bool isLeftToRightDirection = renderBox()->style()->isLeftToRightDirection();
LayoutUnit trackSize;
diff --git a/Source/WebCore/html/shadow/SpinButtonElement.cpp b/Source/WebCore/html/shadow/SpinButtonElement.cpp
index 99dd71947..e5247c4f3 100644
--- a/Source/WebCore/html/shadow/SpinButtonElement.cpp
+++ b/Source/WebCore/html/shadow/SpinButtonElement.cpp
@@ -89,7 +89,7 @@ void SpinButtonElement::defaultEventHandler(Event* event)
}
MouseEvent* mouseEvent = static_cast<MouseEvent*>(event);
- IntPoint local = roundedIntPoint(box->absoluteToLocal(mouseEvent->absoluteLocation(), UseTransforms | SnapOffsetForTransforms));
+ IntPoint local = roundedIntPoint(box->absoluteToLocal(mouseEvent->absoluteLocation(), false, true));
if (mouseEvent->type() == eventNames().mousedownEvent && mouseEvent->button() == LeftButton) {
if (box->pixelSnappedBorderBoxRect().contains(local)) {
// The following functions of HTMLInputElement may run JavaScript
diff --git a/Source/WebCore/html/shadow/TextFieldDecorationElement.cpp b/Source/WebCore/html/shadow/TextFieldDecorationElement.cpp
index be085e430..689aa0ad2 100644
--- a/Source/WebCore/html/shadow/TextFieldDecorationElement.cpp
+++ b/Source/WebCore/html/shadow/TextFieldDecorationElement.cpp
@@ -57,7 +57,6 @@ TextFieldDecorator::~TextFieldDecorator()
TextFieldDecorationElement::TextFieldDecorationElement(Document* document, TextFieldDecorator* decorator)
: HTMLDivElement(HTMLNames::divTag, document)
, m_textFieldDecorator(decorator)
- , m_isInHoverState(false)
{
ASSERT(decorator);
setHasCustomCallbacks();
@@ -138,8 +137,6 @@ void TextFieldDecorationElement::updateImage()
image = m_textFieldDecorator->imageForDisabledState();
else if (hostInput()->readOnly())
image = m_textFieldDecorator->imageForReadonlyState();
- else if (m_isInHoverState)
- image = m_textFieldDecorator->imageForHoverState();
else
image = m_textFieldDecorator->imageForNormalState();
ASSERT(image);
@@ -197,29 +194,10 @@ void TextFieldDecorationElement::defaultEventHandler(Event* event)
event->setDefaultHandled();
}
- if (event->type() == eventNames().mouseoverEvent) {
- m_isInHoverState = true;
- updateImage();
- }
-
- if (event->type() == eventNames().mouseoutEvent) {
- m_isInHoverState = false;
- updateImage();
- }
-
if (!event->defaultHandled())
HTMLDivElement::defaultEventHandler(event);
}
-bool TextFieldDecorationElement::willRespondToMouseMoveEvents()
-{
- const HTMLInputElement* input = hostInput();
- if (!input->disabled() && !input->readOnly())
- return true;
-
- return HTMLDivElement::willRespondToMouseMoveEvents();
-}
-
bool TextFieldDecorationElement::willRespondToMouseClickEvents()
{
const HTMLInputElement* input = hostInput();
diff --git a/Source/WebCore/html/shadow/TextFieldDecorationElement.h b/Source/WebCore/html/shadow/TextFieldDecorationElement.h
index fd5a2c495..2c8d822b3 100644
--- a/Source/WebCore/html/shadow/TextFieldDecorationElement.h
+++ b/Source/WebCore/html/shadow/TextFieldDecorationElement.h
@@ -52,7 +52,6 @@ public:
virtual CachedImage* imageForNormalState() = 0;
virtual CachedImage* imageForDisabledState() = 0;
virtual CachedImage* imageForReadonlyState() = 0;
- virtual CachedImage* imageForHoverState() = 0;
virtual void handleClick(HTMLInputElement*) = 0;
// This function is called just before detaching the decoration. It must not
@@ -72,7 +71,6 @@ public:
TextFieldDecorator* textFieldDecorator() { return m_textFieldDecorator; }
void decorate(HTMLInputElement*, bool visible);
- virtual bool willRespondToMouseMoveEvents() OVERRIDE;
virtual bool willRespondToMouseClickEvents() OVERRIDE;
private:
@@ -89,7 +87,6 @@ private:
void updateImage();
TextFieldDecorator* m_textFieldDecorator;
- bool m_isInHoverState;
};
inline TextFieldDecorationElement* toTextFieldDecorationElement(Node* node)
diff --git a/Source/WebCore/html/track/TextTrack.idl b/Source/WebCore/html/track/TextTrack.idl
index e6465a7af..9836f02ce 100644
--- a/Source/WebCore/html/track/TextTrack.idl
+++ b/Source/WebCore/html/track/TextTrack.idl
@@ -23,35 +23,38 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- Conditional=VIDEO_TRACK,
- V8EnabledAtRuntime=webkitVideoTrack,
- EventTarget,
- JSCustomMarkFunction,
- JSCustomIsReachable
-] interface TextTrack {
- readonly attribute DOMString kind;
- readonly attribute DOMString label;
- readonly attribute DOMString language;
+module html {
- attribute DOMString mode;
+ interface [
+ Conditional=VIDEO_TRACK,
+ V8EnabledAtRuntime=webkitVideoTrack,
+ EventTarget,
+ JSCustomMarkFunction,
+ JSCustomIsReachable
+ ] TextTrack {
+ readonly attribute DOMString kind;
+ readonly attribute DOMString label;
+ readonly attribute DOMString language;
- readonly attribute TextTrackCueList cues;
- readonly attribute TextTrackCueList activeCues;
- attribute EventListener oncuechange;
+ attribute DOMString mode;
- void addCue(in TextTrackCue cue)
- raises (DOMException);
- void removeCue(in TextTrackCue cue)
- raises (DOMException);
+ readonly attribute TextTrackCueList cues;
+ readonly attribute TextTrackCueList activeCues;
+ attribute EventListener oncuechange;
- // EventTarget interface
- void addEventListener(in DOMString type,
- in EventListener listener,
- in [Optional] boolean useCapture);
- void removeEventListener(in DOMString type,
- in EventListener listener,
- in [Optional] boolean useCapture);
- boolean dispatchEvent(in Event evt)
- raises(EventException);
-};
+ void addCue(in TextTrackCue cue)
+ raises (DOMException);
+ void removeCue(in TextTrackCue cue)
+ raises (DOMException);
+
+ // EventTarget interface
+ void addEventListener(in DOMString type,
+ in EventListener listener,
+ in [Optional] boolean useCapture);
+ void removeEventListener(in DOMString type,
+ in EventListener listener,
+ in [Optional] boolean useCapture);
+ boolean dispatchEvent(in Event evt)
+ raises(EventException);
+ };
+}
diff --git a/Source/WebCore/html/track/TextTrackCue.idl b/Source/WebCore/html/track/TextTrackCue.idl
index ddb67e44e..040110963 100644
--- a/Source/WebCore/html/track/TextTrackCue.idl
+++ b/Source/WebCore/html/track/TextTrackCue.idl
@@ -23,49 +23,52 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- Conditional=VIDEO_TRACK,
- V8EnabledAtRuntime=webkitVideoTrack,
- JSGenerateToNativeObject,
- Constructor(in double startTime, in double endTime, in DOMString text),
- CallWith=ScriptExecutionContext,
- EventTarget,
- JSCustomMarkFunction,
- JSCustomIsReachable
-] interface TextTrackCue {
- readonly attribute TextTrack track;
+module html {
- attribute DOMString id;
- attribute double startTime;
- attribute double endTime;
- attribute boolean pauseOnExit;
+ interface [
+ Conditional=VIDEO_TRACK,
+ V8EnabledAtRuntime=webkitVideoTrack,
+ JSGenerateToNativeObject,
+ Constructor(in double startTime, in double endTime, in DOMString text),
+ CallWith=ScriptExecutionContext,
+ EventTarget,
+ JSCustomMarkFunction,
+ JSCustomIsReachable
+ ] TextTrackCue {
+ readonly attribute TextTrack track;
- attribute DOMString vertical
- setter raises (DOMException);
- attribute boolean snapToLines;
- attribute long line
- setter raises (DOMException);
- attribute long position
- setter raises (DOMException);
- attribute long size
- setter raises (DOMException);
- attribute DOMString align
- setter raises (DOMException);
+ attribute DOMString id;
+ attribute double startTime;
+ attribute double endTime;
+ attribute boolean pauseOnExit;
- attribute DOMString text;
- DocumentFragment getCueAsHTML();
-
- attribute EventListener onenter;
- attribute EventListener onexit;
-
- // EventTarget interface
- void addEventListener(in DOMString type,
- in EventListener listener,
- in [Optional] boolean useCapture);
- void removeEventListener(in DOMString type,
- in EventListener listener,
- in [Optional] boolean useCapture);
- boolean dispatchEvent(in Event evt)
- raises(EventException);
-};
+ attribute DOMString vertical
+ setter raises (DOMException);
+ attribute boolean snapToLines;
+ attribute long line
+ setter raises (DOMException);
+ attribute long position
+ setter raises (DOMException);
+ attribute long size
+ setter raises (DOMException);
+ attribute DOMString align
+ setter raises (DOMException);
+ attribute DOMString text;
+ DocumentFragment getCueAsHTML();
+
+ attribute EventListener onenter;
+ attribute EventListener onexit;
+
+ // EventTarget interface
+ void addEventListener(in DOMString type,
+ in EventListener listener,
+ in [Optional] boolean useCapture);
+ void removeEventListener(in DOMString type,
+ in EventListener listener,
+ in [Optional] boolean useCapture);
+ boolean dispatchEvent(in Event evt)
+ raises(EventException);
+ };
+
+}
diff --git a/Source/WebCore/html/track/TextTrackCueList.idl b/Source/WebCore/html/track/TextTrackCueList.idl
index dab976c56..380e59a31 100644
--- a/Source/WebCore/html/track/TextTrackCueList.idl
+++ b/Source/WebCore/html/track/TextTrackCueList.idl
@@ -23,13 +23,16 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- Conditional=VIDEO_TRACK,
- V8EnabledAtRuntime=webkitVideoTrack,
- IndexedGetter
-] interface TextTrackCueList {
- readonly attribute unsigned long length;
- TextTrackCue item(in unsigned long index);
- TextTrackCue getCueById(in DOMString id);
-};
+module html {
+ interface [
+ Conditional=VIDEO_TRACK,
+ V8EnabledAtRuntime=webkitVideoTrack,
+ IndexedGetter
+ ] TextTrackCueList {
+ readonly attribute unsigned long length;
+ TextTrackCue item(in unsigned long index);
+ TextTrackCue getCueById(in DOMString id);
+ };
+
+}
diff --git a/Source/WebCore/html/track/TextTrackList.idl b/Source/WebCore/html/track/TextTrackList.idl
index 0b0e45016..ad4e8621c 100644
--- a/Source/WebCore/html/track/TextTrackList.idl
+++ b/Source/WebCore/html/track/TextTrackList.idl
@@ -23,27 +23,30 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- Conditional=VIDEO_TRACK,
- V8EnabledAtRuntime=webkitVideoTrack,
- IndexedGetter,
- EventTarget,
- JSCustomMarkFunction,
- JSCustomIsReachable,
- V8GenerateIsReachable=ImplOwnerRoot
-] interface TextTrackList {
- readonly attribute unsigned long length;
- TextTrack item(in unsigned long index);
+module html {
- attribute EventListener onaddtrack;
+ interface [
+ Conditional=VIDEO_TRACK,
+ V8EnabledAtRuntime=webkitVideoTrack,
+ IndexedGetter,
+ EventTarget,
+ JSCustomMarkFunction,
+ JSCustomIsReachable,
+ V8GenerateIsReachable=ImplOwnerRoot
+ ] TextTrackList {
+ readonly attribute unsigned long length;
+ TextTrack item(in unsigned long index);
- void addEventListener(in DOMString type,
- in EventListener listener,
- in [Optional] boolean useCapture);
- void removeEventListener(in DOMString type,
- in EventListener listener,
- in [Optional] boolean useCapture);
- boolean dispatchEvent(in Event evt)
- raises(EventException);
-};
+ attribute EventListener onaddtrack;
+ void addEventListener(in DOMString type,
+ in EventListener listener,
+ in [Optional] boolean useCapture);
+ void removeEventListener(in DOMString type,
+ in EventListener listener,
+ in [Optional] boolean useCapture);
+ boolean dispatchEvent(in Event evt)
+ raises(EventException);
+ };
+
+}
diff --git a/Source/WebCore/html/track/TrackEvent.idl b/Source/WebCore/html/track/TrackEvent.idl
index 59b5ca6c6..b475ad41a 100644
--- a/Source/WebCore/html/track/TrackEvent.idl
+++ b/Source/WebCore/html/track/TrackEvent.idl
@@ -23,11 +23,14 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- Conditional=VIDEO_TRACK,
- V8EnabledAtRuntime=webkitVideoTrack,
- ConstructorTemplate=Event
-] interface TrackEvent : Event {
- [InitializedByEventConstructor, CustomGetter] readonly attribute object track;
-};
+module html {
+ interface [
+ Conditional=VIDEO_TRACK,
+ V8EnabledAtRuntime=webkitVideoTrack,
+ ConstructorTemplate=Event
+ ] TrackEvent : Event {
+ readonly attribute [InitializedByEventConstructor, CustomGetter] object track;
+ };
+
+}