Add timeout to the Chromium expectation of state-url-sets-links-visited.html

Unreviewed.

* platform/chromium/TestExpectations: Since Chromium's DRT does not support
computedStyleIncludingVisitedInfo, the test can also timeout as it will
raise an exception before invoking finishJSTest.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143862 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Reduce include graph of JSDOMBinding.h
<http://webkit.org/b/110709>

Reviewed by Antti Koivisto.

Source/WebCore:

Move WebCore::root(Foo*) to the custom JSFooCustom.h headers.
This reduces the number of headers pulled in by JSDOMBinding.h.

* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSCSSRuleCustom.cpp:
* bindings/js/JSCSSRuleCustom.h: Added.
(WebCore::root):
* bindings/js/JSCSSRuleListCustom.cpp:
* bindings/js/JSCSSStyleDeclarationCustom.h:
(WebCore::root):
* bindings/js/JSDOMBinding.h:
* bindings/js/JSMediaListCustom.h: Added.
(WebCore::root):
* bindings/js/JSMutationObserverCustom.cpp:
* bindings/js/JSNodeCustom.h:
(WebCore::root):
* bindings/js/JSSVGElementInstanceCustom.cpp:
* bindings/js/JSStyleSheetCustom.h: Added.
(WebCore::root):
* bindings/js/JSTextTrackCustom.h:
* bindings/js/JSTextTrackListCustom.cpp:
* bindings/js/JSXPathResultCustom.cpp:
* bindings/js/SerializedScriptValue.cpp:
* bindings/scripts/CodeGeneratorGObject.pm:
(Generate):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* bindings/scripts/CodeGeneratorObjC.pm:
(AddIncludesForType):
* css/CSSRule.idl:
* css/CSSStyleDeclaration.idl:
* css/MediaList.idl:
* css/StyleSheet.idl:
* editing/mac/EditorMac.mm:

Source/WebKit/mac:

* WebView/WebHTMLView.mm:

Source/WebKit2:

* Shared/WebRenderObject.cpp:
(WebKit::WebRenderObject::WebRenderObject):
* WebProcess/Storage/StorageAreaProxy.cpp:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143863 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: [Timeline] Shrink CPU bars to make it easier to see frame information popup.
https://bugs.webkit.org/show_bug.cgi?id=110561

Reviewed by Pavel Feldman.

Area that causes frame information popup is overly "shaded" by CPU bars.

* inspector/front-end/timelinePanel.css:
(.timeline-cpu-bars .timeline-graph-bar): Reduce height and opacity.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143864 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Custom Elements] Implement bare-bone document.register()
https://bugs.webkit.org/show_bug.cgi?id=100229

Reviewed by Adam Barth.

Source/WebCore:

This change implements a prefixed version of document.register(), with minimal feature support.
- The feature is guarded by ENABLE(CUSTOM_ELEMENTS) and RuntimeEnabledFeatures::customDOMElementsEnabled().
- This bare-bone version only recognizes "name" and "prototype" parameters. It doesn't support default value of "prototype" parameter.
- Currently only V8 is supported. JSC binding needs its own binding implementation.

= Major new classes under dom/:

The dom module gets two new classes:
- CustomElementConstructor: A return value of document.register()
  which holds the custom element definition.
- CustomElementRegistry: A collection of CustomElementConstructor objects.
  CustomElementRegistry instance is created per Document and is owned by the Document.

CustomElementConstructor knows the definition of each custom
element, which is registered by document.register(). The name and
other options are held by this object. CustomElementRegistry owns a set
of the registered constructors. The registry guarantees invariants
like validity and uniqueness of the element names.

= A change on make_names.pl

This change tweaks make_names.pl (or generated HTMLElementFactory)
to hook the creations of unknown elements. Some of element names
which come to the fallback path can be one of registered custom
element.

= [V8WrapAsFunction] extended attribute:

The document.register() API returns a constructor
function. However, the V8 binding currently doesn't support it. To
make it possible, this change introduces "V8WrapAsFunction"
extended attribute for annotating CustomElementConstructor IDL
interface.

V8WrapAsFunction wraps the annotated interface with a JavaScript
function, which calls the original object as a function, or as a
constructor depends on the context.

With this wrapper function, there are two levels of indirection
between native C++ object and author-visible JS function:

[JS Adaptor Function] <-(hidden property)-> [JS Wrapper Object] -(internal field)-> [C++ Native object]

The code generator generates the binding code which deals with
this indirection.  Also, there is a set of helper functions in
V8AdaptorFunction.h/cpp which takes care of this indirection.
V8DOMWrapper.cpp/h works as a facade for these APIs and is used from
the generated code.

This redundancy comes from limitations of both V8 bindings and V8
embedding API. See bug 108138 for details.

= V8HTMLCustomElement

Unlike built-in HTML elements, any custom element has no
corresponding C++ class. Instead, document.register() should allow
passing a prototype object for the elements being registered.

V8HTMLCustomElement handles this lack of native class.  It behaves
like a native side proxy of non-native HTMLElement subclasses.  It
connects each custom element to an appropriate native element,
which is HTMLElement at this time. This restriction will be
relaxed later. See Bug 110436 for details.

= Custom DOM elements and multiple worlds

In this patch, custom element registration and instantiation is not allowed
in non-main world and document.register() API just fails there.

Reviewed by Adam Barth.

Tests: fast/dom/custom/document-register-basic.html
       fast/dom/custom/document-register-reentrant-null-constructor.html
       fast/dom/custom/document-register-reentrant-returning-fake.html
       fast/dom/custom/document-register-reentrant-throwing-constructor.html

* DerivedSources.make:
* WebCore.gypi:
* bindings/generic/RuntimeEnabledFeatures.cpp:
* bindings/generic/RuntimeEnabledFeatures.h:
(RuntimeEnabledFeatures):
(WebCore::RuntimeEnabledFeatures::customDOMElementsEnabled):
(WebCore::RuntimeEnabledFeatures::setCustomDOMElements):
* bindings/scripts/CodeGeneratorV8.pm:
(GenerateHeader):
* bindings/scripts/IDLAttributes.txt:
* bindings/v8/CustomElementHelpers.cpp: Added.
(WebCore::CustomElementHelpers::initializeConstructorWrapper):
(WebCore::hasNoBuiltinsInPrototype):
(WebCore::CustomElementHelpers::isValidPrototypeParameter):
(WebCore::CustomElementHelpers::isFeatureAllowed):
* bindings/v8/CustomElementHelpers.h: Copied from Source/WebCore/bindings/v8/V8HiddenPropertyName.h.
(CustomElementHelpers):
* bindings/v8/V8AdaptorFunction.cpp: Added.
(WebCore::V8AdaptorFunction::getTemplate):
(WebCore::V8AdaptorFunction::configureTemplate):
(WebCore::V8AdaptorFunction::invocationCallback):
(WebCore::V8AdaptorFunction::wrap):
* bindings/v8/V8AdaptorFunction.h: Added.
(V8AdaptorFunction):
(WebCore::V8AdaptorFunction::unwrap):
(WebCore::V8AdaptorFunction::get):
* bindings/v8/V8DOMConfiguration.cpp:
(WebCore::V8DOMConfiguration::configureTemplate):
* bindings/v8/V8DOMWrapper.cpp:
(WebCore::V8DOMWrapper::toFunction):
(WebCore::V8DOMWrapper::fromFunction):
* bindings/v8/V8DOMWrapper.h:
(V8DOMWrapper):
* bindings/v8/V8HTMLCustomElement.cpp: Added.
(WebCore::V8HTMLCustomElement::createWrapper):
* bindings/v8/V8HTMLCustomElement.h: Copied from Source/WebCore/bindings/v8/V8HiddenPropertyName.h.
(V8HTMLCustomElement):
(WebCore::V8HTMLCustomElement::toV8):
(WebCore::HTMLCustomElement::toV8):
* bindings/v8/V8HiddenPropertyName.h:
* bindings/v8/custom/V8CustomElementConstructorCustom.cpp: Added.
(WebCore::V8CustomElementConstructor::callAsFunctionCallback):
* dom/CustomElementConstructor.cpp: Copied from Source/WebCore/bindings/v8/V8HiddenPropertyName.h.
(WebCore::CustomElementConstructor::create):
(WebCore::CustomElementConstructor::CustomElementConstructor):
(WebCore::CustomElementConstructor::~CustomElementConstructor):
(WebCore::CustomElementConstructor::createElement):
* dom/CustomElementConstructor.h: Copied from Source/WebCore/bindings/v8/V8HiddenPropertyName.h.
(CustomElementConstructor):
(WebCore::CustomElementConstructor::document):
(WebCore::CustomElementConstructor::tagName):
(WebCore::CustomElementConstructor::name):
* dom/CustomElementConstructor.idl: Added.
* dom/CustomElementRegistry.cpp: Added.
(WebCore::CustomElementRegistry::CustomElementRegistry):
(WebCore::CustomElementRegistry::~CustomElementRegistry):
(WebCore::CustomElementRegistry::constructorOf):
(WebCore::CustomElementRegistry::isValidName):
(WebCore::CustomElementRegistry::registerElement):
(WebCore::CustomElementRegistry::find):
(WebCore::CustomElementRegistry::createElement):
(WebCore::CustomElementRegistry::document):
* dom/CustomElementRegistry.h: Added.
(CustomElementRegistry):
* dom/Document.cpp:
(WebCore::Document::removedLastRef):
(WebCore::Document::registerElement):
(WebCore::Document::registry):
* dom/Document.h:
(Document):
* dom/make_names.pl:
(printWrapperFactoryCppFile):
* html/HTMLDocument.idl:

Source/WebKit/chromium:

Added enableCustomDOMElements flag.

* features.gypi:
* public/WebRuntimeFeatures.h:
(WebRuntimeFeatures):
* src/WebRuntimeFeatures.cpp:
(WebKit::WebRuntimeFeatures::enableCustomDOMElements):
(WebKit):
(WebKit::WebRuntimeFeatures::isCustomDOMElementsEnabled):

Tools:

Added enableCustomDOMElements flag.

* DumpRenderTree/chromium/TestShell.cpp:
(TestShell::TestShell):

LayoutTests:

* fast/dom/custom/document-register-basic-expected.txt: Added.
* fast/dom/custom/document-register-basic.html: Added.
* fast/dom/custom/document-register-reentrant-null-constructor-expected.txt: Added.
* fast/dom/custom/document-register-reentrant-null-constructor.html: Added.
* fast/dom/custom/document-register-reentrant-returning-fake-expected.txt: Added.
* fast/dom/custom/document-register-reentrant-returning-fake.html: Added.
* fast/dom/custom/document-register-reentrant-throwing-constructor-expected.txt: Added.
* fast/dom/custom/document-register-reentrant-throwing-constructor.html: Added.
* fast/dom/custom/resources/document-register-fuzz.js: Added.
* platform/mac/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143865 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] FatFingers: move rectForPoint() from HitTestResult to HitTestLocation
https://bugs.webkit.org/show_bug.cgi?id=110570

Patch by Alberto Garcia <albgarcia@rim.com> on 2013-02-24
Reviewed by Allan Sandfeld Jensen.

HitTestResult is no longer a HitTestLocation:
http://trac.webkit.org/changeset/135710/trunk/Source/WebCore/rendering/HitTestResult.h

* WebKitSupport/FatFingers.cpp:
(BlackBerry::WebKit::FatFingers::fingerRectForPoint):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143866 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add methods to date types for new calendar picker
https://bugs.webkit.org/show_bug.cgi?id=110454

Reviewed by Kent Tamura.

Source/WebCore:

Adding some methods to date types as part of the calendar picker redesign (Bug 109439).

Test: platform/chromium/fast/forms/calendar-picker/calendar-picker-date-types.html

* Resources/pagepopups/calendarPicker.js:
(createUTCDate):
(DateType): Base class for Day, Week and Month.
(Day): Simplified constructor to only accept year, month, date.
(Day.createFromValue): Creates a new Day from a value.
(Day.createFromDate): Throw an error if the given date is invalid.
(Day.createFromDay):
(Day.prototype.equals): Accept non Day objects.
(Day.prototype.previous): Modified to take an offset value.
(Day.prototype.next): Ditto.
(Day.prototype.firstDay): Returns the first day in the range. For Day's case, returns itself.
(Day.prototype.middleDay): Returns the middle day in the range. For Day's case, returns itself.
(Day.prototype.lastDay): Returns the middle day in the range. For Day's case, returns itself.
(Day.prototype.valueOf):
(Day.prototype.weekDay): Returns the week day.
(Week): Simplified constructor to only accept year, month, date.
(Week.createFromValue):
(Week.createFromDate):
(Week.createFromDay):
(Week.weekOneStartDateForYear):
(Week.weekOneStartDayForYear):
(Week._numberOfWeeksSinceDate):
(Week.prototype.equals):
(Week.prototype.previous):
(Week.prototype.next):
(Week.prototype.firstDay): Returns the first day in the week.
(Week.prototype.middleDay): Returns the the day for Thursday.
(Week.prototype.lastDay): Returns the last day in the week.
(Week.prototype.valueOf):
(Month):
(Month.createFromValue):
(Month.createFromDate):
(Month.createFromDay):
(Month.prototype.containsDay):
(Month.prototype.equals):
(Month.prototype.previous):
(Month.prototype.next):
(Month.prototype.firstDay): Returns the first day in the month.
(Month.prototype.middleDay): Returns the middle day in the month.
(Month.prototype.lastDay): Returns the last day in the month.
(Month.prototype.valueOf):
(Month.prototype.toLocaleString): Moved location.
(Month.prototype.toShortLocaleString): Returns the month string in short format.
(CalendarPicker): Use createFromValue.
(YearMonthController.prototype.setMonth): Ditto.
(YearMonthController.prototype.moveRelatively): Ditto.

LayoutTests:

* platform/chromium/fast/forms/calendar-picker/calendar-picker-date-types-expected.txt: Added.
* platform/chromium/fast/forms/calendar-picker/calendar-picker-date-types.html: Added. Unit tests for date types.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143867 268f45cc-cd09-0410-ab3c-d52691b4dbfc
StyledElement: Don't expose a mutable direct interface to the inline style.
<http://webkit.org/b/110711>

Reviewed by Antti Koivisto.

Source/WebCore:

Remove the ability to grab at a mutable StylePropertySet* for a StyledElement's inline style
from the outside world. It's now private and returns MutableStylePropertySet* for future convenience.

Three paths to changing the inline style remain:

    - Setting the "style" attribute
    - Via CSSOM (element.style)
    - setInlineStyleProperty/removeInlineStyleProperty helpers

* dom/StyledElement.cpp:
(WebCore::StyledElement::ensureMutableInlineStyle):
* dom/StyledElement.h:
(StyledElement):
* editing/ApplyStyleCommand.cpp:
(WebCore::copyStyleOrCreateEmpty):
(WebCore::ApplyStyleCommand::applyRelativeFontStyleChange):
(WebCore::ApplyStyleCommand::removeEmbeddingUpToEnclosingBlock):
(WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange):
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::handleStyleSpans):
* html/canvas/CanvasStyle.cpp:
(WebCore::currentColor):

Source/WebKit/qt:

QWebElement::styleProperty() is a read-only method, so rewrite it to use StyledElement::inlineStyle().

* Api/qwebelement.cpp:
(QWebElement::styleProperty):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143868 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] GTK+ 2 build broken since GTK_API_VERSION_2 moved to autoconfig.h
https://bugs.webkit.org/show_bug.cgi?id=110702

Reviewed by Martin Robinson.

Source/WebCore:

No tests. Build fix, no behaviour change.

* platform/gtk/GtkVersioning.h: include the autotoolsconfig.h header,
which contains the GTK_API_VERSION_2 define now.

Source/WebKit/gtk:

* tests/testapplicationcache.c: include autotoolsconfig.h.
* tests/testatk.c: ditto.
* tests/testatkroles.c: ditto.
* tests/testcontextmenu.c: ditto.
* tests/testcopyandpaste.c: ditto.
* tests/testdomdocument.c: ditto.
* tests/testdomdomwindow.c: ditto.
* tests/testdomnode.c: ditto.
* tests/testdownload.c: ditto.
* tests/testfavicondatabase.c: ditto.
* tests/testglobals.c: ditto.
* tests/testhittestresult.c: ditto.
* tests/testhttpbackend.c: ditto.
* tests/testkeyevents.c: ditto.
* tests/testloading.c: ditto.
* tests/testmimehandling.c: ditto.
* tests/testnetworkrequest.c: ditto.
* tests/testnetworkresponse.c: ditto.
* tests/testwebbackforwardlist.c: ditto.
* tests/testwebdatasource.c: ditto.
* tests/testwebframe.c: ditto.
* tests/testwebhistoryitem.c: ditto.
* tests/testwebinspector.c: ditto.
* tests/testwebplugindatabase.c: ditto.
* tests/testwebresource.c: ditto.
* tests/testwebsettings.c: ditto.
* tests/testwebview.c: ditto.
* tests/testwindow.c: ditto.

Tools:

* GtkLauncher/main.c: include autotoolsconfig.h.
* Scripts/webkitpy/style/checker.py: make GtkLauncher/main.c exempt of
the include ordering check, since it uses autotoolsconfig.h which needs to
come first.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143869 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Stop generating UserAgentGtk.h
https://bugs.webkit.org/show_bug.cgi?id=110582

Reviewed by Martin Robinson.

.: 

* configure.ac: Provide the USER_AGENT_GTK_(MAJOR|MINOR)_VERSION defines in the autotoolsconfig.h
header, containing the user agent versions that are to be used in the user agent string. The
WEBKIT_USER_AGENT_(MAJOR|MINOR)_VERSION name is avoided as the same defines are specified in the
webkitversion.h API header (but are not accessible from the WebCore layer). The UserAgentGtk.h
header is also not generated anymore from the input file.

Source/WebCore: 

No new tests - no new functionality.

* GNUmakefile.list.am: Move the UserAgentGtk.h build target from the derived sources list to
the list of the WebCore platform sources.
* platform/gtk/UserAgentGtk.cpp:
(WebCore::standardUserAgent): Rename WEBKIT_USER_AGENT_(MAJOR|MINOR)_VERSION to
USER_AGENT_GTK_(MAJOR|MINOR)_VERSION.
* platform/gtk/UserAgentGtk.h: Renamed from Source/WebCore/platform/gtk/UserAgentGtk.h.in.
Same as the input file expect for removed WEBKIT_USER_AGENT_(MAJOR|MINOR)_VERSION defines that
are now replaced by using the USER_AGENT_GTK_(MAJOR|MINOR)_VERSION defines placed in autotoolsconfig.h.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143875 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Bug #110579