1 2015-09-16 Brady Eidson <beidson@apple.com>
3 Have window.indexedDB.deleteDatabase return an IDBOpenDBRequest.
4 https://bugs.webkit.org/show_bug.cgi?id=149229
6 Reviewed by Alex Christensen.
8 Test: storage/indexeddb/modern/deletedatabase-request.html
9 storage/indexeddb/modern/deletedatabase-null-name-exception.html
12 * WebCore.xcodeproj/project.pbxproj:
14 * Modules/indexeddb/IDBDatabaseIdentifier.cpp: Added.
15 (WebCore::IDBDatabaseIdentifier::IDBDatabaseIdentifier):
16 * Modules/indexeddb/IDBDatabaseIdentifier.h: Added.
17 (WebCore::IDBDatabaseIdentifier::IDBDatabaseIdentifier):
18 (WebCore::IDBDatabaseIdentifier::isHashTableDeletedValue):
19 (WebCore::IDBDatabaseIdentifier::hash):
20 (WebCore::IDBDatabaseIdentifier::isValid):
21 (WebCore::IDBDatabaseIdentifier::operator==):
22 (WebCore::IDBDatabaseIdentifier::databaseName):
23 (WebCore::IDBDatabaseIdentifierHash::hash):
24 (WebCore::IDBDatabaseIdentifierHash::equal):
25 (WebCore::IDBDatabaseIdentifierHashTraits::isEmptyValue):
27 * Modules/indexeddb/client/IDBFactoryImpl.cpp:
28 (WebCore::IDBClient::shouldThrowSecurityException):
29 (WebCore::IDBClient::IDBFactory::getDatabaseNames):
30 (WebCore::IDBClient::IDBFactory::open):
31 (WebCore::IDBClient::IDBFactory::deleteDatabase):
32 * Modules/indexeddb/client/IDBFactoryImpl.h:
34 * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp: Copied from Source/WebCore/Modules/indexeddb/client/IDBFactoryImpl.cpp.
35 (WebCore::IDBClient::IDBOpenDBRequest::IDBOpenDBRequest):
36 * Modules/indexeddb/client/IDBOpenDBRequestImpl.h: Copied from Source/WebCore/Modules/indexeddb/client/IDBFactoryImpl.cpp.
37 (WebCore::IDBClient::IDBOpenDBRequest::create):
39 * Modules/indexeddb/client/IDBRequestImpl.cpp: Copied from Source/WebCore/Modules/indexeddb/client/IDBFactoryImpl.cpp.
40 (WebCore::IDBClient::IDBRequest::IDBRequest):
41 (WebCore::IDBClient::IDBRequest::result):
42 (WebCore::IDBClient::IDBRequest::errorCode):
43 (WebCore::IDBClient::IDBRequest::error):
44 (WebCore::IDBClient::IDBRequest::source):
45 (WebCore::IDBClient::IDBRequest::transaction):
46 (WebCore::IDBClient::IDBRequest::readyState):
47 (WebCore::IDBClient::IDBRequest::eventTargetInterface):
48 (WebCore::IDBClient::IDBRequest::activeDOMObjectName):
49 (WebCore::IDBClient::IDBRequest::canSuspendForPageCache):
50 * Modules/indexeddb/client/IDBRequestImpl.h: Copied from Source/WebCore/Modules/indexeddb/client/IDBFactoryImpl.h.
54 2015-09-16 Chris Dumez <cdumez@apple.com>
56 Add initial support for [Unforgeable] IDL extended attribute
57 https://bugs.webkit.org/show_bug.cgi?id=149147
59 Reviewed by Darin Adler.
61 Add initial support for [Unforgeable] IDL extended attribute:
62 https://heycam.github.io/webidl/#Unforgeable
64 In particular, attributes marked as unforgeable are now:
65 - on the instance rather than the prototype
66 - non-configurable. WebKit does not match the Web IDL specification
67 and most properties are currently non-configurable already. However,
68 I added an extra check for [Unforgeable] so that unforgeable
69 attributes stay unconfigurable if we later decide to match the spec
70 and mark properties as configurable.
72 Operation marked as unforgeable are now non-configurable. However, this
73 patch does not move them from the prototype to the instance yet. This
74 needs to be addressed in a follow-up patch as this is a larger change.
76 This patch also drops support for the undocumented
77 [OperationsNotDeletable] IDL extended attribute. It is no longer needed
78 now that we support [Unforgeable] and still support [NotDeletable] for
81 Test: fast/dom/unforgeable-attributes.html
83 * Modules/plugins/QuickTimePluginReplacement.idl:
84 Drop [OperationsNotDeletable] on the interface and mark the only
85 operation on this interface as [NotDeletable]. There is no behavior
86 change but this allows us to drop support for a non-standard and
87 undocumented IDL extended attribute.
89 * bindings/scripts/CodeGeneratorJS.pm:
90 (AttributeShouldBeOnInstance):
91 (GenerateAttributesHashTable):
92 (GenerateImplementation):
93 Add initial support for [Unforgeable] IDL extended attribute.
95 * bindings/scripts/IDLAttributes.txt:
96 Add [Unforgeable]. Drop [OperationsNotDeletable].
98 * crypto/CryptoKeyPair.idl:
99 Drop [OperationsNotDeletable] on the interface as this interface has
103 * page/DOMWindow.idl:
105 Mark attributes / interfaces as [Unforgeable] as per the latest HTML
107 https://html.spec.whatwg.org/multipage/dom.html#document
108 https://html.spec.whatwg.org/multipage/browsers.html#window
109 https://html.spec.whatwg.org/multipage/browsers.html#the-location-interface
111 2015-09-16 Zalan Bujtas <zalan@apple.com>
113 Simple line layout: Glitch selecting long text.
114 https://bugs.webkit.org/show_bug.cgi?id=149204
115 rdar://problem/22646472
117 Reviewed by Antti Koivisto.
119 When long text is split into multiple RenderText objects, we ignore renderer boundaries while
120 collecting wrapping positions (so that we don't end up wrapping unbreakable fragments at the end of each renderer).
121 This patch ensures that fragments with hypen character ignore renderer boundaries too.
123 Test: fast/text/multiple-renderers-with-hypen-on-boundary.html
125 * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
126 (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
128 2015-09-16 Brady Eidson <beidson@apple.com>
130 Remove stray logging string mistakenly left in r189746.
132 * Modules/indexeddb/legacy/LegacyFactory.cpp:
133 (WebCore::LegacyFactory::deleteDatabase):
135 2015-09-16 Chris Fleizach <cfleizach@apple.com>
137 AX: No VoiceOver typing feedback in some search fields
138 https://bugs.webkit.org/show_bug.cgi?id=149177
140 Reviewed by Mario Sanchez Prada.
142 If SearchFieldRole is not marked as a TextControl, it does not end up returning the accessibilityValue,
143 which is needed to output the right text to VoiceOver.
145 Test: accessibility/ax-value-with-search.html
147 * accessibility/AccessibilityObject.cpp:
148 (WebCore::AccessibilityObject::isTextControl):
150 2015-09-16 Manuel Rego Casasnovas <rego@igalia.com>
152 [css-grid] Grid container's height should include scrollbar
153 https://bugs.webkit.org/show_bug.cgi?id=149210
155 Reviewed by Sergio Villar Senin.
157 Add scrollbar's size in the grid container's height calculation at
158 RenderGrid::layoutGridItems().
160 Test: fast/css-grid-layout/grid-container-margin-border-padding-scrollbar.html
162 * rendering/RenderGrid.cpp:
163 (WebCore::RenderGrid::layoutGridItems): Include scrollbarLogicalHeight()
164 while computing the grid's logical height.
166 2015-09-16 Carlos Garcia Campos <cgarcia@igalia.com>
168 Unreviewed. Fix GObject DOM bindings API break after r189676.
170 webkit_dom_character_data_append_data() used to raise exceptions.
172 * bindings/scripts/CodeGeneratorGObject.pm:
173 (FunctionUsedToRaiseException):
175 2015-09-15 Commit Queue <commit-queue@webkit.org>
177 Unreviewed, rolling out r189847.
178 https://bugs.webkit.org/show_bug.cgi?id=149208
180 Asserts on all the tests (Requested by ap on #webkit).
184 "Simple line layout: Glitch selecting long text."
185 https://bugs.webkit.org/show_bug.cgi?id=149204
186 http://trac.webkit.org/changeset/189847
188 2015-09-15 Zalan Bujtas <zalan@apple.com>
190 Simple line layout: Glitch selecting long text.
191 https://bugs.webkit.org/show_bug.cgi?id=149204
192 rdar://problem/22646472
194 Reviewed by Antti Koivisto.
196 When long text is split into multiple RenderText objects, we ignore renderer boundaries while
197 collecting wrapping positions (so that we don't end up wrapping unbreakable fragments at the end of each renderer).
198 This patch ensures that fragments with hypen character ignore renderer boundaries too.
200 Test: fast/text/multiple-renderers-with-hypen-on-boundary.html
202 * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
203 (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
205 2015-09-15 Ryosuke Niwa <rniwa@webkit.org>
207 GTK+ build fix attempt after r189841.
211 2015-09-15 Chris Dumez <cdumez@apple.com>
213 Document.createElement(localName) does not handle correctly missing or null parameter
214 https://bugs.webkit.org/show_bug.cgi?id=149184
215 <rdar://problem/22565070>
217 Reviewed by Ryosuke Niwa.
219 Document.createElement(localName) does not handle correct missing or
221 - https://dom.spec.whatwg.org/#interface-document
223 As per the specification, the parameter is a non-nullable DOMString and
224 is mandatory. Therefore, as per Web IDL, we should have the following
226 1. If the parameter is missing, we should throw an exception
227 2. If the parameter is null, we should convert it to the "null" string
228 and create a <null> element.
230 Chrome and Firefox behave according to the specification. However,
232 1. Create a <undefined> element
233 2. Throw an InvalidCharacterError
235 This patch aligns WebKit's behavior with the specification and other
238 No new tests, already covered by existing tests.
242 2015-09-15 Ryosuke Niwa <rniwa@webkit.org>
244 Add ShadowRoot interface and Element.prototype.attachShadow
245 https://bugs.webkit.org/show_bug.cgi?id=149187
247 Reviewed by Antti Koivisto.
249 Add back ShadowRoot IDL interface and Element.prototype.attachShadow in accordance with
250 http://w3c.github.io/webcomponents/spec/shadow/ at db27e6e36eab512d86edcdabb33ed27b5751acd7 excluding getSelection(),
251 elementFromPoint(), elementsFromPoint(), caretPositionFromPoint(), and styleSheets attribute on ShadowRoot interface.
253 The feature is enabled by default on Mac and iOS ports for testing and disabled by default elsewhere.
255 Also added HTMLElement::canHaveUserAgentShadowRoot which returns false by default and overridden elsewhere to return true
256 to distinguish elements for which attachShadow is supposed to throw NotSupported.
257 See https://w3c.github.io/webcomponents/spec/shadow/#widl-Element-attachShadow-ShadowRoot-ShadowRootInit-shadowRootInitDict
259 Tests: fast/shadow-dom/Element-interface-attachShadow.html
260 fast/shadow-dom/Element-interface-shadowRoot-attribute.html
261 fast/shadow-dom/ShadowRoot-interface.html
264 * Configurations/FeatureDefines.xcconfig:
265 * DerivedSources.cpp:
266 * DerivedSources.make:
268 * WebCore.vcxproj/WebCore.vcxproj:
269 * WebCore.vcxproj/WebCore.vcxproj.filters:
270 * WebCore.xcodeproj/project.pbxproj:
271 * css/SelectorChecker.cpp:
272 (WebCore::SelectorChecker::matchRecursively):
274 (WebCore::Element::bindingsOffsetParent):
275 (WebCore::Element::offsetParent):
276 (WebCore::Element::addShadowRoot):
277 (WebCore::Element::createShadowRoot):
278 (WebCore::Element::attachShadow): Added.
279 (WebCore::Element::bindingShadowRoot): Added. Returns null unless the attached shadow root is in the "open" mode.
281 * dom/Element.idl: Added attachShadow and shadowRoot. We only expose these to JS for now since Dictionary argument isn't
282 supported by other binding code.
283 * dom/ShadowRoot.cpp: Removed an unused enum.
285 (WebCore::ShadowRoot::Type): Replaced old-style enum "ShadowRootType" by an enum class named "Type". Also added two new
286 values Open and Closed for author shadow roots.
287 (WebCore::ShadowRoot::type):
288 * dom/ShadowRoot.idl: Added.
289 * html/HTMLButtonElement.h:
290 * html/HTMLDetailsElement.h:
291 (HTMLButtonElement::canHaveUserAgentShadowRoot): Ditto.
292 * html/HTMLElement.h:
293 (WebCore::HTMLElement::canHaveUserAgentShadowRoot): Added. Returns false by default.
294 * html/HTMLInputElement.h:
295 * html/HTMLKeygenElement.h:
296 * html/HTMLMarqueeElement.h:
297 * html/HTMLMediaElement.h:
298 * html/HTMLMeterElement.h:
299 * html/HTMLPlugInElement.h:
300 * html/HTMLProgressElement.h:
301 * html/HTMLSelectElement.h:
302 * html/HTMLSummaryElement.h:
303 * html/HTMLTextAreaElement.h:
304 * html/shadow/InsertionPoint.h:
305 (ShadowRootWithInsertionPoints::ShadowRootWithInsertionPoints):
306 * rendering/RenderElement.cpp:
307 (WebCore::RenderElement::selectionPseudoStyle):
308 * rendering/RenderLayer.cpp:
309 (WebCore::rendererForScrollbar):
310 * svg/SVGElement.cpp:
311 (WebCore::SVGElement::correspondingUseElement):
312 * testing/Internals.cpp:
313 (WebCore::Internals::shadowRootType):
315 2015-09-15 Brent Fulgham <bfulgham@apple.com>
317 [Win] Unreviewed release fix after r189832
319 * platform/graphics/ca/win/PlatformCALayerWin.h: The implementation
320 should exist in Release builds as well.
322 2015-09-15 Benjamin Poulain <bpoulain@apple.com>
324 Style invalidation affecting siblings does not work with inline-style changes
325 https://bugs.webkit.org/show_bug.cgi?id=149189
327 Reviewed by Antti Koivisto.
329 Style::resolveTree() made the assumption that inline style changes only affect
330 descendants and should not participate in "StyleRecalcAffectsNextSiblingElementStyle".
331 That was wrong. If the inline style change through CSSOM, it can cause the creation
332 of a style attribute, which is observable through "StyleRecalcAffectsNextSiblingElementStyle".
334 This patch removes the incorrect assumption. Style invalidation is always propagated now.
336 Tests: fast/css/style-attribute-invalidation-propagates-to-counted-siblings.html
337 fast/css/style-attribute-invalidation-propagates-to-direct-siblings.html
338 fast/css/style-attribute-invalidation-propagates-to-indirect-siblings.html
340 * css/PropertySetCSSStyleDeclaration.cpp:
341 (WebCore::InlineCSSStyleDeclaration::didMutate): Deleted.
342 * dom/StyledElement.cpp:
343 (WebCore::StyledElement::inlineStyleChanged):
344 * dom/StyledElement.h:
345 (WebCore::StyledElement::invalidateStyleAttribute):
346 Clean up inline-style invalidation a tiny bit.
348 * style/StyleResolveTree.cpp:
349 (WebCore::Style::resolveTree):
352 2015-09-15 Joseph Pecoraro <pecoraro@apple.com>
354 Web Inspector: Paused Debugger prevents page reload
355 https://bugs.webkit.org/show_bug.cgi?id=148174
357 Reviewed by Brian Burg.
359 When navigating the page while paused, suppress any pausing until the page
360 has completed navigation. If not paused and navigating, you can still pause
361 in pagehide and unload handlers or other late page events.
363 Could not write a reliable test for this at the moment.
364 InspectorTest.reloadPage has multiple issues with the output,
365 so I'll investigate making reload tests more reliable later.
367 * inspector/InspectorController.h:
368 * inspector/InspectorController.cpp:
369 (WebCore::InspectorController::resume): Deleted.
370 * loader/FrameLoader.cpp:
371 (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
372 We now use existing InspectorInstrumentation functions instead of a method
373 on InspectorController during load. In dropping the method InspectorController
374 can drop a member variable no longer used.
376 * inspector/InspectorInstrumentation.h:
377 (WebCore::InspectorInstrumentation::willStartProvisionalLoad):
378 Add a new instrumentation hook.
380 * inspector/InspectorInstrumentation.cpp:
381 (WebCore::InspectorInstrumentation::willStartProvisionalLoadImpl):
382 (WebCore::InspectorInstrumentation::didCommitLoadImpl):
383 When starting or completing main frame navigations, let the PageDebuggerAgent do some work.
385 * inspector/PageDebuggerAgent.h:
386 * inspector/PageDebuggerAgent.cpp:
387 (WebCore::PageDebuggerAgent::mainFrameStartedLoading):
388 (WebCore::PageDebuggerAgent::mainFrameStoppedLoading):
389 (WebCore::PageDebuggerAgent::mainFrameNavigated):
390 Suppress pausing if navigating while paused. Otherwise behave as normal.
392 2015-09-15 Brent Fulgham <bfulgham@apple.com>
394 [Win] Provide a means for viewing the layer tree
395 https://bugs.webkit.org/show_bug.cgi?id=149165
397 Reviewed by Simon Fraser.
399 Revise the old fprintf logic to generate a string
400 containing the layer tree so that it can be output
401 to the debugger (or elsewhere).
403 * platform/graphics/ca/PlatformCALayer.h: Rename 'printTree'
404 to 'printLayerTree', and make it available in release builds.
405 * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
406 (WebCore::CACFLayerTreeHost::printLayerTree): Added. Calls into
407 the PlatformCALayer implementation.
408 * platform/graphics/ca/win/CACFLayerTreeHost.h:
409 * platform/graphics/ca/win/PlatformCALayerWin.cpp:
410 (printIndent): Revise to use two-space indent and use StringBuilder.
411 (printTransform): Ditto.
412 (printColor): Added helper function.
413 (printLayer): Revised to output information on the layer contents.
414 (PlatformCALayerWin::printLayerTree): Renamed from 'printTree'.
415 (PlatformCALayerWin::printTree): Deleted.
416 * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
417 (PlatformCALayerWinInternal::drawRepaintCounters): Drive-by fix. Match the
418 cocoa repaint counter logic by not painting counters for the layers that
419 contain the tile grid.
420 * platform/graphics/ca/win/PlatformCALayerWin.h:
421 * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
422 (PlatformCALayerWinInternal::drawRepaintCounters):
424 2015-09-15 Myles C. Maxfield <mmaxfield@apple.com>
426 REGRESSION(r155554): Nested isolates can cause an infinite loop when laying out bidi runs
427 https://bugs.webkit.org/show_bug.cgi?id=149153
429 Reviewed by David Hyatt.
431 When traversing bidi runs, we might encounter a run which is supposed to be isolated. In this
432 situation, we will append a placeholder run in the run list, and remember a pointer to these
433 isolated runs inside BidiResolver. Then, once we're done traversing the bidi runs, we return
434 to the isolated runs and handle them separately (and replace the placeholder with the result).
436 However, due to the fact that our BidiRuns start at leaf nodes, we have to keep track of which
437 local root of the render tree we were inspecting (to ensure that we visit the same node
438 multiple times if there are nested isolate spans). We were not correctly keeping track of this
439 local root, which was leading us to consider the same root multiple times, thereby leading to
442 The solution is simply to keep root information alongside the isolated run information inside
443 BidiResolver. However, BidiResolver is inside platform/, which means that this new type should
444 be a template argument, just like how BidiRun itself is a template argument.
446 This new type, BidiIsolatedRun, holds all the information that our isolate-revisiting logic
447 needs inside constructBidiRunsForSegment(). It also holds a reference to the placeholder run
448 which we will replace.
450 Test: fast/text/international/unicode-bidi-isolate-nested-crash.html
452 * platform/graphics/GraphicsContext.cpp:
453 (WebCore::GraphicsContext::drawBidiText): BidiIsolatedRun template argument is unused, so pass
455 * platform/text/BidiResolver.h: Add template argument.
456 (WebCore::BidiResolver::isolatedRuns):
457 (WebCore::IsolatedRun>::~BidiResolver):
458 (WebCore::IsolatedRun>::appendRun):
459 (WebCore::IsolatedRun>::embed):
460 (WebCore::IsolatedRun>::checkDirectionInLowerRaiseEmbeddingLevel):
461 (WebCore::IsolatedRun>::lowerExplicitEmbeddingLevel):
462 (WebCore::IsolatedRun>::raiseExplicitEmbeddingLevel):
463 (WebCore::IsolatedRun>::commitExplicitEmbedding):
464 (WebCore::IsolatedRun>::updateStatusLastFromCurrentDirection):
465 (WebCore::IsolatedRun>::reorderRunsFromLevels):
466 (WebCore::IsolatedRun>::createBidiRunsForLine):
467 (WebCore::IsolatedRun>::setMidpointForIsolatedRun): Use references instead of pointers.
468 (WebCore::IsolatedRun>::midpointForIsolatedRun): Ditto.
469 (WebCore::Run>::~BidiResolver): Deleted.
470 (WebCore::Run>::appendRun): Deleted.
471 (WebCore::Run>::embed): Deleted.
472 (WebCore::Run>::checkDirectionInLowerRaiseEmbeddingLevel): Deleted.
473 (WebCore::Run>::lowerExplicitEmbeddingLevel): Deleted.
474 (WebCore::Run>::raiseExplicitEmbeddingLevel): Deleted.
475 (WebCore::Run>::commitExplicitEmbedding): Deleted.
476 (WebCore::Run>::updateStatusLastFromCurrentDirection): Deleted.
477 (WebCore::Run>::reorderRunsFromLevels): Deleted.
478 (WebCore::Run>::createBidiRunsForLine): Deleted.
479 (WebCore::Run>::setMidpointForIsolatedRun): Deleted.
480 (WebCore::Run>::midpointForIsolatedRun): Deleted.
481 * rendering/InlineIterator.h:
482 (WebCore::BidiIsolatedRun::BidiIsolatedRun): New type.
483 (WebCore::addPlaceholderRunForIsolatedInline): Create new type, and include local root
485 (WebCore::IsolateTracker::addFakeRunIfNecessary): Include local root information.
486 (WebCore::InlineBidiResolver::appendRun): Ditto.
487 * rendering/RenderBlockLineLayout.cpp: Update for new BidiIsolatedRun type.
488 (WebCore::setUpResolverToResumeInIsolate):
489 (WebCore::constructBidiRunsForSegment):
490 * rendering/line/TrailingObjects.h:
492 2015-09-15 Brady Eidson <beidson@apple.com>
494 Add empty IDBFactory implementation for Modern IDB.
495 https://bugs.webkit.org/show_bug.cgi?id=149191
497 Reviewed by Jer Noble.
499 No new tests (No behavior change).
501 * Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
502 (WebCore::DOMWindowIndexedDatabase::indexedDB):
504 * Modules/indexeddb/client/IDBFactoryImpl.cpp:
505 (WebCore::IDBClient::IDBFactory::create):
506 (WebCore::IDBClient::IDBFactory::IDBFactory):
507 (WebCore::IDBClient::IDBFactory::getDatabaseNames):
508 (WebCore::IDBClient::IDBFactory::open):
509 (WebCore::IDBClient::IDBFactory::deleteDatabase):
510 (WebCore::IDBClient::IDBFactory::cmp):
511 * Modules/indexeddb/client/IDBFactoryImpl.h:
514 * WebCore.xcodeproj/project.pbxproj:
516 * loader/EmptyClients.cpp:
517 * page/DatabaseProvider.h:
519 2015-09-15 Antti Koivisto <antti@apple.com>
521 Split FontDescription into lower and higher level types
522 https://bugs.webkit.org/show_bug.cgi?id=149036
524 Reviewed by Darin Adler.
526 Currently FontDescription is used through the text subsystem. However much of the data it
527 carries is only needed by FontCascade and text layout but not by the lower level Font/FontCache
528 layer. This makes code confusing. For example families specified in FontDescription are ignored
531 Split it into a low level FontDescription and a high level FontCascadeDescription type:
533 FontDescription <-> Font
534 FontCascadeDescription <-> FontCascade
536 The former only carries information that is needed to instantiate a Font or fetch it from the FontCache.
537 The latter has additional data for CSS font cascade semantics and other higher level features.
539 2015-09-15 Myles C. Maxfield <mmaxfield@apple.com>
541 GraphicsContext::drawBidiText()'s BidiResolver should not have isolated runs
542 https://bugs.webkit.org/show_bug.cgi?id=149193
544 Reviewed by Anders Carlsson.
546 There are two users of BidiResolver, one which needs isolated runs (in RenderBlockLineLayout) and
547 one which doesn't (in GraphicsContext::drawBidiText()). Because of [1], the isolated runs vector
548 is migrating to a new type outside of platform/. Therefore, only the first user of BidiResolver
549 should have this member variable.
551 This is achieved by creating two subclasses of BidiResolver, and using the Curiously Repeating
552 Template pattern to downcast into specializations.
554 [1] https://bugs.webkit.org/show_bug.cgi?id=149153
556 No new tests because there is no behavior change.
558 * platform/text/BidiResolver.h:
559 (WebCore::BidiResolverBase::BidiResolverBase):
560 (WebCore::BidiResolverBase::increment):
561 (WebCore::BidiResolverBase::appendRun):
562 (WebCore::BidiResolverBase::incrementInternal):
563 (WebCore::IsolateRun>::~BidiResolverWithIsolate):
564 (WebCore::Subclass>::appendRunInternal):
565 (WebCore::Subclass>::embed):
566 (WebCore::Subclass>::checkDirectionInLowerRaiseEmbeddingLevel):
567 (WebCore::Subclass>::lowerExplicitEmbeddingLevel):
568 (WebCore::Subclass>::raiseExplicitEmbeddingLevel):
569 (WebCore::Subclass>::commitExplicitEmbedding):
570 (WebCore::Subclass>::updateStatusLastFromCurrentDirection):
571 (WebCore::Subclass>::reorderRunsFromLevels):
572 (WebCore::Subclass>::createBidiRunsForLine):
573 (WebCore::Subclass>::setMidpointForIsolatedRun):
574 (WebCore::Subclass>::midpointForIsolatedRun):
575 (WebCore::BidiResolver::BidiResolver): Deleted.
576 (WebCore::BidiResolver::increment): Deleted.
577 (WebCore::BidiResolver::isolatedRuns): Deleted.
578 (WebCore::Run>::~BidiResolver): Deleted.
579 (WebCore::Run>::appendRun): Deleted.
580 (WebCore::Run>::embed): Deleted.
581 (WebCore::Run>::checkDirectionInLowerRaiseEmbeddingLevel): Deleted.
582 (WebCore::Run>::lowerExplicitEmbeddingLevel): Deleted.
583 (WebCore::Run>::raiseExplicitEmbeddingLevel): Deleted.
584 (WebCore::Run>::commitExplicitEmbedding): Deleted.
585 (WebCore::Run>::updateStatusLastFromCurrentDirection): Deleted.
586 (WebCore::Run>::reorderRunsFromLevels): Deleted.
587 (WebCore::Run>::createBidiRunsForLine): Deleted.
588 (WebCore::Run>::setMidpointForIsolatedRun): Deleted.
589 (WebCore::Run>::midpointForIsolatedRun): Deleted.
590 * rendering/InlineIterator.h:
591 (WebCore::InlineBidiResolver::incrementInternal):
592 (WebCore::InlineBidiResolver::appendRunInternal):
593 (WebCore::InlineBidiResolver::increment): Deleted.
594 (WebCore::InlineBidiResolver::appendRun): Deleted.
595 * rendering/line/TrailingObjects.h:
597 2015-09-15 Chris Dumez <cdumez@apple.com>
599 new Event() without parameter should throw
600 https://bugs.webkit.org/show_bug.cgi?id=149146
601 <rdar://problem/22565070>
603 Reviewed by Ryosuke Niwa.
605 new Event() without parameter should throw because the type parameter
606 is mandatory as per the specification:
607 https://dom.spec.whatwg.org/#interface-event
609 Both Firefox and Chrome throw in this case. However, WebKit was
610 creating an event whose type is the string "undefined". This patch
611 aligns our behavior with the specification and other major browsers.
613 No new tests, already covered by existing test.
615 * bindings/scripts/CodeGeneratorJS.pm:
616 (GenerateConstructorDefinition):
617 * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
618 (WebCore::JSTestEventConstructorConstructor::constructJSTestEventConstructor):
620 2015-09-15 Carlos Alberto Lopez Perez <clopez@igalia.com>
622 [GTK] Build failure with ACCELERATED_2D_CANVAS when cairo-gl has built with OpenGLESv2 support only.
623 https://bugs.webkit.org/show_bug.cgi?id=149172
625 Reviewed by Martin Robinson.
627 No new tests, no behavior change.
629 * platform/graphics/glx/GLContextGLX.cpp:
630 (WebCore::GLContextGLX::cairoDevice):
632 2015-09-15 Chris Dumez <cdumez@apple.com>
634 Element.getAttributeNS() should return null if the attribute does not exist
635 https://bugs.webkit.org/show_bug.cgi?id=149180
636 <rdar://problem/22561011>
638 Reviewed by Ryosuke Niwa.
640 Element.getAttributeNS() should return null if the attribute does not
641 exist, similarly to what Element.getAttribute() does:
642 - https://dom.spec.whatwg.org/#element (both return a nullable DOMString).
643 - https://dom.spec.whatwg.org/#dom-element-getattributens (step 2)
645 Firefox and Chrome match the specification. However, WebKit was returning
646 an empty string for getAttributeNS() and null for getAttribute(). This
647 patch aligns WebKit's behavior with the specification and other browsers.
649 No new tests, already covered by existing tests.
653 2015-09-15 Ryosuke Niwa <rniwa@webkit.org>
655 ContentDistribution should be only used for details elements
656 https://bugs.webkit.org/show_bug.cgi?id=149148
658 Reviewed by Antti Koivisto.
660 Extracted ShadowRootWithInsertionPoints out of ShadowRoot for HTMLDetailsElement and HTMLSummaryElement.
662 We don't add a separate .h and .cpp files since this is a temporary measure until we replace it with
663 a slot-based shadow DOM implementation.
665 No new tests. There should be no observable behavioral change.
668 (WebCore::Element::addShadowRoot): Removed the call to didShadowBoundaryChange since this function is only
669 called in ensureUserAgentShadowRoot. Also moved the call to didAddUserAgentShadowRoot for
670 HTMLDetailsElement's shadow root which uses this function instead of ensureUserAgentShadowRoot.
671 (WebCore::Element::removeShadowRoot): Removed the call to invalidateDistribution since it's only called by
673 (WebCore::Element::createShadowRoot):
674 (WebCore::Element::ensureUserAgentShadowRoot): Moved the call didAddUserAgentShadowRoot into addShadowRoot
675 since HTMLDetailsElement uses a subclass of ShadowRoot.
676 (WebCore::Element::childrenChanged):
677 (WebCore::Element::removeAllEventListeners):
680 (Element::addShadowRoot): Made this function a protected member as it's now used by HTMLDetailsElement.
682 * dom/ShadowRoot.cpp:
683 (WebCore::ShadowRoot::childrenChanged): Deleted.
686 (WebCore::ShadowRoot::distributor): Made this a virtual function and return nullptr by default.
687 (WebCore::ShadowRoot::isOrphan):
689 * html/HTMLDetailsElement.cpp:
690 (WebCore::HTMLDetailsElement::create): Uses ShadowRootWithInsertionPoints instead of ShadowRoot.
692 * html/HTMLInputElement.cpp:
693 (WebCore::HTMLInputElement::runPostTypeUpdateTasks): Removed the call to invalidateDistribution since it's
694 only relevant for HTMLDetailsElement's shadow DOM.
696 * html/HTMLSummaryElement.cpp:
697 (WebCore::HTMLSummaryElement::create): Uses ShadowRootWithInsertionPoints instead of ShadowRoot.
699 * html/shadow/ContentDistributor.cpp:
700 (WebCore::ContentDistributor::distribute):
701 (WebCore::ContentDistributor::ensureDistribution):
702 (WebCore::ContentDistributor::invalidateDistribution):
704 * html/shadow/InsertionPoint.cpp:
705 (WebCore::InsertionPoint::childrenChanged):
706 (WebCore::InsertionPoint::insertedInto):
707 (WebCore::InsertionPoint::removedFrom):
708 (WebCore::findInsertionPointOf):
709 (WebCore::ShadowRootWithInsertionPoints::childrenChanged): Moved from ShadowRoot.
711 * html/shadow/InsertionPoint.h:
712 (WebCore::ShadowRootWithInsertionPoints::create): Added.
713 (WebCore::ShadowRootWithInsertionPoints::ShadowRootWithInsertionPoints): Added.
715 2015-09-15 Brent Fulgham <bfulgham@apple.com>
717 [Win] Tiled drawing is rendering more times than it should
718 https://bugs.webkit.org/show_bug.cgi?id=149144
719 <rdar://problem/22313905>
721 Reviewed by Simon Fraser.
723 Provide a more faithful implemenation of the Objective C tiled drawing logic.
724 (1) Create a new WebTiledBackingLayerWin class that represents a the
725 container of tiles. This matches the Objective C design.
726 (2) Move implementation of several methods (e.g., isOpaque) to the internal
727 class implementation so that the Tile Drawing logic can perform special
728 handling in these cases.
729 (3) Remove the duplicated Tiled Drawing logic from PlatformCALayerWinInternal,
730 since it was just duplicating code in TileController and TileGrid.
731 (4) Clean up the display callback code to avoid performing incorrect flipping
732 of the coordinate system.
734 * PlatformAppleWin.cmake: Add new WebTiledBackingLayerWin file.
735 * WebCore.vcxproj/WebCore.vcxproj: Add the new WebTiledBackingLayerWin files.
736 * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
737 * platform/graphics/ca/PlatformCALayer.cpp:
738 (PlatformCALayer::flipContext): Added convenience method.
739 (PlatformCALayer::drawRepaintIndicator): Ditto.
740 * platform/graphics/ca/TileGrid.cpp:
741 (TileGrid::platformCALayerPaintContents): Flip the context before drawing the repaint
742 indicator on Windows.
743 * platform/graphics/ca/win/PlatformCALayerWin.cpp:
744 (PlatformCALayerWin::PlatformCALayerWin): Create a WebTiledBackingLayerWin
745 object if using tiled drawing.
746 (PlatformCALayerWin::~PlatformCALayerWin):
747 (PlatformCALayerWin::isOpaque): Move implementation to internal class.
748 (PlatformCALayerWin::setOpaque): Ditto.
749 (PlatformCALayerWin::setBorderWidth): Ditto.
750 (PlatformCALayerWin::setBorderColor): Ditto.
751 (PlatformCALayerWin::contentsScale): Ditto.
752 (PlatformCALayerWin::setContentsScale): Ditto.
753 (PlatformCALayerWin::cornerRadius): Ditto.
754 (PlatformCALayerWin::tiledBacking): Ditto.
755 (PlatformCALayerWin::drawTextAtPoint): New helper method to draw repaint counter
756 text. Needed to work around bug in CG.
757 * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
758 (PlatformCALayerWinInternal::PlatformCALayerWinInternal): Remove tiling-logic
759 related member variables.
760 (PlatformCALayerWinInternal::~PlatformCALayerWinInternal):
761 (shouldInvertBeforeDrawingContent): Added convenience method.
762 (shouldInvertBeforeDrawingRepaintCounters): Ditto.
763 (PlatformCALayerWinInternal::displayCallback):
764 (PlatformCALayerWinInternal::drawRepaintCounters): Helper method to
765 share code between the two layer classes.
766 (PlatformCALayerWinInternal::internalSetNeedsDisplay): use nullptr.
767 (PlatformCALayerWinInternal::setNeedsDisplay): Ditto.
768 (PlatformCALayerWinInternal::setNeedsDisplayInRect): Move tiled code
769 to WebTiledBackingLayerWin and simplify the remaing code.
770 (PlatformCALayerWinInternal::setSublayers): Remove tile code.
771 (PlatformCALayerWinInternal::getSublayers): Ditto.
772 (PlatformCALayerWinInternal::removeAllSublayers): Ditto.
773 (PlatformCALayerWinInternal::insertSublayer): Ditto.
774 (PlatformCALayerWinInternal::sublayerCount): Ditto.
775 (PlatformCALayerWinInternal::indexOfSublayer): Ditto.
776 (PlatformCALayerWinInternal::sublayerAtIndex): Ditto.
777 (PlatformCALayerWinInternal::setBounds): Ditto.
778 (PlatformCALayerWinInternal::setFrame): Ditto.
779 (PlatformCALayerWinInternal::isOpaque): Ditto.
780 (PlatformCALayerWinInternal::setOpaque): Ditto.
781 (PlatformCALayerWinInternal::contentsScale): Ditto.
782 (PlatformCALayerWinInternal::setContentsScale): Ditto.
783 (PlatformCALayerWinInternal::setBorderWidth): Ditto.
784 (PlatformCALayerWinInternal::setBorderColor): Ditto.
785 (layerTypeIsTiled): Deleted.
786 (PlatformCALayerWinInternal::constrainedSize): Deleted.
787 (PlatformCALayerWinInternal::tileDisplayCallback): Deleted.
788 (PlatformCALayerWinInternal::addTile): Deleted.
789 (PlatformCALayerWinInternal::removeTile): Deleted.
790 (PlatformCALayerWinInternal::tileAtIndex): Deleted.
791 (PlatformCALayerWinInternal::tileCount): Deleted.
792 (PlatformCALayerWinInternal::updateTiles): Deleted.
793 (PlatformCALayerWinInternal::drawTile): Deleted.
794 (PlatformCALayerWinInternal::createTileController): Deleted.
795 (PlatformCALayerWinInternal::tiledBacking): Deleted.
796 * platform/graphics/ca/win/PlatformCALayerWinInternal.h:
797 (WebCore::PlatformCALayerWinInternal::owner):
798 * platform/graphics/ca/win/WebTiledBackingLayerWin.cpp: Added.
799 (WebTiledBackingLayerWin::WebTiledBackingLayerWin):
800 (WebTiledBackingLayerWin::~WebTiledBackingLayerWin):
801 (DisplayOnMainThreadContext::DisplayOnMainThreadContext):
802 (redispatchOnMainQueue):
803 (WebTiledBackingLayerWin::displayCallback):
804 (WebTiledBackingLayerWin::setNeedsDisplay):
805 (WebTiledBackingLayerWin::setNeedsDisplayInRect):
806 (WebTiledBackingLayerWin::setBounds):
807 (WebTiledBackingLayerWin::isOpaque):
808 (WebTiledBackingLayerWin::setOpaque):
809 (WebTiledBackingLayerWin::contentsScale):
810 (WebTiledBackingLayerWin::setContentsScale):
811 (WebTiledBackingLayerWin::setBorderWidth):
812 (WebTiledBackingLayerWin::setBorderColor):
813 (WebTiledBackingLayerWin::createTileController):
814 (WebTiledBackingLayerWin::tiledBacking):
815 (WebTiledBackingLayerWin::invalidate):
816 * platform/graphics/ca/win/WebTiledBackingLayerWin.h: Added.
818 2015-09-14 David Hyatt <hyatt@apple.com>
820 [New Block-Inside-Inline Model] Implement margin collapsing across contiguous anonymous inline blocks.
821 https://bugs.webkit.org/show_bug.cgi?id=149132
823 Reviewed by Zalan Bujtas.
825 Added new tests inside fast/block/inside-inlines/
827 * rendering/InlineFlowBox.cpp:
828 (WebCore::InlineFlowBox::anonymousInlineBlock):
829 Change this accessor to be more robust and be willing to both recur (in case we ever do decide intermediate line boxes should exist)
830 and to type check. This is not currently needed, but I'm just being paranoid and future proof.
832 (WebCore::InlineFlowBox::addToLine):
833 Again, for thoroughness, I am making sure to propagate the hasAnonymousInlineBlock() bit through to parents. This is only needed
834 if we build intermediate line boxes for lines with anonymous inline blocks.
836 (WebCore::InlineFlowBox::placeBoxesInBlockDirection):
837 Anonymous inline blocks receive a layout via layoutBlockChild, in order to make sure that margin collapsing runs. This means
838 that unlike other line objects, the position of the child has been determined already. Therefore we simply set the position
839 of the line box that wraps the anonymous inline block to the already-computed position for that block.
841 Also patch the code that sets lineTop and lineBottom using the root box's dimensions. We don't really care about the root line
842 box on anonymous inline block lines and just want to set lineTop and lineBottom to fit the anonymous inline block.
844 * rendering/RenderBlockFlow.cpp:
845 (WebCore::RenderBlockFlow::collapseMargins):
846 (WebCore::RenderBlockFlow::collapseMarginsWithChildInfo):
847 Refactor collapseMargins to call a helper function that can pass in a previous "sibling", and that can handle the child
848 being null. We do this to perform a margin collapse when anonymous inline blocks run up against regular lines (which is like
849 collapsing with a sibling block "child").
851 * rendering/RenderBlockFlow.h:
852 Tweak the MarginInfo constructor to take a const RenderBlockFlow. Tweak some line layout methods to pass in the LineLayoutState
853 so that MarginInfo is available during line layout.
855 * rendering/RenderBlockLineLayout.cpp:
856 (WebCore::RenderBlockFlow::createLineBoxes):
857 When we create a new line box, if it is not an anonymous inline block line and our previous line was, simulate a margin
858 collapse in order to possibly push the line box down or up. Re-use the pagination adjustment code to rewind line layout
859 and perform it again if pushed below a float.
861 (WebCore::constructBidiRunsForSegment):
862 (WebCore::RenderBlockFlow::layoutRunsAndFloats):
863 (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
864 (WebCore::RenderBlockFlow::layoutLineBoxes):
865 (WebCore::RenderBlockFlow::determineStartPosition):
866 (WebCore::RenderBlockFlow::matchedEndLine):
867 (WebCore::RenderBlockFlow::updateRegionForLine):
868 (WebCore::RenderBlockFlow::marginCollapseLinesFromStart):
869 Patch line layout to run margin collapsing when anonymous inline blocks are encountered. This involves making sure
870 margin info and float bottom positions are passed through so that layoutBlockChild can be properly called on
871 anonymous inline blocks that we encounter.
873 In addition line layout when it syncs dirty lines has to run margin collapsing on earlier lines in order to make
874 sure margin info is properly set up at the first dirty line position.
876 Note that there will be more improvements/changes in this area (dirty line syncing), as the current model is inefficient
877 when many anonymous inline blocks are scattered throughout a large-scale line box tree.
879 * rendering/RootInlineBox.cpp:
880 (WebCore::RootInlineBox::alignBoxesInBlockDirection):
881 (WebCore::RootInlineBox::ascentAndDescentForBox):
882 Make sure to rely on the block layout code for the placement of the boxes themselves. Set up the line box code to not have
883 an effect on ascent/descent.
885 * rendering/line/BreakingContext.h:
886 (WebCore::BreakingContext::BreakingContext):
887 (WebCore::BreakingContext::handleReplaced):
888 When we encounter an anonymous inline block, lay it out when it is seen. We have to delay the layout, since we have
889 to be able to perform it mid-line-layout when the containing block's logical height is at the correct value and all previous
890 lines are placed. Margin info also has to be current.
892 * rendering/line/LineBreaker.cpp:
893 * rendering/line/LineBreaker.h:
894 Patched to pass LineLayoutState through so that the stuff we need to perform block layout is available (margin info and float vars).
896 * rendering/line/LineLayoutState.h:
897 Add the block layout margin and float bottom information to the line layout state so that we have it available when performing
898 layouts and margin collapses on anonymous inline block children.
900 2015-09-15 Brady Eidson <beidson@apple.com>
902 Make the IDBAny::Type enum into an enum class.
903 https://bugs.webkit.org/show_bug.cgi?id=149169.
905 Reviewed by Oliver Hunt.
907 No new tests (Cleanup, no behavior change).
909 * Modules/indexeddb/IDBAny.h:
910 * Modules/indexeddb/legacy/LegacyAny.cpp:
911 (WebCore::LegacyAny::createInvalid):
912 (WebCore::LegacyAny::createNull):
913 (WebCore::LegacyAny::LegacyAny):
914 (WebCore::LegacyAny::domStringList):
915 (WebCore::LegacyAny::idbCursor):
916 (WebCore::LegacyAny::idbCursorWithValue):
917 (WebCore::LegacyAny::idbDatabase):
918 (WebCore::LegacyAny::idbFactory):
919 (WebCore::LegacyAny::idbIndex):
920 (WebCore::LegacyAny::idbObjectStore):
921 (WebCore::LegacyAny::idbTransaction):
922 (WebCore::LegacyAny::scriptValue):
923 (WebCore::LegacyAny::string):
924 (WebCore::LegacyAny::integer):
925 (WebCore::LegacyAny::legacyCursor):
926 (WebCore::LegacyAny::legacyCursorWithValue):
927 (WebCore::LegacyAny::legacyDatabase):
928 (WebCore::LegacyAny::legacyFactory):
929 (WebCore::LegacyAny::legacyIndex):
930 (WebCore::LegacyAny::legacyObjectStore):
931 (WebCore::LegacyAny::legacyTransaction):
932 * Modules/indexeddb/legacy/LegacyCursor.cpp:
933 (WebCore::LegacyCursor::LegacyCursor):
934 (WebCore::LegacyCursor::effectiveObjectStore):
935 * Modules/indexeddb/legacy/LegacyObjectStore.cpp:
936 * Modules/indexeddb/legacy/LegacyOpenDBRequest.cpp:
937 (WebCore::LegacyOpenDBRequest::dispatchEvent):
938 * Modules/indexeddb/legacy/LegacyRequest.cpp:
939 (WebCore::LegacyRequest::getResultCursor):
940 (WebCore::effectiveObjectStore):
941 * bindings/js/JSIDBAnyCustom.cpp:
943 * inspector/InspectorIndexedDBAgent.cpp:
944 * page/DatabaseProvider.h:
946 2015-09-15 Brady Eidson <beidson@apple.com>
948 Move most IDB object encoding/decoding from WebKit2 to WebCore.
949 https://bugs.webkit.org/show_bug.cgi?id=149152
951 Reviewed by Alex Christensen.
953 No new tests (Cleanup, no behavior change).
955 * Modules/indexeddb/IDBDatabaseMetadata.h:
956 (WebCore::IDBDatabaseMetadata::encode):
957 (WebCore::IDBDatabaseMetadata::decode):
958 * Modules/indexeddb/IDBIndexMetadata.h:
959 (WebCore::IDBIndexMetadata::encode):
960 (WebCore::IDBIndexMetadata::decode):
961 * Modules/indexeddb/IDBKeyData.h:
962 (WebCore::IDBKeyData::encode):
963 (WebCore::IDBKeyData::decode):
964 * Modules/indexeddb/IDBKeyPath.h:
965 (WebCore::IDBKeyPath::encode):
966 (WebCore::IDBKeyPath::decode):
967 * Modules/indexeddb/IDBKeyRangeData.h:
968 (WebCore::IDBKeyRangeData::encode):
969 (WebCore::IDBKeyRangeData::decode):
970 * Modules/indexeddb/IDBObjectStoreMetadata.h:
971 (WebCore::IDBObjectStoreMetadata::encode):
972 (WebCore::IDBObjectStoreMetadata::decode):
974 2015-09-14 Brady Eidson <beidson@apple.com>
976 Make the enum IDBKey::Type into a utility enum class.
977 https://bugs.webkit.org/show_bug.cgi?id=149149
979 Reviewed by Alex Christensen.
981 No new tests (Cleanup, no behavior change).
983 * Modules/indexeddb/IDBKey.cpp:
984 (WebCore::IDBKey::isValid):
985 (WebCore::IDBKey::compare):
986 * Modules/indexeddb/IDBKey.h:
987 (WebCore::IDBKey::createNumber):
988 (WebCore::IDBKey::createDate):
989 (WebCore::IDBKey::createMultiEntryArray):
990 (WebCore::IDBKey::createArray):
991 (WebCore::IDBKey::type):
992 (WebCore::IDBKey::array):
993 (WebCore::IDBKey::string):
994 (WebCore::IDBKey::date):
995 (WebCore::IDBKey::number):
996 (WebCore::IDBKey::compareTypes):
997 (WebCore::IDBKey::IDBKey):
998 * Modules/indexeddb/IDBKeyData.cpp:
999 (WebCore::IDBKeyData::IDBKeyData):
1000 (WebCore::IDBKeyData::maybeCreateIDBKey):
1001 (WebCore::IDBKeyData::isolatedCopy):
1002 (WebCore::IDBKeyData::encode):
1003 (WebCore::IDBKeyData::decode):
1004 (WebCore::IDBKeyData::compare):
1005 (WebCore::IDBKeyData::loggingString):
1006 (WebCore::IDBKeyData::setArrayValue):
1007 (WebCore::IDBKeyData::setStringValue):
1008 (WebCore::IDBKeyData::setDateValue):
1009 (WebCore::IDBKeyData::setNumberValue):
1010 * Modules/indexeddb/IDBKeyData.h:
1011 (WebCore::IDBKeyData::IDBKeyData):
1012 (WebCore::IDBKeyData::minimum):
1013 (WebCore::IDBKeyData::maximum):
1014 * Modules/indexeddb/IndexedDB.h:
1015 * bindings/js/IDBBindingUtilities.cpp:
1016 (WebCore::idbKeyToJSValue):
1017 (WebCore::createIDBKeyFromValue):
1018 (WebCore::createIDBKeyFromScriptValueAndKeyPath):
1019 (WebCore::generateIndexKeysForValue):
1020 * inspector/InspectorIndexedDBAgent.cpp:
1022 2015-09-15 Javier Fernandez <jfernandez@igalia.com>
1024 [CSS Grid Layout] Using {row, column}-axis terms in alignment related logic
1025 https://bugs.webkit.org/show_bug.cgi?id=148942
1027 Reviewed by Sergio Villar Senin.
1029 This patch changes the names of several functions and variables
1030 defined to implement the alignment logic. We want to use from now
1031 on the terms row-axis and column-axis when referring to the
1032 alignment direction the logic is applied to.
1034 No new tests, no new functionality.
1036 * rendering/RenderGrid.cpp:
1037 (WebCore::RenderGrid::columnAxisOffsetForChild):
1038 (WebCore::RenderGrid::rowAxisOffsetForChild):
1039 (WebCore::RenderGrid::findChildLogicalPosition):
1040 * rendering/RenderGrid.h:
1042 2015-09-14 Gyuyoung Kim <gyuyoung.kim@webkit.org>
1044 Remove all uses of PassRefPtr in WebCore/xml
1045 https://bugs.webkit.org/show_bug.cgi?id=149114
1047 Reviewed by Darin Adler.
1049 * dom/DecodedDataDocumentParser.h:
1050 * dom/DocumentParser.h:
1051 * dom/RawDataDocumentParser.h:
1052 * html/FTPDirectoryDocument.cpp:
1053 (WebCore::FTPDirectoryDocumentParser::append):
1054 * html/parser/HTMLDocumentParser.cpp:
1055 (WebCore::HTMLDocumentParser::append):
1056 * html/parser/HTMLDocumentParser.h:
1057 * html/parser/TextDocumentParser.cpp:
1058 (WebCore::TextDocumentParser::append):
1059 * html/parser/TextDocumentParser.h:
1060 * xml/NativeXPathNSResolver.cpp:
1061 (WebCore::NativeXPathNSResolver::NativeXPathNSResolver):
1062 * xml/NativeXPathNSResolver.h:
1063 (WebCore::NativeXPathNSResolver::create):
1064 * xml/XMLErrors.cpp:
1065 (WebCore::createXHTMLParserErrorHeader):
1066 * xml/XMLHttpRequestProgressEventThrottle.cpp:
1067 (WebCore::XMLHttpRequestProgressEventThrottle::dispatchReadyStateChangeEvent):
1068 (WebCore::XMLHttpRequestProgressEventThrottle::dispatchEvent):
1069 (WebCore::XMLHttpRequestProgressEventThrottle::dispatchDeferredEvents):
1070 * xml/XMLHttpRequestProgressEventThrottle.h:
1071 * xml/XMLSerializer.h:
1072 * xml/XPathEvaluator.cpp:
1073 (WebCore::XPathEvaluator::createExpression):
1074 (WebCore::XPathEvaluator::createNSResolver):
1075 (WebCore::XPathEvaluator::evaluate):
1076 * xml/XPathEvaluator.h:
1077 * xml/XPathNodeSet.h: Fix style errors.
1078 (WebCore::XPath::NodeSet::NodeSet):
1079 (WebCore::XPath::NodeSet::append):
1080 * xml/XPathPath.cpp:
1081 (WebCore::XPath::Filter::evaluate):
1082 (WebCore::XPath::LocationPath::evaluate):
1083 * xml/XPathValue.h: ditto.
1084 (WebCore::XPath::Value::Value):
1085 (WebCore::XPath::Value::Data::create):
1086 (WebCore::XPath::Value::Data::Data):
1087 * xml/XSLTProcessor.cpp:
1088 (WebCore::XSLTProcessor::transformToDocument):
1089 (WebCore::XSLTProcessor::transformToFragment):
1090 * xml/XSLTProcessor.h:
1091 (WebCore::XSLTProcessor::setXSLStyleSheet):
1092 (WebCore::XSLTProcessor::importStylesheet):
1093 * xml/parser/XMLDocumentParser.cpp:
1094 (WebCore::XMLDocumentParser::append):
1095 * xml/parser/XMLDocumentParser.h:
1097 2015-09-14 Dewei Zhu <dewei_zhu@apple.com>
1099 Polish code for r189579.
1100 https://bugs.webkit.org/show_bug.cgi?id=149131
1102 Reviewed by Chris Dumez.
1104 Use more self-explaining function name "characterSetWithUTF8Fallback" instead of
1105 "characterSetForBindings". Optimize the way to get text encoding.
1108 (WebCore::Document::characterSetWithUTF8Fallback):
1109 (WebCore::Document::encoding): Deleted.
1110 (WebCore::Document::characterSetForBindings): Deleted.
1112 (WebCore::Document::encoding):
1113 (WebCore::Document::textEncoding):
1115 * loader/DocumentWriter.cpp:
1116 (WebCore::DocumentWriter::createDecoderIfNeeded):
1117 * loader/FormSubmission.cpp:
1118 (WebCore::encodingFromAcceptCharset):
1120 2015-09-14 Chris Dumez <cdumez@apple.com>
1122 Drop non-standard [IsIndex] WebKit IDL extended attribute
1123 https://bugs.webkit.org/show_bug.cgi?id=149122
1124 <rdar://problem/22547139>
1126 Reviewed by Darin Adler.
1128 Drop non-standard [IsIndex] WebKit IDL extended attribute. This attribute
1129 causes us to throw an IndexSizeError if the input value is negative. Web
1130 IDL supports no such thing. Instead Web IDL supports:
1131 1. Default behavior: the input value wraps around if it does not fit.
1132 2. [EnforceRange]: A TypeError is thrown if the input value does not fit [1].
1133 3. [Clamp]: The input value will be clamped if it does not fit [2].
1135 Our bindings generator supports all three. We don't need the non-standard
1138 We previously used [IsIndex] in places where we're supposed to wrap around
1139 as per Web IDL. Therefore, we threw for negative values but other browsers
1140 don't. For e.g., CharacterData.substringData(offset, -1) is supposed to
1141 return the substring from offset to the end of the string. It does so in
1142 Firefox and Chrome. However, WebKit was throwing an Exception.
1144 This change impacts the CharacterData and the SVGTextContentElement
1145 API. The compatibility risk is low because we were throwing an exception
1146 for negative values and we now wrap the value around instead, as other
1149 No new tests, already covered by existing tests.
1151 [1] https://heycam.github.io/webidl/#EnforceRange
1152 [2] https://heycam.github.io/webidl/#Clamp
1154 * bindings/scripts/CodeGeneratorJS.pm:
1155 (GenerateParametersCheck): Deleted.
1156 * bindings/scripts/IDLAttributes.txt:
1157 * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1158 (WebCore::jsTestEventTargetPrototypeFunctionItem):
1159 * bindings/scripts/test/TestEventTarget.idl:
1160 * dom/CharacterData.cpp:
1161 (WebCore::CharacterData::deleteData):
1162 (WebCore::CharacterData::replaceData):
1163 * dom/CharacterData.idl:
1164 * dom/ClientRectList.idl:
1165 * svg/SVGTextContentElement.cpp:
1166 (WebCore::SVGTextContentElement::getSubStringLength):
1167 (WebCore::SVGTextContentElement::selectSubString):
1168 * svg/SVGTextContentElement.idl:
1170 2015-09-14 Chris Dumez <cdumez@apple.com>
1172 Document.createNodeIterator(null) / Document.createTreeWalker(null) should throw a TypeError
1173 https://bugs.webkit.org/show_bug.cgi?id=149126
1174 <rdar://problem/22564891>
1176 Reviewed by Ryosuke Niwa.
1178 Document.createNodeIterator(null) / Document.createTreeWalker(null)
1179 should throw a TypeError:
1180 https://dom.spec.whatwg.org/#interface-document
1182 This is because the parameter is not nullable and Web IDL says we
1183 should throw a TypeError in this case.
1185 Firefox and Chrome throw an exception in this case. This patch
1186 aligns our behavior with the specification and other major browsers.
1188 No new tests, already covered by existing W3C test.
1191 (WebCore::Document::createNodeIterator):
1192 (WebCore::Document::createTreeWalker):
1195 * dom/NodeIterator.cpp:
1196 (WebCore::NodeIterator::NodeIterator):
1197 * dom/NodeIterator.h:
1198 (WebCore::NodeIterator::create):
1199 * dom/Traversal.cpp:
1200 (WebCore::NodeIteratorBase::NodeIteratorBase):
1202 * dom/TreeWalker.cpp:
1203 (WebCore::TreeWalker::TreeWalker):
1205 (WebCore::TreeWalker::create):
1207 2015-09-14 Alex Christensen <achristensen@webkit.org>
1209 Fix Windows clean build after r189746
1211 * WebCore.vcxproj/copyForwardingHeaders.cmd:
1212 Copy headers from new legacy directory.
1214 2015-09-14 Chris Dumez <cdumez@apple.com>
1216 window.HTMLDetailsElement should exist
1217 https://bugs.webkit.org/show_bug.cgi?id=149139
1219 Reviewed by Ryosuke Niwa.
1221 window.HTMLDetailsElement should exist:
1222 https://html.spec.whatwg.org/multipage/forms.html#the-details-element
1224 Drop the [NoInterfaceObject] IDL extended attribute in WebKit to
1225 address the problem.
1227 No new tests, already covered by existing tests.
1229 * html/HTMLDetailsElement.idl:
1231 2015-09-14 Alex Christensen <achristensen@webkit.org>
1233 Fix AppleWin CMake build
1234 https://bugs.webkit.org/show_bug.cgi?id=149137
1236 Reviewed by Brent Fulgham.
1238 * PlatformAppleWin.cmake:
1239 Spell Inband correctly.
1240 * css/makegrammar.pl:
1241 Add quotes so bison can be in a directory with spaces in it.
1243 2015-09-14 Alex Christensen <achristensen@webkit.org>
1245 [Win] Unreviewed build fix after r189746
1247 * WebCore.vcxproj/WebCoreIncludeCommon.props:
1248 Include new legacy directory.
1250 2015-09-14 Alex Christensen <achristensen@webkit.org>
1252 Progress towards CMake on Mac.
1253 https://bugs.webkit.org/show_bug.cgi?id=149123
1255 Reviewed by Chris Dumez.
1258 Added some more files.
1259 * PlatformMac.cmake:
1260 Added more files and listed the strange ObjC bindings.
1261 * contentextensions/DFACombiner.cpp:
1262 * contentextensions/DFACombiner.h:
1263 Added preprocessor protection.
1264 * platform/FileSystem.h:
1265 Include utility. It's needed to compile the different configurations.
1266 * platform/ScrollAnimator.cpp:
1267 ScrollAnimator is an abstract class on Mac. Don't compile it.
1268 * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
1269 FontAntialiasingStateSaver.h is only used on iOS.
1270 * rendering/RenderThemeMac.mm:
1271 config.h needs to be outside the #if !PLATFORM(IOS) to compile correctly without precompiled headers.
1273 2015-09-14 Brady Eidson <beidson@apple.com>
1275 Rename current concrete IDB implementation to "Legacy".
1276 https://bugs.webkit.org/show_bug.cgi?id=149118
1278 Reviewed by Alex Christensen.
1280 No new tests (No change in behavior).
1282 This patch makes IDL bindings abstract.
1283 It then renames the current concrete implementations of the bindings from "IDB" to "Legacy".
1284 Finally it moves those files and their support classes to a "legacy" subfolder.
1287 * Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
1288 * Modules/indexeddb/IDBAny.cpp:
1289 * Modules/indexeddb/IDBAny.h:
1290 * Modules/indexeddb/IDBCursor.cpp:
1291 * Modules/indexeddb/IDBCursor.h:
1292 * Modules/indexeddb/IDBCursor.idl:
1293 * Modules/indexeddb/IDBCursorWithValue.cpp:
1294 * Modules/indexeddb/IDBCursorWithValue.h:
1295 * Modules/indexeddb/IDBCursorWithValue.idl:
1296 * Modules/indexeddb/IDBDatabase.cpp:
1297 * Modules/indexeddb/IDBDatabase.h:
1298 * Modules/indexeddb/IDBDatabase.idl:
1299 * Modules/indexeddb/IDBFactory.cpp:
1300 * Modules/indexeddb/IDBFactory.h:
1301 * Modules/indexeddb/IDBFactory.idl:
1302 * Modules/indexeddb/IDBIndex.cpp:
1303 * Modules/indexeddb/IDBIndex.h:
1304 * Modules/indexeddb/IDBIndex.idl:
1305 * Modules/indexeddb/IDBObjectStore.cpp:
1306 * Modules/indexeddb/IDBObjectStore.h:
1307 * Modules/indexeddb/IDBObjectStore.idl:
1308 * Modules/indexeddb/IDBOpenDBRequest.cpp:
1309 * Modules/indexeddb/IDBOpenDBRequest.h:
1310 * Modules/indexeddb/IDBOpenDBRequest.idl:
1311 * Modules/indexeddb/IDBRequest.cpp:
1312 * Modules/indexeddb/IDBRequest.h:
1313 * Modules/indexeddb/IDBRequest.idl:
1314 * Modules/indexeddb/IDBTransaction.cpp:
1315 * Modules/indexeddb/IDBTransaction.h:
1316 * Modules/indexeddb/IDBTransaction.idl:
1317 * Modules/indexeddb/IDBVersionChangeEvent.cpp:
1318 * Modules/indexeddb/IDBVersionChangeEvent.h:
1319 * Modules/indexeddb/legacy/IDBCallbacks.h: Renamed from Source/WebCore/Modules/indexeddb/IDBCallbacks.h.
1320 * Modules/indexeddb/legacy/IDBCursorBackend.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBCursorBackend.cpp.
1321 * Modules/indexeddb/legacy/IDBCursorBackend.h: Renamed from Source/WebCore/Modules/indexeddb/IDBCursorBackend.h.
1322 * Modules/indexeddb/legacy/IDBCursorBackendOperations.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBCursorBackendOperations.cpp.
1323 * Modules/indexeddb/legacy/IDBCursorBackendOperations.h: Renamed from Source/WebCore/Modules/indexeddb/IDBCursorBackendOperations.h.
1324 * Modules/indexeddb/legacy/IDBDatabaseBackend.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBDatabaseBackend.cpp.
1325 * Modules/indexeddb/legacy/IDBDatabaseBackend.h: Renamed from Source/WebCore/Modules/indexeddb/IDBDatabaseBackend.h.
1326 * Modules/indexeddb/legacy/IDBDatabaseCallbacks.h: Renamed from Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacks.h.
1327 * Modules/indexeddb/legacy/IDBDatabaseCallbacksImpl.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp.
1328 * Modules/indexeddb/legacy/IDBDatabaseCallbacksImpl.h: Renamed from Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacksImpl.h.
1329 * Modules/indexeddb/legacy/IDBFactoryBackendInterface.h: Renamed from Source/WebCore/Modules/indexeddb/IDBFactoryBackendInterface.h.
1330 * Modules/indexeddb/legacy/IDBPendingDeleteCall.h: Renamed from Source/WebCore/Modules/indexeddb/IDBPendingDeleteCall.h.
1331 * Modules/indexeddb/legacy/IDBPendingOpenCall.h: Renamed from Source/WebCore/Modules/indexeddb/IDBPendingOpenCall.h.
1332 * Modules/indexeddb/legacy/IDBPendingTransactionMonitor.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBPendingTransactionMonitor.cpp.
1333 * Modules/indexeddb/legacy/IDBPendingTransactionMonitor.h: Renamed from Source/WebCore/Modules/indexeddb/IDBPendingTransactionMonitor.h.
1334 * Modules/indexeddb/legacy/IDBTransactionBackend.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionBackend.cpp.
1335 * Modules/indexeddb/legacy/IDBTransactionBackend.h: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionBackend.h.
1336 * Modules/indexeddb/legacy/IDBTransactionBackendOperations.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionBackendOperations.cpp.
1337 * Modules/indexeddb/legacy/IDBTransactionBackendOperations.h: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionBackendOperations.h.
1338 * Modules/indexeddb/legacy/IDBTransactionCoordinator.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionCoordinator.cpp.
1339 * Modules/indexeddb/legacy/IDBTransactionCoordinator.h: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionCoordinator.h.
1340 * Modules/indexeddb/legacy/LegacyAny.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBAny.cpp.
1341 * Modules/indexeddb/legacy/LegacyAny.h: Added.
1342 * Modules/indexeddb/legacy/LegacyCursor.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBCursor.cpp.
1343 * Modules/indexeddb/legacy/LegacyCursor.h: Copied from Source/WebCore/Modules/indexeddb/IDBCursor.h.
1344 * Modules/indexeddb/legacy/LegacyCursorWithValue.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBCursorWithValue.cpp.
1345 * Modules/indexeddb/legacy/LegacyCursorWithValue.h: Copied from Source/WebCore/Modules/indexeddb/IDBCursorWithValue.h.
1346 * Modules/indexeddb/legacy/LegacyDatabase.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBDatabase.cpp.
1347 * Modules/indexeddb/legacy/LegacyDatabase.h: Copied from Source/WebCore/Modules/indexeddb/IDBDatabase.h.
1348 * Modules/indexeddb/legacy/LegacyFactory.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBFactory.cpp.
1349 * Modules/indexeddb/legacy/LegacyFactory.h: Copied from Source/WebCore/Modules/indexeddb/IDBFactory.h.
1350 * Modules/indexeddb/legacy/LegacyIndex.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBIndex.cpp.
1351 * Modules/indexeddb/legacy/LegacyIndex.h: Added.
1352 * Modules/indexeddb/legacy/LegacyObjectStore.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp.
1353 * Modules/indexeddb/legacy/LegacyObjectStore.h: Copied from Source/WebCore/Modules/indexeddb/IDBObjectStore.h.
1354 * Modules/indexeddb/legacy/LegacyOpenDBRequest.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp.
1355 * Modules/indexeddb/legacy/LegacyOpenDBRequest.h: Copied from Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.h.
1356 * Modules/indexeddb/legacy/LegacyRequest.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBRequest.cpp.
1357 * Modules/indexeddb/legacy/LegacyRequest.h: Copied from Source/WebCore/Modules/indexeddb/IDBRequest.h.
1358 * Modules/indexeddb/legacy/LegacyTransaction.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBTransaction.cpp.
1359 * Modules/indexeddb/legacy/LegacyTransaction.h: Copied from Source/WebCore/Modules/indexeddb/IDBTransaction.h.
1360 * Modules/indexeddb/legacy/LegacyVersionChangeEvent.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.cpp.
1361 * Modules/indexeddb/legacy/LegacyVersionChangeEvent.h: Copied from Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.h.
1362 * WebCore.xcodeproj/project.pbxproj:
1363 * WebCore.vcxproj/WebCore.vcxproj:
1365 2015-09-14 Gyuyoung Kim <gyuyoung.kim@webkit.org>
1367 [EFL] Remove create() factory function in EvasGLContext and EvasGLSurface
1368 https://bugs.webkit.org/show_bug.cgi?id=149110
1370 Reviewed by Csaba Osztrogonác.
1372 It is not good implementation we support both create() factory function and public constructor.
1373 In EvasGLContext and EvasGLSurface cases, those have supported both. However create() factory is only
1374 used by EwkView. Thus let's remove the create() function, then EwkView creates EvasGLContext using
1375 std::make_unique<> directly.
1377 * platform/graphics/efl/EvasGLContext.h:
1378 (WebCore::EvasGLContext::create): Deleted.
1379 * platform/graphics/efl/EvasGLSurface.h:
1380 (WebCore::EvasGLSurface::create): Deleted.
1382 2015-09-09 Sergio Villar Senin <svillar@igalia.com>
1384 min-width/height should default to auto for grid items
1385 https://bugs.webkit.org/show_bug.cgi?id=146021
1387 Reviewed by Darin Adler.
1389 Based on Blink's r194408, r194863 and r194887 by <rego@igalia.com>.
1391 From the spec (http://dev.w3.org/csswg/css-grid/#grid-items):
1392 "The auto value of min-width and min-height behaves on grid
1393 items in the relevant axis analogously to its behavior on flex
1394 items in the main axis."
1396 From now on the default value for min-width and min-height for
1397 grid items is auto, meaning that in general, grid items won't
1398 shrink bellow their content.
1400 The change is not exactly the same as the one in Blink because
1401 this one takes into account vertical writting modes, something
1402 that was not well handled in the original one.
1404 Tests: fast/css-grid-layout/min-width-height-auto-overflow.html
1405 fast/css-grid-layout/min-width-height-auto.html
1407 * rendering/RenderBox.cpp:
1408 (WebCore::RenderBox::computeLogicalWidthInRegion):
1409 (WebCore::RenderBox::computeLogicalHeight):
1411 2015-09-14 Manuel Rego Casasnovas <rego@igalia.com>
1413 [css-grid] Percentage columns should remove scrollbar's width
1414 https://bugs.webkit.org/show_bug.cgi?id=149116
1416 Reviewed by Sergio Villar Senin.
1418 Currently the calculation of percentage columns was not subtracting the
1420 Fixed RenderGrid::computeUsedBreadthOfSpecifiedLength()
1421 to avoid this problem.
1423 Test: fast/css-grid-layout/grid-percent-track-scrollbar.html
1425 * rendering/RenderGrid.cpp:
1426 (WebCore::RenderGrid::computeUsedBreadthOfSpecifiedLength):
1428 2015-09-13 Chris Dumez <cdumez@apple.com>
1430 Improve Node pre-insertion validation when the parent is a Document
1431 https://bugs.webkit.org/show_bug.cgi?id=149109
1432 <rdar://problem/22560436>
1434 Reviewed by Ryosuke Niwa.
1436 Improve Node pre-insertion validation when the parent is a Document to
1437 match the specification:
1438 https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity
1439 https://dom.spec.whatwg.org/#concept-node-replace
1441 This affects the following API: Node.insertBefore(), Node.appendChild(),
1442 Node.replaceChild().
1444 WebKit current fails to do the following checks whenever the parent is a
1445 Document from pre-insertion validation:
1446 1. If the inserted Node is a DocumentFragment, we should make sure it
1447 contains only one Element.
1448 -> This is because a Document can have only one child that is an
1450 2.a. If an Element is inserted, we should make sure it is not inserted
1451 before a DocumentType.
1452 2.b. If a DocumentType is inserted, we should make sure it is not
1453 inserted after an Element.
1454 -> This is because the DocType must come before the optional Element
1457 Firefox and Chrome already match the specification here. This patch
1458 aligns WebKit's behavior with those browsers and the specification.
1460 [1] https://dom.spec.whatwg.org/#node-trees
1462 No new tests, already covered by existing W3C tests.
1464 * dom/ContainerNode.cpp:
1465 (WebCore::checkAcceptChild):
1466 (WebCore::checkAddChild):
1467 (WebCore::checkReplaceChild):
1468 (WebCore::ContainerNode::insertBefore):
1469 (WebCore::ContainerNode::appendChild):
1470 (WebCore::containsConsideringHostElements): Deleted.
1471 (WebCore::checkAcceptChildGuaranteedNodeTypes): Deleted.
1473 (WebCore::Document::canAcceptChild):
1474 (WebCore::Document::cloneNodeInternal): Deleted.
1477 2015-09-13 Chris Dumez <cdumez@apple.com>
1479 Document.adoptNode() should be able to explicitly adopt a DocumentType node
1480 https://bugs.webkit.org/show_bug.cgi?id=149097
1481 <rdar://problem/22549345>
1483 Reviewed by Ryosuke Niwa.
1485 Document.adoptNode() should be able to explicitly adopt a DocumentType
1486 node as per the latest DOM specification:
1487 https://dom.spec.whatwg.org/#dom-document-adoptnode
1489 Chrome and Firefox match the specidicaiton but WebKit was throwing a
1492 No new tests, already covered by existing test.
1495 (WebCore::Document::adoptNode): Deleted.
1497 2015-09-13 Chris Dumez <cdumez@apple.com>
1499 Document.title does not behave according to specification
1500 https://bugs.webkit.org/show_bug.cgi?id=149098
1502 Reviewed by Ryosuke Niwa.
1504 Update Document.title to behave according to the latest DOM specification:
1505 https://html.spec.whatwg.org/multipage/dom.html#document.title
1507 In particular, the following Web-Exposed changes were made:
1508 1. The title Element should be the first title element in the document
1509 (in tree order) [1]. Previously, WebKit would use the first title
1510 Element *added* to the Document. Document.title returns the text
1511 content of the title Element so this change is web-exposed.
1512 2. If the title Element is replaced after the title has been set by the
1513 JS (via the document.title setter), we should update the value
1514 returned by the document.title getter. Previously, WebKit would set
1515 a flag if the title was explicitly set by JS via document.title
1516 setter and later title element changes would not override the title
1517 set by the JS. This behavior isn't specified and does not match the
1518 behavior of other browsers.
1520 The new behavior is also consistent with the behavior of Firefox and
1523 Some refactoring was made for the sake of clarity now that our
1524 implementation has changed. See details below.
1526 [1] https://html.spec.whatwg.org/multipage/dom.html#the-title-element-2
1528 No new tests, already covered by existing tests.
1531 (WebCore::Document::updateTitleFromTitleElement):
1532 New convenience method that calls updateTitle() with the text of the
1533 document's current title Element. If there is no title Element, it
1536 (WebCore::Document::updateTitleElement):
1537 Method which updates the Document's title Element whenever a title
1538 Element is added or removed from the Document. Once the title Element
1539 is updated, it takes care of calling updateTitleFromTitleElement() to
1540 update the Document's title.
1542 (WebCore::Document::titleElementAdded):
1543 (WebCore::Document::titleElementRemoved):
1544 (WebCore::Document::titleElementTextChanged):
1545 New Document public API called by HTMLTitleElement / SVGTitleElement
1546 whenever a title Element is added / removed from the Document or
1547 whenever the title element's text has changed. These methods will
1548 take care of calling updateTitleElement() / updateTitleFromTitleElement()
1550 Previously, we would only have 2 methods:
1551 - setTitleElement() which would be called whenever a title Element was
1552 added to the document or when its text had changed. The name was
1553 confusing because it would not necessarily set the document's title
1554 Element and it would be used both for title element update and a
1555 simple title update. This method has been split into 2:
1556 titleElementAdded() and titleElementTextChanged().
1557 - removeTitle() which would be called whenever a title Element was
1558 removed. The naming was confusing because it would not necessarily
1559 remove the Document's title Element. This is now called
1560 titleElementRemoved().
1562 * html/HTMLTitleElement.cpp:
1563 (WebCore::HTMLTitleElement::insertedInto):
1564 Call the new titleElementAdded() instead of setTitleElement().
1566 (WebCore::HTMLTitleElement::removedFrom):
1567 Call the new titleElementRemoved() instead of removeTitle().
1569 (WebCore::HTMLTitleElement::childrenChanged):
1570 Call the new titleElementTextChanged() instead of
1571 setTitleElement() / removeTitle() as we don't really want
1572 to remove or add a title Element. We merely want to notify
1573 the document that the title element text has changed in
1574 case it is the current title Element of the Document.
1576 (WebCore::HTMLTitleElement::computedTextWithDirection):
1577 Rename textWithDirection() to computedTextWithDirection() to
1578 make it clear it is not a simple getter and make it private
1579 as it is only used to set the m_title member which caches the
1582 * html/HTMLTitleElement.h:
1583 Add new textWithDirection() getter which returns m_title. This
1584 is needed so that Document can query the title of the Element.
1585 Previously, HTMLTitleElement would pass directly m_title to
1586 the Document when calling Document::setTitleElement().
1588 * svg/SVGTitleElement.cpp:
1589 (WebCore::SVGTitleElement::insertedInto):
1590 Call the new titleElementAdded() instead of setTitleElement().
1592 (WebCore::SVGTitleElement::removedFrom):
1593 Call the new titleElementRemoved() instead of removeTitle().
1595 (WebCore::SVGTitleElement::childrenChanged):
1596 Call the new titleElementTextChanged() instead of
1599 2015-09-13 Chris Dumez <cdumez@apple.com>
1601 document.lastModified should use the user's local time zone
1602 https://bugs.webkit.org/show_bug.cgi?id=149092
1603 <rdar://problem/22567705>
1605 Reviewed by Ryosuke Niwa.
1607 document.lastModified should use the user's local time zone:
1608 https://html.spec.whatwg.org/multipage/dom.html#dom-document-lastmodified
1610 Chrome and Firefox comply with the specification but WebKit was using
1611 UTC. This patch aligns WebKit's behavior with the specification and
1614 No new tests, already covered by existing tests.
1617 (WebCore::Document::lastModified):
1618 (WebCore::Document::setCookieURL): Deleted.
1620 2015-09-13 Chris Dumez <cdumez@apple.com>
1622 Node.baseURI should not return null for detached nodes
1623 https://bugs.webkit.org/show_bug.cgi?id=149104
1624 <rdar://problem/22559535>
1626 Reviewed by Sam Weinig.
1628 Node.baseURI should not return null for detached nodes. It should return
1629 the node document's base URL. The node document is set when the node is
1630 created so it is valid even if the node is detached [1]:
1631 https://dom.spec.whatwg.org/#dom-node-baseuri
1633 WebKit was traversing the ancestors to find the base URL, which only
1634 works if the node is attached. Also, WebKit was taking into account
1635 the xml:base attribute when computing the baseURI.
1637 Both Chrome and Firefox already dropped support for xml:base:
1638 https://code.google.com/p/chromium/issues/detail?id=341854
1639 https://bugzilla.mozilla.org/show_bug.cgi?id=903372
1641 Firefox complies with the specification. Chrome's baseURI still only
1642 works for attached Nodes as their implementation still traverses the
1643 DOM tree, despite dropping support for xml:base.
1645 This patch drops support xml:base when computing Node.baseURI, as
1646 Firefox, Chrome and the latest DOM specification do. It also makes
1647 Node.baseURI work for detached Nodes by returning the base URL of the
1648 node Document. This means we no longer have to traverse the Node's
1649 ancestors in the DOM tree. This is consistent with the behavior of
1650 Firefox and the latest DOM specification.
1652 This patch does not drop the SVGElement.xmlbase attribute yet. However,
1653 we should probably consider making this change as well given that:
1654 - The SVG2 specification dropped it
1655 - Chrome dropped it.
1656 - It no longers impacts Node.baseURI
1658 [1] https://www.w3.org/Bugs/Public/show_bug.cgi?id=20976
1660 No new tests, already covered by existing test.
1663 (WebCore::Document::setContent): Deleted.
1665 (WebCore::Document::inputCursor): Deleted.
1666 * dom/DocumentType.cpp:
1667 (WebCore::DocumentType::nodeName): Deleted.
1668 * dom/DocumentType.h:
1670 (WebCore::Element::imageSourceURL): Deleted.
1671 (WebCore::Element::rendererIsNeeded): Deleted.
1672 (WebCore::Element::createElementRenderer): Deleted.
1673 (WebCore::Element::insertedInto): Deleted.
1676 (WebCore::Node::baseURI):
1678 * svg/SVGElement.idl:
1680 2015-09-13 Chris Dumez <cdumez@apple.com>
1682 CharacterData API parameters should not be optional
1683 https://bugs.webkit.org/show_bug.cgi?id=149101
1684 <rdar://problem/22546954>
1686 Reviewed by Sam Weinig.
1688 CharacterData API parameters should not be optional as per the DOM
1690 https://dom.spec.whatwg.org/#characterdata
1692 The parameters are also mandatory in Firefox and Chrome. However,
1693 those parameters are optional in WebKit. When DOMString parameters
1694 were omitted, we would use the "undefined" string instead. When
1695 unsigned long parameters were omitted, we would use 0 instead.
1696 This patch aligns our behavior with the specification and other
1699 No new tests, already covered by existing tests.
1701 * dom/CharacterData.cpp:
1702 (WebCore::CharacterData::appendData):
1703 * dom/CharacterData.h:
1704 * dom/CharacterData.idl:
1706 (WebCore::Element::mergeWithNextTextNode):
1708 (WebCore::Node::normalize):
1709 * xml/parser/XMLDocumentParser.cpp:
1710 (WebCore::XMLDocumentParser::exitText):
1712 2015-09-13 Gyuyoung Kim <gyuyoung.kim@webkit.org>
1714 Remove all uses of PassRefPtr in crypto, storage, and history
1715 https://bugs.webkit.org/show_bug.cgi?id=149091
1717 Reviewed by Andreas Kling.
1719 * crypto/CryptoKeyPair.cpp:
1720 (WebCore::CryptoKeyPair::CryptoKeyPair):
1721 * crypto/CryptoKeyPair.h:
1722 (WebCore::CryptoKeyPair::create):
1723 * crypto/SubtleCrypto.h:
1724 (WebCore::SubtleCrypto::create):
1725 * crypto/gnutls/CryptoKeyRSAGnuTLS.cpp:
1726 (WebCore::CryptoKeyRSA::create):
1727 * crypto/keys/CryptoKeyAES.cpp:
1728 (WebCore::CryptoKeyAES::generate):
1729 * crypto/keys/CryptoKeyAES.h:
1730 * crypto/keys/CryptoKeyHMAC.cpp:
1731 (WebCore::CryptoKeyHMAC::generate):
1732 * crypto/keys/CryptoKeyHMAC.h:
1733 * crypto/keys/CryptoKeyRSA.h:
1734 * crypto/mac/CryptoKeyRSAMac.cpp:
1735 (WebCore::CryptoKeyRSA::create):
1736 * history/BackForwardController.cpp:
1737 (WebCore::BackForwardController::BackForwardController):
1738 * history/BackForwardController.h:
1739 * history/HistoryItem.cpp:
1740 (WebCore::HistoryItem::setStateObject):
1741 (WebCore::HistoryItem::setFormData):
1742 * history/HistoryItem.h:
1743 (WebCore::HistoryItem::stateObject):
1744 * loader/EmptyClients.cpp:
1746 (WebCore::Page::Page):
1747 * storage/Storage.cpp:
1748 (WebCore::Storage::create):
1749 (WebCore::Storage::Storage):
1750 * storage/Storage.h:
1751 * storage/StorageArea.h:
1752 * storage/StorageMap.cpp:
1753 (WebCore::StorageMap::copy):
1754 (WebCore::StorageMap::setItem):
1755 (WebCore::StorageMap::setItemIgnoringQuota):
1756 (WebCore::StorageMap::removeItem):
1757 * storage/StorageMap.h:
1758 * storage/StorageNamespace.h:
1760 2015-09-12 Chris Dumez <cdumez@apple.com>
1762 window.EventTarget should exist
1763 https://bugs.webkit.org/show_bug.cgi?id=149085
1764 <rdar://problem/22546774>
1766 Reviewed by Sam Weinig.
1768 Drop [NoInterfaceObject] for the EventTarget interface to match Chrome,
1769 Firefox and the specification:
1770 https://dom.spec.whatwg.org/#interface-eventtarget
1772 No new tests, already covered by existing tests.
1774 * dom/EventTarget.idl:
1776 2015-09-12 Brian Burg <bburg@apple.com>
1778 Web Inspector: disambiguate inspected/frontend controllers and pages in backend code
1779 https://bugs.webkit.org/show_bug.cgi?id=149071
1781 Reviewed by Joseph Pecoraro.
1783 Be consistent about prefixing pages, inspector controllers, and window controllers
1784 with either "frontend" or "inspected", as appropriate. This change makes obvious some bugs
1785 in the frontend connection code, which are tracked by https://webkit.org/b/149006.
1787 No new tests, no behavior change.
1790 * inspector/InspectorClient.h:
1791 * inspector/InspectorController.cpp:
1792 (WebCore::InspectorController::inspectedPageDestroyed):
1793 (WebCore::InspectorController::show):
1794 (WebCore::InspectorController::close):
1795 * inspector/InspectorFrontendClientLocal.cpp:
1796 (WebCore::InspectorFrontendClientLocal::InspectorFrontendClientLocal):
1797 (WebCore::InspectorFrontendClientLocal::~InspectorFrontendClientLocal):
1798 (WebCore::InspectorFrontendClientLocal::canAttachWindow):
1799 (WebCore::InspectorFrontendClientLocal::changeAttachedWindowHeight):
1800 (WebCore::InspectorFrontendClientLocal::changeAttachedWindowWidth):
1801 (WebCore::InspectorFrontendClientLocal::openInNewTab):
1802 (WebCore::InspectorFrontendClientLocal::restoreAttachedWindowHeight):
1803 (WebCore::InspectorFrontendClientLocal::showMainResourceForFrame):
1804 (WebCore::InspectorFrontendClientLocal::isUnderTest):
1805 * inspector/InspectorFrontendClientLocal.h:
1806 * inspector/InspectorOverlay.cpp:
1807 (WebCore::InspectorOverlay::freePage):
1808 * loader/EmptyClients.h:
1810 2015-09-12 Chris Dumez <cdumez@apple.com>
1812 ChildNode.replaceWith() without argument should replace the node with an empty DocumentFragment
1813 https://bugs.webkit.org/show_bug.cgi?id=149073
1814 <rdar://problem/22547801>
1816 Reviewed by Ryosuke Niwa.
1818 ChildNode.replaceWith() without argument should replace the node with
1819 an empty DocumentFragment, as per the specification:
1820 https://dom.spec.whatwg.org/#dom-childnode-replacewith
1821 https://dom.spec.whatwg.org/#converting-nodes-into-a-node
1823 Previously, WebKit did not do anything in this case. This patch fixes
1826 No new tests, already covered by existing test.
1829 (WebCore::Node::replaceWith):
1831 2015-09-12 Gyuyoung Kim <gyuyoung.kim@webkit.org>
1833 Remove all uses of PassRefPtr in WebCore/plugins
1834 https://bugs.webkit.org/show_bug.cgi?id=149055
1836 Reviewed by Darin Adler.
1838 * plugins/DOMMimeType.cpp:
1839 (WebCore::DOMMimeType::DOMMimeType):
1840 (WebCore::DOMMimeType::enabledPlugin):
1841 * plugins/DOMMimeType.h:
1842 (WebCore::DOMMimeType::create):
1843 * plugins/DOMMimeTypeArray.cpp:
1844 (WebCore::DOMMimeTypeArray::item):
1845 * plugins/DOMMimeTypeArray.h:
1846 * plugins/DOMPlugin.cpp:
1847 (WebCore::DOMPlugin::item):
1848 * plugins/DOMPlugin.h:
1849 * plugins/DOMPluginArray.cpp:
1850 (WebCore::DOMPluginArray::item):
1851 * plugins/DOMPluginArray.h:
1852 * plugins/PluginViewBase.h:
1853 (WebCore::PluginViewBase::bindingInstance):
1855 2015-09-12 Gyuyoung Kim <gyuyoung.kim@webkit.org>
1857 Remove all uses of PassRefPtr in WebCore/accessibility and WebCore/fileapi
1858 https://bugs.webkit.org/show_bug.cgi?id=149059
1860 Reviewed by Darin Adler.
1862 * accessibility/AXObjectCache.cpp:
1863 * accessibility/AccessibilityObject.cpp:
1864 (WebCore::rangeClosestToRange):
1865 (WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection):
1866 (WebCore::AccessibilityObject::selectionRange):
1867 (WebCore::AccessibilityObject::selectText):
1868 * accessibility/AccessibilityObject.h:
1869 * accessibility/ios/AXObjectCacheIOS.mm:
1870 * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1871 (-[WebAccessibilityObjectWrapper _convertToDOMRange:]):
1872 (-[WebAccessibilityObjectWrapper textMarkerForPosition:]):
1873 * accessibility/mac/AXObjectCacheMac.mm:
1874 * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1875 (-[WebAccessibilityObjectWrapper _textMarkerForIndex:]):
1876 * fileapi/FileList.h:
1877 (WebCore::FileList::append):
1878 * fileapi/WebKitBlobBuilder.cpp:
1879 (WebCore::BlobBuilder::append):
1880 * fileapi/WebKitBlobBuilder.h:
1882 2015-09-11 Said Abou-Hallawa <sabouhallawa@apple.com>
1884 SVGColor custom text format is different from the CSS color custom text format
1885 https://bugs.webkit.org/show_bug.cgi?id=148879
1887 Reviewed by Daniel Bates.
1889 Implement the serialization of a CSS color value as it is described in
1890 <https://drafts.csswg.org/cssom/#serializing-css-values>. Add the new
1891 function Color::cssText() which is refactored from the existing function
1892 Color::serialized(). Use the new function for serializing the SVGColor
1893 always and also for Color but only when the alpha component is not 1.
1895 Test: svg/css/computed-style-rgb-color.html
1897 * css/CSSPrimitiveValue.cpp:
1898 (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText): Move the code
1899 for serializing the color from this function to Color::cssText().
1901 * platform/graphics/Color.cpp:
1902 (WebCore::Color::serialized): Call Color::cssText() if the alpha component
1903 is not 1 and delete the repeated code.
1905 (WebCore::Color::cssText):
1906 * platform/graphics/Color.h: Add the new function to the header file.
1909 (WebCore::SVGColor::customCSSText): Call Color::cssText() always instead
1910 of calling Color::serialized() for serializing the SVGColor.
1912 2015-09-11 Nan Wang <n_wang@apple.com>
1914 AX: ARIA 1.1 @aria-current
1915 https://bugs.webkit.org/show_bug.cgi?id=146012
1917 Reviewed by Chris Fleizach.
1919 Tests: accessibility/aria-current.html
1920 inspector/dom/getAccessibilityPropertiesForNode_ariaCurrent.html
1922 Added support for ARIA 1.1 aria-current.
1924 * accessibility/AccessibilityObject.cpp:
1925 (WebCore::AccessibilityObject::invalidStatus):
1926 (WebCore::AccessibilityObject::ariaCurrentState):
1927 (WebCore::AccessibilityObject::hasTagName):
1928 * accessibility/AccessibilityObject.h:
1929 * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1930 (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
1931 (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
1932 * html/HTMLAttributeNames.in:
1933 * inspector/InspectorDOMAgent.cpp:
1934 (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
1936 2015-09-11 Chris Dumez <cdumez@apple.com>
1938 DOMTokenList update steps for classList don't follow the spec
1939 https://bugs.webkit.org/show_bug.cgi?id=148589
1940 <rdar://problem/22547443>
1942 Reviewed by Ryosuke Niwa and Darin Adler.
1944 Update our DOMTokenList implementation to behave according to
1945 the latest DOM specification:
1946 https://dom.spec.whatwg.org/#interface-domtokenlist
1948 In particular, the following changes were made:
1949 - The stringifier now returns the result of the ordered set serializer
1950 for tokens. This means that we drop duplicate spaces and extra spaces
1952 - DOMSettableTokenList.value now returns the result of the ordered set
1953 serializer for tokens [4] as well.
1954 - When the DOMTokenList's tokens are updated and there is an associated
1955 Element attribute, we set the attribute value to be the the ordered
1956 set serializer for tokens. This is according to the DOMTokenList
1957 update steps in the specification [6]. Chrome does not match the
1958 specification either.
1960 Edge browser behaves according to the specification already. Firefox was
1961 implementing this via [7] but no recent progress. This makes the JS API
1962 nicer to use and interest was shown by jQuery Team.
1964 The following refactoring was done:
1965 - Merge ClassList / RelList into a single AttributeDOMTokenList class
1966 as their code is mostly duplicated and the only thing that changes
1967 is which attribute is associated (class vs rel). AttributeDOMTokenList
1968 now keeps the attribute name as a member so it could be used for any
1969 attribute. AttributeDOMTokenList overrides DOMTokenList's
1970 updateAfterTokenChange() to do update the attribute's value as per
1972 - We no longer use a SpaceSplitString for the internal representation
1973 as we need to sanitize the tokens (drop duplicates and extra spaces).
1974 DOMTokenList now has an internal Vector<AtomicString> containing the
1975 tokens that is constructed from the algorithm in [2]. As a result,
1976 most of the logic is now in DOMTokenList instead of its subclasses
1977 which means that most methods are no longer virtual. We only have
1978 one virtual function named updateAfterTokenChange() to do the update
1979 steps as AttributeDOMTokenList needs to update the associated
1982 This change does not seem to impact Dromaeo.
1984 [1] https://dom.spec.whatwg.org/#concept-ordered-set-serializer
1985 [2] https://dom.spec.whatwg.org/#ordered%20sets
1986 [3] https://dom.spec.whatwg.org/#stringification-behavior
1987 [4] https://dom.spec.whatwg.org/#dom-domsettabletokenlist-value
1988 [5] https://dom.spec.whatwg.org/#dom-domtokenlist-contains (step 2)
1989 [6] https://dom.spec.whatwg.org/#concept-DTL-update
1990 [7] https://bugzilla.mozilla.org/show_bug.cgi?id=869788
1992 No new tests, already covered by existing tests.
1995 (WebCore::Element::classAttributeChanged):
1996 When the class attribute changes, make sure to update the associated
1997 classList if there is one. We could do this lazily if it turns out
1998 to be a performance problem. However, chances are this is not as
1999 classList is rarely used and we only need to update the classList if
2000 it was ever accessed by JS for this Element.
2002 (WebCore::Element::insertedInto):
2003 Drop call to clearClassListValueForQuirksMode() as we no longer need
2004 to maintain a separate SpaceSplitString for classes when in quirks
2005 mode. This is because AttributeDOMTokenList now has its own Vector
2006 of classes in their original cases. It therefore no longer relies on
2007 Element::classNames() which has its case folded when in quirks mode.
2009 (WebCore::Element::classList):
2010 Return a AttributeDOMTokenList instead of a ClassList.
2012 * html/AttributeDOMTokenList.h: Added.
2013 * html/AttributeDOMTokenList.cpp: Added.
2014 (WebCore::AttributeDOMTokenList::AttributeDOMTokenList):
2015 Call DOMTokenList::setValue() using the attribute's value so that
2016 DOMTokenList can initialize its token Vector.
2018 (WebCore::AttributeDOMTokenList::attributeValueChanged):
2019 If the attribute value was changed by somebody else that the
2020 AttributeDOMTokenList, call DOMTokenList::setValue() so that it
2021 can update its token Vector.
2023 (WebCore::AttributeDOMTokenList::updateAfterTokenChange):
2024 This is called whenever the token Vector is changed via JS. In
2025 this case, we update the associated attribute's value.
2027 * html/ClassList.cpp: Removed.
2028 * html/ClassList.h: Removed.
2029 Now merged into AttributeDOMTokenList.
2031 * html/DOMSettableTokenList.cpp:
2032 * html/DOMSettableTokenList.h:
2033 Get rid of most of the code as most of the logic is now in
2034 DOMTokenList parent class.
2036 * html/DOMTokenList.cpp:
2037 (WebCore::DOMTokenList::validateToken):
2038 Use a String parameter instead of an AtomicString as this method does
2039 not need the input the be an AtomicString. This avoid atomizing
2040 String unnecessarily.
2042 (WebCore::DOMTokenList::validateTokens):
2045 (WebCore::DOMTokenList::contains):
2046 No longer use containsInternal() virtual function. We can now check
2047 the internal token Vector.
2049 (WebCore::DOMTokenList::add):
2050 Now update the internal Vector. Use a modern loop and try to minimize
2051 Vector capacity reallocation.
2053 (WebCore::DOMTokenList::remove):
2054 Now update the internal Vector.
2056 (WebCore::DOMTokenList::toggle):
2057 Now update the internal Vector and refactor the code so that it is
2058 structured exactly as the algorithm in the specification for
2061 (WebCore::DOMTokenList::value):
2062 Now return the result of the ordered set serializer for tokens. This
2064 - The DOMSettableTokenList.value() getter
2065 - The DOMTokenList stringifier
2066 - As attribute value when updating the associated attribute in
2067 AttributeDOMTokenList.
2069 (WebCore::DOMTokenList::setValue):
2070 Update the internal Vector using the algorithm in [2].
2072 * html/DOMTokenList.h:
2073 (WebCore::DOMTokenList::length):
2074 No longer virtual, now returns the size of the internal token Vector.
2076 (WebCore::DOMTokenList::item):
2077 No longer virtual, now returns the token at the given index in the
2080 * html/HTMLAnchorElement.cpp:
2081 (WebCore::HTMLAnchorElement::relList):
2082 Now return a AttributeDOMTokenList.
2084 * html/HTMLLinkElement.cpp:
2085 (WebCore::HTMLLinkElement::relList):
2086 Now return a AttributeDOMTokenList.
2088 * html/RelList.cpp: Removed.
2089 * html/RelList.h: Removed.
2090 Now merged into AttributeDOMTokenList.
2092 2015-09-11 Chris Dumez <cdumez@apple.com>
2094 Element.tagName should be upper-case for HTML elements in HTML documents
2095 https://bugs.webkit.org/show_bug.cgi?id=148843
2096 <rdar://problem/22559081>
2098 Reviewed by Ryosuke Niwa.
2100 Element.tagName should be upper-case for HTML elements in HTML documents,
2101 as per the DOM specification:
2102 https://dom.spec.whatwg.org/#dom-element-tagname
2104 Previously, WebKit would fail to upper-case the tagname if the element's
2105 tag had a prefix. This patch corrects this. This aligns our behavior with
2106 Firefox, Chrome and IE.
2108 No new tests, already covered by existing tests.
2110 * html/HTMLElement.cpp:
2111 (WebCore::HTMLElement::nodeName):
2113 2015-09-11 Chris Dumez <cdumez@apple.com>
2115 document.body = "text" should throw a TypeError, not a HierarchyRequestError
2116 https://bugs.webkit.org/show_bug.cgi?id=149057
2117 <rdar://problem/22567157>
2119 Reviewed by Ryosuke Niwa.
2121 document.body = "text" should throw a TypeError, not a
2122 HierarchyRequestError:
2123 https://html.spec.whatwg.org/multipage/dom.html#dom-document-body
2125 This is because "text" is a DOMString and it cannot be converted into an
2126 HTMLElement?. Therefore, the WebIDL specification says we should throw a
2127 TypeError in this case.
2129 Chrome and Firefox throw the right exception.
2131 No new tests, already covered by existing test.
2135 2015-09-11 Andreas Kling <akling@apple.com>
2137 [JSC] Weak should only accept cell pointees.
2138 <https://webkit.org/b/148955>
2140 Reviewed by Geoffrey Garen.
2142 Update WebCore bindings for the new Weak and Weak-related signatures.
2144 * bindings/js/JSCSSRuleListCustom.cpp:
2145 (WebCore::JSCSSRuleListOwner::isReachableFromOpaqueRoots):
2146 * bindings/js/JSCSSValueCustom.cpp:
2147 (WebCore::JSCSSValueOwner::isReachableFromOpaqueRoots):
2148 (WebCore::JSCSSValueOwner::finalize):
2149 * bindings/js/JSCallbackData.cpp:
2150 (WebCore::JSCallbackDataWeak::WeakOwner::isReachableFromOpaqueRoots):
2151 * bindings/js/JSCallbackData.h:
2152 * bindings/js/JSMutationObserverCustom.cpp:
2153 (WebCore::JSMutationObserverOwner::isReachableFromOpaqueRoots):
2154 * bindings/js/JSNodeCustom.cpp:
2155 (WebCore::isReachableFromDOM):
2156 (WebCore::JSNodeOwner::isReachableFromOpaqueRoots):
2157 * bindings/js/JSNodeListCustom.cpp:
2158 (WebCore::JSNodeListOwner::isReachableFromOpaqueRoots):
2159 * bindings/js/JSTextTrackCueCustom.cpp:
2160 (WebCore::JSTextTrackCueOwner::isReachableFromOpaqueRoots):
2161 * bindings/js/WebCoreTypedArrayController.cpp:
2162 (WebCore::WebCoreTypedArrayController::JSArrayBufferOwner::isReachableFromOpaqueRoots):
2163 (WebCore::WebCoreTypedArrayController::JSArrayBufferOwner::finalize):
2164 * bindings/js/WebCoreTypedArrayController.h:
2165 * bindings/scripts/CodeGeneratorJS.pm:
2167 (GenerateImplementation):
2168 * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2169 (WebCore::JSTestActiveDOMObjectOwner::isReachableFromOpaqueRoots):
2170 (WebCore::JSTestActiveDOMObjectOwner::finalize):
2171 * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
2172 * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
2173 (WebCore::JSTestCustomConstructorWithNoInterfaceObjectOwner::isReachableFromOpaqueRoots):
2174 (WebCore::JSTestCustomConstructorWithNoInterfaceObjectOwner::finalize):
2175 * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
2176 * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
2177 (WebCore::JSTestCustomNamedGetterOwner::isReachableFromOpaqueRoots):
2178 (WebCore::JSTestCustomNamedGetterOwner::finalize):
2179 * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
2180 * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2181 (WebCore::JSTestEventConstructorOwner::isReachableFromOpaqueRoots):
2182 (WebCore::JSTestEventConstructorOwner::finalize):
2183 * bindings/scripts/test/JS/JSTestEventConstructor.h:
2184 * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2185 (WebCore::JSTestEventTargetOwner::isReachableFromOpaqueRoots):
2186 (WebCore::JSTestEventTargetOwner::finalize):
2187 * bindings/scripts/test/JS/JSTestEventTarget.h:
2188 * bindings/scripts/test/JS/JSTestException.cpp:
2189 (WebCore::JSTestExceptionOwner::isReachableFromOpaqueRoots):
2190 (WebCore::JSTestExceptionOwner::finalize):
2191 * bindings/scripts/test/JS/JSTestException.h:
2192 * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
2193 (WebCore::JSTestGenerateIsReachableOwner::isReachableFromOpaqueRoots):
2194 (WebCore::JSTestGenerateIsReachableOwner::finalize):
2195 * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
2196 * bindings/scripts/test/JS/JSTestInterface.cpp:
2197 (WebCore::JSTestInterfaceOwner::isReachableFromOpaqueRoots):
2198 (WebCore::JSTestInterfaceOwner::finalize):
2199 * bindings/scripts/test/JS/JSTestInterface.h:
2200 * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
2201 (WebCore::JSTestMediaQueryListListenerOwner::isReachableFromOpaqueRoots):
2202 (WebCore::JSTestMediaQueryListListenerOwner::finalize):
2203 * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
2204 * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2205 (WebCore::JSTestNamedConstructorOwner::isReachableFromOpaqueRoots):
2206 (WebCore::JSTestNamedConstructorOwner::finalize):
2207 * bindings/scripts/test/JS/JSTestNamedConstructor.h:
2208 * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
2209 (WebCore::JSTestNondeterministicOwner::isReachableFromOpaqueRoots):
2210 (WebCore::JSTestNondeterministicOwner::finalize):
2211 * bindings/scripts/test/JS/JSTestNondeterministic.h:
2212 * bindings/scripts/test/JS/JSTestObj.cpp:
2213 (WebCore::JSTestObjOwner::isReachableFromOpaqueRoots):
2214 (WebCore::JSTestObjOwner::finalize):
2215 * bindings/scripts/test/JS/JSTestObj.h:
2216 * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2217 (WebCore::JSTestOverloadedConstructorsOwner::isReachableFromOpaqueRoots):
2218 (WebCore::JSTestOverloadedConstructorsOwner::finalize):
2219 * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
2220 * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
2221 (WebCore::JSTestOverrideBuiltinsOwner::isReachableFromOpaqueRoots):
2222 (WebCore::JSTestOverrideBuiltinsOwner::finalize):
2223 * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
2224 * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2225 (WebCore::JSTestSerializedScriptValueInterfaceOwner::isReachableFromOpaqueRoots):
2226 (WebCore::JSTestSerializedScriptValueInterfaceOwner::finalize):
2227 * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
2228 * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2229 (WebCore::JSTestTypedefsOwner::isReachableFromOpaqueRoots):
2230 (WebCore::JSTestTypedefsOwner::finalize):
2231 * bindings/scripts/test/JS/JSTestTypedefs.h:
2232 * bindings/scripts/test/JS/JSattribute.cpp:
2233 (WebCore::JSattributeOwner::isReachableFromOpaqueRoots):
2234 (WebCore::JSattributeOwner::finalize):
2235 * bindings/scripts/test/JS/JSattribute.h:
2236 * bindings/scripts/test/JS/JSreadonly.cpp:
2237 (WebCore::JSreadonlyOwner::isReachableFromOpaqueRoots):
2238 (WebCore::JSreadonlyOwner::finalize):
2239 * bindings/scripts/test/JS/JSreadonly.h:
2240 * bridge/runtime_root.cpp:
2241 (JSC::Bindings::RootObject::finalize):
2242 * bridge/runtime_root.h:
2244 2015-09-10 Chris Fleizach <cfleizach@apple.com>
2246 AX: Mavericks: Text cursor does not move along with VoiceOver cursor for text fields
2247 https://bugs.webkit.org/show_bug.cgi?id=148891
2249 Reviewed by Alexey Proskuryakov.
2251 Asychronous focus setting DOES work on Yosemite, just not Mavericks.
2253 * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2254 (-[WebAccessibilityObjectWrapper accessibilitySetValue:forAttribute:]):
2255 (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
2257 2015-09-10 David Hyatt <hyatt@apple.com>
2259 [New Block-Inside-Inline Model] Self-collapsing block check needs to account for anonymous inline blocks
2260 https://bugs.webkit.org/show_bug.cgi?id=149042
2262 Reviewed by Dean Jackson.
2264 Added new tests in fast/block/inside-inlines/
2266 * rendering/InlineFlowBox.cpp:
2267 * rendering/InlineFlowBox.h:
2268 (WebCore::InlineFlowBox::anonymousInlineBlock):
2269 Add a new accessor to get the anonymousInlineBlock() for lines that wrap them.
2271 * rendering/RenderBlock.cpp:
2272 (WebCore::RenderBlock::childrenPreventSelfCollapsing):
2273 (WebCore::RenderBlock::isSelfCollapsingBlock):
2274 isSelfCollapsingBlock() now calls a virtual method that checks lines/children called childrenPreventSelfCollapsing.
2275 This lets us farm out the lines check to the derived RenderBlockFlow class.
2277 * rendering/RenderBlock.h:
2278 (WebCore::RenderBlock::childrenPreventSelfCollapsing):
2279 Added new virtual method for checking children.
2281 * rendering/RenderBlockFlow.cpp:
2282 * rendering/RenderBlockFlow.h:
2283 (WebCore::RenderBlockFlow::childrenPreventSelfCollapsing):
2284 Overridden to ensure that blocks can still be self-collapsing if they only contain anonymous inline-block lines that
2285 are also self-collapsing.
2287 2015-09-10 Jinyoung Hur <hur.ims@navercorp.com>
2289 [WebGL][GLES] bad shaders should not be linked not only for GL but also for GL ES
2290 https://bugs.webkit.org/show_bug.cgi?id=148794
2292 Reviewed by Dean Jackson.
2294 Checking bad shaders, precision matching and varyings packing are all valid for GL ES too.
2296 Test: webgl/1.0.2/conformance/programs/program-test.html
2298 * html/canvas/WebGLRenderingContextBase.cpp:
2299 (WebCore::WebGLRenderingContextBase::linkProgram):
2301 2015-09-10 Jinyoung Hur <hur.ims@navercorp.com>
2303 Static variables in GraphicsContext3DOpenGLCommon should be avoided because of the race condition
2304 https://bugs.webkit.org/show_bug.cgi?id=148957
2306 Reviewed by Dean Jackson.
2308 There is no guarantee that only one thread calls GraphicsContext3D::compileShader() at a time so it would be
2309 better to use a thread local storage variable rather than use a static variable.
2311 No new tests. No behavioural changes.
2313 * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2314 (WebCore::getCurrentNameHashMapForShader):
2315 (WebCore::setCurrentNameHashMapForShader):
2316 (WebCore::nameHashForShader):
2317 (WebCore::GraphicsContext3D::compileShader):
2318 (WebCore::GraphicsContext3D::mappedSymbolName):
2320 2015-09-10 Chris Dumez <cdumez@apple.com>
2322 Node.appendChild(null) / replaceChild(null, null) / removeChild(null) / insertBefore(null, ref) should throw a TypeError
2323 https://bugs.webkit.org/show_bug.cgi?id=148971
2324 <rdar://problem/22560883>
2325 <rdar://problem/22559225>
2327 Reviewed by Ryosuke Niwa.
2329 Node.appendChild(null) / replaceChild(null, null) / removeChild(null)
2330 and insertBefore(null, ref) should throw a TypeError instead of a
2331 NotFoundError, as per the specification:
2332 https://dom.spec.whatwg.org/#node
2334 The parameters are not nullable so the Web IDL specification says
2335 we should throw a TypeError in this case.
2337 This patch moves the null-checking from ContainerNode to the methods
2338 on Node. The null-checking is supposed to be done by the bindings code
2339 but our generator currently does not support this so we do the null
2340 checking as close to the bindings as possible. The bindings code is
2341 calling the methods on Node. This also makes sure we throw a TypeError
2342 for null-argument when the Node is not a ContainerNode. For e.g.
2343 Text.appendChild(null) should throw a TypeError too.
2345 The methods on ContainerNode now take references insteaad of pointer
2346 parameters now that the null-checking is done at the call site in
2347 Node. This lead to a lot of code update as those methods are used
2348 a lot throughout the code base.
2350 No new tests, already covered by pre-existing layout tests.
2352 2015-09-10 Daniel Bates <dabates@apple.com>
2354 Write a test to ensure we don't regress processing of tasks when page defers loading
2355 https://bugs.webkit.org/show_bug.cgi?id=135882
2356 <rdar://problem/22550497>
2358 Reviewed by Darin Adler.
2360 Towards adding a test for <https://bugs.webkit.org/show_bug.cgi?id=135688>, add a window.internals
2361 function, setPageDefersLoading, to enable and disable whether the page defers loading.
2363 Test: storage/websql/success-callback-when-page-defers-loading.html
2365 * testing/Internals.cpp:
2366 (WebCore::Internals::resetToConsistentState): Reset defers loading for the page to false.
2367 (WebCore::Internals::setPageDefersLoading): Added.
2368 * testing/Internals.h:
2369 * testing/Internals.idl: Added IDL declaration setPageDefersLoading.
2371 2015-09-10 Sergio Villar Senin <svillar@igalia.com>
2373 min-width/height should default to auto for flexbox items
2374 https://bugs.webkit.org/show_bug.cgi?id=146020
2376 Reviewed by David Hyatt.
2378 Based on Blink's r193665, r194062, r194887 and r195930 by <cbiesinger@chromium.org>.
2381 http://dev.w3.org/csswg/css-flexbox/#min-size-auto the default
2382 value of min-{width|height} is auto for flex items.
2384 In case this patch breaks any website (as it's changing the
2385 default value of those properties) the fix is likely to add:
2390 to any relevant flexitems.
2392 Test: css3/flexbox/min-size-auto.html
2394 * css/CSSComputedStyleDeclaration.cpp:
2395 (WebCore::isFlexOrGrid): New helper method to identify grids and flexs.
2396 (WebCore::ComputedStyleExtractor::propertyValue): Return auto
2397 for flex items if min-width/height is auto.
2398 * css/CSSParser.cpp:
2399 (WebCore::CSSParser::parseValue):
2400 * html/shadow/SliderThumbElement.cpp:
2401 * rendering/RenderBox.cpp:
2402 (WebCore::RenderBox::constrainLogicalHeightByMinMax):
2403 (WebCore::RenderBox::constrainContentBoxLogicalHeightByMinMax):
2404 (WebCore::RenderBox::computeLogicalWidthInRegionUsing):
2405 (WebCore::RenderBox::computeLogicalHeight):
2406 (WebCore::RenderBox::computeLogicalHeightUsing):
2407 (WebCore::RenderBox::computeContentLogicalHeight):
2408 (WebCore::RenderBox::computeContentAndScrollbarLogicalHeightUsing):
2409 (WebCore::RenderBox::computeReplacedLogicalWidth):
2410 (WebCore::RenderBox::computeReplacedLogicalWidthRespectingMinMaxWidth):
2411 (WebCore::RenderBox::computeReplacedLogicalWidthUsing):
2412 (WebCore::RenderBox::computeReplacedLogicalHeight):
2413 (WebCore::RenderBox::computeReplacedLogicalHeightRespectingMinMaxHeight):
2414 (WebCore::RenderBox::computeReplacedLogicalHeightUsing):
2415 (WebCore::RenderBox::availableLogicalHeightUsing):
2416 (WebCore::RenderBox::computePositionedLogicalWidth):
2417 (WebCore::RenderBox::computePositionedLogicalWidthUsing):
2418 (WebCore::RenderBox::computePositionedLogicalHeight):
2419 (WebCore::RenderBox::computePositionedLogicalHeightUsing):
2420 * rendering/RenderBox.h:
2421 * rendering/RenderButton.h:
2422 * rendering/RenderFlexibleBox.cpp:
2423 (WebCore::RenderFlexibleBox::computeMainAxisExtentForChild):
2424 (WebCore::RenderFlexibleBox::mainAxisExtentIsDefinite):
2425 (WebCore::RenderFlexibleBox::mainAxisLengthIsIndefinite):
2426 (WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax):
2427 (WebCore::RenderFlexibleBox::mainAxisOverflowForChild):
2428 * rendering/RenderFlexibleBox.h:
2429 (WebCore::RenderFlexibleBox::isFlexibleBoxImpl):
2430 * rendering/RenderFullScreen.h:
2431 * rendering/RenderGrid.cpp:
2432 (WebCore::RenderGrid::computeUsedBreadthOfSpecifiedLength):
2433 * rendering/RenderMediaControlElements.h:
2434 * rendering/RenderMenuList.cpp:
2435 (WebCore::RenderMenuList::adjustInnerStyle): Do not longer set
2436 the min-width explicitly.
2437 * rendering/RenderMenuList.h:
2438 * rendering/RenderMultiColumnSet.cpp:
2439 (WebCore::RenderMultiColumnSet::calculateMaxColumnHeight):
2440 * rendering/RenderNamedFlowFragment.cpp:
2441 (WebCore::RenderNamedFlowFragment::maxPageLogicalHeight):
2442 * rendering/RenderReplaced.cpp:
2443 (WebCore::RenderReplaced::computeReplacedLogicalWidth):
2444 (WebCore::RenderReplaced::computeReplacedLogicalHeight):
2445 * rendering/RenderSlider.h:
2446 * rendering/RenderTextControl.h:
2447 * rendering/RenderTextControlSingleLine.cpp:
2448 (WebCore::RenderTextControlSingleLine::createInnerBlockStyle): Do not longer set
2449 the min-width explicitly.
2450 * rendering/mathml/RenderMathMLBlock.h:
2451 * rendering/style/RenderStyle.h:
2453 2015-09-10 ChangSeok Oh <changseok.oh@collabora.com>
2455 [GTK] Volume bar is broken
2456 https://bugs.webkit.org/show_bug.cgi?id=145639
2458 Reviewed by Philippe Normand.
2460 The ControlPart enum values' order has mismatched the one of values in CSSValueKeywords.in
2461 after r180965. The MediaVolumeSliderPart should be prior to the MediaVolumeSliderContainerpart.
2463 Tests: media/click-volume-bar-not-pausing.html
2464 media/volume-bar-empty-when-muted.html
2466 * platform/ThemeTypes.h:
2468 2015-09-09 Gyuyoung Kim <gyuyoung.kim@webkit.org>
2470 Remove all uses of PassRefPtr in WebCore/svg
2471 https://bugs.webkit.org/show_bug.cgi?id=148472
2473 Reviewed by Darin Adler.
2475 Clean up all uses of PassRefPtr in WebCore/svg.
2477 * Modules/webaudio/AudioScheduledSourceNode.cpp:
2478 (WebCore::AudioScheduledSourceNode::addEventListener):
2479 * Modules/webaudio/AudioScheduledSourceNode.h:
2480 * Modules/webaudio/ScriptProcessorNode.cpp:
2481 (WebCore::ScriptProcessorNode::addEventListener):
2482 * Modules/webaudio/ScriptProcessorNode.h:
2483 * dom/EventListenerMap.cpp:
2484 (WebCore::copyListenersNotCreatedFromMarkupToTarget):
2485 * dom/EventTarget.cpp:
2486 (WebCore::EventTarget::addEventListener):
2487 * dom/EventTarget.h:
2488 * dom/MessagePort.cpp:
2489 (WebCore::MessagePort::addEventListener):
2490 * dom/MessagePort.h:
2492 (WebCore::tryAddEventListener):
2493 (WebCore::Node::addEventListener):
2495 * html/HTMLMediaElement.cpp:
2496 (WebCore::HTMLMediaElement::addEventListener):
2497 * html/HTMLMediaElement.h:
2498 * html/ImageDocument.cpp:
2499 (WebCore::ImageDocument::createDocumentStructure):
2500 * html/shadow/MediaControlsApple.cpp:
2501 (WebCore::MediaControlsApple::showClosedCaptionTrackList):
2502 * page/DOMWindow.cpp:
2503 (WebCore::DOMWindow::addEventListener):
2505 * rendering/svg/RenderSVGResourceFilter.cpp:
2506 (WebCore::RenderSVGResourceFilter::buildPrimitives):
2507 * svg/SVGElement.cpp:
2508 (WebCore::SVGElement::addEventListener):
2510 * svg/SVGPathElement.cpp:
2511 (WebCore::SVGPathElement::pathSegListChanged):
2512 * svg/SVGPathUtilities.cpp:
2513 (WebCore::appendSVGPathByteStreamFromSVGPathSeg):
2514 * svg/SVGPathUtilities.h:
2515 * svg/SVGTRefElement.cpp:
2516 (WebCore::SVGTRefTargetEventListener::attach):
2517 (WebCore::SVGTRefElement::buildPendingResource):
2518 * svg/graphics/filters/SVGFilterBuilder.cpp:
2519 (WebCore::SVGFilterBuilder::appendEffectToEffectReferences):
2520 * svg/graphics/filters/SVGFilterBuilder.h:
2522 2015-09-09 Dewei Zhu <dewei_zhu@apple.com>
2524 Document.characterSet should return "UTF-8" instead of null by default.
2525 https://bugs.webkit.org/show_bug.cgi?id=148810
2526 <rdar://problem/22548727>
2528 Reviewed by Ryosuke Niwa.
2530 Document encoding should default to "UTF-8" as is specified in
2531 https://dom.spec.whatwg.org/#concept-document-encoding. This behavior
2532 is consistent with Firefox and Chrome.
2535 (WebCore::Document::encoding): Returns nullAtom according to declearation.
2536 (WebCore::Document::characterSetForBindings): Returns "UTF-8" by default instead of null String.
2538 (WebCore::Document::charset):
2539 (WebCore::Document::inputEncoding): Deleted.
2540 (WebCore::Document::characterSet): Deleted.
2542 * dom/InlineStyleSheetOwner.cpp:
2543 (WebCore::InlineStyleSheetOwner::createSheet):
2544 * inspector/InspectorPageAgent.cpp:
2545 (WebCore::InspectorPageAgent::mainResourceContent):
2546 * inspector/InspectorResourceAgent.cpp:
2547 (WebCore::InspectorResourceAgent::didFinishLoading):
2548 (WebCore::InspectorResourceAgent::didFailLoading):
2549 * loader/DocumentWriter.cpp:
2550 (WebCore::DocumentWriter::createDecoderIfNeeded):
2551 * loader/FormSubmission.cpp:
2552 (WebCore::encodingFromAcceptCharset):
2554 2015-09-09 Benjamin Poulain <bpoulain@apple.com>
2556 CSS general sibling selectors does not work without CSS JIT
2557 https://bugs.webkit.org/show_bug.cgi?id=148987
2558 rdar://problem/22559860
2560 Reviewed by Andreas Kling.
2562 When traversing with the indirect adjacent combinator, SelectorChecker
2563 was not setting the style invalidation flag on the right element.
2565 Tests: fast/css/indirect-adjacent-style-invalidation-1.html
2566 fast/css/indirect-adjacent-style-invalidation-2.html
2567 fast/css/indirect-adjacent-style-invalidation-3.html
2569 * css/SelectorChecker.cpp:
2570 (WebCore::SelectorChecker::matchRecursively):
2572 2015-09-09 Joseph Pecoraro <pecoraro@apple.com>
2574 Web Inspector: Remove unused InspectorFrontendHost methods
2575 https://bugs.webkit.org/show_bug.cgi?id=149013
2577 Reviewed by Brian Burg.
2579 * inspector/InspectorFrontendHost.cpp:
2580 (WebCore::InspectorFrontendHost::canSaveAs): Deleted.
2581 (WebCore::InspectorFrontendHost::canInspectWorkers): Deleted.
2582 * inspector/InspectorFrontendHost.h:
2583 * inspector/InspectorFrontendHost.idl:
2585 2015-09-09 Myles C. Maxfield <mmaxfield@apple.com>
2587 ASSERTION FAILED: typesettingFeatures & (Kerning | Ligatures) in WebCore::applyFontTransforms
2588 https://bugs.webkit.org/show_bug.cgi?id=146194
2590 Reviewed by Dean Jackson.
2592 We might trigger shaping even if the author hasn't specified kerning or ligatures.
2594 Test: fast/text/softbank-emoji-no-ligatures-nor-kerning.html
2596 * platform/graphics/WidthIterator.cpp:
2597 (WebCore::isSoftBankEmoji):
2598 (WebCore::WidthIterator::applyFontTransforms):
2599 (WebCore::WidthIterator::advanceInternal):
2600 (WebCore::applyFontTransforms): Deleted.
2601 * platform/graphics/WidthIterator.h:
2603 2015-09-09 Chris Dumez <cdumez@apple.com>
2605 Setting document.title when there is no title and no head element should no nothing
2606 https://bugs.webkit.org/show_bug.cgi?id=149005
2607 <rdar://problem/22567524>
2609 Reviewed by Ryosuke Niwa.
2611 Setting document.title when there is no title element and no head
2612 element should no nothing:
2613 - https://html.spec.whatwg.org/multipage/dom.html#document.title
2615 Firefox and Chrome comply with the specification. However, WebKit
2616 was returning the updated title when querying document.title after
2619 No new tests, covered by existing tests.
2622 (WebCore::Document::setTitle):
2624 2015-09-09 Manuel Rego Casasnovas <rego@igalia.com>
2626 [css-grid] Percentage columns shouldn't include border and padding
2627 https://bugs.webkit.org/show_bug.cgi?id=148978
2629 Reviewed by Sergio Villar Senin.
2631 Subtract border and padding when we're calculating the breadth of the
2632 columns in LayoutGrid::computeUsedBreadthOfSpecifiedLength().
2634 Added test to check the behavior for both columns and rows.
2636 Test: fast/css-grid-layout/grid-percent-track-margin-border-padding.html
2638 * rendering/RenderGrid.cpp:
2639 (WebCore::RenderGrid::computeUsedBreadthOfSpecifiedLength):
2641 2015-09-09 Commit Queue <commit-queue@webkit.org>
2643 Unreviewed, rolling out r189536 and r189538.
2644 https://bugs.webkit.org/show_bug.cgi?id=149002
2646 broke tests on mac (Requested by alexchristensen on #webkit).
2648 Reverted changesets:
2650 "min-width/height should default to auto for flexbox items"
2651 https://bugs.webkit.org/show_bug.cgi?id=146020
2652 http://trac.webkit.org/changeset/189536
2654 "[css-grid] Percentage columns shouldn't include border and
2656 https://bugs.webkit.org/show_bug.cgi?id=148978
2657 http://trac.webkit.org/changeset/189538
2659 2015-09-08 David Hyatt <hyatt@apple.com>
2661 REGRESSION: Inline-block baseline is wrong when zero-width replaced child is present
2662 https://bugs.webkit.org/show_bug.cgi?id=147452
2663 rdar://problem/21943074
2665 Reviewed by Myles Maxfield.
2667 Added new test in fast/inline-block
2669 Treat zero width replaced elements the same as replaced elements with width. Instead of
2670 clearing floats based off having no committed width, we instead track both committed
2671 width and committed replaced objects. We do this with two new booleans in LineWidth
2672 so that we know when we have uncomitted and committed replaced objects.
2674 * rendering/line/BreakingContext.h:
2675 (WebCore::BreakingContext::handleReplaced):
2676 (WebCore::BreakingContext::handleText):
2677 (WebCore::BreakingContext::canBreakAtThisPosition):
2678 (WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):
2679 * rendering/line/LineWidth.cpp:
2680 (WebCore::LineWidth::LineWidth):
2681 (WebCore::LineWidth::commit):
2682 (WebCore::LineWidth::applyOverhang):
2683 * rendering/line/LineWidth.h:
2684 (WebCore::LineWidth::committedWidth):
2685 (WebCore::LineWidth::availableWidth):
2686 (WebCore::LineWidth::logicalLeftOffset):
2687 (WebCore::LineWidth::hasCommitted):
2688 (WebCore::LineWidth::addUncommittedWidth):
2689 (WebCore::LineWidth::addUncommittedReplacedWidth):
2691 2015-09-09 Antti Koivisto <antti@apple.com>
2693 Split mixed font GlyphPage functionality to separate class
2694 https://bugs.webkit.org/show_bug.cgi?id=148965
2696 Reviewed by Myles Maxfield.
2698 Currently GlyphPage class is used for both immutable single font case (in Font) and
2699 for caching mixed font mappings (in FontCascadeFonts). It is cleaner to use separate
2700 classed for these cases. This will also make future improvements easier.
2702 * platform/graphics/Font.cpp:
2703 (WebCore::Font::~Font):
2704 (WebCore::fillGlyphPage):
2705 (WebCore::createAndFillGlyphPage):
2706 (WebCore::Font::glyphPage):
2707 (WebCore::Font::glyphForCharacter):
2708 (WebCore::Font::glyphDataForCharacter):
2709 * platform/graphics/Font.h:
2710 * platform/graphics/FontCascadeFonts.cpp:
2711 (WebCore::MixedFontGlyphPage::MixedFontGlyphPage):
2712 (WebCore::MixedFontGlyphPage::glyphDataForCharacter):
2713 (WebCore::MixedFontGlyphPage::setGlyphDataForCharacter):
2714 (WebCore::MixedFontGlyphPage::setGlyphDataForIndex):
2716 Mixed font pages are now an implementation detail of FontCascadeFonts.
2718 (WebCore::FontCascadeFonts::GlyphPageCacheEntry::glyphDataForCharacter):
2719 (WebCore::FontCascadeFonts::GlyphPageCacheEntry::setGlyphDataForCharacter):
2720 (WebCore::FontCascadeFonts::GlyphPageCacheEntry::setSingleFontPage):
2722 Cache entry is either shared single font GlyphPage or mutable MixedFontGlyphPage.
2724 (WebCore::FontCascadeFonts::FontCascadeFonts):
2725 (WebCore::FontCascadeFonts::glyphDataForCharacter):
2726 (WebCore::FontCascadeFonts::pruneSystemFallbacks):
2727 * platform/graphics/FontCascadeFonts.h:
2728 (WebCore::FontCascadeFonts::GlyphPageCacheEntry::isNull):
2729 (WebCore::FontCascadeFonts::GlyphPageCacheEntry::isMixedFont):
2730 * platform/graphics/GlyphPage.h:
2732 GlyphPage is now for single font mappings only.
2733 Use regular allocation instead of variable size tricks.
2734 It is always immutable after initialization (though currently a setter is still needed).
2736 (WebCore::GlyphPage::create):
2737 (WebCore::GlyphPage::~GlyphPage):
2738 (WebCore::GlyphPage::count):
2739 (WebCore::GlyphPage::indexForCharacter):
2740 (WebCore::GlyphPage::glyphDataForCharacter):
2741 (WebCore::GlyphPage::glyphForCharacter):
2742 (WebCore::GlyphPage::glyphDataForIndex):
2743 (WebCore::GlyphPage::glyphForIndex):
2744 (WebCore::GlyphPage::setGlyphForIndex):
2745 (WebCore::GlyphPage::font):
2746 (WebCore::GlyphPage::GlyphPage):
2747 (WebCore::GlyphPage::createForMixedFonts): Deleted.
2748 (WebCore::GlyphPage::createCopyForMixedFonts): Deleted.
2749 (WebCore::GlyphPage::createForSingleFont): Deleted.
2750 (WebCore::GlyphPage::isImmutable): Deleted.
2751 (WebCore::GlyphPage::setImmutable): Deleted.
2752 (WebCore::GlyphPage::glyphAt): Deleted.
2753 (WebCore::GlyphPage::fontForCharacter): Deleted.
2754 (WebCore::GlyphPage::setGlyphDataForCharacter): Deleted.
2755 (WebCore::GlyphPage::setGlyphDataForIndex): Deleted.
2756 (WebCore::GlyphPage::hasPerGlyphFontData): Deleted.
2757 * platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp:
2758 (WebCore::GlyphPage::fill):
2759 * platform/graphics/mac/GlyphPageMac.cpp:
2760 (WebCore::GlyphPage::fill):
2761 * platform/graphics/opentype/OpenTypeVerticalData.cpp:
2762 (WebCore::OpenTypeVerticalData::substituteWithVerticalGlyphs):
2763 * platform/graphics/win/GlyphPageTreeNodeCGWin.cpp:
2764 (WebCore::GlyphPage::fill):
2765 * platform/graphics/win/GlyphPageTreeNodeCairoWin.cpp:
2766 (WebCore::GlyphPage::fill):
2767 * svg/SVGFontData.cpp:
2768 (WebCore::SVGFontData::applySVGGlyphSelection):
2769 (WebCore::SVGFontData::fillSVGGlyphPage):
2770 (WebCore::SVGFontData::fillBMPGlyphs):
2771 (WebCore::SVGFontData::fillNonBMPGlyphs):
2772 * svg/SVGFontData.h:
2773 (WebCore::SVGFontData::verticalAdvanceY):
2775 2015-09-09 Manuel Rego Casasnovas <rego@igalia.com>
2777 [css-grid] Percentage columns shouldn't include border and padding
2778 https://bugs.webkit.org/show_bug.cgi?id=148978
2780 Reviewed by Sergio Villar Senin.
2782 Subtract border and padding when we're calculating the breadth of the
2783 columns in LayoutGrid::computeUsedBreadthOfSpecifiedLength().
2785 Added test to check the behavior for both columns and rows.
2787 Test: fast/css-grid-layout/grid-percent-track-margin-border-padding.html
2789 * rendering/RenderGrid.cpp:
2790 (WebCore::RenderGrid::computeUsedBreadthOfSpecifiedLength):
2792 2015-09-09 Chris Dumez <cdumez@apple.com>
2794 HTMLTableElement.tHead / tFoot / caption should be nullable
2795 https://bugs.webkit.org/show_bug.cgi?id=148991
2797 Reviewed by Ryosuke Niwa.
2799 According to the specification, HTMLTableElement.tHead / tFoot / caption
2801 https://html.spec.whatwg.org/multipage/tables.html#htmltableelement
2803 Upon assigning null, we are supposed to remove the existing tHead / tFoot
2804 / caption element. However, we had a bug causing us to throw an exception
2805 after removing the element. This is because we would try to insert a null
2806 element and ContainerNode::insertBefore() throws when doing so.
2808 Also, as per the specification, setting tHead / tFoot to something else
2809 than a thead / tfoot element should throw a HierarchyRequestError:
2810 https://html.spec.whatwg.org/multipage/tables.html#dom-table-thead
2811 https://html.spec.whatwg.org/multipage/tables.html#dom-table-tfoot
2813 Previously, WebKit did not check the tag and was happy inserting the
2814 element as long as it was an HTMLTableSectionElement. This means that
2815 you could set a tfoot by assigning table.tHead.
2817 This patch corrects both bugs and adds test coverage for it.
2819 Test: fast/dom/HTMLTableElement/nullable-attributes.html
2821 * html/HTMLTableElement.cpp:
2822 (WebCore::HTMLTableElement::setCaption):
2823 Only call insertBefore() if newCaption is not null as insertBefore()
2824 will throw an exception otherwise.
2826 (WebCore::HTMLTableElement::setTHead):
2827 - Throw a HierarchyRequestError if the HTMLTableSectionElement is not
2828 null or a <thead> element, as per the specification.
2829 - Only call insertBefore() if newHead is not null as insertBefore()
2830 will throw an exception otherwise.
2832 (WebCore::HTMLTableElement::setTFoot):
2833 - Throw a HierarchyRequestError if the HTMLTableSectionElement is not
2834 null or a <tfoot> element, as per the specification.
2835 - Only call insertBefore() if newFoot is not null as insertBefore()
2836 will throw an exception otherwise.
2838 * html/HTMLTableElement.idl:
2839 Use [StrictTypeChecking] for these 3 attributes so that the bindings
2840 will throw a TypeError if the JS tries to assign a value with the
2841 wrong type. When the implementation is called with null, we now know
2842 this is because the JS assigned null (and not an invalid value).
2843 This is important as assigning null is valid since those attributes
2846 2015-06-26 Sergio Villar Senin <svillar@igalia.com>
2848 min-width/height should default to auto for flexbox items
2849 https://bugs.webkit.org/show_bug.cgi?id=146020
2851 Reviewed by David Hyatt.
2853 Based on Blink's r193665, r194062, r194887 and r195930 by <cbiesinger@chromium.org>.
2856 http://dev.w3.org/csswg/css-flexbox/#min-size-auto the default
2857 value of min-{width|height} is auto for flex items.
2859 In case this patch breaks any website (as it's changing the
2860 default value of those properties) the fix is likely to add:
2865 to any relevant flexitems.
2867 Test: css3/flexbox/min-size-auto.html
2869 * css/CSSComputedStyleDeclaration.cpp:
2870 (WebCore::isFlexOrGrid): New helper method to identify grids and flexs.
2871 (WebCore::ComputedStyleExtractor::propertyValue): Return auto
2872 for flex items if min-width/height is auto.
2873 * css/CSSParser.cpp:
2874 (WebCore::CSSParser::parseValue):
2875 * html/shadow/SliderThumbElement.cpp:
2876 * rendering/RenderBox.cpp:
2877 (WebCore::RenderBox::constrainLogicalHeightByMinMax):
2878 (WebCore::RenderBox::constrainContentBoxLogicalHeightByMinMax):
2879 (WebCore::RenderBox::computeLogicalWidthInRegionUsing):
2880 (WebCore::RenderBox::computeLogicalHeight):
2881 (WebCore::RenderBox::computeLogicalHeightUsing):
2882 (WebCore::RenderBox::computeContentLogicalHeight):
2883 (WebCore::RenderBox::computeContentAndScrollbarLogicalHeightUsing):
2884 (WebCore::RenderBox::computeReplacedLogicalWidth):
2885 (WebCore::RenderBox::computeReplacedLogicalWidthRespectingMinMaxWidth):
2886 (WebCore::RenderBox::computeReplacedLogicalWidthUsing):
2887 (WebCore::RenderBox::computeReplacedLogicalHeight):
2888 (WebCore::RenderBox::computeReplacedLogicalHeightRespectingMinMaxHeight):
2889 (WebCore::RenderBox::computeReplacedLogicalHeightUsing):
2890 (WebCore::RenderBox::availableLogicalHeightUsing):
2891 (WebCore::RenderBox::computePositionedLogicalWidth):
2892 (WebCore::RenderBox::computePositionedLogicalWidthUsing):
2893 (WebCore::RenderBox::computePositionedLogicalHeight):
2894 (WebCore::RenderBox::computePositionedLogicalHeightUsing):
2895 * rendering/RenderBox.h:
2896 * rendering/RenderButton.h:
2897 * rendering/RenderFlexibleBox.cpp:
2898 (WebCore::RenderFlexibleBox::computeMainAxisExtentForChild):
2899 (WebCore::RenderFlexibleBox::mainAxisExtentIsDefinite):
2900 (WebCore::RenderFlexibleBox::mainAxisLengthIsIndefinite):
2901 (WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax):
2902 (WebCore::RenderFlexibleBox::mainAxisOverflowForChild):
2903 * rendering/RenderFlexibleBox.h:
2904 (WebCore::RenderFlexibleBox::isFlexibleBoxImpl):
2905 * rendering/RenderFullScreen.h:
2906 * rendering/RenderGrid.cpp:
2907 (WebCore::RenderGrid::computeUsedBreadthOfSpecifiedLength):
2908 * rendering/RenderMediaControlElements.h:
2909 * rendering/RenderMenuList.cpp:
2910 (WebCore::RenderMenuList::adjustInnerStyle): Do not longer set
2911 the min-width explicitly.
2912 * rendering/RenderMenuList.h:
2913 * rendering/RenderMultiColumnSet.cpp:
2914 (WebCore::RenderMultiColumnSet::calculateMaxColumnHeight):
2915 * rendering/RenderNamedFlowFragment.cpp:
2916 (WebCore::RenderNamedFlowFragment::maxPageLogicalHeight):
2917 * rendering/RenderReplaced.cpp:
2918 (WebCore::RenderReplaced::computeReplacedLogicalWidth):
2919 (WebCore::RenderReplaced::computeReplacedLogicalHeight):
2920 * rendering/RenderSlider.h:
2921 * rendering/RenderTextControl.h:
2922 * rendering/RenderTextControlSingleLine.cpp:
2923 (WebCore::RenderTextControlSingleLine::createInnerBlockStyle): Do not longer set
2924 the min-width explicitly.
2925 * rendering/mathml/RenderMathMLBlock.h:
2926 * rendering/style/RenderStyle.h:
2928 2015-09-08 Joseph Pecoraro <pecoraro@apple.com>
2930 Web Inspector: No need for [Custom] Implementation of some InspectorFrontendHost methods
2931 https://bugs.webkit.org/show_bug.cgi?id=148990
2933 Reviewed by Timothy Hatcher.
2935 * bindings/js/JSInspectorFrontendHostCustom.cpp:
2936 (WebCore::JSInspectorFrontendHost::platform): Deleted.
2937 (WebCore::JSInspectorFrontendHost::port): Deleted.
2938 * inspector/InspectorFrontendHost.cpp:
2939 (WebCore::InspectorFrontendHost::platform):
2940 (WebCore::InspectorFrontendHost::port):
2941 * inspector/InspectorFrontendHost.h:
2942 * inspector/InspectorFrontendHost.idl:
2943 Uncustomize a few basic functions.
2945 2015-09-08 Michael Catanzaro <mcatanzaro@igalia.com>
2947 Crash when WebCore::SQLiteFileSystem::openDatabase is called from multiple threads
2948 https://bugs.webkit.org/show_bug.cgi?id=143245
2950 Reviewed by Darin Adler.
2952 sqlite3_initialize is documented to be thread-safe, and to be called automatically by the
2953 library when needed, so applications should never need to call it directly. The problem is,
2954 it's not thread-safe: we have documented instances of GNOME Builder, Devhelp, Epiphany, and
2955 cinnamon-screensaver crashing when sqlite3_initialize is called simultaneously in separate
2956 threads (usually inside sqlite3_open). So call it manually, guarded using std::call_once, to
2957 make sure that the library is fully initialized before the first call to sqlite3_open. It's
2958 a good idea to do this regardless, because the documentation says it could be required in
2959 a future release of SQLite. (Though the use of std::call_once should not be needed, and is
2960 only used to attempt to work around the crashes.)
2962 This is a workaround for an SQLite bug that might have been fixed upstream, but the SQLite
2963 developers are not really confident in the thread-safety of this function, and have advised
2964 that we carry the workaround. Seems like a good idea.
2966 * platform/sql/SQLiteDatabase.cpp:
2967 (WebCore::SQLiteDatabase::SQLiteDatabase):
2969 2015-09-08 Yusuke Suzuki <utatane.tea@gmail.com>
2971 Unify symbolTablePut in JSLexicalEnvironment and JSSymbolTableObject
2972 https://bugs.webkit.org/show_bug.cgi?id=148783
2974 Reviewed by Geoffrey Garen.
2978 * bindings/js/JSDOMWindowBase.cpp:
2979 (WebCore::JSDOMWindowBase::updateDocument):
2981 2015-09-08 Brian Burg <bburg@apple.com>
2983 Several inspector-protocol tests are flaky with GuardMalloc
2984 https://bugs.webkit.org/show_bug.cgi?id=136715
2986 Reviewed by Joseph Pecoraro.
2988 Sometimes, the async dispatch task can outlive its owning frontend client.
2989 To avoid problems, make it refcounted instead and add a protector reference.
2991 No new tests, covered by existing tests.
2993 * inspector/InspectorFrontendClientLocal.cpp:
2994 (WebCore::InspectorBackendDispatchTask::create):
2995 (WebCore::InspectorBackendDispatchTask::dispatch):
2996 (WebCore::InspectorBackendDispatchTask::reset):
2997 (WebCore::InspectorBackendDispatchTask::timerFired):
2998 (WebCore::InspectorBackendDispatchTask::InspectorBackendDispatchTask):
2999 (WebCore::InspectorFrontendClientLocal::InspectorFrontendClientLocal):
3000 (WebCore::InspectorFrontendClientLocal::~InspectorFrontendClientLocal):
3001 * inspector/InspectorFrontendClientLocal.h:
3003 2015-09-08 Chris Dumez <cdumez@apple.com>
3005 new Comment(undefined) / new Text(undefined) should use default's empty string
3006 https://bugs.webkit.org/show_bug.cgi?id=148973
3007 <rdar://problem/22548042>
3009 Reviewed by Ryosuke Niwa.
3011 new Comment(undefined) / new Text(undefined) should use default's empty string instead of converting
3012 undefined to the "undefined" string:
3013 - https://dom.spec.whatwg.org/#interface-comment (parameter is optional, default value is empty String)
3014 - https://dom.spec.whatwg.org/#text (ditto)
3016 undefined should be treated as if the parameter is missing, in the case the parameter is optional, as
3017 per the Web IDL specification. This patch aligns WebKit's behavior with the specification and the
3018 behavior of Firefox and Chrome.
3020 No new tests, already covered by existing tests.
3022 * bindings/scripts/CodeGeneratorJS.pm:
3023 (GenerateParametersCheck):
3024 * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
3025 (WebCore::JSTestNamedConstructorNamedConstructor::constructJSTestNamedConstructor):
3026 * bindings/scripts/test/JS/JSTestObj.cpp:
3027 (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsNullString):
3029 2015-09-08 Chris Dumez <cdumez@apple.com>
3031 document.importNode(node, deep): deep's default value should be false
3032 https://bugs.webkit.org/show_bug.cgi?id=148959
3033 <rdar://problem/22558915>
3035 Reviewed by Alexey Proskuryakov.
3037 Switch deep parameter's default value for document.importNode() to
3038 false, as per the latest DOM specification:
3039 - https://dom.spec.whatwg.org/#interface-document
3040 - https://dom.spec.whatwg.org/#dom-document-importnode
3042 Firefox and Chrome follow the specification. However, WebKit was using
3043 "true" for deep's default value.
3045 No new tests, already covered by:
3046 imported/w3c/web-platform-tests/dom/nodes/Document-importNode.html
3049 (WebCore::Document::importNode):
3051 2015-09-08 Per Arne Vollan <peavo@outlook.com>
3053 [Win][HighDPI] Video window placement is incorrect.
3054 https://bugs.webkit.org/show_bug.cgi?id=148954
3056 Reviewed by Alex Christensen.
3058 We need to scale window dimensions with device scale factor.
3060 * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
3061 (WebCore::MediaPlayerPrivateMediaFoundation::setSize):
3063 2015-09-08 Gyuyoung Kim <gyuyoung.kim@webkit.org>
3065 Reduce uses of PassRefPtr in fileapi
3066 https://bugs.webkit.org/show_bug.cgi?id=148952
3068 Reviewed by Andreas Kling.
3070 Remove all uses of PassRefPtr in return type. Argument uses of PassRefPtr will be
3071 removed in near future.
3073 * fileapi/FileError.h:
3074 (WebCore::FileError::create):
3075 * fileapi/FileReader.cpp:
3076 (WebCore::FileReader::arrayBufferResult):
3077 * fileapi/FileReader.h:
3078 * fileapi/FileReaderLoader.cpp:
3079 (WebCore::FileReaderLoader::arrayBufferResult):
3080 * fileapi/FileReaderLoader.h:
3081 * fileapi/FileReaderSync.cpp:
3082 (WebCore::FileReaderSync::readAsArrayBuffer):
3083 * fileapi/FileReaderSync.h:
3084 * fileapi/ThreadableBlobRegistry.cpp:
3085 (WebCore::ThreadableBlobRegistry::getCachedOrigin):
3086 * fileapi/ThreadableBlobRegistry.h:
3088 2015-09-07 Chris Fleizach <cfleizach@apple.com>
3090 AX: Mavericks: Text cursor does not move along with VoiceOver cursor for text fields
3091 https://bugs.webkit.org/show_bug.cgi?id=148891
3093 Reviewed by Mario Sanchez Prada.
3095 Undo the asynchronous dispatch of accessibility setting values on pre El Capitan machines
3096 because it causes focus to not sync correctly.
3098 Test: accessibility/mac/focus-moves-cursor.html
3100 * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3101 (-[WebAccessibilityObjectWrapper accessibilitySetValue:forAttribute:]):
3102 (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
3104 2015-09-07 Gyuyoung Kim <gyuyoung.kim@webkit.org>
3106 [CoordinatedGraphics] Remove ScrollingStateScrollingNodeCoordinatedGraphics.cpp
3107 https://bugs.webkit.org/show_bug.cgi?id=148931
3109 Reviewed by Csaba Osztrogonác.
3111 ScrollingStateScrollingNodeCoordinatedGraphics.cpp implements nothing. Removed it.
3113 * PlatformEfl.cmake:
3114 * PlatformGTK.cmake:
3115 * WebCore.vcxproj/WebCore.vcxproj:
3116 * WebCore.vcxproj/WebCore.vcxproj.filters:
3117 * page/scrolling/coordinatedgraphics/ScrollingStateScrollingNodeCoordinatedGraphics.cpp: Removed.
3119 2015-09-07 Daniel Bates <dabates@apple.com>
3121 ASSERT_WITH_SECURITY_IMPLICATION in WebCore::DocumentOrderedMap::get(); update form
3122 association after subtree insertion
3123 https://bugs.webkit.org/show_bug.cgi?id=148919
3124 <rdar://problem/21868036>
3126 Reviewed by Andy Estes.
3128 Currently we update the form association of a form control upon insertion into
3129 the document. Instead we should update the form association of a form control
3130 after its containing subtree is inserted into the document to avoid an assertion
3131 failure when the containing subtree has an element whose id is identical to both
3132 the id of some other element in the document and the name of the form referenced
3133 by the inserted form control.
3135 Tests: fast/forms/update-form-owner-in-moved-subtree-assertion-failure-2.html
3136 fast/forms/update-form-owner-in-moved-subtree-assertion-failure-3.html
3137 fast/forms/update-form-owner-in-moved-subtree-assertion-failure-4.html
3138 fast/forms/update-form-owner-in-moved-subtree-assertion-failure.html
3140 * html/FormAssociatedElement.cpp:
3141 (WebCore::FormAssociatedElement::insertedInto): Moved resetFormOwner() from here
3142 to {HTMLFormControlElement, HTMLObjectElement}::finishedInsertingSubtree().
3143 * html/HTMLFormControlElement.cpp:
3144 (WebCore::HTMLFormControlElement::insertedInto): Return InsertionShouldCallFinishedInsertingSubtree
3145 so that HTMLFormControlElement::finishedInsertingSubtree() is called.
3146 (WebCore::HTMLFormControlElement::finishedInsertingSubtree): Added; turn around and
3147 call FormAssociatedElement::resetFormOwner().
3148 * html/HTMLFormControlElement.h:
3149 * html/HTMLInputElement.cpp:
3150 (WebCore::HTMLInputElement::insertedInto): Return InsertionShouldCallFinishedInsertingSubtree so
3151 that HTMLInputElement::finishedInsertingSubtree() is called and move logic to update radio button
3153 (WebCore::HTMLInputElement::finishedInsertingSubtree): to here.
3154 * html/HTMLInputElement.h:
3155 * html/HTMLObjectElement.cpp:
3156 (WebCore::HTMLObjectElement::insertedInto): Return InsertionShouldCallFinishedInsertingSubtree so
3157 that HTMLObjectElement::finishedInsertingSubtree() is called.
3158 (WebCore::HTMLObjectElement::finishedInsertingSubtree): Added; turn around and
3159 call FormAssociatedElement::resetFormOwner().
3160 * html/HTMLObjectElement.h:
3161 * html/HTMLSelectElement.cpp:
3162 (WebCore::HTMLSelectElement::insertedInto): Modified to return the result of
3163 HTMLFormControlElementWithState::insertedInto(), which may schedule a callback after subtree
3165 * html/HTMLTextFormControlElement.cpp:
3166 (WebCore::HTMLTextFormControlElement::insertedInto): Ditto.
3168 2015-09-07 Antti Koivisto <antti@apple.com>
3170 Remove GlyphPage::mayUseMixedFontsWhenFilling
3171 https://bugs.webkit.org/show_bug.cgi?id=148928
3173 Reviewed by Dan Bernstein.
3175 http://trac.webkit.org/188566 removed support for composite fonts. We never need to use mixed
3176 glyph pages for fonts anymore.
3178 * platform/graphics/Font.cpp:
3179 (WebCore::createAndFillGlyphPage):
3180 * platform/graphics/GlyphPage.h:
3181 (WebCore::GlyphPage::GlyphPage):
3182 (WebCore::GlyphPage::mayUseMixedFontsWhenFilling): Deleted.
3183 * platform/graphics/mac/GlyphPageMac.cpp:
3184 (WebCore::shouldUseCoreText):
3185 (WebCore::GlyphPage::fill):
3186 (WebCore::GlyphPage::mayUseMixedFontsWhenFilling): Deleted.
3188 2015-09-07 Antti Koivisto <antti@apple.com>
3190 Remove unneeded offset and length arguments from glyph page filling functions
3191 https://bugs.webkit.org/show_bug.cgi?id=148929
3193 Reviewed by Andreas Kling.
3195 They are always passed 0/GlyphPage::size.
3197 * platform/graphics/Font.cpp:
3198 (WebCore::Font::~Font):
3199 (WebCore::fillGlyphPage):
3200 (WebCore::createAndFillGlyphPage):
3201 * platform/graphics/Font.h:
3202 * platform/graphics/GlyphPage.h:
3203 (WebCore::GlyphPage::setGlyphDataForIndex):
3204 * platform/graphics/mac/GlyphPageMac.cpp:
3205 (WebCore::GlyphPage::mayUseMixedFontsWhenFilling):
3206 (WebCore::GlyphPage::fill):
3207 * platform/graphics/win/GlyphPageTreeNodeCGWin.cpp:
3208 (WebCore::GlyphPage::fill):
3209 * platform/graphics/win/GlyphPageTreeNodeCairoWin.cpp:
3210 (WebCore::GlyphPage::fill):
3211 * svg/SVGFontData.cpp:
3212 (WebCore::SVGFontData::applySVGGlyphSelection):
3213 (WebCore::SVGFontData::fillSVGGlyphPage):
3214 (WebCore::SVGFontData::fillBMPGlyphs):
3215 (WebCore::SVGFontData::fillNonBMPGlyphs):
3216 * svg/SVGFontData.h:
3217 (WebCore::SVGFontData::verticalAdvanceY):
3219 2015-09-06 Chris Dumez <cdumez@apple.com>
3221 dispatchEvent() should throw an InvalidStateError if the event's initialized flag is not set
3222 https://bugs.webkit.org/show_bug.cgi?id=148800
3223 <rdar://problem/22565782>
3224 <rdar://problem/22565485>
3226 Reviewed by Geoffrey Garen.
3228 dispatchEvent() should throw an InvalidStateError if the event's
3229 initialized flag is not set or its dispatch flag is set, and should
3230 allow dispatching events with an empty type as long as it is
3232 https://dom.spec.whatwg.org/#dom-eventtarget-dispatchevent (step 1)
3234 Previously, WebKit relied on the event type being empty to throw a
3235 UNSPECIFIED_EVENT_TYPE_ERR: DOM Events Exception 0. However, this
3236 exception type is outdated and initializing Event.type to an empty
3239 No new tests, already covered by existing tests that were rebaselined.
3242 (WebCore::Event::Event):
3243 (WebCore::Event::initEvent):
3245 (WebCore::Event::isInitialized):
3246 * dom/EventTarget.cpp:
3247 (WebCore::EventTarget::dispatchEvent):
3249 2015-09-06 Youenn Fablet <youenn.fablet@crf.canon.fr>
3251 XHR2 timeout property should allow late updates
3252 https://bugs.webkit.org/show_bug.cgi?id=98156
3254 Reviewed by Darin Adler.
3256 Adding a timer within XMLHttpRequest to handle timeouts for asynchronous requests.
3257 This allows easy update of the timeout even after request is sent.
3258 Timeout is still handled by the network backend for synchronous requests (Web worker context).
3260 Covered by updated tests.
3262 * xml/XMLHttpRequest.cpp:
3263 (WebCore::XMLHttpRequest::XMLHttpRequest): Adding timeout timer initialization.
3264 (WebCore::XMLHttpRequest::setTimeout): Updating timeout timer state if request is sent.
3265 (WebCore::XMLHttpRequest::createRequest): Starting timeout timer if needed.
3266 (WebCore::XMLHttpRequest::internalAbort): Stopping timeout timer if needed.
3267 (WebCore::XMLHttpRequest::didFail): Adding comment.
3268 (WebCore::XMLHttpRequest::didFinishLoading): Stopping timeout timer if needed.
3269 * xml/XMLHttpRequest.h:
3271 2015-09-05 Jaehun Lim <ljaehun.lim@samsung.com>
3273 Remove unused macros from StyleResolver.cpp
3274 https://bugs.webkit.org/show_bug.cgi?id=148163
3276 Reviewed by Andreas Kling.
3278 HANDLE_INHERIT and HANDLE_INHERIT_AND_INITIAL are not used after
3279 StyleBuilder refactoring.
3281 No new tests because there is no behavior change.
3283 * css/StyleResolver.cpp:
3284 Remove HANDLE_INHERIT and HANDLE_INHERIT_AND_INITIAL.
3286 2015-09-05 Brian Burg <bburg@apple.com>
3288 Web Inspector: tighten up lifetimes for Agent-owned objects, and initialize agents using contexts
3289 https://bugs.webkit.org/show_bug.cgi?id=148625
3291 Reviewed by Joseph Pecoraro.
3293 All agents own their domain-specific frontend and backend dispatchers. Change so that
3294 they are initialized in constructors rather than when a frontend connects or disconnects.
3295 This may cause additional memory use, but this can be counteracted by lazily creating
3296 some agents that are not required for other agents to function (i.e., runtime and page agents).
3298 To avoid adding frontend/backend dispatcher arguments to every single agent constructor,
3299 change agent construction to take a AgentContext or a subclass of it. This provides agents with
3300 references to objects in the owning InspectorEnvironment subclass that are guaranteed to
3301 outlive all agents. AgentContext and its subclasses follow the existing Agent class hierarchy.
3303 No new tests, no behavior changed.
3305 * bindings/js/WorkerScriptDebugServer.cpp:
3306 (WebCore::WorkerScriptDebugServer::WorkerScriptDebugServer):
3307 (WebCore::WorkerScriptDebugServer::addListener):
3308 (WebCore::WorkerScriptDebugServer::removeListener):
3309 (WebCore::WorkerScriptDebugServer::runEventLoopWhilePaused):
3310 * bindings/js/WorkerScriptDebugServer.h:
3311 * inspector/InspectorApplicationCacheAgent.cpp:
3312 (WebCore::InspectorApplicationCacheAgent::InspectorApplicationCacheAgent):
3313 (WebCore::InspectorApplicationCacheAgent::didCreateFrontendAndBackend):
3314 (WebCore::InspectorApplicationCacheAgent::getFramesWithManifests):
3315 (WebCore::InspectorApplicationCacheAgent::willDestroyFrontendAndBackend):
3316 * inspector/InspectorApplicationCacheAgent.h:
3317 * inspector/InspectorCSSAgent.cpp:
3318 (WebCore::InspectorCSSAgent::InspectorCSSAgent):
3319 (WebCore::InspectorCSSAgent::didCreateFrontendAndBackend):
3320 (WebCore::InspectorCSSAgent::willDestroyFrontendAndBackend):
3321 * inspector/InspectorCSSAgent.h:
3322 * inspector/InspectorController.cpp:
3323 (WebCore::InspectorController::InspectorController):
3324 * inspector/InspectorDOMAgent.cpp:
3325 (WebCore::InspectorDOMAgent::InspectorDOMAgent):
3326 (WebCore::InspectorDOMAgent::didCreateFrontendAndBackend):
3327 (WebCore::InspectorDOMAgent::willDestroyFrontendAndBackend):
3328 * inspector/InspectorDOMAgent.h:
3329 * inspector/InspectorDOMDebuggerAgent.cpp:
3330 (WebCore::InspectorDOMDebuggerAgent::InspectorDOMDebuggerAgent):
3331 (WebCore::InspectorDOMDebuggerAgent::didCreateFrontendAndBackend):
3332 (WebCore::InspectorDOMDebuggerAgent::willDestroyFrontendAndBackend):
3333 * inspector/InspectorDOMDebuggerAgent.h:
3334 * inspector/InspectorDOMStorageAgent.cpp:
3335 (WebCore::InspectorDOMStorageAgent::InspectorDOMStorageAgent):
3336 (WebCore::InspectorDOMStorageAgent::didCreateFrontendAndBackend):
3337 (WebCore::InspectorDOMStorageAgent::findStorageArea):
3338 (WebCore::InspectorDOMStorageAgent::willDestroyFrontendAndBackend):
3339 * inspector/InspectorDOMStorageAgent.h:
3340 * inspector/InspectorDatabaseAgent.cpp:
3341 (WebCore::InspectorDatabaseAgent::InspectorDatabaseAgent):
3342 (WebCore::InspectorDatabaseAgent::didCreateFrontendAndBackend):
3343 (WebCore::InspectorDatabaseAgent::willDestroyFrontendAndBackend):
3344 * inspector/InspectorDatabaseAgent.h:
3345 * inspector/InspectorIndexedDBAgent.cpp:
3346 (WebCore::InspectorIndexedDBAgent::InspectorIndexedDBAgent):
3347 (WebCore::InspectorIndexedDBAgent::didCreateFrontendAndBackend):
3348 (WebCore::InspectorIndexedDBAgent::willDestroyFrontendAndBackend):
3349 * inspector/InspectorIndexedDBAgent.h:
3350 * inspector/InspectorInstrumentation.cpp:
3351 (WebCore::InspectorInstrumentation::didClearWindowObjectInWorldImpl):
3352 * inspector/InspectorLayerTreeAgent.cpp:
3353 (WebCore::InspectorLayerTreeAgent::InspectorLayerTreeAgent):
3354 (WebCore::InspectorLayerTreeAgent::didCreateFrontendAndBackend):
3355 (WebCore::InspectorLayerTreeAgent::willDestroyFrontendAndBackend):
3356 * inspector/InspectorLayerTreeAgent.h:
3357 * inspector/InspectorPageAgent.cpp:
3358 (WebCore::InspectorPageAgent::InspectorPageAgent):
3359 (WebCore::InspectorPageAgent::didCreateFrontendAndBackend):
3360 (WebCore::InspectorPageAgent::enable):
3361 (WebCore::InspectorPageAgent::reload):
3362 (WebCore::InspectorPageAgent::navigate):
3363 (WebCore::InspectorPageAgent::getCookies):
3364 (WebCore::InspectorPageAgent::deleteCookie):
3365 (WebCore::InspectorPageAgent::getResourceTree):
3366 (WebCore::InspectorPageAgent::searchInResources):
3367 (WebCore::InspectorPageAgent::getScriptExecutionStatus):
3368 (WebCore::InspectorPageAgent::setScriptExecutionDisabled):
3369 (WebCore::InspectorPageAgent::mainFrame):
3370 (WebCore::InspectorPageAgent::findFrameWithSecurityOrigin):
3371 (WebCore::InspectorPageAgent::buildObjectForFrame):
3372 (WebCore::InspectorPageAgent::buildObjectForFrameTree):
3373 (WebCore::InspectorPageAgent::setEmulatedMedia):
3374 (WebCore::InspectorPageAgent::getCompositingBordersVisible):
3375 (WebCore::InspectorPageAgent::setCompositingBordersVisible):
3376 (WebCore::InspectorPageAgent::snapshotNode):
3377 (WebCore::InspectorPageAgent::snapshotRect):
3378 (WebCore::InspectorPageAgent::archive):
3379 (WebCore::InspectorPageAgent::willDestroyFrontendAndBackend):
3380 * inspector/InspectorPageAgent.h:
3381 * inspector/InspectorReplayAgent.cpp:
3382 (WebCore::InspectorReplayAgent::InspectorReplayAgent):
3383 (WebCore::InspectorReplayAgent::didCreateFrontendAndBackend):
3384 (WebCore::InspectorReplayAgent::willDestroyFrontendAndBackend):
3385 * inspector/InspectorReplayAgent.h:
3386 * inspector/InspectorResourceAgent.cpp:
3387 (WebCore::InspectorResourceAgent::InspectorResourceAgent):
3388 (WebCore::InspectorResourceAgent::didCreateFrontendAndBackend):
3389 (WebCore::InspectorResourceAgent::willDestroyFrontendAndBackend):
3390 * inspector/InspectorResourceAgent.h:
3391 * inspector/InspectorTimelineAgent.cpp:
3392 (WebCore::InspectorTimelineAgent::didCreateFrontendAndBackend):
3393 (WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
3394 (WebCore::InspectorTimelineAgent::willDestroyFrontendAndBackend):
3395 (WebCore::InspectorTimelineAgent::page):
3396 * inspector/InspectorTimelineAgent.h:
3397 * inspector/InspectorWebAgentBase.h:
3398 (WebCore::WebAgentContext::WebAgentContext):
3399 (WebCore::PageAgentContext::PageAgentContext):
3400 (WebCore::WorkerAgentContext::WorkerAgentContext):
3401 (WebCore::InspectorAgentBase::InspectorAgentBase):
3402 * inspector/InspectorWorkerAgent.cpp:
3403 (WebCore::InspectorWorkerAgent::InspectorWorkerAgent):
3404 (WebCore::InspectorWorkerAgent::didCreateFrontendAndBackend):
3405 (WebCore::InspectorWorkerAgent::willDestroyFrontendAndBackend):
3406 * inspector/InspectorWorkerAgent.h:
3407 * inspector/PageConsoleAgent.cpp:
3408 (WebCore::PageConsoleAgent::PageConsoleAgent):
3409 * inspector/PageConsoleAgent.h:
3410 * inspector/PageDebuggerAgent.cpp:
3411 (WebCore::PageDebuggerAgent::PageDebuggerAgent):
3412 (WebCore::PageDebuggerAgent::sourceMapURLForScript):