Spell Jon's name correctly. I expect payback for this mistake.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-09-17  Dean Jackson  <dino@apple.com>
2
3         Multi-hop reference cycles not detected.
4         https://bugs.webkit.org/show_bug.cgi?id=149181
5
6         Reviewed by Jon Honeycutt.
7
8         SVG's cycle detection was not picking up a
9         case where an element was drawing a pattern, that
10         referenced another pattern, that referenced another
11         pattern, that referenced the original pattern.
12
13         The issue was that we were forgetting to check the
14         children of the renderer itself, rather than just
15         the children of the referenced renderers.
16
17         Found by running a test from Blink.
18
19         I also took the opportunity to clean up the debugging
20         code that logs cycle detection.
21
22         Test: svg/custom/pattern-3-step-cycle.html
23
24         * platform/Logging.h: Add a new SVG channel. I can't believe we
25         didn't already have one!
26         * rendering/svg/SVGResourcesCycleSolver.cpp:
27         (WebCore::SVGResourcesCycleSolver::resourceContainsCycles): Check the referenced
28         resources for cycles.
29         (WebCore::SVGResourcesCycleSolver::resolveCycles): Logging update.
30
31 2015-09-17  Dean Jackson  <dino@apple.com>
32
33         Cyclic resources were not detected if the reference had deep containers
34         https://bugs.webkit.org/show_bug.cgi?id=149182
35
36         Reviewed by Jon Honeycutt.
37
38         During our examination of the SVG rendering tree looking for cycles,
39         if a resource pointed to something that had a nested structure, and
40         one of the parent nodes in that structure was a container object
41         without resources itself, we were not looking into the children.
42
43         Test: svg/custom/pattern-content-cycle-w-resourceless-container.html
44
45         * rendering/svg/SVGResourcesCycleSolver.cpp:
46         (WebCore::SVGResourcesCycleSolver::resourceContainsCycles): We should still
47         check all children resources, but not exit early if there are none. Instead
48         we should recurse into any children.
49         (WebCore::SVGResourcesCycleSolver::resolveCycles): Changes to some debug
50         code that no longer compiled (it's still off by default, but at least
51         it will work now).
52
53 2015-09-17  Myles C. Maxfield  <mmaxfield@apple.com>
54
55         REGRESSION(r188871): 50% regression in page load time of Wikipedia home page
56         https://bugs.webkit.org/show_bug.cgi?id=149320
57
58         Reviewed by Daniel Bates.
59
60         This is due to <rdar://problem/22144016> about how language-specific
61         font fallback is an order of magnitude slower than regular non-language-
62         specific font-fallback. This performance problem has been fixed, but not
63         for iOS 9.
64
65         No new tests because there is no correctness change.
66
67         * platform/graphics/ios/FontCacheIOS.mm:
68         (WebCore::platformLookupFallbackFont):
69
70 2015-09-17  Ryosuke Niwa  <rniwa@webkit.org>
71
72         Add HTMLSlotElement, Element.slot, and NonDocumentTypeChildNode.assignedSlot
73         https://bugs.webkit.org/show_bug.cgi?id=149241
74
75         Reviewed by Antti Koivisto.
76
77         Implement the slotting algorithm and related features: slot element, slot attribute, and assignedSlot
78         as specified by https://w3c.github.io/webcomponents/spec/shadow/#slotting-algorithm
79         as of 8bf56e8ea5521a7a911efd1cabeb2be0d5c3ca74.
80
81         The slotting algorithm is implemented by the newly introduced SlotAssignment class which is created on
82         demand by ShadowRoot when a HTMLSlotElement is inserted into the shadow root. SlotAssignment contains
83         a HashMap of a slot name to SlotInfo structure, which holds the number of slot elements of the said name,
84         the first element if it's known, and an ordered list of the assigned nodes.
85
86         When there is exactly one slot element of a given name, "element" returns the slot element in O(1).
87         When another slot of the same name is inserted into the same shadow tree, we increment "elementCount" and
88         set "element" to nullptr since we don't know which slot element comes first in the tree order without O(n)
89         tree traversal, which is lazily done in resolveAllSlotElements.
90
91         Observe that SlotInfo's "element" can be nullptr in two occasions: (1) when there is no slot element of
92         the given name (SlotAssignment::assignSlots may insert such an entry), and (2) when there are more than
93         one slot elements of the same name and we haven't run resolveAllSlotElements.
94
95         Resolving assigned nodes, on the other hand, is always O(n) unless all assignments are up to date, and
96         lazily computed by assignSlots. This is because inserting or removing a node doesn't tell us the relative
97         ordering of the node with respect to other nodes assigned to the same slot. For example, let's say we have
98         child nodes (A, B, C, D) and (A, D) are assigned to slot Alpha and (B, C) are assigned to slot Beta. If we
99         insert a new node E between nodes B and C and this node is assigned to slot Alpha, then we must create an
100         ordered list (A, E, D) for slot Alpha. Unfortunately, determining where to insert E in this list can cost
101         O(n) child traversal in the worst case.
102
103         Tests: fast/shadow-dom/HTMLSlotElement-interface.html
104                fast/shadow-dom/NonDocumentTypeChildNode-interface-assignedSlot.html
105
106         * CMakeLists.txt:
107         * DerivedSources.cpp:
108         * DerivedSources.make:
109         * WebCore.vcxproj/WebCore.vcxproj:
110         * WebCore.vcxproj/WebCore.vcxproj.filters:
111         * WebCore.xcodeproj/project.pbxproj:
112         * dom/Element.cpp:
113         (WebCore::Element::attributeChanged): Invalidate the slot assignments when slot attribute is changed.
114         (WebCore::Element::childrenChanged): Ditto for when a child node is inserted or removed. We can avoid it
115         when there is no default slot and only text nodes are removed or added in the future.
116         * dom/Element.idl: Added slot attribute on Element.
117         * dom/Node.cpp:
118         (WebCore::Node::assignedSlot): Added. Returns the assigned slot if the slot is in an open shadow tree.
119         * dom/Node.h:
120         * dom/NonDocumentTypeChildNode.idl: Added assignedSlot. Only expose in JS for now to avoid generating
121         the binding code for HTMLSlotElement in other languages.
122         * dom/ShadowRoot.cpp:
123         (WebCore::ShadowRoot::findAssignedSlot): Added. Forwards it to the implementation in SlotAssignment.
124         (WebCore::ShadowRoot::addSlotElementByName): Ditto.
125         (WebCore::ShadowRoot::removeSlotElementByName): Ditto.
126         (WebCore::ShadowRoot::invalidateSlotAssignments): Ditto.
127         (WebCore::ShadowRoot::assignedNodesForSlot): Ditto.
128         * dom/ShadowRoot.h:
129         (WebCore::ShadowRoot): Added m_slotAssignments as a member.
130         * dom/SlotAssignment.cpp: Added.
131         (WebCore::treatNullAsEmpty): Added. See https://w3c.github.io/webcomponents/spec/shadow/#dfn-default-slot
132         (WebCore::SlotAssignment::findAssignedSlot): Find the slot element to which a given node is assigned.
133         Since there could be multiple slot elements of the same name (or lack thereof), call findFirstSlotElement
134         to find the first slot element.
135         (WebCore::SlotAssignment::addSlotElementByName): Added. Called when a new slot element is inserted into
136         the associated shadow tree. When a slot element's name is changed, removeSlotElementByName is called on
137         with the old name before addSlotElementByName is called with the new name.
138         (WebCore::SlotAssignment::removeSlotElementByName): Ditto for removal.
139         (WebCore::SlotAssignment::assignedNodesForSlot): Added. Finds the ordered list of assigned nodes for
140         a given slot element. When there are multiple slot elements of the same name, we return the list only if
141         SlotInfo::element matches the argument. 
142         (WebCore::SlotAssignment::findFirstSlotElement): Added. Resolves SlotInfo::element if needed.
143         (WebCore::SlotAssignment::resolveAllSlotElements): Finds SlotInfo::element for all slots. We resolve all
144         slots simultaneously to avoid doing O(number of nodes) tree traversal for O(number of slots) to avoid
145         the worst case O(n^2) behavior when all nodes in the shadow tree are slot elements of the same name. 
146         (WebCore::SlotAssignment::assignSlots): Added. Computes the slot assignments by traversing each child
147         of the shadow host and adding to the appropriate SlotInfo::assignedNodes, creating a new entry if needed.
148         * dom/SlotAssignment.h: Added.
149         (WebCore::SlotAssignment::SlotAssignment):
150         (WebCore::SlotAssignment::invalidate):
151         (WebCore::SlotAssignment::SlotInfo::SlotInfo):
152         (WebCore::SlotAssignment::SlotInfo::hasSlotElements):
153         (WebCore::SlotAssignment::SlotInfo::hasDuplicatedSlotElements):
154         (WebCore::SlotAssignment::SlotInfo::shouldResolveSlotElement):
155         * html/HTMLAttributeNames.in: Added slot attribute.
156         * html/HTMLSlotElement.cpp: Added.
157         (WebCore::HTMLSlotElement::create):
158         (WebCore::HTMLSlotElement::HTMLSlotElement):
159         (WebCore::HTMLSlotElement::insertedInto): Calls addSlotElementByName.
160         (WebCore::HTMLSlotElement::removedFrom): Calls removeSlotElementByName. Because the element had already
161         been removed from the shadow tree, we can't use containingShadowRoot() to find the ShadowRoot here.
162         (WebCore::HTMLSlotElement::attributeChanged): Calls removeSlotElementByName and addSlotElementByName.
163         (WebCore::HTMLSlotElement::getDistributedNodes): Returns an ordered list of the assigned nodes.
164         * html/HTMLSlotElement.h: Added.
165         * html/HTMLSlotElement.idl: Added.
166         * html/HTMLTagNames.in: Added slot element.
167
168 2015-09-17  Chris Dumez  <cdumez@apple.com>
169
170         Regression(r189881): release assertion hit in toJS(ExecState*, JSDOMGlobalObject*, DocumentFragment*)
171         https://bugs.webkit.org/show_bug.cgi?id=149281
172
173         Reviewed by Ryosuke Niwa.
174
175         After r189881, we started generating a toJS() function for DocumentFragment
176         as an optimization. DocumentFragment has a subclass (ShadowRoot) but the
177         default toJS() implementation should have still been acceptable given that
178         the subclass is not web-exposed and therefore does not have a JS wrapper.
179
180         However, the ShadowRoot interface was introduced shortly after in r189841
181         and to toJS() implementation for DocumentFragment is now invalid. This
182         patch introduces a ShadowRoot-aware custom implementation of toJS() for
183         DocumentFragment to address the problem.
184
185         No new tests, already covered by:
186         plugins/snapshotting/snapshot-plugin-not-quite-blocked-by-image.html
187
188         * bindings/js/JSDocumentFragmentCustom.cpp:
189         (WebCore::createNewDocumentFragmentWrapper):
190         (WebCore::toJSNewlyCreated):
191         (WebCore::toJS):
192         Provide a ShadowRoot-aware custom implementation of toJS() /
193         toJSNewlyCreated() for DocumentFragment.
194
195         * bindings/js/JSNodeCustom.cpp:
196         (WebCore::createWrapperInline):
197         Fix bug in toJS() implementation for Node as it was not handling
198         ShadowRoots properly either.
199
200         * dom/DocumentFragment.idl:
201         Use [CustomToJSObject] so we can provide our own custom implementation
202         of toJS().
203
204 2015-09-17  Antti Koivisto  <antti@apple.com>
205
206         De-template ContainerNodeAlgorithms
207         https://bugs.webkit.org/show_bug.cgi?id=149286
208
209         Reviewed by Andreas Kling.
210
211         These are always used with ContainerNode/Node.
212
213         * dom/ContainerNode.cpp:
214         (WebCore::ContainerNode::removeDetachedChildren):
215         (WebCore::destroyRenderTreeIfNeeded):
216         (WebCore::ContainerNode::takeAllChildrenFrom):
217         (WebCore::ContainerNode::insertBeforeCommon):
218         (WebCore::ContainerNode::appendChildCommon):
219
220             Make append a member for consistency with insert.
221
222         (WebCore::ContainerNode::notifyChildInserted):
223         (WebCore::ContainerNode::notifyChildRemoved):
224         (WebCore::ContainerNode::parserInsertBefore):
225         (WebCore::ContainerNode::replaceChild):
226         (WebCore::ContainerNode::appendChild):
227         (WebCore::ContainerNode::parserAppendChild):
228
229             Also make rest of these ownership-taking functions take Ref<>&&.
230
231         * dom/ContainerNode.h:
232         (WebCore::NoEventDispatchAssertion::NoEventDispatchAssertion):
233         (WebCore::ContainerNode::setFirstChild):
234         * dom/ContainerNodeAlgorithms.cpp:
235         (WebCore::notifyChildNodeRemoved):
236         (WebCore::addChildNodesToDeletionQueue):
237         (WebCore::removeDetachedChildrenInContainer):
238         (WebCore::collectFrameOwners):
239         (WebCore::assertConnectedSubrameCountIsConsistent):
240         (WebCore::disconnectSubframes):
241         * dom/ContainerNodeAlgorithms.h:
242         (WebCore::removeDetachedChildrenInContainer): Deleted.
243         (WebCore::appendChildToContainer): Deleted.
244         (WebCore::Private::NodeRemovalDispatcher::dispatch): Deleted.
245         (WebCore::Private::addChildNodesToDeletionQueue): Deleted.
246         * html/parser/HTMLConstructionSite.cpp:
247         (WebCore::insert):
248         (WebCore::executeInsertTask):
249         (WebCore::executeReparentTask):
250         (WebCore::executeInsertAlreadyParsedChildTask):
251         * html/track/WebVTTParser.cpp:
252         (WebCore::WebVTTTreeBuilder::constructTreeFromToken):
253         * xml/XMLErrors.cpp:
254         (WebCore::XMLErrors::appendErrorMessage):
255         (WebCore::createXHTMLParserErrorHeader):
256         (WebCore::XMLErrors::insertErrorMessageBlock):
257         * xml/parser/XMLDocumentParser.cpp:
258         (WebCore::XMLDocumentParser::enterText):
259         (WebCore::toString):
260         * xml/parser/XMLDocumentParserLibxml2.cpp:
261         (WebCore::XMLDocumentParser::startElementNs):
262         (WebCore::XMLDocumentParser::processingInstruction):
263         (WebCore::XMLDocumentParser::cdataBlock):
264         (WebCore::XMLDocumentParser::comment):
265
266 2015-09-17  Tim Horton  <timothy_horton@apple.com>
267
268         Block Objective-C exceptions in DictionaryLookup
269         https://bugs.webkit.org/show_bug.cgi?id=149256
270
271         Reviewed by Anders Carlsson.
272
273         * editing/mac/DictionaryLookup.mm:
274         (WebCore::DictionaryLookup::rangeForSelection):
275         (WebCore::DictionaryLookup::rangeAtHitTestResult):
276         (WebCore::expandSelectionByCharacters):
277         (WebCore::DictionaryLookup::stringForPDFSelection):
278         (WebCore::showPopupOrCreateAnimationController):
279         (WebCore::DictionaryLookup::hidePopup):
280         It is possible for Lookup to throw an exception if one of its
281         related services dies for some reason. This shouldn't take down
282         our UI process, so block the exceptions.
283
284 2015-09-17  Yusuke Suzuki  <utatane.tea@gmail.com>
285
286         [ES6] Add more fine-grained APIs and additional hooks to control module loader from WebCore
287         https://bugs.webkit.org/show_bug.cgi?id=149129
288
289         Reviewed by Saam Barati.
290
291         No behavior change.
292
293         * bindings/js/JSDOMWindowBase.cpp:
294         * bindings/js/JSWorkerGlobalScopeBase.cpp:
295
296 2015-09-17  Alex Christensen  <achristensen@webkit.org>
297
298         Switch AppleWin build to use CMake
299         https://bugs.webkit.org/show_bug.cgi?id=149163
300
301         Reviewed by Brent Fulgham.
302
303         * bindings/scripts/preprocess-idls.pl:
304         (CygwinPathIfNeeded):
305         (WriteFileIfChanged):
306         * bindings/scripts/preprocessor.pm:
307         (applyPreprocessor):
308         Fix new cygwin quirks.  Cygwin is now using some paths from CMake.
309
310 2015-09-17  Zalan Bujtas  <zalan@apple.com>
311
312         Remove integral snapping functions from InlineBox class.
313         https://bugs.webkit.org/show_bug.cgi?id=136419
314
315         Reviewed by Simon Fraser.
316
317         We should not integral snap inlines during layout time.
318
319         Covered by existing tests.
320
321         * rendering/InlineBox.h:
322         (WebCore::InlineBox::pixelSnappedLogicalLeft): Deleted.
323         (WebCore::InlineBox::pixelSnappedLogicalRight): Deleted.
324         (WebCore::InlineBox::pixelSnappedLogicalTop): Deleted.
325         (WebCore::InlineBox::pixelSnappedLogicalBottom): Deleted.
326         * rendering/InlineFlowBox.cpp:
327         (WebCore::InlineFlowBox::placeBoxesInBlockDirection):
328         (WebCore::InlineFlowBox::addBoxShadowVisualOverflow):
329         (WebCore::InlineFlowBox::addBorderOutsetVisualOverflow):
330         (WebCore::InlineFlowBox::addTextBoxVisualOverflow):
331
332 2015-09-17  Per Arne Vollan  <peavo@outlook.com>
333
334         [WinCairo] Compile error, include file not found.
335         https://bugs.webkit.org/show_bug.cgi?id=149282
336
337         Reviewed by Alex Christensen.
338
339         * PlatformWin.cmake:
340         Copy forwarding headers from new legacy directory, fixing CMake clean builds since r189746.
341
342 2015-09-17  Tim Horton  <timothy_horton@apple.com>
343
344         Delete some dead code
345         https://bugs.webkit.org/show_bug.cgi?id=149255
346
347         Reviewed by Dan Bernstein.
348
349         No new tests, just cleanup.
350
351         * platform/RuntimeApplicationChecksIOS.h:
352         * platform/RuntimeApplicationChecksIOS.mm:
353         (WebCore::applicationIsEpicurious): Deleted.
354         (WebCore::applicationIsMASH): Deleted.
355         Nothing uses these application checks anymore.
356
357         * platform/ios/SoundIOS.mm:
358         (WebCore::systemBeep):
359         What a beep should be on iOS, I don't know.
360         What it should not be is a NSLog.
361
362 2015-09-17  Saam barati  <sbarati@apple.com>
363
364         Interpreter::unwind() shouldn't be responsible for filtering out uncatchable exceptions
365         https://bugs.webkit.org/show_bug.cgi?id=149228
366
367         Reviewed by Mark Lam.
368
369         No new tests, already covered by current tests. This is not an observable behavior change.
370
371         * bindings/js/JSNodeFilterCustom.cpp:
372         (WebCore::JSNodeFilter::acceptNode):
373
374 2015-09-17  Zalan Bujtas  <zalan@apple.com>
375
376         column-rule-style: outset/inset doesn't work
377         https://bugs.webkit.org/show_bug.cgi?id=148815
378         <rdar://problem/22582644>
379
380         Reviewed by David Hyatt.
381
382         https://drafts.csswg.org/css-multicol-1/#crs
383         The <‘border-style’> values are interpreted as in the collapsing border model.
384
385         Unskipped 4 multicolumn tests, 
386
387         * rendering/RenderMultiColumnSet.cpp:
388         (WebCore::RenderMultiColumnSet::paintColumnRules):
389         * rendering/RenderTableCell.cpp:
390         (WebCore::collapsedBorderStyle): Deleted.
391         * rendering/style/RenderStyle.h:
392         (WebCore::collapsedBorderStyle):
393
394 2015-09-17  Chris Dumez  <cdumez@apple.com>
395
396         Range.deleteContents cannot delete DocType
397         https://bugs.webkit.org/show_bug.cgi?id=148773
398         <rdar://problem/22571280>
399
400         Reviewed by Ryosuke Niwa.
401
402         Range.deleteContents() was not able to delete a DocumentType Node, and
403         was throwing a HIERARCHY_REQUEST_ERR. The DOM specification does not
404         say we should throw in such case:
405         https://dom.spec.whatwg.org/#dom-range-deletecontents
406
407         However, Range.extractContents() should still throw an exception
408         if any of the contained children in a DocumentType Node:
409         https://dom.spec.whatwg.org/#concept-range-extract (Step 12)
410
411         No new tests, already covered by existing test.
412
413         * dom/Range.cpp:
414         (WebCore::Range::deleteContents):
415         (WebCore::Range::extractContents):
416         (WebCore::Range::checkDeleteExtract):
417         * dom/Range.h:
418
419 2015-09-17  Eric Carlson  <eric.carlson@apple.com>
420
421         [Mac MediaStream] Cleanup capture source classes
422         https://bugs.webkit.org/show_bug.cgi?id=149233
423
424         Reviewed by Jer Noble.
425
426         * platform/cf/CoreMediaSoftLink.cpp: Soft-link CMAudioFormatDescriptionGetStreamBasicDescription,
427           CMSampleBufferGetAudioBufferListWithRetainedBlockBuffer, and CMSampleBufferGetNumSamples.
428         * platform/cf/CoreMediaSoftLink.h:
429
430         * platform/mediastream/mac/AVAudioCaptureSource.h:
431         (WebCore::AVAudioCaptureSource::Observer::~Observer):
432         * platform/mediastream/mac/AVAudioCaptureSource.mm:
433         (WebCore::AVAudioCaptureSource::AVAudioCaptureSource): Initialize m_inputDescription.
434         (WebCore::AVAudioCaptureSource::capabilities): 0 -> nullptr.
435         (WebCore::AVAudioCaptureSource::addObserver): New, add an observer and tell it to prepare.
436         (WebCore::AVAudioCaptureSource::removeObserver): New.
437         (WebCore::operator==): Compare AudioStreamBasicDescription.
438         (WebCore::operator!=):
439         (WebCore::AVAudioCaptureSource::captureOutputDidOutputSampleBufferFromConnection): Call 
440           observer->prepare when passed a new stream description, call observer->process.
441
442         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
443         (WebCore::refreshCaptureDeviceList): Set m_groupID and m_localizedName.
444         (WebCore::AVCaptureDeviceManager::sessionSupportsConstraint): Invalid constraint names should
445           be ignored, so return true when passed one.
446         (WebCore::AVCaptureDeviceManager::getSourcesInfo): This just didn't work, fix it.
447         (WebCore::AVCaptureDeviceManager::verifyConstraintsForMediaType): Optional constraints are
448           optional so they don't need to be validated.
449         (WebCore::AVCaptureDeviceManager::bestSourcesForTypeAndConstraints): m_audioSource -> m_audioAVMediaCaptureSource,
450           m_videoSource -> m_videoAVMediaCaptureSource.
451         (WebCore::AVCaptureDeviceManager::sourceWithUID): Ditto.
452
453         * platform/mediastream/mac/AVMediaCaptureSource.h:
454         (WebCore::AVMediaCaptureSource::session):
455         (WebCore::AVMediaCaptureSource::device):
456         (WebCore::AVMediaCaptureSource::currentStates):
457         (WebCore::AVMediaCaptureSource::constraints):
458         (WebCore::AVMediaCaptureSource::statesDidChanged):
459         (WebCore::AVMediaCaptureSource::createWeakPtr):
460         (WebCore::AVMediaCaptureSource::buffer): Deleted.
461         (WebCore::AVMediaCaptureSource::setBuffer): Deleted.
462         * platform/mediastream/mac/AVMediaCaptureSource.mm:
463         (WebCore::AVMediaCaptureSource::AVMediaCaptureSource): Initilize m_weakPtrFactory.
464         (WebCore::AVMediaCaptureSource::scheduleDeferredTask): New, call a function asynchronously on
465           the main thread.
466         (-[WebCoreAVMediaCaptureSourceObserver captureOutput:didOutputSampleBuffer:fromConnection:]): Don't
467           dispatch calls to the main thread, let the derived classes do that if necessary.
468
469         * platform/mediastream/mac/AVVideoCaptureSource.h:
470         (WebCore::AVVideoCaptureSource::width):
471         (WebCore::AVVideoCaptureSource::height):
472         (WebCore::AVVideoCaptureSource::previewLayer):
473         (WebCore::AVVideoCaptureSource::currentFrameSampleBuffer):
474         * platform/mediastream/mac/AVVideoCaptureSource.mm:
475         (WebCore::AVVideoCaptureSource::setFrameRateConstraint): Remove unwanted logging.
476         (WebCore::AVVideoCaptureSource::setupCaptureSession): Configure the AVCaptureVideoDataOutput so
477           it delivers 32-bit BGRA samples.
478         (WebCore::AVVideoCaptureSource::calculateFramerate): Return bool to signal if the frame rate
479           changed.
480         (WebCore::AVVideoCaptureSource::processNewFrame): New. Process sample buffer, invalidate cached
481           image, signal when characteristics change.
482         (WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection): Schedule
483           call to processNewFrame on the main thread so we do all video processing on main thread.
484         (WebCore::AVVideoCaptureSource::currentFrameImage): Create and return a CVImageBuffer of the
485           current video frame.
486         (WebCore::AVVideoCaptureSource::paintCurrentFrameInContext): Draw the current frame to a context.
487
488 2015-09-15  Sergio Villar Senin  <svillar@igalia.com>
489
490         [CSS Grid Layout]  Using automatic (instead of min-content) minimums for 'auto' tracks
491         https://bugs.webkit.org/show_bug.cgi?id=142329
492
493         Reviewed by Darin Adler.
494
495         Based on Blink's r198697 by <svillar@igalia.com> and r200478 by <jfernandez@igalia.com>
496
497         More precisely (syntax-wise), this would allow 'auto' to be used within the
498         minmax() function (it's currently forbidden) and have the 'auto' keyword map
499         to minmax(auto, auto) instead of minmax(min-content, max-content).
500         - As a minimum, 'auto' would mean "use the specified minimum size, or if
501         that is auto, treat as 0 or min-content per Flexbox rules".
502         - As a maximum, 'auto' would mean "use the max-content size".
503
504         Regarding the implementation, a new phase is added to the track sizing
505         algorithm called ResolveIntrinsicMinimums (the former ResolveIntrinsicMinimums
506         is now called ResolveContentBasedMinimums which does not include 'auto'
507         resolution) which will be run before any other. This phase uses the minimum
508         size of grid items (as specified by min-width/height).
509
510         Tests: fast/css-grid-layout/grid-automatic-minimum-for-auto-columns.html
511                fast/css-grid-layout/grid-automatic-minimum-for-auto-rows.html
512
513         * css/CSSParser.cpp:
514         (WebCore::CSSParser::parseGridBreadth):
515         * rendering/RenderGrid.cpp:
516         (WebCore::RenderGrid::computeUsedBreadthOfMinLength):
517         (WebCore::RenderGrid::computeUsedBreadthOfMaxLength):
518         (WebCore::RenderGrid::minSizeForChild):
519         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
520         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForNonSpanningItems):
521         (WebCore::RenderGrid::trackSizeForTrackSizeComputationPhase):
522         (WebCore::RenderGrid::shouldProcessTrackForTrackSizeComputationPhase):
523         (WebCore::RenderGrid::trackShouldGrowBeyondGrowthLimitsForTrackSizeComputationPhase):
524         (WebCore::RenderGrid::markAsInfinitelyGrowableForTrackSizeComputationPhase):
525         (WebCore::RenderGrid::updateTrackSizeForTrackSizeComputationPhase):
526         (WebCore::RenderGrid::currentItemSizeForTrackSizeComputationPhase):
527         * rendering/RenderGrid.h:
528         * rendering/style/GridTrackSize.h:
529         (WebCore::GridTrackSize::minTrackBreadth):
530         (WebCore::GridTrackSize::maxTrackBreadth):
531         (WebCore::GridTrackSize::cacheMinMaxTrackBreadthTypes):
532         (WebCore::GridTrackSize::hasIntrinsicMinTrackBreadth):
533         (WebCore::GridTrackSize::hasAutoMinTrackBreadth):
534         (WebCore::GridTrackSize::hasAutoMaxTrackBreadth):
535         (WebCore::GridTrackSize::hasMaxContentOrAutoMaxTrackBreadth):
536         (WebCore::GridTrackSize::hasAutoOrMinContentMinTrackBreadthAndIntrinsicMaxTrackBreadth):
537         (WebCore::GridTrackSize::hasMinContentMinTrackBreadthAndMinOrMaxContentMaxTrackBreadth): Deleted.
538
539 2015-09-17  Javier Fernandez  <jfernandez@igalia.com>
540
541         [CSS Grid Layout] Relayout whenever Box Alignment properties change
542         https://bugs.webkit.org/show_bug.cgi?id=148070
543
544         Reviewed by Darin Adler.
545
546         We were Reattaching the styles to the RenderTree whenever Content Alignment
547         properties (align-items and justify-items) changed their values, since the
548         Self Alignment properties depend on such values to resolve 'auto' values
549         during layout.
550
551         This patch removes such restriction, since we resolve the auto values
552         whenever we access the alignment properties. The only thing we need to
553         do is to mark a grid item for layout whenever the Default Alignment
554         properties change from/to stretch, since it implies a resize of the grid
555         items using 'auto' values for the Self Alignment properties.
556
557         Tests: fast/css-grid-layout/relayout-align-items-changed.html
558                fast/css-grid-layout/relayout-align-self-changed.html
559                fast/css-grid-layout/relayout-justify-items-changed.html
560                fast/css-grid-layout/relayout-justify-self-changed.html
561                fast/repaint/align-items-change.html
562                fast/repaint/align-items-overflow-change.html
563                fast/repaint/align-self-change.html
564                fast/repaint/align-self-overflow-change.html
565                fast/repaint/justify-items-change.html
566                fast/repaint/justify-items-legacy-change.html
567                fast/repaint/justify-items-overflow-change.html
568                fast/repaint/justify-self-change.html
569                fast/repaint/justify-self-overflow-change.html
570
571         * rendering/RenderGrid.cpp:
572         (WebCore::defaultAlignmentIsStretch):
573         (WebCore::RenderGrid::styleDidChange):
574         * rendering/RenderGrid.h:
575         * rendering/style/RenderStyle.cpp:
576         (WebCore::RenderStyle::resolveAlignmentOverflow):
577         (WebCore::RenderStyle::changeRequiresLayout):
578         * style/StyleResolveTree.cpp:
579         (WebCore::Style::determineChange): Deleted.
580
581 2015-09-16  Carlos Garcia Campos  <cgarcia@igalia.com>
582
583         printing does not use minimum page zoom factor
584         https://bugs.webkit.org/show_bug.cgi?id=108507
585
586         Reviewed by Darin Adler.
587
588         * page/PrintContext.cpp:
589         (WebCore::PrintContext::beginAndComputePageRectsWithPageSize):
590         Helper function to share common code from numberOfPages() and
591         spoolAllPagesWithBoundaries().
592         (WebCore::PrintContext::numberOfPages): Use beginAndComputePageRectsWithPageSize().
593         (WebCore::PrintContext::spoolAllPagesWithBoundaries): Use
594         beginAndComputePageRectsWithPageSize() and don't flip the Y axis
595         for non Cocoa platforms.
596         * page/PrintContext.h:
597
598 2015-09-16  Ryosuke Niwa  <rniwa@webkit.org>
599
600         removeShadow shouldn't call ChildNodeRemovalNotifier with the shadow host as the removal point
601         https://bugs.webkit.org/show_bug.cgi?id=149244
602
603         Reviewed by Antti Koivisto.
604
605         Since a shadow host is in a different tree than nodes in its shadow tree, it's incorrect to call
606         removedFrom with the shadow host as the removal point. This causes HTMLSlotElement::removedFrom
607         which will be added in the bug 149241 to call methods on a wrong ShadowRoot.
608
609         We still keep the ad-hoc behavior of using the shadow host as the insertion/removal point when
610         calling insertedInto and removedFrom on the shadow root itself to update the InDocument node flag.
611         We may want to re-visit this design in the future.
612
613         No new tests since I couldn't quite create a reduction. However, tests I'm adding in the bug 149241
614         will crash without this change.
615
616         I separated this patch from the bug 149241 to isolate the high-risk code change here.
617
618         * dom/Element.cpp:
619         (WebCore::Element::addShadowRoot): Call insertedInto on ShadowRoot, and then call it on all its
620         children separately with the insertion point set to the shadow root since insertedInto relies on
621         insertion point's inDocument flag to be true when the shadow host is in the document.
622         (WebCore::Element::removeShadowRoot): Ditto in the reverse order.
623
624 2015-09-16  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
625
626         Remove all uses of PassRefPtr in WebCore/inspector
627         https://bugs.webkit.org/show_bug.cgi?id=149156
628
629         Reviewed by Darin Adler.
630
631         * inspector/DOMEditor.cpp:
632         (WebCore::DOMEditor::InsertBeforeAction::InsertBeforeAction):
633         (WebCore::DOMEditor::ReplaceChildNodeAction::ReplaceChildNodeAction):
634         (WebCore::DOMEditor::insertBefore):
635         (WebCore::DOMEditor::replaceChild):
636         * inspector/DOMEditor.h:
637         * inspector/DOMPatchSupport.cpp:
638         (WebCore::DOMPatchSupport::removeChildAndMoveToNew):
639         * inspector/InspectorDOMAgent.cpp:
640         (WebCore::InspectorDOMAgent::highlightSelector):
641         * inspector/InspectorDatabaseAgent.cpp:
642         (WebCore::InspectorDatabaseAgent::didOpenDatabase):
643         * inspector/InspectorDatabaseAgent.h:
644         * inspector/InspectorDatabaseInstrumentation.h:
645         * inspector/InspectorDatabaseResource.h:
646         (WebCore::InspectorDatabaseResource::setDatabase):
647         * inspector/InspectorFrontendHost.cpp:
648         (WebCore::FrontendMenuProvider::create):
649         * inspector/InspectorInstrumentation.cpp:
650         (WebCore::InspectorInstrumentation::didOpenDatabaseImpl):
651         * inspector/InspectorLayerTreeAgent.h:
652         * inspector/InspectorOverlay.cpp:
653         (WebCore::InspectorOverlay::highlightNodeList):
654         * inspector/InspectorOverlay.h:
655         * inspector/InspectorPageAgent.cpp:
656         (WebCore::InspectorPageAgent::sharedBufferContent):
657         * inspector/InspectorPageAgent.h:
658         * inspector/InspectorResourceAgent.cpp:
659         * inspector/InspectorTimelineAgent.cpp:
660         (WebCore::startProfiling):
661         (WebCore::stopProfiling):
662         (WebCore::InspectorTimelineAgent::stopFromConsole):
663         * inspector/InspectorTimelineAgent.h:
664         * inspector/InspectorWorkerResource.h:
665         (WebCore::InspectorWorkerResource::create):
666         * inspector/InstrumentingAgents.h:
667         * inspector/NetworkResourcesData.cpp:
668         (WebCore::createOtherResourceTextDecoder):
669         (WebCore::NetworkResourcesData::addResourceSharedBuffer):
670         * inspector/NetworkResourcesData.h:
671         * inspector/TimelineRecordFactory.cpp:
672         (WebCore::createQuad):
673         * inspector/WebInjectedScriptHost.h:
674         * inspector/WebInjectedScriptManager.cpp:
675         (WebCore::WebInjectedScriptManager::WebInjectedScriptManager):
676         * inspector/WebInjectedScriptManager.h:
677
678 2015-09-16  Brady Eidson  <beidson@apple.com>
679
680         Have window.indexedDB.open return an IDBOpenDBRequest.
681         https://bugs.webkit.org/show_bug.cgi?id=149234
682
683         Reviewed by Alex Christensen.
684
685         Test: storage/indexeddb/modern/opendatabase-request.html
686
687         * Modules/indexeddb/client/IDBFactoryImpl.cpp:
688         (WebCore::IDBClient::IDBFactory::open):
689         (WebCore::IDBClient::IDBFactory::openInternal):
690         * Modules/indexeddb/client/IDBFactoryImpl.h:
691
692 2015-09-16  Antti Koivisto  <antti@apple.com>
693
694         Turn ChildNodeInsertion/RemovalNotifier classes into functions
695         https://bugs.webkit.org/show_bug.cgi?id=149236
696
697         Reviewed by Ryosuke Niwa.
698
699         Less architecture, more readability.
700
701         * dom/ContainerNode.cpp:
702         (WebCore::ContainerNode::notifyChildInserted):
703         (WebCore::ContainerNode::notifyChildRemoved):
704         (WebCore::ContainerNode::removeChildren):
705         * dom/ContainerNodeAlgorithms.cpp:
706         (WebCore::notifyDescendantInsertedIntoDocument):
707         (WebCore::notifyDescendantInsertedIntoTree):
708         (WebCore::notifyNodeInsertedIntoDocument):
709         (WebCore::notifyNodeInsertedIntoTree):
710         (WebCore::notifyChildNodeInserted):
711         (WebCore::notifyNodeRemovedFromDocument):
712         (WebCore::notifyNodeRemovedFromTree):
713         (WebCore::notifyChildNodeRemoved):
714         (WebCore::ChildNodeInsertionNotifier::notifyDescendantInsertedIntoDocument): Deleted.
715         (WebCore::ChildNodeInsertionNotifier::notifyDescendantInsertedIntoTree): Deleted.
716         (WebCore::ChildNodeRemovalNotifier::notifyDescendantRemovedFromDocument): Deleted.
717         (WebCore::ChildNodeRemovalNotifier::notifyDescendantRemovedFromTree): Deleted.
718         * dom/ContainerNodeAlgorithms.h:
719         (WebCore::ChildNodeInsertionNotifier::ChildNodeInsertionNotifier): Deleted.
720         (WebCore::ChildNodeRemovalNotifier::ChildNodeRemovalNotifier): Deleted.
721         (WebCore::ChildNodeInsertionNotifier::notifyNodeInsertedIntoDocument): Deleted.
722         (WebCore::ChildNodeInsertionNotifier::notifyNodeInsertedIntoTree): Deleted.
723         (WebCore::ChildNodeInsertionNotifier::notify): Deleted.
724         (WebCore::ChildNodeRemovalNotifier::notifyNodeRemovedFromDocument): Deleted.
725         (WebCore::ChildNodeRemovalNotifier::notifyNodeRemovedFromTree): Deleted.
726         (WebCore::ChildNodeRemovalNotifier::notify): Deleted.
727         * dom/Element.cpp:
728         (WebCore::Element::addShadowRoot):
729         (WebCore::Element::removeShadowRoot):
730         (WebCore::Element::createShadowRoot):
731
732 2015-09-16  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
733
734         Remove all uses of PassRefPtr in WebCore/bindings
735         https://bugs.webkit.org/show_bug.cgi?id=149207
736
737         Reviewed by Darin Adler.
738
739         If RefPtr<>&& argument is passed to new variable or other function, we use copyRef() or WTF::move().
740         copyRef() should be used when the argument continues to be used in following code. If it is final use
741         inside function, we have to use WTF::move().
742
743         * bridge/NP_jsobject.cpp:
744         * bridge/NP_jsobject.h:
745         * bridge/c/CRuntimeObject.cpp:
746         (JSC::Bindings::CRuntimeObject::CRuntimeObject):
747         * bridge/c/CRuntimeObject.h:
748         (JSC::Bindings::CRuntimeObject::create):
749         * bridge/c/c_instance.cpp:
750         (JSC::Bindings::CInstance::CInstance):
751         * bridge/c/c_instance.h:
752         (JSC::Bindings::CInstance::create):
753         * bridge/jsc/BridgeJSC.cpp:
754         (JSC::Bindings::Array::Array):
755         (JSC::Bindings::Instance::Instance):
756         * bridge/jsc/BridgeJSC.h:
757         * bridge/objc/ObjCRuntimeObject.h:
758         (JSC::Bindings::ObjCRuntimeObject::create):
759         * bridge/objc/ObjCRuntimeObject.mm:
760         (JSC::Bindings::ObjCRuntimeObject::ObjCRuntimeObject):
761         * bridge/objc/WebScriptObjectProtocol.h:
762         * bridge/objc/objc_instance.h:
763         * bridge/objc/objc_instance.mm:
764         (ObjcInstance::ObjcInstance):
765         (ObjcInstance::create):
766         * bridge/objc/objc_runtime.h:
767         * bridge/objc/objc_runtime.mm:
768         (JSC::Bindings::ObjcArray::ObjcArray):
769         * bridge/runtime_object.cpp:
770         (JSC::Bindings::RuntimeObject::RuntimeObject):
771         * bridge/runtime_object.h:
772         * bridge/runtime_root.cpp:
773         (JSC::Bindings::RootObject::create):
774         * bridge/runtime_root.h:
775
776 2015-09-16  Chris Dumez  <cdumez@apple.com>
777
778         Element's attribute NS API should defined treat undefined namespace as null
779         https://bugs.webkit.org/show_bug.cgi?id=149238
780         <rdar://problem/22562204>
781
782         Reviewed by Ryosuke Niwa.
783
784         Element's attribute NS API should treat defined undefined namespace as null
785         instead of converting it to the "undefined" String. This is because the
786         namespace parameter is a nullable String as per the DOM spec:
787         - https://dom.spec.whatwg.org/#element
788
789         The attribute is nullable and WebIDL says undefined should be converted
790         to null for nullable parameters:
791         - https://heycam.github.io/webidl/#es-nullable-type (step 3)
792
793         Firefox follows the specification.
794
795         No new tests, already covered by existing test.
796
797         * dom/Element.idl:
798
799 2015-09-16  Chris Dumez  <cdumez@apple.com>
800
801         Possible small iOS PLT regression from r189537
802         https://bugs.webkit.org/show_bug.cgi?id=149232
803
804         Reviewed by Ryosuke Niwa.
805
806         r189537 may have regressed PLT a bit on iOS. That change added a couple
807         of extra branches to throw exceptions. This patch marks those branches
808         as UNLIKELY() as we already do for other similar checks in the JS
809         bindings.
810
811         * bindings/scripts/CodeGeneratorJS.pm:
812         (GenerateImplementation):
813         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
814         (webkit_dom_test_obj_get_property):
815         (webkit_dom_test_obj_class_init):
816         (webkit_dom_test_obj_get_strict_type_checking_attribute):
817         (webkit_dom_test_obj_set_strict_type_checking_attribute):
818         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
819         * bindings/scripts/test/JS/JSTestObj.cpp:
820         (WebCore::jsTestObjStrictTypeCheckingAttribute):
821         (WebCore::setJSTestObjStrictTypeCheckingAttribute):
822         * bindings/scripts/test/ObjC/DOMTestObj.h:
823         * bindings/scripts/test/ObjC/DOMTestObj.mm:
824         (-[DOMTestObj strictTypeCheckingAttribute]):
825         (-[DOMTestObj setStrictTypeCheckingAttribute:]):
826         * bindings/scripts/test/TestObj.idl:
827         * html/HTMLTableElement.cpp:
828         (WebCore::HTMLTableElement::setTHead):
829         (WebCore::HTMLTableElement::setTFoot):
830
831 2015-09-16  Joseph Pecoraro  <pecoraro@apple.com>
832
833         Web Inspector: Fix common typo "supress" => "suppress"
834         https://bugs.webkit.org/show_bug.cgi?id=149199
835
836         Reviewed by Gyuyoung Kim.
837
838         * html/shadow/ContentDistributor.h:
839         (WebCore::ContentDistributor::needsDistribution):
840         * page/ContentSecurityPolicy.cpp:
841         (WebCore::ContentSecurityPolicy::reportViolation):
842         * platform/NotImplemented.h:
843         * platform/graphics/ca/win/LayerChangesFlusher.cpp:
844         (WebCore::LayerChangesFlusher::hookCallback):
845         * platform/mac/HIDGamepadProvider.cpp:
846         (WebCore::HIDGamepadProvider::deviceRemoved):
847         * platform/win/makesafeseh.asm:
848
849 2015-09-16  Chris Dumez  <cdumez@apple.com>
850
851         WebIDL: Rename [ReturnNewObject] to [NewObject] and use it more consistently in DOM
852         https://bugs.webkit.org/show_bug.cgi?id=149192
853
854         Reviewed by Darin Adler.
855
856         Rename [ReturnNewObject] to [NewObject] and use it more consistently in
857         DOM.
858
859         This aligns our IDL extended attribute naming with standard Web IDL:
860         https://heycam.github.io/webidl/#NewObject
861
862         We already have [ReturnNewObject] in most places that the DOM
863         specification uses [NewObject] but we are missing a few so I'll
864         fix this as well:
865         https://dom.spec.whatwg.org/#interface-document
866
867         Using [NewObject] lets the bindings generator know that the API in
868         question always returns new objects and that we can bypass the check
869         for existing wrappers and directly create a new wrapper for the
870         returned object.
871
872         This patch also adds support for generating the toJSNewlyCreated()
873         utility function for most types. Previously, to use [ReturnNewObject]
874         for a new type, you needed to add the type to a hard-coded list in
875         the bindings generator then provide your own implementation for
876         toJSNewlyCreated() as custom bindings.
877
878         No new-exposed behavior change.
879
880         * bindings/js/JSDocumentCustom.cpp:
881         * bindings/js/JSEventCustom.cpp:
882         * bindings/js/JSNodeListCustom.cpp:
883         Add toJSNewlyCreated() custom implementation for Node, Event and
884         Document, that shares code with the existing toJS() implementation for
885         those types.
886
887         * bindings/js/JSCDATASectionCustom.cpp: Removed.
888         * bindings/js/JSTextCustom.cpp: Removed.
889         * bindings/js/JSTouchCustom.cpp: Removed.
890         * bindings/js/JSTouchListCustom.cpp: Removed.
891         Drop several custom bindings files as the bindings generator is
892         now able to generate the toJSNewlyCreated() utility function for
893         most types.
894
895         * bindings/scripts/CodeGeneratorJS.pm:
896         - Rename [ReturnNewObject] to [NewObject].
897         - Generate a toJSNewlyCreated() whenever we generate a toJS() already.
898           Get rid of the hard-coded list of types that need a
899           toJSNewlyCreated().
900
901         * bindings/scripts/IDLAttributes.txt:
902         Rename [ReturnNewObject] to [NewObject].
903
904         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
905         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
906         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
907         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
908         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
909         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
910         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
911         * bindings/scripts/test/JS/JSTestEventConstructor.h:
912         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
913         * bindings/scripts/test/JS/JSTestEventTarget.h:
914         * bindings/scripts/test/JS/JSTestException.cpp:
915         * bindings/scripts/test/JS/JSTestException.h:
916         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
917         * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
918         * bindings/scripts/test/JS/JSTestInterface.cpp:
919         * bindings/scripts/test/JS/JSTestInterface.h:
920         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
921         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
922         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
923         * bindings/scripts/test/JS/JSTestNamedConstructor.h:
924         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
925         * bindings/scripts/test/JS/JSTestNondeterministic.h:
926         * bindings/scripts/test/JS/JSTestObj.cpp:
927         * bindings/scripts/test/JS/JSTestObj.h:
928         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
929         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
930         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
931         * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
932         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
933         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
934         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
935         * bindings/scripts/test/JS/JSTestTypedefs.h:
936         * bindings/scripts/test/JS/JSattribute.cpp:
937         * bindings/scripts/test/JS/JSattribute.h:
938         * bindings/scripts/test/JS/JSreadonly.cpp:
939         * bindings/scripts/test/JS/JSreadonly.h:
940         Rebaseline bindings tests.
941
942         * dom/Attr.idl:
943         * dom/CDATASection.idl:
944         * dom/Comment.idl:
945         * dom/DocumentFragment.idl:
946         * dom/DocumentType.idl:
947         * dom/EntityReference.idl:
948         * dom/ProcessingInstruction.idl:
949         Add [JSGenerateToJSObject] so that the bindings generator generates
950         a toJS() / toJSNewlyCreated() for this type. While it is not strictly
951         needed, it avoids falling back to using the toJS() from Node which
952         calls the virtual nodeType() function to determine the node type.
953         This change was made for efficiency purposes.
954
955         * dom/DOMImplementation.idl:
956         Rename [ReturnNewObject] to [NewObject] and add it to createHTMLDocument()
957         as well, as per the specification:
958         https://dom.spec.whatwg.org/#interface-domimplementation
959
960         * dom/Document.idl:
961         Rename [ReturnNewObject] to [NewObject] and add it to more operations
962         as per he DOM specification:
963         https://dom.spec.whatwg.org/#document
964
965         * dom/Node.idl:
966         Add [NewObject] to cloneNode() as per the DOM specification:
967         https://dom.spec.whatwg.org/#node
968
969         * dom/ParentNode.idl:
970         Add [NewObject] to querySelectorAll() as per the DOM specification:
971         https://dom.spec.whatwg.org/#parentnode
972
973         * dom/Range.idl:
974         Add [NewObject] for several operations, as per the DOM specification:
975         https://dom.spec.whatwg.org/#interface-range
976
977 2015-09-16  Brady Eidson  <beidson@apple.com>
978
979         Have window.indexedDB.deleteDatabase return an IDBOpenDBRequest.
980         https://bugs.webkit.org/show_bug.cgi?id=149229
981
982         Reviewed by Alex Christensen.
983
984         Test: storage/indexeddb/modern/deletedatabase-request.html
985               storage/indexeddb/modern/deletedatabase-null-name-exception.html
986
987         * CMakeLists.txt:
988         * WebCore.xcodeproj/project.pbxproj:
989
990         * Modules/indexeddb/IDBDatabaseIdentifier.cpp: Added.
991         (WebCore::IDBDatabaseIdentifier::IDBDatabaseIdentifier):
992         * Modules/indexeddb/IDBDatabaseIdentifier.h: Added.
993         (WebCore::IDBDatabaseIdentifier::IDBDatabaseIdentifier):
994         (WebCore::IDBDatabaseIdentifier::isHashTableDeletedValue):
995         (WebCore::IDBDatabaseIdentifier::hash):
996         (WebCore::IDBDatabaseIdentifier::isValid):
997         (WebCore::IDBDatabaseIdentifier::operator==):
998         (WebCore::IDBDatabaseIdentifier::databaseName):
999         (WebCore::IDBDatabaseIdentifierHash::hash):
1000         (WebCore::IDBDatabaseIdentifierHash::equal):
1001         (WebCore::IDBDatabaseIdentifierHashTraits::isEmptyValue):
1002
1003         * Modules/indexeddb/client/IDBFactoryImpl.cpp:
1004         (WebCore::IDBClient::shouldThrowSecurityException):
1005         (WebCore::IDBClient::IDBFactory::getDatabaseNames):
1006         (WebCore::IDBClient::IDBFactory::open):
1007         (WebCore::IDBClient::IDBFactory::deleteDatabase):
1008         * Modules/indexeddb/client/IDBFactoryImpl.h:
1009
1010         * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp: Copied from Source/WebCore/Modules/indexeddb/client/IDBFactoryImpl.cpp.
1011         (WebCore::IDBClient::IDBOpenDBRequest::IDBOpenDBRequest):
1012         * Modules/indexeddb/client/IDBOpenDBRequestImpl.h: Copied from Source/WebCore/Modules/indexeddb/client/IDBFactoryImpl.cpp.
1013         (WebCore::IDBClient::IDBOpenDBRequest::create):
1014
1015         * Modules/indexeddb/client/IDBRequestImpl.cpp: Copied from Source/WebCore/Modules/indexeddb/client/IDBFactoryImpl.cpp.
1016         (WebCore::IDBClient::IDBRequest::IDBRequest):
1017         (WebCore::IDBClient::IDBRequest::result):
1018         (WebCore::IDBClient::IDBRequest::errorCode):
1019         (WebCore::IDBClient::IDBRequest::error):
1020         (WebCore::IDBClient::IDBRequest::source):
1021         (WebCore::IDBClient::IDBRequest::transaction):
1022         (WebCore::IDBClient::IDBRequest::readyState):
1023         (WebCore::IDBClient::IDBRequest::eventTargetInterface):
1024         (WebCore::IDBClient::IDBRequest::activeDOMObjectName):
1025         (WebCore::IDBClient::IDBRequest::canSuspendForPageCache):
1026         * Modules/indexeddb/client/IDBRequestImpl.h: Copied from Source/WebCore/Modules/indexeddb/client/IDBFactoryImpl.h.
1027
1028         * platform/Logging.h:
1029
1030 2015-09-16  Chris Dumez  <cdumez@apple.com>
1031
1032         Add initial support for [Unforgeable] IDL extended attribute
1033         https://bugs.webkit.org/show_bug.cgi?id=149147
1034
1035         Reviewed by Darin Adler.
1036
1037         Add initial support for [Unforgeable] IDL extended attribute:
1038         https://heycam.github.io/webidl/#Unforgeable
1039
1040         In particular, attributes marked as unforgeable are now:
1041         - on the instance rather than the prototype
1042         - non-configurable. WebKit does not match the Web IDL specification
1043           and most properties are currently non-configurable already. However,
1044           I added an extra check for [Unforgeable] so that unforgeable
1045           attributes stay unconfigurable if we later decide to match the spec
1046           and mark properties as configurable.
1047
1048         Operation marked as unforgeable are now non-configurable. However, this
1049         patch does not move them from the prototype to the instance yet. This
1050         needs to be addressed in a follow-up patch as this is a larger change.
1051
1052         This patch also drops support for the undocumented
1053         [OperationsNotDeletable] IDL extended attribute. It is no longer needed
1054         now that we support [Unforgeable] and still support [NotDeletable] for
1055         operations.
1056
1057         Test: fast/dom/unforgeable-attributes.html
1058
1059         * Modules/plugins/QuickTimePluginReplacement.idl:
1060         Drop [OperationsNotDeletable] on the interface and mark the only
1061         operation on this interface as [NotDeletable]. There is no behavior
1062         change but this allows us to drop support for a non-standard and
1063         undocumented IDL extended attribute.
1064
1065         * bindings/scripts/CodeGeneratorJS.pm:
1066         (AttributeShouldBeOnInstance):
1067         (GenerateAttributesHashTable):
1068         (GenerateImplementation):
1069         Add initial support for [Unforgeable] IDL extended attribute.
1070
1071         * bindings/scripts/IDLAttributes.txt:
1072         Add [Unforgeable]. Drop [OperationsNotDeletable].
1073
1074         * crypto/CryptoKeyPair.idl:
1075         Drop [OperationsNotDeletable] on the interface as this interface has
1076         no operations.
1077
1078         * dom/Document.idl:
1079         * page/DOMWindow.idl:
1080         * page/Location.idl:
1081         Mark attributes / interfaces as [Unforgeable] as per the latest HTML
1082         specification:
1083         https://html.spec.whatwg.org/multipage/dom.html#document
1084         https://html.spec.whatwg.org/multipage/browsers.html#window
1085         https://html.spec.whatwg.org/multipage/browsers.html#the-location-interface
1086
1087 2015-09-16  Zalan Bujtas  <zalan@apple.com>
1088
1089         Simple line layout: Glitch selecting long text.
1090         https://bugs.webkit.org/show_bug.cgi?id=149204
1091         rdar://problem/22646472
1092
1093         Reviewed by Antti Koivisto.
1094
1095         When long text is split into multiple RenderText objects, we ignore renderer boundaries while
1096         collecting wrapping positions (so that we don't end up wrapping unbreakable fragments at the end of each renderer).
1097         This patch ensures that fragments with hypen character ignore renderer boundaries too.
1098
1099         Test: fast/text/multiple-renderers-with-hypen-on-boundary.html
1100
1101         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
1102         (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
1103
1104 2015-09-16  Brady Eidson  <beidson@apple.com>
1105
1106         Remove stray logging string mistakenly left in r189746.
1107
1108         * Modules/indexeddb/legacy/LegacyFactory.cpp:
1109         (WebCore::LegacyFactory::deleteDatabase):
1110
1111 2015-09-16  Chris Fleizach  <cfleizach@apple.com>
1112
1113         AX: No VoiceOver typing feedback in some search fields
1114         https://bugs.webkit.org/show_bug.cgi?id=149177
1115
1116         Reviewed by Mario Sanchez Prada.
1117
1118         If SearchFieldRole is not marked as a TextControl, it does not end up returning the accessibilityValue,
1119         which is needed to output the right text to VoiceOver.
1120
1121         Test: accessibility/ax-value-with-search.html
1122
1123         * accessibility/AccessibilityObject.cpp:
1124         (WebCore::AccessibilityObject::isTextControl):
1125
1126 2015-09-16  Manuel Rego Casasnovas  <rego@igalia.com>
1127
1128         [css-grid] Grid container's height should include scrollbar
1129         https://bugs.webkit.org/show_bug.cgi?id=149210
1130
1131         Reviewed by Sergio Villar Senin.
1132
1133         Add scrollbar's size in the grid container's height calculation at
1134         RenderGrid::layoutGridItems().
1135
1136         Test: fast/css-grid-layout/grid-container-margin-border-padding-scrollbar.html
1137
1138         * rendering/RenderGrid.cpp:
1139         (WebCore::RenderGrid::layoutGridItems): Include scrollbarLogicalHeight()
1140         while computing the grid's logical height.
1141
1142 2015-09-16  Carlos Garcia Campos  <cgarcia@igalia.com>
1143
1144         Unreviewed. Fix GObject DOM bindings API break after r189676.
1145
1146         webkit_dom_character_data_append_data() used to raise exceptions.
1147
1148         * bindings/scripts/CodeGeneratorGObject.pm:
1149         (FunctionUsedToRaiseException):
1150
1151 2015-09-15  Commit Queue  <commit-queue@webkit.org>
1152
1153         Unreviewed, rolling out r189847.
1154         https://bugs.webkit.org/show_bug.cgi?id=149208
1155
1156         Asserts on all the tests (Requested by ap on #webkit).
1157
1158         Reverted changeset:
1159
1160         "Simple line layout: Glitch selecting long text."
1161         https://bugs.webkit.org/show_bug.cgi?id=149204
1162         http://trac.webkit.org/changeset/189847
1163
1164 2015-09-15  Zalan Bujtas  <zalan@apple.com>
1165
1166         Simple line layout: Glitch selecting long text.
1167         https://bugs.webkit.org/show_bug.cgi?id=149204
1168         rdar://problem/22646472
1169
1170         Reviewed by Antti Koivisto.
1171
1172         When long text is split into multiple RenderText objects, we ignore renderer boundaries while
1173         collecting wrapping positions (so that we don't end up wrapping unbreakable fragments at the end of each renderer).
1174         This patch ensures that fragments with hypen character ignore renderer boundaries too.
1175
1176         Test: fast/text/multiple-renderers-with-hypen-on-boundary.html
1177
1178         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
1179         (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
1180
1181 2015-09-15  Ryosuke Niwa  <rniwa@webkit.org>
1182
1183         GTK+ build fix attempt after r189841.
1184
1185         * PlatformGTK.cmake:
1186
1187 2015-09-15  Chris Dumez  <cdumez@apple.com>
1188
1189         Document.createElement(localName) does not handle correctly missing or null parameter
1190         https://bugs.webkit.org/show_bug.cgi?id=149184
1191         <rdar://problem/22565070>
1192
1193         Reviewed by Ryosuke Niwa.
1194
1195         Document.createElement(localName) does not handle correct missing or
1196         null parameter:
1197         - https://dom.spec.whatwg.org/#interface-document
1198
1199         As per the specification, the parameter is a non-nullable DOMString and
1200         is mandatory. Therefore, as per Web IDL, we should have the following
1201         behavior:
1202         1. If the parameter is missing, we should throw an exception
1203         2. If the parameter is null, we should convert it to the "null" string
1204            and create a <null> element.
1205
1206         Chrome and Firefox behave according to the specification. However,
1207         WebKit was doing:
1208         1. Create a <undefined> element
1209         2. Throw an InvalidCharacterError
1210
1211         This patch aligns WebKit's behavior with the specification and other
1212         major browsers.
1213
1214         No new tests, already covered by existing tests.
1215
1216         * dom/Document.idl:
1217
1218 2015-09-15  Ryosuke Niwa  <rniwa@webkit.org>
1219
1220         Add ShadowRoot interface and Element.prototype.attachShadow
1221         https://bugs.webkit.org/show_bug.cgi?id=149187
1222
1223         Reviewed by Antti Koivisto.
1224
1225         Add back ShadowRoot IDL interface and Element.prototype.attachShadow in accordance with
1226         http://w3c.github.io/webcomponents/spec/shadow/ at db27e6e36eab512d86edcdabb33ed27b5751acd7 excluding getSelection(),
1227         elementFromPoint(), elementsFromPoint(), caretPositionFromPoint(), and styleSheets attribute on ShadowRoot interface.
1228
1229         The feature is enabled by default on Mac and iOS ports for testing and disabled by default elsewhere.
1230
1231         Also added HTMLElement::canHaveUserAgentShadowRoot which returns false by default and overridden elsewhere to return true
1232         to distinguish elements for which attachShadow is supposed to throw NotSupported.
1233         See https://w3c.github.io/webcomponents/spec/shadow/#widl-Element-attachShadow-ShadowRoot-ShadowRootInit-shadowRootInitDict
1234
1235         Tests: fast/shadow-dom/Element-interface-attachShadow.html
1236                fast/shadow-dom/Element-interface-shadowRoot-attribute.html
1237                fast/shadow-dom/ShadowRoot-interface.html
1238
1239         * CMakeLists.txt:
1240         * Configurations/FeatureDefines.xcconfig:
1241         * DerivedSources.cpp:
1242         * DerivedSources.make:
1243         * PlatformGTK.cmake:
1244         * WebCore.vcxproj/WebCore.vcxproj:
1245         * WebCore.vcxproj/WebCore.vcxproj.filters:
1246         * WebCore.xcodeproj/project.pbxproj:
1247         * css/SelectorChecker.cpp:
1248         (WebCore::SelectorChecker::matchRecursively):
1249         * dom/Element.cpp:
1250         (WebCore::Element::bindingsOffsetParent):
1251         (WebCore::Element::offsetParent):
1252         (WebCore::Element::addShadowRoot):
1253         (WebCore::Element::createShadowRoot):
1254         (WebCore::Element::attachShadow): Added.
1255         (WebCore::Element::bindingShadowRoot): Added. Returns null unless the attached shadow root is in the "open" mode.
1256         * dom/Element.h:
1257         * dom/Element.idl: Added attachShadow and shadowRoot. We only expose these to JS for now since Dictionary argument isn't
1258         supported by other binding code.
1259         * dom/ShadowRoot.cpp: Removed an unused enum.
1260         * dom/ShadowRoot.h:
1261         (WebCore::ShadowRoot::Type): Replaced old-style enum "ShadowRootType" by an enum class named "Type". Also added two new
1262         values Open and Closed for author shadow roots.
1263         (WebCore::ShadowRoot::type):
1264         * dom/ShadowRoot.idl: Added.
1265         * html/HTMLButtonElement.h:
1266         * html/HTMLDetailsElement.h:
1267         (HTMLButtonElement::canHaveUserAgentShadowRoot): Ditto.
1268         * html/HTMLElement.h:
1269         (WebCore::HTMLElement::canHaveUserAgentShadowRoot): Added. Returns false by default.
1270         * html/HTMLInputElement.h:
1271         * html/HTMLKeygenElement.h:
1272         * html/HTMLMarqueeElement.h:
1273         * html/HTMLMediaElement.h:
1274         * html/HTMLMeterElement.h:
1275         * html/HTMLPlugInElement.h:
1276         * html/HTMLProgressElement.h:
1277         * html/HTMLSelectElement.h:
1278         * html/HTMLSummaryElement.h:
1279         * html/HTMLTextAreaElement.h:
1280         * html/shadow/InsertionPoint.h:
1281         (ShadowRootWithInsertionPoints::ShadowRootWithInsertionPoints):
1282         * rendering/RenderElement.cpp:
1283         (WebCore::RenderElement::selectionPseudoStyle):
1284         * rendering/RenderLayer.cpp:
1285         (WebCore::rendererForScrollbar):
1286         * svg/SVGElement.cpp:
1287         (WebCore::SVGElement::correspondingUseElement):
1288         * testing/Internals.cpp:
1289         (WebCore::Internals::shadowRootType):
1290
1291 2015-09-15  Brent Fulgham  <bfulgham@apple.com>
1292
1293         [Win] Unreviewed release fix after r189832
1294
1295         * platform/graphics/ca/win/PlatformCALayerWin.h: The implementation
1296         should exist in Release builds as well.
1297
1298 2015-09-15  Benjamin Poulain  <bpoulain@apple.com>
1299
1300         Style invalidation affecting siblings does not work with inline-style changes
1301         https://bugs.webkit.org/show_bug.cgi?id=149189
1302
1303         Reviewed by Antti Koivisto.
1304
1305         Style::resolveTree() made the assumption that inline style changes only affect
1306         descendants and should not participate in "StyleRecalcAffectsNextSiblingElementStyle".
1307         That was wrong. If the inline style change through CSSOM, it can cause the creation
1308         of a style attribute, which is observable through "StyleRecalcAffectsNextSiblingElementStyle".
1309
1310         This patch removes the incorrect assumption. Style invalidation is always propagated now.
1311
1312         Tests: fast/css/style-attribute-invalidation-propagates-to-counted-siblings.html
1313                fast/css/style-attribute-invalidation-propagates-to-direct-siblings.html
1314                fast/css/style-attribute-invalidation-propagates-to-indirect-siblings.html
1315
1316         * css/PropertySetCSSStyleDeclaration.cpp:
1317         (WebCore::InlineCSSStyleDeclaration::didMutate): Deleted.
1318         * dom/StyledElement.cpp:
1319         (WebCore::StyledElement::inlineStyleChanged):
1320         * dom/StyledElement.h:
1321         (WebCore::StyledElement::invalidateStyleAttribute):
1322         Clean up inline-style invalidation a tiny bit.
1323
1324         * style/StyleResolveTree.cpp:
1325         (WebCore::Style::resolveTree):
1326         Fix the bug.
1327
1328 2015-09-15  Joseph Pecoraro  <pecoraro@apple.com>
1329
1330         Web Inspector: Paused Debugger prevents page reload
1331         https://bugs.webkit.org/show_bug.cgi?id=148174
1332
1333         Reviewed by Brian Burg.
1334
1335         When navigating the page while paused, suppress any pausing until the page
1336         has completed navigation. If not paused and navigating, you can still pause
1337         in pagehide and unload handlers or other late page events.
1338
1339         Could not write a reliable test for this at the moment.
1340         InspectorTest.reloadPage has multiple issues with the output,
1341         so I'll investigate making reload tests more reliable later.
1342
1343         * inspector/InspectorController.h:
1344         * inspector/InspectorController.cpp:
1345         (WebCore::InspectorController::resume): Deleted.
1346         * loader/FrameLoader.cpp:
1347         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
1348         We now use existing InspectorInstrumentation functions instead of a method
1349         on InspectorController during load. In dropping the method InspectorController
1350         can drop a member variable no longer used.
1351
1352         * inspector/InspectorInstrumentation.h:
1353         (WebCore::InspectorInstrumentation::willStartProvisionalLoad):
1354         Add a new instrumentation hook.
1355
1356         * inspector/InspectorInstrumentation.cpp:
1357         (WebCore::InspectorInstrumentation::willStartProvisionalLoadImpl):
1358         (WebCore::InspectorInstrumentation::didCommitLoadImpl):
1359         When starting or completing main frame navigations, let the PageDebuggerAgent do some work.
1360
1361         * inspector/PageDebuggerAgent.h:
1362         * inspector/PageDebuggerAgent.cpp:
1363         (WebCore::PageDebuggerAgent::mainFrameStartedLoading):
1364         (WebCore::PageDebuggerAgent::mainFrameStoppedLoading):
1365         (WebCore::PageDebuggerAgent::mainFrameNavigated):
1366         Suppress pausing if navigating while paused. Otherwise behave as normal.
1367
1368 2015-09-15  Brent Fulgham  <bfulgham@apple.com>
1369
1370         [Win] Provide a means for viewing the layer tree
1371         https://bugs.webkit.org/show_bug.cgi?id=149165
1372
1373         Reviewed by Simon Fraser.
1374
1375         Revise the old fprintf logic to generate a string
1376         containing the layer tree so that it can be output
1377         to the debugger (or elsewhere).
1378
1379         * platform/graphics/ca/PlatformCALayer.h: Rename 'printTree'
1380         to 'printLayerTree', and make it available in release builds.
1381         * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
1382         (WebCore::CACFLayerTreeHost::printLayerTree): Added. Calls into
1383         the PlatformCALayer implementation.
1384         * platform/graphics/ca/win/CACFLayerTreeHost.h:
1385         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
1386         (printIndent): Revise to use two-space indent and use StringBuilder.
1387         (printTransform): Ditto.
1388         (printColor): Added helper function.
1389         (printLayer): Revised to output information on the layer contents.
1390         (PlatformCALayerWin::printLayerTree): Renamed from 'printTree'.
1391         (PlatformCALayerWin::printTree): Deleted.
1392         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
1393         (PlatformCALayerWinInternal::drawRepaintCounters): Drive-by fix. Match the
1394         cocoa repaint counter logic by not painting counters for the layers that
1395         contain the tile grid.
1396         * platform/graphics/ca/win/PlatformCALayerWin.h:
1397         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
1398         (PlatformCALayerWinInternal::drawRepaintCounters):
1399
1400 2015-09-15  Myles C. Maxfield  <mmaxfield@apple.com>
1401
1402         REGRESSION(r155554): Nested isolates can cause an infinite loop when laying out bidi runs
1403         https://bugs.webkit.org/show_bug.cgi?id=149153
1404
1405         Reviewed by David Hyatt.
1406
1407         When traversing bidi runs, we might encounter a run which is supposed to be isolated. In this
1408         situation, we will append a placeholder run in the run list, and remember a pointer to these
1409         isolated runs inside BidiResolver. Then, once we're done traversing the bidi runs, we return
1410         to the isolated runs and handle them separately (and replace the placeholder with the result).
1411
1412         However, due to the fact that our BidiRuns start at leaf nodes, we have to keep track of which
1413         local root of the render tree we were inspecting (to ensure that we visit the same node
1414         multiple times if there are nested isolate spans). We were not correctly keeping track of this
1415         local root, which was leading us to consider the same root multiple times, thereby leading to
1416         an infinite loop.
1417
1418         The solution is simply to keep root information alongside the isolated run information inside
1419         BidiResolver. However, BidiResolver is inside platform/, which means that this new type should
1420         be a template argument, just like how BidiRun itself is a template argument.
1421
1422         This new type, BidiIsolatedRun, holds all the information that our isolate-revisiting logic
1423         needs inside constructBidiRunsForSegment(). It also holds a reference to the placeholder run
1424         which we will replace.
1425
1426         Test: fast/text/international/unicode-bidi-isolate-nested-crash.html
1427
1428         * platform/graphics/GraphicsContext.cpp:
1429         (WebCore::GraphicsContext::drawBidiText): BidiIsolatedRun template argument is unused, so pass
1430         in Void.
1431         * platform/text/BidiResolver.h: Add template argument.
1432         (WebCore::BidiResolver::isolatedRuns):
1433         (WebCore::IsolatedRun>::~BidiResolver):
1434         (WebCore::IsolatedRun>::appendRun):
1435         (WebCore::IsolatedRun>::embed):
1436         (WebCore::IsolatedRun>::checkDirectionInLowerRaiseEmbeddingLevel):
1437         (WebCore::IsolatedRun>::lowerExplicitEmbeddingLevel):
1438         (WebCore::IsolatedRun>::raiseExplicitEmbeddingLevel):
1439         (WebCore::IsolatedRun>::commitExplicitEmbedding):
1440         (WebCore::IsolatedRun>::updateStatusLastFromCurrentDirection):
1441         (WebCore::IsolatedRun>::reorderRunsFromLevels):
1442         (WebCore::IsolatedRun>::createBidiRunsForLine):
1443         (WebCore::IsolatedRun>::setMidpointForIsolatedRun): Use references instead of pointers.
1444         (WebCore::IsolatedRun>::midpointForIsolatedRun): Ditto.
1445         (WebCore::Run>::~BidiResolver): Deleted.
1446         (WebCore::Run>::appendRun): Deleted.
1447         (WebCore::Run>::embed): Deleted.
1448         (WebCore::Run>::checkDirectionInLowerRaiseEmbeddingLevel): Deleted.
1449         (WebCore::Run>::lowerExplicitEmbeddingLevel): Deleted.
1450         (WebCore::Run>::raiseExplicitEmbeddingLevel): Deleted.
1451         (WebCore::Run>::commitExplicitEmbedding): Deleted.
1452         (WebCore::Run>::updateStatusLastFromCurrentDirection): Deleted.
1453         (WebCore::Run>::reorderRunsFromLevels): Deleted.
1454         (WebCore::Run>::createBidiRunsForLine): Deleted.
1455         (WebCore::Run>::setMidpointForIsolatedRun): Deleted.
1456         (WebCore::Run>::midpointForIsolatedRun): Deleted.
1457         * rendering/InlineIterator.h:
1458         (WebCore::BidiIsolatedRun::BidiIsolatedRun): New type.
1459         (WebCore::addPlaceholderRunForIsolatedInline): Create new type, and include local root
1460         information.
1461         (WebCore::IsolateTracker::addFakeRunIfNecessary): Include local root information.
1462         (WebCore::InlineBidiResolver::appendRun): Ditto.
1463         * rendering/RenderBlockLineLayout.cpp: Update for new BidiIsolatedRun type.
1464         (WebCore::setUpResolverToResumeInIsolate):
1465         (WebCore::constructBidiRunsForSegment):
1466         * rendering/line/TrailingObjects.h:
1467
1468 2015-09-15  Brady Eidson  <beidson@apple.com>
1469
1470         Add empty IDBFactory implementation for Modern IDB.
1471         https://bugs.webkit.org/show_bug.cgi?id=149191
1472
1473         Reviewed by Jer Noble.
1474
1475         No new tests (No behavior change).
1476
1477         * Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
1478         (WebCore::DOMWindowIndexedDatabase::indexedDB):
1479         
1480         * Modules/indexeddb/client/IDBFactoryImpl.cpp: 
1481         (WebCore::IDBClient::IDBFactory::create):
1482         (WebCore::IDBClient::IDBFactory::IDBFactory):
1483         (WebCore::IDBClient::IDBFactory::getDatabaseNames):
1484         (WebCore::IDBClient::IDBFactory::open):
1485         (WebCore::IDBClient::IDBFactory::deleteDatabase):
1486         (WebCore::IDBClient::IDBFactory::cmp):
1487         * Modules/indexeddb/client/IDBFactoryImpl.h: 
1488         
1489         * CMakeLists.txt:
1490         * WebCore.xcodeproj/project.pbxproj:
1491         
1492         * loader/EmptyClients.cpp:
1493         * page/DatabaseProvider.h:
1494
1495 2015-09-15  Antti Koivisto  <antti@apple.com>
1496
1497         Split FontDescription into lower and higher level types
1498         https://bugs.webkit.org/show_bug.cgi?id=149036
1499
1500         Reviewed by Darin Adler.
1501
1502         Currently FontDescription is used through the text subsystem. However much of the data it
1503         carries is only needed by FontCascade and text layout but not by the lower level Font/FontCache
1504         layer. This makes code confusing. For example families specified in FontDescription are ignored
1505         at lower levels.
1506
1507         Split it into a low level FontDescription and a high level FontCascadeDescription type:
1508
1509         FontDescription <-> Font
1510         FontCascadeDescription <-> FontCascade
1511
1512         The former only carries information that is needed to instantiate a Font or fetch it from the FontCache.
1513         The latter has additional data for CSS font cascade semantics and other higher level features.
1514
1515 2015-09-15  Myles C. Maxfield  <mmaxfield@apple.com>
1516
1517         GraphicsContext::drawBidiText()'s BidiResolver should not have isolated runs
1518         https://bugs.webkit.org/show_bug.cgi?id=149193
1519
1520         Reviewed by Anders Carlsson.
1521
1522         There are two users of BidiResolver, one which needs isolated runs (in RenderBlockLineLayout) and
1523         one which doesn't (in GraphicsContext::drawBidiText()). Because of [1], the isolated runs vector
1524         is migrating to a new type outside of platform/. Therefore, only the first user of BidiResolver
1525         should have this member variable.
1526
1527         This is achieved by creating two subclasses of BidiResolver, and using the Curiously Repeating
1528         Template pattern to downcast into specializations.
1529
1530         [1] https://bugs.webkit.org/show_bug.cgi?id=149153
1531
1532         No new tests because there is no behavior change.
1533
1534         * platform/text/BidiResolver.h:
1535         (WebCore::BidiResolverBase::BidiResolverBase):
1536         (WebCore::BidiResolverBase::increment):
1537         (WebCore::BidiResolverBase::appendRun):
1538         (WebCore::BidiResolverBase::incrementInternal):
1539         (WebCore::IsolateRun>::~BidiResolverWithIsolate):
1540         (WebCore::Subclass>::appendRunInternal):
1541         (WebCore::Subclass>::embed):
1542         (WebCore::Subclass>::checkDirectionInLowerRaiseEmbeddingLevel):
1543         (WebCore::Subclass>::lowerExplicitEmbeddingLevel):
1544         (WebCore::Subclass>::raiseExplicitEmbeddingLevel):
1545         (WebCore::Subclass>::commitExplicitEmbedding):
1546         (WebCore::Subclass>::updateStatusLastFromCurrentDirection):
1547         (WebCore::Subclass>::reorderRunsFromLevels):
1548         (WebCore::Subclass>::createBidiRunsForLine):
1549         (WebCore::Subclass>::setMidpointForIsolatedRun):
1550         (WebCore::Subclass>::midpointForIsolatedRun):
1551         (WebCore::BidiResolver::BidiResolver): Deleted.
1552         (WebCore::BidiResolver::increment): Deleted.
1553         (WebCore::BidiResolver::isolatedRuns): Deleted.
1554         (WebCore::Run>::~BidiResolver): Deleted.
1555         (WebCore::Run>::appendRun): Deleted.
1556         (WebCore::Run>::embed): Deleted.
1557         (WebCore::Run>::checkDirectionInLowerRaiseEmbeddingLevel): Deleted.
1558         (WebCore::Run>::lowerExplicitEmbeddingLevel): Deleted.
1559         (WebCore::Run>::raiseExplicitEmbeddingLevel): Deleted.
1560         (WebCore::Run>::commitExplicitEmbedding): Deleted.
1561         (WebCore::Run>::updateStatusLastFromCurrentDirection): Deleted.
1562         (WebCore::Run>::reorderRunsFromLevels): Deleted.
1563         (WebCore::Run>::createBidiRunsForLine): Deleted.
1564         (WebCore::Run>::setMidpointForIsolatedRun): Deleted.
1565         (WebCore::Run>::midpointForIsolatedRun): Deleted.
1566         * rendering/InlineIterator.h:
1567         (WebCore::InlineBidiResolver::incrementInternal):
1568         (WebCore::InlineBidiResolver::appendRunInternal):
1569         (WebCore::InlineBidiResolver::increment): Deleted.
1570         (WebCore::InlineBidiResolver::appendRun): Deleted.
1571         * rendering/line/TrailingObjects.h:
1572
1573 2015-09-15  Chris Dumez  <cdumez@apple.com>
1574
1575         new Event() without parameter should throw
1576         https://bugs.webkit.org/show_bug.cgi?id=149146
1577         <rdar://problem/22565070>
1578
1579         Reviewed by Ryosuke Niwa.
1580
1581         new Event() without parameter should throw because the type parameter
1582         is mandatory as per the specification:
1583         https://dom.spec.whatwg.org/#interface-event
1584
1585         Both Firefox and Chrome throw in this case. However, WebKit was
1586         creating an event whose type is the string "undefined". This patch
1587         aligns our behavior with the specification and other major browsers.
1588
1589         No new tests, already covered by existing test.
1590
1591         * bindings/scripts/CodeGeneratorJS.pm:
1592         (GenerateConstructorDefinition):
1593         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1594         (WebCore::JSTestEventConstructorConstructor::constructJSTestEventConstructor):
1595
1596 2015-09-15  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1597
1598         [GTK] Build failure with ACCELERATED_2D_CANVAS when cairo-gl has built with OpenGLESv2 support only.
1599         https://bugs.webkit.org/show_bug.cgi?id=149172
1600
1601         Reviewed by Martin Robinson.
1602
1603         No new tests, no behavior change.
1604
1605         * platform/graphics/glx/GLContextGLX.cpp:
1606         (WebCore::GLContextGLX::cairoDevice):
1607
1608 2015-09-15  Chris Dumez  <cdumez@apple.com>
1609
1610         Element.getAttributeNS() should return null if the attribute does not exist
1611         https://bugs.webkit.org/show_bug.cgi?id=149180
1612         <rdar://problem/22561011>
1613
1614         Reviewed by Ryosuke Niwa.
1615
1616         Element.getAttributeNS() should return null if the attribute does not
1617         exist, similarly to what Element.getAttribute() does:
1618         - https://dom.spec.whatwg.org/#element (both return a nullable DOMString).
1619         - https://dom.spec.whatwg.org/#dom-element-getattributens (step 2)
1620
1621         Firefox and Chrome match the specification. However, WebKit was returning
1622         an empty string for getAttributeNS() and null for getAttribute(). This
1623         patch aligns WebKit's behavior with the specification and other browsers.
1624
1625         No new tests, already covered by existing tests.
1626
1627         * dom/Element.idl:
1628
1629 2015-09-15  Ryosuke Niwa  <rniwa@webkit.org>
1630
1631         ContentDistribution should be only used for details elements
1632         https://bugs.webkit.org/show_bug.cgi?id=149148
1633
1634         Reviewed by Antti Koivisto.
1635
1636         Extracted ShadowRootWithInsertionPoints out of ShadowRoot for HTMLDetailsElement and HTMLSummaryElement.
1637
1638         We don't add a separate .h and .cpp files since this is a temporary measure until we replace it with
1639         a slot-based shadow DOM implementation.
1640
1641         No new tests. There should be no observable behavioral change.
1642
1643         * dom/Element.cpp:
1644         (WebCore::Element::addShadowRoot): Removed the call to didShadowBoundaryChange since this function is only
1645         called in ensureUserAgentShadowRoot. Also moved the call to didAddUserAgentShadowRoot for
1646         HTMLDetailsElement's shadow root which uses this function instead of ensureUserAgentShadowRoot.
1647         (WebCore::Element::removeShadowRoot): Removed the call to invalidateDistribution since it's only called by
1648         ~Element.
1649         (WebCore::Element::createShadowRoot):
1650         (WebCore::Element::ensureUserAgentShadowRoot): Moved the call didAddUserAgentShadowRoot into addShadowRoot
1651         since HTMLDetailsElement uses a subclass of ShadowRoot.
1652         (WebCore::Element::childrenChanged):
1653         (WebCore::Element::removeAllEventListeners):
1654
1655         * dom/Element.h:
1656         (Element::addShadowRoot): Made this function a protected member as it's now used by HTMLDetailsElement.
1657
1658         * dom/ShadowRoot.cpp:
1659         (WebCore::ShadowRoot::childrenChanged): Deleted.
1660
1661         * dom/ShadowRoot.h:
1662         (WebCore::ShadowRoot::distributor): Made this a virtual function and return nullptr by default.
1663         (WebCore::ShadowRoot::isOrphan):
1664
1665         * html/HTMLDetailsElement.cpp:
1666         (WebCore::HTMLDetailsElement::create): Uses ShadowRootWithInsertionPoints instead of ShadowRoot.
1667
1668         * html/HTMLInputElement.cpp:
1669         (WebCore::HTMLInputElement::runPostTypeUpdateTasks): Removed the call to invalidateDistribution since it's
1670         only relevant for HTMLDetailsElement's shadow DOM.
1671
1672         * html/HTMLSummaryElement.cpp:
1673         (WebCore::HTMLSummaryElement::create): Uses ShadowRootWithInsertionPoints instead of ShadowRoot.
1674
1675         * html/shadow/ContentDistributor.cpp:
1676         (WebCore::ContentDistributor::distribute):
1677         (WebCore::ContentDistributor::ensureDistribution):
1678         (WebCore::ContentDistributor::invalidateDistribution):
1679
1680         * html/shadow/InsertionPoint.cpp:
1681         (WebCore::InsertionPoint::childrenChanged):
1682         (WebCore::InsertionPoint::insertedInto):
1683         (WebCore::InsertionPoint::removedFrom):
1684         (WebCore::findInsertionPointOf):
1685         (WebCore::ShadowRootWithInsertionPoints::childrenChanged): Moved from ShadowRoot.
1686
1687         * html/shadow/InsertionPoint.h:
1688         (WebCore::ShadowRootWithInsertionPoints::create): Added.
1689         (WebCore::ShadowRootWithInsertionPoints::ShadowRootWithInsertionPoints): Added.
1690
1691 2015-09-15  Brent Fulgham  <bfulgham@apple.com>
1692
1693         [Win] Tiled drawing is rendering more times than it should
1694         https://bugs.webkit.org/show_bug.cgi?id=149144
1695         <rdar://problem/22313905>
1696
1697         Reviewed by Simon Fraser.
1698
1699         Provide a more faithful implemenation of the Objective C tiled drawing logic.
1700         (1) Create a new WebTiledBackingLayerWin class that represents a the
1701             container of tiles. This matches the Objective C design.
1702         (2) Move implementation of several methods (e.g., isOpaque) to the internal
1703             class implementation so that the Tile Drawing logic can perform special
1704             handling in these cases.
1705         (3) Remove the duplicated Tiled Drawing logic from PlatformCALayerWinInternal,
1706             since it was just duplicating code in TileController and TileGrid.
1707         (4) Clean up the display callback code to avoid performing incorrect flipping
1708             of the coordinate system.
1709
1710         * PlatformAppleWin.cmake: Add new WebTiledBackingLayerWin file.            
1711         * WebCore.vcxproj/WebCore.vcxproj: Add the new WebTiledBackingLayerWin files.
1712         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
1713         * platform/graphics/ca/PlatformCALayer.cpp:
1714         (PlatformCALayer::flipContext): Added convenience method.
1715         (PlatformCALayer::drawRepaintIndicator): Ditto.
1716         * platform/graphics/ca/TileGrid.cpp:
1717         (TileGrid::platformCALayerPaintContents): Flip the context before drawing the repaint
1718         indicator on Windows.
1719         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
1720         (PlatformCALayerWin::PlatformCALayerWin): Create a WebTiledBackingLayerWin
1721         object if using tiled drawing.
1722         (PlatformCALayerWin::~PlatformCALayerWin):
1723         (PlatformCALayerWin::isOpaque): Move implementation to internal class.
1724         (PlatformCALayerWin::setOpaque): Ditto.
1725         (PlatformCALayerWin::setBorderWidth): Ditto.
1726         (PlatformCALayerWin::setBorderColor): Ditto.
1727         (PlatformCALayerWin::contentsScale): Ditto.
1728         (PlatformCALayerWin::setContentsScale): Ditto.
1729         (PlatformCALayerWin::cornerRadius): Ditto.
1730         (PlatformCALayerWin::tiledBacking): Ditto.
1731         (PlatformCALayerWin::drawTextAtPoint): New helper method to draw repaint counter
1732         text. Needed to work around bug in CG.
1733         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
1734         (PlatformCALayerWinInternal::PlatformCALayerWinInternal): Remove tiling-logic
1735         related member variables.
1736         (PlatformCALayerWinInternal::~PlatformCALayerWinInternal):
1737         (shouldInvertBeforeDrawingContent): Added convenience method.
1738         (shouldInvertBeforeDrawingRepaintCounters): Ditto.
1739         (PlatformCALayerWinInternal::displayCallback):
1740         (PlatformCALayerWinInternal::drawRepaintCounters): Helper method to
1741         share code between the two layer classes.
1742         (PlatformCALayerWinInternal::internalSetNeedsDisplay): use nullptr.
1743         (PlatformCALayerWinInternal::setNeedsDisplay): Ditto.
1744         (PlatformCALayerWinInternal::setNeedsDisplayInRect): Move tiled code
1745         to WebTiledBackingLayerWin and simplify the remaing code.
1746         (PlatformCALayerWinInternal::setSublayers): Remove tile code.
1747         (PlatformCALayerWinInternal::getSublayers): Ditto.
1748         (PlatformCALayerWinInternal::removeAllSublayers): Ditto.
1749         (PlatformCALayerWinInternal::insertSublayer): Ditto.
1750         (PlatformCALayerWinInternal::sublayerCount): Ditto.
1751         (PlatformCALayerWinInternal::indexOfSublayer): Ditto.
1752         (PlatformCALayerWinInternal::sublayerAtIndex): Ditto.
1753         (PlatformCALayerWinInternal::setBounds): Ditto.
1754         (PlatformCALayerWinInternal::setFrame): Ditto.
1755         (PlatformCALayerWinInternal::isOpaque): Ditto.
1756         (PlatformCALayerWinInternal::setOpaque): Ditto.
1757         (PlatformCALayerWinInternal::contentsScale): Ditto.
1758         (PlatformCALayerWinInternal::setContentsScale): Ditto.
1759         (PlatformCALayerWinInternal::setBorderWidth): Ditto.
1760         (PlatformCALayerWinInternal::setBorderColor): Ditto.
1761         (layerTypeIsTiled): Deleted.
1762         (PlatformCALayerWinInternal::constrainedSize): Deleted.
1763         (PlatformCALayerWinInternal::tileDisplayCallback): Deleted.
1764         (PlatformCALayerWinInternal::addTile): Deleted.
1765         (PlatformCALayerWinInternal::removeTile): Deleted.
1766         (PlatformCALayerWinInternal::tileAtIndex): Deleted.
1767         (PlatformCALayerWinInternal::tileCount): Deleted.
1768         (PlatformCALayerWinInternal::updateTiles): Deleted.
1769         (PlatformCALayerWinInternal::drawTile): Deleted.
1770         (PlatformCALayerWinInternal::createTileController): Deleted.
1771         (PlatformCALayerWinInternal::tiledBacking): Deleted.
1772         * platform/graphics/ca/win/PlatformCALayerWinInternal.h:
1773         (WebCore::PlatformCALayerWinInternal::owner):
1774         * platform/graphics/ca/win/WebTiledBackingLayerWin.cpp: Added.
1775         (WebTiledBackingLayerWin::WebTiledBackingLayerWin):
1776         (WebTiledBackingLayerWin::~WebTiledBackingLayerWin):
1777         (DisplayOnMainThreadContext::DisplayOnMainThreadContext):
1778         (redispatchOnMainQueue):
1779         (WebTiledBackingLayerWin::displayCallback):
1780         (WebTiledBackingLayerWin::setNeedsDisplay):
1781         (WebTiledBackingLayerWin::setNeedsDisplayInRect):
1782         (WebTiledBackingLayerWin::setBounds):
1783         (WebTiledBackingLayerWin::isOpaque):
1784         (WebTiledBackingLayerWin::setOpaque):
1785         (WebTiledBackingLayerWin::contentsScale):
1786         (WebTiledBackingLayerWin::setContentsScale):
1787         (WebTiledBackingLayerWin::setBorderWidth):
1788         (WebTiledBackingLayerWin::setBorderColor):
1789         (WebTiledBackingLayerWin::createTileController):
1790         (WebTiledBackingLayerWin::tiledBacking):
1791         (WebTiledBackingLayerWin::invalidate):
1792         * platform/graphics/ca/win/WebTiledBackingLayerWin.h: Added.
1793
1794 2015-09-14  David Hyatt  <hyatt@apple.com>
1795
1796         [New Block-Inside-Inline Model] Implement margin collapsing across contiguous anonymous inline blocks.
1797         https://bugs.webkit.org/show_bug.cgi?id=149132
1798
1799         Reviewed by Zalan Bujtas.
1800
1801         Added new tests inside fast/block/inside-inlines/
1802
1803         * rendering/InlineFlowBox.cpp:
1804         (WebCore::InlineFlowBox::anonymousInlineBlock):
1805         Change this accessor to be more robust and be willing to both recur (in case we ever do decide intermediate line boxes should exist)
1806         and to type check. This is not currently needed, but I'm just being paranoid and future proof.
1807
1808         (WebCore::InlineFlowBox::addToLine):
1809         Again, for thoroughness, I am making sure to propagate the hasAnonymousInlineBlock() bit through to parents. This is only needed
1810         if we build intermediate line boxes for lines with anonymous inline blocks.
1811
1812         (WebCore::InlineFlowBox::placeBoxesInBlockDirection):
1813         Anonymous inline blocks receive a layout via layoutBlockChild, in order to make sure that margin collapsing runs. This means
1814         that unlike other line objects, the position of the child has been determined already. Therefore we simply set the position
1815         of the line box that wraps the anonymous inline block to the already-computed position for that block.
1816
1817         Also patch the code that sets lineTop and lineBottom using the root box's dimensions. We don't really care about the root line
1818         box on anonymous inline block lines and just want to set lineTop and lineBottom to fit the anonymous inline block.
1819
1820         * rendering/RenderBlockFlow.cpp:
1821         (WebCore::RenderBlockFlow::collapseMargins):
1822         (WebCore::RenderBlockFlow::collapseMarginsWithChildInfo):
1823         Refactor collapseMargins to call a helper function that can pass in a previous "sibling", and that can handle the child
1824         being null. We do this to perform a margin collapse when anonymous inline blocks run up against regular lines (which is like
1825         collapsing with a sibling block "child").
1826
1827         * rendering/RenderBlockFlow.h:
1828         Tweak the MarginInfo constructor to take a const RenderBlockFlow. Tweak some line layout methods to pass in the LineLayoutState
1829         so that MarginInfo is available during line layout.
1830
1831         * rendering/RenderBlockLineLayout.cpp:
1832         (WebCore::RenderBlockFlow::createLineBoxes):
1833         When we create a new line box, if it is not an anonymous inline block line and our previous line was, simulate a margin
1834         collapse in order to possibly push the line box down or up. Re-use the pagination adjustment code to rewind line layout
1835         and perform it again if pushed below a float.
1836
1837         (WebCore::constructBidiRunsForSegment):
1838         (WebCore::RenderBlockFlow::layoutRunsAndFloats):
1839         (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
1840         (WebCore::RenderBlockFlow::layoutLineBoxes):
1841         (WebCore::RenderBlockFlow::determineStartPosition):
1842         (WebCore::RenderBlockFlow::matchedEndLine):
1843         (WebCore::RenderBlockFlow::updateRegionForLine):
1844         (WebCore::RenderBlockFlow::marginCollapseLinesFromStart):
1845         Patch line layout to run margin collapsing when anonymous inline blocks are encountered. This involves making sure
1846         margin info and float bottom positions are passed through so that layoutBlockChild can be properly called on
1847         anonymous inline blocks that we encounter.
1848
1849         In addition line layout when it syncs dirty lines has to run margin collapsing on earlier lines in order to make
1850         sure margin info is properly set up at the first dirty line position.
1851
1852         Note that there will be more improvements/changes in this area (dirty line syncing), as the current model is inefficient
1853         when many anonymous inline blocks are scattered throughout a large-scale line box tree.
1854
1855         * rendering/RootInlineBox.cpp:
1856         (WebCore::RootInlineBox::alignBoxesInBlockDirection):
1857         (WebCore::RootInlineBox::ascentAndDescentForBox):
1858         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
1859         an effect on ascent/descent.
1860
1861         * rendering/line/BreakingContext.h:
1862         (WebCore::BreakingContext::BreakingContext):
1863         (WebCore::BreakingContext::handleReplaced):
1864         When we encounter an anonymous inline block, lay it out when it is seen. We have to delay the layout, since we have
1865         to be able to perform it mid-line-layout when the containing block's logical height is at the correct value and all previous
1866         lines are placed. Margin info also has to be current.
1867
1868         * rendering/line/LineBreaker.cpp:
1869         * rendering/line/LineBreaker.h:
1870         Patched to pass LineLayoutState through so that the stuff we need to perform block layout is available (margin info and float vars).
1871
1872         * rendering/line/LineLayoutState.h:
1873         Add the block layout margin and float bottom information to the line layout state so that we have it available when performing
1874         layouts and margin collapses on anonymous inline block children.
1875
1876 2015-09-15  Brady Eidson  <beidson@apple.com>
1877
1878         Make the IDBAny::Type enum into an enum class.
1879         https://bugs.webkit.org/show_bug.cgi?id=149169.
1880
1881         Reviewed by Oliver Hunt.
1882
1883         No new tests (Cleanup, no behavior change).
1884
1885         * Modules/indexeddb/IDBAny.h:
1886         * Modules/indexeddb/legacy/LegacyAny.cpp:
1887         (WebCore::LegacyAny::createInvalid):
1888         (WebCore::LegacyAny::createNull):
1889         (WebCore::LegacyAny::LegacyAny):
1890         (WebCore::LegacyAny::domStringList):
1891         (WebCore::LegacyAny::idbCursor):
1892         (WebCore::LegacyAny::idbCursorWithValue):
1893         (WebCore::LegacyAny::idbDatabase):
1894         (WebCore::LegacyAny::idbFactory):
1895         (WebCore::LegacyAny::idbIndex):
1896         (WebCore::LegacyAny::idbObjectStore):
1897         (WebCore::LegacyAny::idbTransaction):
1898         (WebCore::LegacyAny::scriptValue):
1899         (WebCore::LegacyAny::string):
1900         (WebCore::LegacyAny::integer):
1901         (WebCore::LegacyAny::legacyCursor):
1902         (WebCore::LegacyAny::legacyCursorWithValue):
1903         (WebCore::LegacyAny::legacyDatabase):
1904         (WebCore::LegacyAny::legacyFactory):
1905         (WebCore::LegacyAny::legacyIndex):
1906         (WebCore::LegacyAny::legacyObjectStore):
1907         (WebCore::LegacyAny::legacyTransaction):
1908         * Modules/indexeddb/legacy/LegacyCursor.cpp:
1909         (WebCore::LegacyCursor::LegacyCursor):
1910         (WebCore::LegacyCursor::effectiveObjectStore):
1911         * Modules/indexeddb/legacy/LegacyObjectStore.cpp:
1912         * Modules/indexeddb/legacy/LegacyOpenDBRequest.cpp:
1913         (WebCore::LegacyOpenDBRequest::dispatchEvent):
1914         * Modules/indexeddb/legacy/LegacyRequest.cpp:
1915         (WebCore::LegacyRequest::getResultCursor):
1916         (WebCore::effectiveObjectStore):
1917         * bindings/js/JSIDBAnyCustom.cpp:
1918         (WebCore::toJS):
1919         * inspector/InspectorIndexedDBAgent.cpp:
1920         * page/DatabaseProvider.h:
1921
1922 2015-09-15  Brady Eidson  <beidson@apple.com>
1923
1924         Move most IDB object encoding/decoding from WebKit2 to WebCore.
1925         https://bugs.webkit.org/show_bug.cgi?id=149152
1926
1927         Reviewed by Alex Christensen.
1928
1929         No new tests (Cleanup, no behavior change).
1930
1931         * Modules/indexeddb/IDBDatabaseMetadata.h:
1932         (WebCore::IDBDatabaseMetadata::encode):
1933         (WebCore::IDBDatabaseMetadata::decode):
1934         * Modules/indexeddb/IDBIndexMetadata.h:
1935         (WebCore::IDBIndexMetadata::encode):
1936         (WebCore::IDBIndexMetadata::decode):
1937         * Modules/indexeddb/IDBKeyData.h:
1938         (WebCore::IDBKeyData::encode):
1939         (WebCore::IDBKeyData::decode):
1940         * Modules/indexeddb/IDBKeyPath.h:
1941         (WebCore::IDBKeyPath::encode):
1942         (WebCore::IDBKeyPath::decode):
1943         * Modules/indexeddb/IDBKeyRangeData.h:
1944         (WebCore::IDBKeyRangeData::encode):
1945         (WebCore::IDBKeyRangeData::decode):
1946         * Modules/indexeddb/IDBObjectStoreMetadata.h:
1947         (WebCore::IDBObjectStoreMetadata::encode):
1948         (WebCore::IDBObjectStoreMetadata::decode):
1949
1950 2015-09-14  Brady Eidson  <beidson@apple.com>
1951
1952         Make the enum IDBKey::Type into a utility enum class.
1953         https://bugs.webkit.org/show_bug.cgi?id=149149
1954
1955         Reviewed by Alex Christensen.
1956
1957         No new tests (Cleanup, no behavior change).
1958
1959         * Modules/indexeddb/IDBKey.cpp:
1960         (WebCore::IDBKey::isValid):
1961         (WebCore::IDBKey::compare):
1962         * Modules/indexeddb/IDBKey.h:
1963         (WebCore::IDBKey::createNumber):
1964         (WebCore::IDBKey::createDate):
1965         (WebCore::IDBKey::createMultiEntryArray):
1966         (WebCore::IDBKey::createArray):
1967         (WebCore::IDBKey::type):
1968         (WebCore::IDBKey::array):
1969         (WebCore::IDBKey::string):
1970         (WebCore::IDBKey::date):
1971         (WebCore::IDBKey::number):
1972         (WebCore::IDBKey::compareTypes):
1973         (WebCore::IDBKey::IDBKey):
1974         * Modules/indexeddb/IDBKeyData.cpp:
1975         (WebCore::IDBKeyData::IDBKeyData):
1976         (WebCore::IDBKeyData::maybeCreateIDBKey):
1977         (WebCore::IDBKeyData::isolatedCopy):
1978         (WebCore::IDBKeyData::encode):
1979         (WebCore::IDBKeyData::decode):
1980         (WebCore::IDBKeyData::compare):
1981         (WebCore::IDBKeyData::loggingString):
1982         (WebCore::IDBKeyData::setArrayValue):
1983         (WebCore::IDBKeyData::setStringValue):
1984         (WebCore::IDBKeyData::setDateValue):
1985         (WebCore::IDBKeyData::setNumberValue):
1986         * Modules/indexeddb/IDBKeyData.h:
1987         (WebCore::IDBKeyData::IDBKeyData):
1988         (WebCore::IDBKeyData::minimum):
1989         (WebCore::IDBKeyData::maximum):
1990         * Modules/indexeddb/IndexedDB.h:
1991         * bindings/js/IDBBindingUtilities.cpp:
1992         (WebCore::idbKeyToJSValue):
1993         (WebCore::createIDBKeyFromValue):
1994         (WebCore::createIDBKeyFromScriptValueAndKeyPath):
1995         (WebCore::generateIndexKeysForValue):
1996         * inspector/InspectorIndexedDBAgent.cpp:
1997
1998 2015-09-15  Javier Fernandez  <jfernandez@igalia.com>
1999
2000         [CSS Grid Layout] Using {row, column}-axis terms in alignment related logic
2001         https://bugs.webkit.org/show_bug.cgi?id=148942
2002
2003         Reviewed by Sergio Villar Senin.
2004
2005         This patch changes the names of several functions and variables
2006         defined to implement the alignment logic. We want to use from now
2007         on the terms row-axis and column-axis when referring to the
2008         alignment direction the logic is applied to.
2009
2010         No new tests, no new functionality.
2011
2012         * rendering/RenderGrid.cpp:
2013         (WebCore::RenderGrid::columnAxisOffsetForChild):
2014         (WebCore::RenderGrid::rowAxisOffsetForChild):
2015         (WebCore::RenderGrid::findChildLogicalPosition):
2016         * rendering/RenderGrid.h:
2017
2018 2015-09-14  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2019
2020         Remove all uses of PassRefPtr in WebCore/xml
2021         https://bugs.webkit.org/show_bug.cgi?id=149114
2022
2023         Reviewed by Darin Adler.
2024
2025         * dom/DecodedDataDocumentParser.h:
2026         * dom/DocumentParser.h:
2027         * dom/RawDataDocumentParser.h:
2028         * html/FTPDirectoryDocument.cpp:
2029         (WebCore::FTPDirectoryDocumentParser::append):
2030         * html/parser/HTMLDocumentParser.cpp:
2031         (WebCore::HTMLDocumentParser::append):
2032         * html/parser/HTMLDocumentParser.h:
2033         * html/parser/TextDocumentParser.cpp:
2034         (WebCore::TextDocumentParser::append):
2035         * html/parser/TextDocumentParser.h:
2036         * xml/NativeXPathNSResolver.cpp:
2037         (WebCore::NativeXPathNSResolver::NativeXPathNSResolver):
2038         * xml/NativeXPathNSResolver.h:
2039         (WebCore::NativeXPathNSResolver::create):
2040         * xml/XMLErrors.cpp:
2041         (WebCore::createXHTMLParserErrorHeader):
2042         * xml/XMLHttpRequestProgressEventThrottle.cpp:
2043         (WebCore::XMLHttpRequestProgressEventThrottle::dispatchReadyStateChangeEvent):
2044         (WebCore::XMLHttpRequestProgressEventThrottle::dispatchEvent):
2045         (WebCore::XMLHttpRequestProgressEventThrottle::dispatchDeferredEvents):
2046         * xml/XMLHttpRequestProgressEventThrottle.h:
2047         * xml/XMLSerializer.h:
2048         * xml/XPathEvaluator.cpp:
2049         (WebCore::XPathEvaluator::createExpression):
2050         (WebCore::XPathEvaluator::createNSResolver):
2051         (WebCore::XPathEvaluator::evaluate):
2052         * xml/XPathEvaluator.h:
2053         * xml/XPathNodeSet.h: Fix style errors.
2054         (WebCore::XPath::NodeSet::NodeSet):
2055         (WebCore::XPath::NodeSet::append):
2056         * xml/XPathPath.cpp:
2057         (WebCore::XPath::Filter::evaluate):
2058         (WebCore::XPath::LocationPath::evaluate):
2059         * xml/XPathValue.h: ditto.
2060         (WebCore::XPath::Value::Value):
2061         (WebCore::XPath::Value::Data::create):
2062         (WebCore::XPath::Value::Data::Data):
2063         * xml/XSLTProcessor.cpp:
2064         (WebCore::XSLTProcessor::transformToDocument):
2065         (WebCore::XSLTProcessor::transformToFragment):
2066         * xml/XSLTProcessor.h:
2067         (WebCore::XSLTProcessor::setXSLStyleSheet):
2068         (WebCore::XSLTProcessor::importStylesheet):
2069         * xml/parser/XMLDocumentParser.cpp:
2070         (WebCore::XMLDocumentParser::append):
2071         * xml/parser/XMLDocumentParser.h:
2072
2073 2015-09-14  Dewei Zhu  <dewei_zhu@apple.com>
2074
2075         Polish code for r189579.
2076         https://bugs.webkit.org/show_bug.cgi?id=149131
2077
2078         Reviewed by Chris Dumez.
2079
2080         Use more self-explaining function name "characterSetWithUTF8Fallback" instead of
2081         "characterSetForBindings". Optimize the way to get text encoding.
2082
2083         * dom/Document.cpp:
2084         (WebCore::Document::characterSetWithUTF8Fallback):
2085         (WebCore::Document::encoding): Deleted.
2086         (WebCore::Document::characterSetForBindings): Deleted.
2087         * dom/Document.h:
2088         (WebCore::Document::encoding):
2089         (WebCore::Document::textEncoding):
2090         * dom/Document.idl:
2091         * loader/DocumentWriter.cpp:
2092         (WebCore::DocumentWriter::createDecoderIfNeeded):
2093         * loader/FormSubmission.cpp:
2094         (WebCore::encodingFromAcceptCharset):
2095
2096 2015-09-14  Chris Dumez  <cdumez@apple.com>
2097
2098         Drop non-standard [IsIndex] WebKit IDL extended attribute
2099         https://bugs.webkit.org/show_bug.cgi?id=149122
2100         <rdar://problem/22547139>
2101
2102         Reviewed by Darin Adler.
2103
2104         Drop non-standard [IsIndex] WebKit IDL extended attribute. This attribute
2105         causes us to throw an IndexSizeError if the input value is negative. Web
2106         IDL supports no such thing. Instead Web IDL supports:
2107         1. Default behavior: the input value wraps around if it does not fit.
2108         2. [EnforceRange]: A TypeError is thrown if the input value does not fit [1].
2109         3. [Clamp]: The input value will be clamped if it does not fit [2].
2110
2111         Our bindings generator supports all three. We don't need the non-standard
2112         [IsIndex].
2113
2114         We previously used [IsIndex] in places where we're supposed to wrap around
2115         as per Web IDL. Therefore, we threw for negative values but other browsers
2116         don't. For e.g., CharacterData.substringData(offset, -1) is supposed to
2117         return the substring from offset to the end of the string. It does so in
2118         Firefox and Chrome. However, WebKit was throwing an Exception.
2119
2120         This change impacts the CharacterData and the SVGTextContentElement
2121         API. The compatibility risk is low because we were throwing an exception
2122         for negative values and we now wrap the value around instead, as other
2123         browsers do.
2124
2125         No new tests, already covered by existing tests.
2126
2127         [1] https://heycam.github.io/webidl/#EnforceRange
2128         [2] https://heycam.github.io/webidl/#Clamp
2129
2130         * bindings/scripts/CodeGeneratorJS.pm:
2131         (GenerateParametersCheck): Deleted.
2132         * bindings/scripts/IDLAttributes.txt:
2133         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2134         (WebCore::jsTestEventTargetPrototypeFunctionItem):
2135         * bindings/scripts/test/TestEventTarget.idl:
2136         * dom/CharacterData.cpp:
2137         (WebCore::CharacterData::deleteData):
2138         (WebCore::CharacterData::replaceData):
2139         * dom/CharacterData.idl:
2140         * dom/ClientRectList.idl:
2141         * svg/SVGTextContentElement.cpp:
2142         (WebCore::SVGTextContentElement::getSubStringLength):
2143         (WebCore::SVGTextContentElement::selectSubString):
2144         * svg/SVGTextContentElement.idl:
2145
2146 2015-09-14  Chris Dumez  <cdumez@apple.com>
2147
2148         Document.createNodeIterator(null) / Document.createTreeWalker(null) should throw a TypeError
2149         https://bugs.webkit.org/show_bug.cgi?id=149126
2150         <rdar://problem/22564891>
2151
2152         Reviewed by Ryosuke Niwa.
2153
2154         Document.createNodeIterator(null) / Document.createTreeWalker(null)
2155         should throw a TypeError:
2156         https://dom.spec.whatwg.org/#interface-document
2157
2158         This is because the parameter is not nullable and Web IDL says we
2159         should throw a TypeError in this case.
2160
2161         Firefox and Chrome throw an exception in this case. This patch
2162         aligns our behavior with the specification and other major browsers.
2163
2164         No new tests, already covered by existing W3C test.
2165
2166         * dom/Document.cpp:
2167         (WebCore::Document::createNodeIterator):
2168         (WebCore::Document::createTreeWalker):
2169         * dom/Document.h:
2170         * dom/Document.idl:
2171         * dom/NodeIterator.cpp:
2172         (WebCore::NodeIterator::NodeIterator):
2173         * dom/NodeIterator.h:
2174         (WebCore::NodeIterator::create):
2175         * dom/Traversal.cpp:
2176         (WebCore::NodeIteratorBase::NodeIteratorBase):
2177         * dom/Traversal.h:
2178         * dom/TreeWalker.cpp:
2179         (WebCore::TreeWalker::TreeWalker):
2180         * dom/TreeWalker.h:
2181         (WebCore::TreeWalker::create):
2182
2183 2015-09-14  Alex Christensen  <achristensen@webkit.org>
2184
2185         Fix Windows clean build after r189746
2186
2187         * WebCore.vcxproj/copyForwardingHeaders.cmd:
2188         Copy headers from new legacy directory.
2189
2190 2015-09-14  Chris Dumez  <cdumez@apple.com>
2191
2192         window.HTMLDetailsElement should exist
2193         https://bugs.webkit.org/show_bug.cgi?id=149139
2194
2195         Reviewed by Ryosuke Niwa.
2196
2197         window.HTMLDetailsElement should exist:
2198         https://html.spec.whatwg.org/multipage/forms.html#the-details-element
2199
2200         Drop the [NoInterfaceObject] IDL extended attribute in WebKit to
2201         address the problem.
2202
2203         No new tests, already covered by existing tests.
2204
2205         * html/HTMLDetailsElement.idl:
2206
2207 2015-09-14  Alex Christensen  <achristensen@webkit.org>
2208
2209         Fix AppleWin CMake build
2210         https://bugs.webkit.org/show_bug.cgi?id=149137
2211
2212         Reviewed by Brent Fulgham.
2213
2214         * PlatformAppleWin.cmake:
2215         Spell Inband correctly.
2216         * css/makegrammar.pl:
2217         Add quotes so bison can be in a directory with spaces in it.        
2218
2219 2015-09-14  Alex Christensen  <achristensen@webkit.org>
2220
2221         [Win] Unreviewed build fix after r189746
2222
2223         * WebCore.vcxproj/WebCoreIncludeCommon.props:
2224         Include new legacy directory.
2225
2226 2015-09-14  Alex Christensen  <achristensen@webkit.org>
2227
2228         Progress towards CMake on Mac.
2229         https://bugs.webkit.org/show_bug.cgi?id=149123
2230
2231         Reviewed by Chris Dumez.
2232
2233         * CMakeLists.txt:
2234         Added some more files.
2235         * PlatformMac.cmake:
2236         Added more files and listed the strange ObjC bindings.
2237         * contentextensions/DFACombiner.cpp:
2238         * contentextensions/DFACombiner.h:
2239         Added preprocessor protection.
2240         * platform/FileSystem.h:
2241         Include utility.  It's needed to compile the different configurations.
2242         * platform/ScrollAnimator.cpp:
2243         ScrollAnimator is an abstract class on Mac.  Don't compile it.
2244         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2245         FontAntialiasingStateSaver.h is only used on iOS.
2246         * rendering/RenderThemeMac.mm:
2247         config.h needs to be outside the #if !PLATFORM(IOS) to compile correctly without precompiled headers.
2248
2249 2015-09-14  Brady Eidson  <beidson@apple.com>
2250
2251         Rename current concrete IDB implementation to "Legacy".
2252         https://bugs.webkit.org/show_bug.cgi?id=149118
2253
2254         Reviewed by Alex Christensen.
2255
2256         No new tests (No change in behavior).
2257
2258         This patch makes IDL bindings abstract.
2259         It then renames the current concrete implementations of the bindings from "IDB" to "Legacy".
2260         Finally it moves those files and their support classes to a "legacy" subfolder.
2261
2262         * CMakeLists.txt:
2263         * Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
2264         * Modules/indexeddb/IDBAny.cpp:
2265         * Modules/indexeddb/IDBAny.h:
2266         * Modules/indexeddb/IDBCursor.cpp:
2267         * Modules/indexeddb/IDBCursor.h:
2268         * Modules/indexeddb/IDBCursor.idl:
2269         * Modules/indexeddb/IDBCursorWithValue.cpp:
2270         * Modules/indexeddb/IDBCursorWithValue.h:
2271         * Modules/indexeddb/IDBCursorWithValue.idl:
2272         * Modules/indexeddb/IDBDatabase.cpp:
2273         * Modules/indexeddb/IDBDatabase.h:
2274         * Modules/indexeddb/IDBDatabase.idl:
2275         * Modules/indexeddb/IDBFactory.cpp:
2276         * Modules/indexeddb/IDBFactory.h:
2277         * Modules/indexeddb/IDBFactory.idl:
2278         * Modules/indexeddb/IDBIndex.cpp:
2279         * Modules/indexeddb/IDBIndex.h:
2280         * Modules/indexeddb/IDBIndex.idl:
2281         * Modules/indexeddb/IDBObjectStore.cpp:
2282         * Modules/indexeddb/IDBObjectStore.h:
2283         * Modules/indexeddb/IDBObjectStore.idl:
2284         * Modules/indexeddb/IDBOpenDBRequest.cpp:
2285         * Modules/indexeddb/IDBOpenDBRequest.h:
2286         * Modules/indexeddb/IDBOpenDBRequest.idl:
2287         * Modules/indexeddb/IDBRequest.cpp:
2288         * Modules/indexeddb/IDBRequest.h:
2289         * Modules/indexeddb/IDBRequest.idl:
2290         * Modules/indexeddb/IDBTransaction.cpp:
2291         * Modules/indexeddb/IDBTransaction.h:
2292         * Modules/indexeddb/IDBTransaction.idl:
2293         * Modules/indexeddb/IDBVersionChangeEvent.cpp:
2294         * Modules/indexeddb/IDBVersionChangeEvent.h:
2295         * Modules/indexeddb/legacy/IDBCallbacks.h: Renamed from Source/WebCore/Modules/indexeddb/IDBCallbacks.h.
2296         * Modules/indexeddb/legacy/IDBCursorBackend.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBCursorBackend.cpp.
2297         * Modules/indexeddb/legacy/IDBCursorBackend.h: Renamed from Source/WebCore/Modules/indexeddb/IDBCursorBackend.h.
2298         * Modules/indexeddb/legacy/IDBCursorBackendOperations.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBCursorBackendOperations.cpp.
2299         * Modules/indexeddb/legacy/IDBCursorBackendOperations.h: Renamed from Source/WebCore/Modules/indexeddb/IDBCursorBackendOperations.h.
2300         * Modules/indexeddb/legacy/IDBDatabaseBackend.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBDatabaseBackend.cpp.
2301         * Modules/indexeddb/legacy/IDBDatabaseBackend.h: Renamed from Source/WebCore/Modules/indexeddb/IDBDatabaseBackend.h.
2302         * Modules/indexeddb/legacy/IDBDatabaseCallbacks.h: Renamed from Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacks.h.
2303         * Modules/indexeddb/legacy/IDBDatabaseCallbacksImpl.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp.
2304         * Modules/indexeddb/legacy/IDBDatabaseCallbacksImpl.h: Renamed from Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacksImpl.h.
2305         * Modules/indexeddb/legacy/IDBFactoryBackendInterface.h: Renamed from Source/WebCore/Modules/indexeddb/IDBFactoryBackendInterface.h.
2306         * Modules/indexeddb/legacy/IDBPendingDeleteCall.h: Renamed from Source/WebCore/Modules/indexeddb/IDBPendingDeleteCall.h.
2307         * Modules/indexeddb/legacy/IDBPendingOpenCall.h: Renamed from Source/WebCore/Modules/indexeddb/IDBPendingOpenCall.h.
2308         * Modules/indexeddb/legacy/IDBPendingTransactionMonitor.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBPendingTransactionMonitor.cpp.
2309         * Modules/indexeddb/legacy/IDBPendingTransactionMonitor.h: Renamed from Source/WebCore/Modules/indexeddb/IDBPendingTransactionMonitor.h.
2310         * Modules/indexeddb/legacy/IDBTransactionBackend.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionBackend.cpp.
2311         * Modules/indexeddb/legacy/IDBTransactionBackend.h: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionBackend.h.
2312         * Modules/indexeddb/legacy/IDBTransactionBackendOperations.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionBackendOperations.cpp.
2313         * Modules/indexeddb/legacy/IDBTransactionBackendOperations.h: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionBackendOperations.h.
2314         * Modules/indexeddb/legacy/IDBTransactionCoordinator.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionCoordinator.cpp.
2315         * Modules/indexeddb/legacy/IDBTransactionCoordinator.h: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionCoordinator.h.
2316         * Modules/indexeddb/legacy/LegacyAny.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBAny.cpp.
2317         * Modules/indexeddb/legacy/LegacyAny.h: Added.
2318         * Modules/indexeddb/legacy/LegacyCursor.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBCursor.cpp.
2319         * Modules/indexeddb/legacy/LegacyCursor.h: Copied from Source/WebCore/Modules/indexeddb/IDBCursor.h.
2320         * Modules/indexeddb/legacy/LegacyCursorWithValue.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBCursorWithValue.cpp.
2321         * Modules/indexeddb/legacy/LegacyCursorWithValue.h: Copied from Source/WebCore/Modules/indexeddb/IDBCursorWithValue.h.
2322         * Modules/indexeddb/legacy/LegacyDatabase.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBDatabase.cpp.
2323         * Modules/indexeddb/legacy/LegacyDatabase.h: Copied from Source/WebCore/Modules/indexeddb/IDBDatabase.h.
2324         * Modules/indexeddb/legacy/LegacyFactory.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBFactory.cpp.
2325         * Modules/indexeddb/legacy/LegacyFactory.h: Copied from Source/WebCore/Modules/indexeddb/IDBFactory.h.
2326         * Modules/indexeddb/legacy/LegacyIndex.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBIndex.cpp.
2327         * Modules/indexeddb/legacy/LegacyIndex.h: Added.
2328         * Modules/indexeddb/legacy/LegacyObjectStore.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp.
2329         * Modules/indexeddb/legacy/LegacyObjectStore.h: Copied from Source/WebCore/Modules/indexeddb/IDBObjectStore.h.
2330         * Modules/indexeddb/legacy/LegacyOpenDBRequest.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp.
2331         * Modules/indexeddb/legacy/LegacyOpenDBRequest.h: Copied from Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.h.
2332         * Modules/indexeddb/legacy/LegacyRequest.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBRequest.cpp.
2333         * Modules/indexeddb/legacy/LegacyRequest.h: Copied from Source/WebCore/Modules/indexeddb/IDBRequest.h.
2334         * Modules/indexeddb/legacy/LegacyTransaction.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBTransaction.cpp.
2335         * Modules/indexeddb/legacy/LegacyTransaction.h: Copied from Source/WebCore/Modules/indexeddb/IDBTransaction.h.
2336         * Modules/indexeddb/legacy/LegacyVersionChangeEvent.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.cpp.
2337         * Modules/indexeddb/legacy/LegacyVersionChangeEvent.h: Copied from Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.h.
2338         * WebCore.xcodeproj/project.pbxproj:
2339         * WebCore.vcxproj/WebCore.vcxproj:
2340
2341 2015-09-14  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2342
2343         [EFL] Remove create() factory function in EvasGLContext and EvasGLSurface
2344         https://bugs.webkit.org/show_bug.cgi?id=149110
2345
2346         Reviewed by Csaba Osztrogonác.
2347
2348         It is not good implementation we support both create() factory function and public constructor.
2349         In EvasGLContext and EvasGLSurface cases, those have supported both. However create() factory is only
2350         used by EwkView. Thus let's remove the create() function, then EwkView creates EvasGLContext using
2351         std::make_unique<> directly.
2352
2353         * platform/graphics/efl/EvasGLContext.h:
2354         (WebCore::EvasGLContext::create): Deleted.
2355         * platform/graphics/efl/EvasGLSurface.h:
2356         (WebCore::EvasGLSurface::create): Deleted.
2357
2358 2015-09-09  Sergio Villar Senin  <svillar@igalia.com>
2359
2360         min-width/height should default to auto for grid items
2361         https://bugs.webkit.org/show_bug.cgi?id=146021
2362
2363         Reviewed by Darin Adler.
2364
2365         Based on Blink's r194408, r194863 and r194887 by <rego@igalia.com>.
2366
2367         From the spec (http://dev.w3.org/csswg/css-grid/#grid-items):
2368         "The auto value of min-width and min-height behaves on grid
2369         items in the relevant axis analogously to its behavior on flex
2370         items in the main axis."
2371
2372         From now on the default value for min-width and min-height for
2373         grid items is auto, meaning that in general, grid items won't
2374         shrink bellow their content.
2375
2376         The change is not exactly the same as the one in Blink because
2377         this one takes into account vertical writting modes, something
2378         that was not well handled in the original one.
2379
2380         Tests: fast/css-grid-layout/min-width-height-auto-overflow.html
2381                fast/css-grid-layout/min-width-height-auto.html
2382
2383         * rendering/RenderBox.cpp:
2384         (WebCore::RenderBox::computeLogicalWidthInRegion):
2385         (WebCore::RenderBox::computeLogicalHeight):
2386
2387 2015-09-14  Manuel Rego Casasnovas  <rego@igalia.com>
2388
2389         [css-grid] Percentage columns should remove scrollbar's width
2390         https://bugs.webkit.org/show_bug.cgi?id=149116
2391
2392         Reviewed by Sergio Villar Senin.
2393
2394         Currently the calculation of percentage columns was not subtracting the
2395         scrollbar's size.
2396         Fixed RenderGrid::computeUsedBreadthOfSpecifiedLength()
2397         to avoid this problem.
2398
2399         Test: fast/css-grid-layout/grid-percent-track-scrollbar.html
2400
2401         * rendering/RenderGrid.cpp:
2402         (WebCore::RenderGrid::computeUsedBreadthOfSpecifiedLength):
2403
2404 2015-09-13  Chris Dumez  <cdumez@apple.com>
2405
2406         Improve Node pre-insertion validation when the parent is a Document
2407         https://bugs.webkit.org/show_bug.cgi?id=149109
2408         <rdar://problem/22560436>
2409
2410         Reviewed by Ryosuke Niwa.
2411
2412         Improve Node pre-insertion validation when the parent is a Document to
2413         match the specification:
2414         https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity
2415         https://dom.spec.whatwg.org/#concept-node-replace
2416
2417         This affects the following API: Node.insertBefore(), Node.appendChild(),
2418         Node.replaceChild().
2419
2420         WebKit current fails to do the following checks whenever the parent is a
2421         Document from pre-insertion validation:
2422         1. If the inserted Node is a DocumentFragment, we should make sure it
2423           contains only one Element.
2424         -> This is because a Document can have only one child that is an
2425            Element [1].
2426         2.a. If an Element is inserted, we should make sure it is not inserted
2427              before a DocumentType.
2428         2.b. If a DocumentType is inserted, we should make sure it is not
2429              inserted after an Element.
2430         -> This is because the DocType must come before the optional Element
2431            child [1].
2432
2433         Firefox and Chrome already match the specification here. This patch
2434         aligns WebKit's behavior with those browsers and the specification.
2435
2436         [1] https://dom.spec.whatwg.org/#node-trees
2437
2438         No new tests, already covered by existing W3C tests.
2439
2440         * dom/ContainerNode.cpp:
2441         (WebCore::checkAcceptChild):
2442         (WebCore::checkAddChild):
2443         (WebCore::checkReplaceChild):
2444         (WebCore::ContainerNode::insertBefore):
2445         (WebCore::ContainerNode::appendChild):
2446         (WebCore::containsConsideringHostElements): Deleted.
2447         (WebCore::checkAcceptChildGuaranteedNodeTypes): Deleted.
2448         * dom/Document.cpp:
2449         (WebCore::Document::canAcceptChild):
2450         (WebCore::Document::cloneNodeInternal): Deleted.
2451         * dom/Document.h:
2452
2453 2015-09-13  Chris Dumez  <cdumez@apple.com>
2454
2455         Document.adoptNode() should be able to explicitly adopt a DocumentType node
2456         https://bugs.webkit.org/show_bug.cgi?id=149097
2457         <rdar://problem/22549345>
2458
2459         Reviewed by Ryosuke Niwa.
2460
2461         Document.adoptNode() should be able to explicitly adopt a DocumentType
2462         node as per the latest DOM specification:
2463         https://dom.spec.whatwg.org/#dom-document-adoptnode
2464
2465         Chrome and Firefox match the specidicaiton but WebKit was throwing a
2466         NotSupportedError.
2467
2468         No new tests, already covered by existing test.
2469
2470         * dom/Document.cpp:
2471         (WebCore::Document::adoptNode): Deleted.
2472
2473 2015-09-13  Chris Dumez  <cdumez@apple.com>
2474
2475         Document.title does not behave according to specification
2476         https://bugs.webkit.org/show_bug.cgi?id=149098
2477
2478         Reviewed by Ryosuke Niwa.
2479
2480         Update Document.title to behave according to the latest DOM specification:
2481         https://html.spec.whatwg.org/multipage/dom.html#document.title
2482
2483         In particular, the following Web-Exposed changes were made:
2484         1. The title Element should be the first title element in the document
2485            (in tree order) [1]. Previously, WebKit would use the first title
2486            Element *added* to the Document. Document.title returns the text
2487            content of the title Element so this change is web-exposed.
2488         2. If the title Element is replaced after the title has been set by the
2489            JS (via the document.title setter), we should update the value
2490            returned by the document.title getter. Previously, WebKit would set
2491            a flag if the title was explicitly set by JS via document.title
2492            setter and later title element changes would not override the title
2493            set by the JS. This behavior isn't specified and does not match the
2494            behavior of other browsers.
2495
2496         The new behavior is also consistent with the behavior of Firefox and
2497         Chrome.
2498
2499         Some refactoring was made for the sake of clarity now that our
2500         implementation has changed. See details below.
2501
2502         [1] https://html.spec.whatwg.org/multipage/dom.html#the-title-element-2
2503
2504         No new tests, already covered by existing tests.
2505
2506         * dom/Document.cpp:
2507         (WebCore::Document::updateTitleFromTitleElement):
2508         New convenience method that calls updateTitle() with the text of the
2509         document's current title Element. If there is no title Element, it
2510         clears the title.
2511
2512         (WebCore::Document::updateTitleElement):
2513         Method which updates the Document's title Element whenever a title
2514         Element is added or removed from the Document. Once the title Element
2515         is updated, it takes care of calling updateTitleFromTitleElement() to
2516         update the Document's title.
2517
2518         (WebCore::Document::titleElementAdded):
2519         (WebCore::Document::titleElementRemoved):
2520         (WebCore::Document::titleElementTextChanged):
2521         New Document public API called by HTMLTitleElement / SVGTitleElement
2522         whenever a title Element is added / removed from the Document or
2523         whenever the title element's text has changed. These methods will
2524         take care of calling updateTitleElement() / updateTitleFromTitleElement()
2525         as necessary.
2526         Previously, we would only have 2 methods:
2527         - setTitleElement() which would be called whenever a title Element was
2528           added to the document or when its text had changed. The name was
2529           confusing because it would not necessarily set the document's title
2530           Element and it would be used both for title element update and a
2531           simple title update. This method has been split into 2:
2532           titleElementAdded() and titleElementTextChanged().
2533         - removeTitle() which would be called whenever a title Element was
2534           removed. The naming was confusing because it would not necessarily
2535           remove the Document's title Element. This is now called
2536           titleElementRemoved().
2537
2538         * html/HTMLTitleElement.cpp:
2539         (WebCore::HTMLTitleElement::insertedInto):
2540         Call the new titleElementAdded() instead of setTitleElement().
2541
2542         (WebCore::HTMLTitleElement::removedFrom):
2543         Call the new titleElementRemoved() instead of removeTitle().
2544
2545         (WebCore::HTMLTitleElement::childrenChanged):
2546         Call the new titleElementTextChanged() instead of
2547         setTitleElement() / removeTitle() as we don't really want
2548         to remove or add a title Element. We merely want to notify
2549         the document that the title element text has changed in
2550         case it is the current title Element of the Document.
2551
2552         (WebCore::HTMLTitleElement::computedTextWithDirection):
2553         Rename textWithDirection() to computedTextWithDirection() to
2554         make it clear it is not a simple getter and make it private
2555         as it is only used to set the m_title member which caches the
2556         computed text.
2557
2558         * html/HTMLTitleElement.h:
2559         Add new textWithDirection() getter which returns m_title. This
2560         is needed so that Document can query the title of the Element.
2561         Previously, HTMLTitleElement would pass directly m_title to
2562         the Document when calling Document::setTitleElement().
2563
2564         * svg/SVGTitleElement.cpp:
2565         (WebCore::SVGTitleElement::insertedInto):
2566         Call the new titleElementAdded() instead of setTitleElement().
2567
2568         (WebCore::SVGTitleElement::removedFrom):
2569         Call the new titleElementRemoved() instead of removeTitle().
2570
2571         (WebCore::SVGTitleElement::childrenChanged):
2572         Call the new titleElementTextChanged() instead of
2573         setTitleElement().
2574
2575 2015-09-13  Chris Dumez  <cdumez@apple.com>
2576
2577         document.lastModified should use the user's local time zone
2578         https://bugs.webkit.org/show_bug.cgi?id=149092
2579         <rdar://problem/22567705>
2580
2581         Reviewed by Ryosuke Niwa.
2582
2583         document.lastModified should use the user's local time zone:
2584         https://html.spec.whatwg.org/multipage/dom.html#dom-document-lastmodified
2585
2586         Chrome and Firefox comply with the specification but WebKit was using
2587         UTC. This patch aligns WebKit's behavior with the specification and
2588         other browsers.
2589
2590         No new tests, already covered by existing tests.
2591
2592         * dom/Document.cpp:
2593         (WebCore::Document::lastModified):
2594         (WebCore::Document::setCookieURL): Deleted.
2595
2596 2015-09-13  Chris Dumez  <cdumez@apple.com>
2597
2598         Node.baseURI should not return null for detached nodes
2599         https://bugs.webkit.org/show_bug.cgi?id=149104
2600         <rdar://problem/22559535>
2601
2602         Reviewed by Sam Weinig.
2603
2604         Node.baseURI should not return null for detached nodes. It should return
2605         the node document's base URL. The node document is set when the node is
2606         created so it is valid even if the node is detached [1]:
2607         https://dom.spec.whatwg.org/#dom-node-baseuri
2608
2609         WebKit was traversing the ancestors to find the base URL, which only
2610         works if the node is attached. Also, WebKit was taking into account
2611         the xml:base attribute when computing the baseURI.
2612
2613         Both Chrome and Firefox already dropped support for xml:base:
2614         https://code.google.com/p/chromium/issues/detail?id=341854
2615         https://bugzilla.mozilla.org/show_bug.cgi?id=903372
2616
2617         Firefox complies with the specification. Chrome's baseURI still only
2618         works for attached Nodes as their implementation still traverses the
2619         DOM tree, despite dropping support for xml:base.
2620
2621         This patch drops support xml:base when computing Node.baseURI, as
2622         Firefox, Chrome and the latest DOM specification do. It also makes
2623         Node.baseURI work for detached Nodes by returning the base URL of the
2624         node Document. This means we no longer have to traverse the Node's
2625         ancestors in the DOM tree. This is consistent with the behavior of
2626         Firefox and the latest DOM specification.
2627
2628         This patch does not drop the SVGElement.xmlbase attribute yet. However,
2629         we should probably consider making this change as well given that:
2630         - The SVG2 specification dropped it
2631         - Chrome dropped it.
2632         - It no longers impacts Node.baseURI
2633
2634         [1] https://www.w3.org/Bugs/Public/show_bug.cgi?id=20976
2635
2636         No new tests, already covered by existing test.
2637
2638         * dom/Document.cpp:
2639         (WebCore::Document::setContent): Deleted.
2640         * dom/Document.h:
2641         (WebCore::Document::inputCursor): Deleted.
2642         * dom/DocumentType.cpp:
2643         (WebCore::DocumentType::nodeName): Deleted.
2644         * dom/DocumentType.h:
2645         * dom/Element.cpp:
2646         (WebCore::Element::imageSourceURL): Deleted.
2647         (WebCore::Element::rendererIsNeeded): Deleted.
2648         (WebCore::Element::createElementRenderer): Deleted.
2649         (WebCore::Element::insertedInto): Deleted.
2650         * dom/Element.h:
2651         * dom/Node.cpp:
2652         (WebCore::Node::baseURI):
2653         * dom/Node.h:
2654         * svg/SVGElement.idl:
2655
2656 2015-09-13  Chris Dumez  <cdumez@apple.com>
2657
2658         CharacterData API parameters should not be optional
2659         https://bugs.webkit.org/show_bug.cgi?id=149101
2660         <rdar://problem/22546954>
2661
2662         Reviewed by Sam Weinig.
2663
2664         CharacterData API parameters should not be optional as per the DOM
2665         specification:
2666         https://dom.spec.whatwg.org/#characterdata
2667
2668         The parameters are also mandatory in Firefox and Chrome. However,
2669         those parameters are optional in WebKit. When DOMString parameters
2670         were omitted, we would use the "undefined" string instead. When
2671         unsigned long parameters were omitted, we would use 0 instead.
2672         This patch aligns our behavior with the specification and other
2673         major browsers.
2674
2675         No new tests, already covered by existing tests.
2676
2677         * dom/CharacterData.cpp:
2678         (WebCore::CharacterData::appendData):
2679         * dom/CharacterData.h:
2680         * dom/CharacterData.idl:
2681         * dom/Element.cpp:
2682         (WebCore::Element::mergeWithNextTextNode):
2683         * dom/Node.cpp:
2684         (WebCore::Node::normalize):
2685         * xml/parser/XMLDocumentParser.cpp:
2686         (WebCore::XMLDocumentParser::exitText):
2687
2688 2015-09-13  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2689
2690         Remove all uses of PassRefPtr in crypto, storage, and history
2691         https://bugs.webkit.org/show_bug.cgi?id=149091
2692
2693         Reviewed by Andreas Kling.
2694
2695         * crypto/CryptoKeyPair.cpp:
2696         (WebCore::CryptoKeyPair::CryptoKeyPair):
2697         * crypto/CryptoKeyPair.h:
2698         (WebCore::CryptoKeyPair::create):
2699         * crypto/SubtleCrypto.h:
2700         (WebCore::SubtleCrypto::create):
2701         * crypto/gnutls/CryptoKeyRSAGnuTLS.cpp:
2702         (WebCore::CryptoKeyRSA::create):
2703         * crypto/keys/CryptoKeyAES.cpp:
2704         (WebCore::CryptoKeyAES::generate):
2705         * crypto/keys/CryptoKeyAES.h:
2706         * crypto/keys/CryptoKeyHMAC.cpp:
2707         (WebCore::CryptoKeyHMAC::generate):
2708         * crypto/keys/CryptoKeyHMAC.h:
2709         * crypto/keys/CryptoKeyRSA.h:
2710         * crypto/mac/CryptoKeyRSAMac.cpp:
2711         (WebCore::CryptoKeyRSA::create):
2712         * history/BackForwardController.cpp:
2713         (WebCore::BackForwardController::BackForwardController):
2714         * history/BackForwardController.h:
2715         * history/HistoryItem.cpp:
2716         (WebCore::HistoryItem::setStateObject):
2717         (WebCore::HistoryItem::setFormData):
2718         * history/HistoryItem.h:
2719         (WebCore::HistoryItem::stateObject):
2720         * loader/EmptyClients.cpp:
2721         * page/Page.cpp:
2722         (WebCore::Page::Page):
2723         * storage/Storage.cpp:
2724         (WebCore::Storage::create):
2725         (WebCore::Storage::Storage):
2726         * storage/Storage.h:
2727         * storage/StorageArea.h:
2728         * storage/StorageMap.cpp:
2729         (WebCore::StorageMap::copy):
2730         (WebCore::StorageMap::setItem):
2731         (WebCore::StorageMap::setItemIgnoringQuota):
2732         (WebCore::StorageMap::removeItem):
2733         * storage/StorageMap.h:
2734         * storage/StorageNamespace.h:
2735
2736 2015-09-12  Chris Dumez  <cdumez@apple.com>
2737
2738         window.EventTarget should exist
2739         https://bugs.webkit.org/show_bug.cgi?id=149085
2740         <rdar://problem/22546774>
2741
2742         Reviewed by Sam Weinig.
2743
2744         Drop [NoInterfaceObject] for the EventTarget interface to match Chrome,
2745         Firefox and the specification:
2746         https://dom.spec.whatwg.org/#interface-eventtarget
2747
2748         No new tests, already covered by existing tests.
2749
2750         * dom/EventTarget.idl:
2751
2752 2015-09-12  Brian Burg  <bburg@apple.com>
2753
2754         Web Inspector: disambiguate inspected/frontend controllers and pages in backend code
2755         https://bugs.webkit.org/show_bug.cgi?id=149071
2756
2757         Reviewed by Joseph Pecoraro.
2758
2759         Be consistent about prefixing pages, inspector controllers, and window controllers
2760         with either "frontend" or "inspected", as appropriate. This change makes obvious some bugs
2761         in the frontend connection code, which are tracked by https://webkit.org/b/149006.
2762
2763         No new tests, no behavior change.
2764
2765         * WebCore.order:
2766         * inspector/InspectorClient.h:
2767         * inspector/InspectorController.cpp:
2768         (WebCore::InspectorController::inspectedPageDestroyed):
2769         (WebCore::InspectorController::show):
2770         (WebCore::InspectorController::close):
2771         * inspector/InspectorFrontendClientLocal.cpp:
2772         (WebCore::InspectorFrontendClientLocal::InspectorFrontendClientLocal):
2773         (WebCore::InspectorFrontendClientLocal::~InspectorFrontendClientLocal):
2774         (WebCore::InspectorFrontendClientLocal::canAttachWindow):
2775         (WebCore::InspectorFrontendClientLocal::changeAttachedWindowHeight):
2776         (WebCore::InspectorFrontendClientLocal::changeAttachedWindowWidth):
2777         (WebCore::InspectorFrontendClientLocal::openInNewTab):
2778         (WebCore::InspectorFrontendClientLocal::restoreAttachedWindowHeight):
2779         (WebCore::InspectorFrontendClientLocal::showMainResourceForFrame):
2780         (WebCore::InspectorFrontendClientLocal::isUnderTest):
2781         * inspector/InspectorFrontendClientLocal.h:
2782         * inspector/InspectorOverlay.cpp:
2783         (WebCore::InspectorOverlay::freePage):
2784         * loader/EmptyClients.h:
2785
2786 2015-09-12  Chris Dumez  <cdumez@apple.com>
2787
2788         ChildNode.replaceWith() without argument should replace the node with an empty DocumentFragment
2789         https://bugs.webkit.org/show_bug.cgi?id=149073
2790         <rdar://problem/22547801>
2791
2792         Reviewed by Ryosuke Niwa.
2793
2794         ChildNode.replaceWith() without argument should replace the node with 
2795         an empty DocumentFragment, as per the specification:
2796         https://dom.spec.whatwg.org/#dom-childnode-replacewith
2797         https://dom.spec.whatwg.org/#converting-nodes-into-a-node
2798
2799         Previously, WebKit did not do anything in this case. This patch fixes
2800         it.
2801
2802         No new tests, already covered by existing test.
2803
2804         * dom/Node.cpp:
2805         (WebCore::Node::replaceWith):
2806
2807 2015-09-12  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2808
2809         Remove all uses of PassRefPtr in WebCore/plugins
2810         https://bugs.webkit.org/show_bug.cgi?id=149055
2811
2812         Reviewed by Darin Adler.
2813
2814         * plugins/DOMMimeType.cpp:
2815         (WebCore::DOMMimeType::DOMMimeType):
2816         (WebCore::DOMMimeType::enabledPlugin):
2817         * plugins/DOMMimeType.h:
2818         (WebCore::DOMMimeType::create):
2819         * plugins/DOMMimeTypeArray.cpp:
2820         (WebCore::DOMMimeTypeArray::item):
2821         * plugins/DOMMimeTypeArray.h:
2822         * plugins/DOMPlugin.cpp:
2823         (WebCore::DOMPlugin::item):
2824         * plugins/DOMPlugin.h:
2825         * plugins/DOMPluginArray.cpp:
2826         (WebCore::DOMPluginArray::item):
2827         * plugins/DOMPluginArray.h:
2828         * plugins/PluginViewBase.h:
2829         (WebCore::PluginViewBase::bindingInstance):
2830
2831 2015-09-12  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2832
2833         Remove all uses of PassRefPtr in WebCore/accessibility and WebCore/fileapi
2834         https://bugs.webkit.org/show_bug.cgi?id=149059
2835
2836         Reviewed by Darin Adler.
2837
2838         * accessibility/AXObjectCache.cpp:
2839         * accessibility/AccessibilityObject.cpp:
2840         (WebCore::rangeClosestToRange):
2841         (WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection):
2842         (WebCore::AccessibilityObject::selectionRange):
2843         (WebCore::AccessibilityObject::selectText):
2844         * accessibility/AccessibilityObject.h:
2845         * accessibility/ios/AXObjectCacheIOS.mm:
2846         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2847         (-[WebAccessibilityObjectWrapper _convertToDOMRange:]):
2848         (-[WebAccessibilityObjectWrapper textMarkerForPosition:]):
2849         * accessibility/mac/AXObjectCacheMac.mm:
2850         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2851         (-[WebAccessibilityObjectWrapper _textMarkerForIndex:]):
2852         * fileapi/FileList.h:
2853         (WebCore::FileList::append):
2854         * fileapi/WebKitBlobBuilder.cpp:
2855         (WebCore::BlobBuilder::append):
2856         * fileapi/WebKitBlobBuilder.h:
2857
2858 2015-09-11  Said Abou-Hallawa  <sabouhallawa@apple.com>
2859
2860         SVGColor custom text format is different from the CSS color custom text format
2861         https://bugs.webkit.org/show_bug.cgi?id=148879
2862
2863         Reviewed by Daniel Bates.
2864
2865         Implement the serialization of a CSS color value as it is described in
2866         <https://drafts.csswg.org/cssom/#serializing-css-values>. Add the new
2867         function Color::cssText() which is refactored from the existing function
2868         Color::serialized(). Use the new function for serializing the SVGColor
2869         always and also for Color but only when the alpha component is not 1.
2870
2871         Test: svg/css/computed-style-rgb-color.html
2872
2873         * css/CSSPrimitiveValue.cpp:
2874         (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText): Move the code
2875         for serializing the color from this function to Color::cssText().
2876         
2877         * platform/graphics/Color.cpp:
2878         (WebCore::Color::serialized): Call Color::cssText() if the alpha component
2879         is not 1 and delete the repeated code. 
2880         
2881         (WebCore::Color::cssText):
2882         * platform/graphics/Color.h: Add the new function to the header file.
2883         
2884         * svg/SVGColor.cpp:
2885         (WebCore::SVGColor::customCSSText): Call Color::cssText() always instead
2886         of calling Color::serialized() for serializing the SVGColor.
2887
2888 2015-09-11  Nan Wang  <n_wang@apple.com>
2889
2890         AX: ARIA 1.1 @aria-current
2891         https://bugs.webkit.org/show_bug.cgi?id=146012
2892
2893         Reviewed by Chris Fleizach.
2894
2895         Tests: accessibility/aria-current.html
2896                inspector/dom/getAccessibilityPropertiesForNode_ariaCurrent.html
2897
2898         Added support for ARIA 1.1 aria-current.
2899
2900         * accessibility/AccessibilityObject.cpp:
2901         (WebCore::AccessibilityObject::invalidStatus):
2902         (WebCore::AccessibilityObject::ariaCurrentState):
2903         (WebCore::AccessibilityObject::hasTagName):
2904         * accessibility/AccessibilityObject.h:
2905         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2906         (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
2907         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
2908         * html/HTMLAttributeNames.in:
2909         * inspector/InspectorDOMAgent.cpp:
2910         (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
2911
2912 2015-09-11  Chris Dumez  <cdumez@apple.com>
2913
2914         DOMTokenList update steps for classList don't follow the spec
2915         https://bugs.webkit.org/show_bug.cgi?id=148589
2916         <rdar://problem/22547443>
2917
2918         Reviewed by Ryosuke Niwa and Darin Adler.
2919
2920         Update our DOMTokenList implementation to behave according to
2921         the latest DOM specification:
2922         https://dom.spec.whatwg.org/#interface-domtokenlist
2923
2924         In particular, the following changes were made:
2925         - The stringifier now returns the result of the ordered set serializer
2926           for tokens. This means that we drop duplicate spaces and extra spaces
2927           [1][2][3].
2928         - DOMSettableTokenList.value now returns the result of the ordered set
2929           serializer for tokens [4] as well.
2930         - When the DOMTokenList's tokens are updated and there is an associated
2931           Element attribute, we set the attribute value to be the the ordered
2932           set serializer for tokens. This is according to the DOMTokenList
2933           update steps in the specification [6]. Chrome does not match the
2934           specification either.
2935
2936         Edge browser behaves according to the specification already. Firefox was
2937         implementing this via [7] but no recent progress. This makes the JS API
2938         nicer to use and interest was shown by jQuery Team.
2939
2940         The following refactoring was done:
2941         - Merge ClassList / RelList into a single AttributeDOMTokenList class
2942           as their code is mostly duplicated and the only thing that changes
2943           is which attribute is associated (class vs rel). AttributeDOMTokenList
2944           now keeps the attribute name as a member so it could be used for any
2945           attribute. AttributeDOMTokenList overrides DOMTokenList's
2946           updateAfterTokenChange() to do update the attribute's value as per
2947           [6].
2948         - We no longer use a SpaceSplitString for the internal representation
2949           as we need to sanitize the tokens (drop duplicates and extra spaces).
2950           DOMTokenList now has an internal Vector<AtomicString> containing the
2951           tokens that is constructed from the algorithm in [2]. As a result,
2952           most of the logic is now in DOMTokenList instead of its subclasses
2953           which means that most methods are no longer virtual. We only have
2954           one virtual function named updateAfterTokenChange() to do the update
2955           steps as AttributeDOMTokenList needs to update the associated
2956           attribute.
2957
2958         This change does not seem to impact Dromaeo.
2959
2960         [1] https://dom.spec.whatwg.org/#concept-ordered-set-serializer
2961         [2] https://dom.spec.whatwg.org/#ordered%20sets
2962         [3] https://dom.spec.whatwg.org/#stringification-behavior
2963         [4] https://dom.spec.whatwg.org/#dom-domsettabletokenlist-value
2964         [5] https://dom.spec.whatwg.org/#dom-domtokenlist-contains (step 2)
2965         [6] https://dom.spec.whatwg.org/#concept-DTL-update
2966         [7] https://bugzilla.mozilla.org/show_bug.cgi?id=869788
2967
2968         No new tests, already covered by existing tests.
2969
2970         * dom/Element.cpp:
2971         (WebCore::Element::classAttributeChanged):
2972         When the class attribute changes, make sure to update the associated
2973         classList if there is one. We could do this lazily if it turns out
2974         to be a performance problem. However, chances are this is not as
2975         classList is rarely used and we only need to update the classList if
2976         it was ever accessed by JS for this Element.
2977
2978         (WebCore::Element::insertedInto):
2979         Drop call to clearClassListValueForQuirksMode() as we no longer need
2980         to maintain a separate SpaceSplitString for classes when in quirks
2981         mode. This is because AttributeDOMTokenList now has its own Vector
2982         of classes in their original cases. It therefore no longer relies on
2983         Element::classNames() which has its case folded when in quirks mode.
2984
2985         (WebCore::Element::classList):
2986         Return a AttributeDOMTokenList instead of a ClassList.
2987
2988         * html/AttributeDOMTokenList.h: Added.
2989         * html/AttributeDOMTokenList.cpp: Added.
2990         (WebCore::AttributeDOMTokenList::AttributeDOMTokenList):
2991         Call DOMTokenList::setValue() using the attribute's value so that
2992         DOMTokenList can initialize its token Vector.
2993
2994         (WebCore::AttributeDOMTokenList::attributeValueChanged):
2995         If the attribute value was changed by somebody else that the
2996         AttributeDOMTokenList, call DOMTokenList::setValue() so that it
2997         can update its token Vector.
2998
2999         (WebCore::AttributeDOMTokenList::updateAfterTokenChange):
3000         This is called whenever the token Vector is changed via JS. In
3001         this case, we update the associated attribute's value.
3002
3003         * html/ClassList.cpp: Removed.
3004         * html/ClassList.h: Removed.
3005         Now merged into AttributeDOMTokenList.
3006
3007         * html/DOMSettableTokenList.cpp:
3008         * html/DOMSettableTokenList.h:
3009         Get rid of most of the code as most of the logic is now in
3010         DOMTokenList parent class.
3011
3012         * html/DOMTokenList.cpp:
3013         (WebCore::DOMTokenList::validateToken):
3014         Use a String parameter instead of an AtomicString as this method does
3015         not need the input the be an AtomicString. This avoid atomizing
3016         String unnecessarily.
3017
3018         (WebCore::DOMTokenList::validateTokens):
3019         Use a modern loop.
3020
3021         (WebCore::DOMTokenList::contains):
3022         No longer use containsInternal() virtual function. We can now check
3023         the internal token Vector.
3024
3025         (WebCore::DOMTokenList::add):
3026         Now update the internal Vector. Use a modern loop and try to minimize
3027         Vector capacity reallocation.
3028
3029         (WebCore::DOMTokenList::remove):
3030         Now update the internal Vector.
3031
3032         (WebCore::DOMTokenList::toggle):
3033         Now update the internal Vector and refactor the code so that it is
3034         structured exactly as the algorithm in the specification for
3035         clarity.
3036
3037         (WebCore::DOMTokenList::value):
3038         Now return the result of the ordered set serializer for tokens. This
3039         method is used for:
3040         - The DOMSettableTokenList.value() getter
3041         - The DOMTokenList stringifier
3042         - As attribute value when updating the associated attribute in
3043           AttributeDOMTokenList.
3044
3045         (WebCore::DOMTokenList::setValue):
3046         Update the internal Vector using the algorithm in [2].
3047
3048         * html/DOMTokenList.h:
3049         (WebCore::DOMTokenList::length):
3050         No longer virtual, now returns the size of the internal token Vector.
3051
3052         (WebCore::DOMTokenList::item):
3053         No longer virtual, now returns the token at the given index in the
3054         internal Vector.
3055
3056         * html/HTMLAnchorElement.cpp:
3057         (WebCore::HTMLAnchorElement::relList):
3058         Now return a AttributeDOMTokenList.
3059
3060         * html/HTMLLinkElement.cpp:
3061         (WebCore::HTMLLinkElement::relList):
3062         Now return a AttributeDOMTokenList.
3063
3064         * html/RelList.cpp: Removed.
3065         * html/RelList.h: Removed.
3066         Now merged into AttributeDOMTokenList.
3067
3068 2015-09-11  Chris Dumez  <cdumez@apple.com>
3069
3070         Element.tagName should be upper-case for HTML elements in HTML documents
3071         https://bugs.webkit.org/show_bug.cgi?id=148843
3072         <rdar://problem/22559081>
3073
3074         Reviewed by Ryosuke Niwa.
3075
3076         Element.tagName should be upper-case for HTML elements in HTML documents,
3077         as per the DOM specification:
3078         https://dom.spec.whatwg.org/#dom-element-tagname
3079
3080         Previously, WebKit would fail to upper-case the tagname if the element's
3081         tag had a prefix. This patch corrects this. This aligns our behavior with
3082         Firefox, Chrome and IE.
3083
3084         No new tests, already covered by existing tests.
3085
3086         * html/HTMLElement.cpp:
3087         (WebCore::HTMLElement::nodeName):
3088
3089 2015-09-11  Chris Dumez  <cdumez@apple.com>
3090
3091         document.body = "text" should throw a TypeError, not a HierarchyRequestError
3092         https://bugs.webkit.org/show_bug.cgi?id=149057
3093         <rdar://problem/22567157>
3094
3095         Reviewed by Ryosuke Niwa.
3096
3097         document.body = "text" should throw a TypeError, not a
3098         HierarchyRequestError:
3099         https://html.spec.whatwg.org/multipage/dom.html#dom-document-body
3100
3101         This is because "text" is a DOMString and it cannot be converted into an
3102         HTMLElement?. Therefore, the WebIDL specification says we should throw a
3103         TypeError in this case.
3104
3105         Chrome and Firefox throw the right exception.
3106
3107         No new tests, already covered by existing test.
3108
3109         * dom/Document.idl:
3110
3111 2015-09-11  Andreas Kling  <akling@apple.com>
3112
3113         [JSC] Weak should only accept cell pointees.
3114         <https://webkit.org/b/148955>
3115
3116         Reviewed by Geoffrey Garen.
3117
3118         Update WebCore bindings for the new Weak and Weak-related signatures.
3119
3120         * bindings/js/JSCSSRuleListCustom.cpp:
3121         (WebCore::JSCSSRuleListOwner::isReachableFromOpaqueRoots):
3122         * bindings/js/JSCSSValueCustom.cpp:
3123         (WebCore::JSCSSValueOwner::isReachableFromOpaqueRoots):
3124         (WebCore::JSCSSValueOwner::finalize):
3125         * bindings/js/JSCallbackData.cpp:
3126         (WebCore::JSCallbackDataWeak::WeakOwner::isReachableFromOpaqueRoots):
3127         * bindings/js/JSCallbackData.h:
3128         * bindings/js/JSMutationObserverCustom.cpp:
3129         (WebCore::JSMutationObserverOwner::isReachableFromOpaqueRoots):
3130         * bindings/js/JSNodeCustom.cpp:
3131         (WebCore::isReachableFromDOM):
3132         (WebCore::JSNodeOwner::isReachableFromOpaqueRoots):
3133         * bindings/js/JSNodeListCustom.cpp:
3134         (WebCore::JSNodeListOwner::isReachableFromOpaqueRoots):
3135         * bindings/js/JSTextTrackCueCustom.cpp:
3136         (WebCore::JSTextTrackCueOwner::isReachableFromOpaqueRoots):
3137         * bindings/js/WebCoreTypedArrayController.cpp:
3138         (WebCore::WebCoreTypedArrayController::JSArrayBufferOwner::isReachableFromOpaqueRoots):
3139         (WebCore::WebCoreTypedArrayController::JSArrayBufferOwner::finalize):
3140         * bindings/js/WebCoreTypedArrayController.h:
3141         * bindings/scripts/CodeGeneratorJS.pm:
3142         (GenerateHeader):
3143         (GenerateImplementation):
3144         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
3145         (WebCore::JSTestActiveDOMObjectOwner::isReachableFromOpaqueRoots):
3146         (WebCore::JSTestActiveDOMObjectOwner::finalize):
3147         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
3148         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
3149         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectOwner::isReachableFromOpaqueRoots):
3150         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectOwner::finalize):
3151         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
3152         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
3153         (WebCore::JSTestCustomNamedGetterOwner::isReachableFromOpaqueRoots):
3154         (WebCore::JSTestCustomNamedGetterOwner::finalize):
3155         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
3156         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
3157         (WebCore::JSTestEventConstructorOwner::isReachableFromOpaqueRoots):
3158         (WebCore::JSTestEventConstructorOwner::finalize):
3159         * bindings/scripts/test/JS/JSTestEventConstructor.h:
3160         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3161         (WebCore::JSTestEventTargetOwner::isReachableFromOpaqueRoots):
3162         (WebCore::JSTestEventTargetOwner::finalize):
3163         * bindings/scripts/test/JS/JSTestEventTarget.h:
3164         * bindings/scripts/test/JS/JSTestException.cpp:
3165         (WebCore::JSTestExceptionOwner::isReachableFromOpaqueRoots):
3166         (WebCore::JSTestExceptionOwner::finalize):
3167         * bindings/scripts/test/JS/JSTestException.h:
3168         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
3169         (WebCore::JSTestGenerateIsReachableOwner::isReachableFromOpaqueRoots):
3170         (WebCore::JSTestGenerateIsReachableOwner::finalize):
3171         * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
3172         * bindings/scripts/test/JS/JSTestInterface.cpp:
3173         (WebCore::JSTestInterfaceOwner::isReachableFromOpaqueRoots):
3174         (WebCore::JSTestInterfaceOwner::finalize):
3175         * bindings/scripts/test/JS/JSTestInterface.h:
3176         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
3177         (WebCore::JSTestMediaQueryListListenerOwner::isReachableFromOpaqueRoots):
3178         (WebCore::JSTestMediaQueryListListenerOwner::finalize):
3179         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
3180         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
3181         (WebCore::JSTestNamedConstructorOwner::isReachableFromOpaqueRoots):
3182         (WebCore::JSTestNamedConstructorOwner::finalize):
3183         * bindings/scripts/test/JS/JSTestNamedConstructor.h:
3184         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
3185         (WebCore::JSTestNondeterministicOwner::isReachableFromOpaqueRoots):
3186         (WebCore::JSTestNondeterministicOwner::finalize):
3187         * bindings/scripts/test/JS/JSTestNondeterministic.h:
3188         * bindings/scripts/test/JS/JSTestObj.cpp:
3189         (WebCore::JSTestObjOwner::isReachableFromOpaqueRoots):
3190         (WebCore::JSTestObjOwner::finalize):
3191         * bindings/scripts/test/JS/JSTestObj.h:
3192         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
3193         (WebCore::JSTestOverloadedConstructorsOwner::isReachableFromOpaqueRoots):
3194         (WebCore::JSTestOverloadedConstructorsOwner::finalize):
3195         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
3196         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
3197         (WebCore::JSTestOverrideBuiltinsOwner::isReachableFromOpaqueRoots):
3198         (WebCore::JSTestOverrideBuiltinsOwner::finalize):
3199         * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
3200         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
3201         (WebCore::JSTestSerializedScriptValueInterfaceOwner::isReachableFromOpaqueRoots):
3202         (WebCore::JSTestSerializedScriptValueInterfaceOwner::finalize):
3203         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
3204         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3205         (WebCore::JSTestTypedefsOwner::isReachableFromOpaqueRoots):
3206         (WebCore::JSTestTypedefsOwner::finalize):
3207         * bindings/scripts/test/JS/JSTestTypedefs.h:
3208         * bindings/scripts/test/JS/JSattribute.cpp:
3209         (WebCore::JSattributeOwner::isReachableFromOpaqueRoots):
3210         (WebCore::JSattributeOwner::finalize):
3211         * bindings/scripts/test/JS/JSattribute.h:
3212         * bindings/scripts/test/JS/JSreadonly.cpp:
3213         (WebCore::JSreadonlyOwner::isReachableFromOpaqueRoots):
3214         (WebCore::JSreadonlyOwner::finalize):
3215         * bindings/scripts/test/JS/JSreadonly.h:
3216         * bridge/runtime_root.cpp:
3217         (JSC::Bindings::RootObject::finalize):
3218         * bridge/runtime_root.h:
3219
3220 2015-09-10  Chris Fleizach  <cfleizach@apple.com>
3221
3222         AX: Mavericks: Text cursor does not move along with VoiceOver cursor for text fields
3223         https://bugs.webkit.org/show_bug.cgi?id=148891
3224
3225         Reviewed by Alexey Proskuryakov.
3226
3227         Asychronous focus setting DOES work on Yosemite, just not Mavericks.
3228
3229         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3230         (-[WebAccessibilityObjectWrapper accessibilitySetValue:forAttribute:]):
3231         (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
3232
3233 2015-09-10  David Hyatt  <hyatt@apple.com>
3234
3235         [New Block-Inside-Inline Model] Self-collapsing block check needs to account for anonymous inline blocks
3236         https://bugs.webkit.org/show_bug.cgi?id=149042
3237
3238         Reviewed by Dean Jackson.
3239
3240         Added new tests in fast/block/inside-inlines/
3241
3242         * rendering/InlineFlowBox.cpp:
3243         * rendering/InlineFlowBox.h:
3244         (WebCore::InlineFlowBox::anonymousInlineBlock):
3245         Add a new accessor to get the anonymousInlineBlock() for lines that wrap them.
3246
3247         * rendering/RenderBlock.cpp:
3248         (WebCore::RenderBlock::childrenPreventSelfCollapsing):
3249         (WebCore::RenderBlock::isSelfCollapsingBlock):
3250         isSelfCollapsingBlock() now calls a virtual method that checks lines/children called childrenPreventSelfCollapsing.
3251         This lets us farm out the lines check to the derived RenderBlockFlow class.
3252
3253         * rendering/RenderBlock.h:
3254         (WebCore::RenderBlock::childrenPreventSelfCollapsing):
3255         Added new virtual method for checking children.
3256
3257         * rendering/RenderBlockFlow.cpp:
3258         * rendering/RenderBlockFlow.h:
3259         (WebCore::RenderBlockFlow::childrenPreventSelfCollapsing):
3260         Overridden to ensure that blocks can still be self-collapsing if they only contain anonymous inline-block lines that
3261         are also self-collapsing.
3262
3263 2015-09-10  Jinyoung Hur  <hur.ims@navercorp.com>
3264
3265         [WebGL][GLES] bad shaders should not be linked not only for GL but also for GL ES
3266         https://bugs.webkit.org/show_bug.cgi?id=148794
3267
3268         Reviewed by Dean Jackson.
3269
3270         Checking bad shaders, precision matching and varyings packing are all valid for GL ES too.
3271
3272         Test: webgl/1.0.2/conformance/programs/program-test.html
3273
3274         * html/canvas/WebGLRenderingContextBase.cpp:
3275         (WebCore::WebGLRenderingContextBase::linkProgram):
3276
3277 2015-09-10  Jinyoung Hur  <hur.ims@navercorp.com>
3278
3279         Static variables in GraphicsContext3DOpenGLCommon should be avoided because of the race condition
3280         https://bugs.webkit.org/show_bug.cgi?id=148957
3281
3282         Reviewed by Dean Jackson.
3283
3284         There is no guarantee that only one thread calls GraphicsContext3D::compileShader() at a time so it would be 
3285         better to use a thread local storage variable rather than use a static variable.
3286
3287         No new tests. No behavioural changes.
3288
3289         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
3290         (WebCore::getCurrentNameHashMapForShader):
3291         (WebCore::setCurrentNameHashMapForShader):
3292         (WebCore::nameHashForShader):
3293         (WebCore::GraphicsContext3D::compileShader):
3294         (WebCore::GraphicsContext3D::mappedSymbolName):
3295
3296 2015-09-10  Chris Dumez  <cdumez@apple.com>
3297
3298         Node.appendChild(null) / replaceChild(null, null) / removeChild(null) / insertBefore(null, ref) should throw a TypeError
3299         https://bugs.webkit.org/show_bug.cgi?id=148971
3300         <rdar://problem/22560883>
3301         <rdar://problem/22559225>
3302
3303         Reviewed by Ryosuke Niwa.
3304
3305         Node.appendChild(null) / replaceChild(null, null) / removeChild(null)
3306         and insertBefore(null, ref) should throw a TypeError instead of a
3307         NotFoundError, as per the specification:
3308         https://dom.spec.whatwg.org/#node
3309
3310         The parameters are not nullable so the Web IDL specification says
3311         we should throw a TypeError in this case.
3312
3313         This patch moves the null-checking from ContainerNode to the methods
3314         on Node. The null-checking is supposed to be done by the bindings code
3315         but our generator currently does not support this so we do the null
3316         checking as close to the bindings as possible. The bindings code is
3317         calling the methods on Node. This also makes sure we throw a TypeError
3318         for null-argument when the Node is not a ContainerNode. For e.g.
3319         Text.appendChild(null) should throw a TypeError too.
3320
3321         The methods on ContainerNode now take references insteaad of pointer
3322         parameters now that the null-checking is done at the call site in
3323         Node. This lead to a lot of code update as those methods are used
3324         a lot throughout the code base.
3325
3326         No new tests, already covered by pre-existing layout tests.
3327
3328 2015-09-10  Daniel Bates  <dabates@apple.com>
3329
3330         Write a test to ensure we don't regress processing of tasks when page defers loading
3331         https://bugs.webkit.org/show_bug.cgi?id=135882
3332         <rdar://problem/22550497>
3333
3334         Reviewed by Darin Adler.
3335
3336         Towards adding a test for <https://bugs.webkit.org/show_bug.cgi?id=135688>, add a window.internals
3337         function, setPageDefersLoading, to enable and disable whether the page defers loading.
3338
3339         Test: storage/websql/success-callback-when-page-defers-loading.html
3340
3341         * testing/Internals.cpp:
3342         (WebCore::Internals::resetToConsistentState): Reset defers loading for the page to false.
3343         (WebCore::Internals::setPageDefersLoading): Added.
3344         * testing/Internals.h:
3345         * testing/Internals.idl: Added IDL declaration setPageDefersLoading.
3346
3347 2015-09-10  Sergio Villar Senin  <svillar@igalia.com>
3348
3349         min-width/height should default to auto for flexbox items
3350         https://bugs.webkit.org/show_bug.cgi?id=146020
3351
3352         Reviewed by David Hyatt.
3353
3354         Based on Blink's r193665, r194062, r194887 and r195930 by <cbiesinger@chromium.org>.
3355
3356         As specified here
3357         http://dev.w3.org/csswg/css-flexbox/#min-size-auto the default
3358         value of min-{width|height} is auto for flex items.
3359
3360         In case this patch breaks any website (as it's changing the
3361         default value of those properties) the fix is likely to add:
3362
3363         min-width: 0;
3364         min-height: 0;
3365
3366         to any relevant flexitems.
3367
3368         Test: css3/flexbox/min-size-auto.html
3369
3370         * css/CSSComputedStyleDeclaration.cpp:
3371         (WebCore::isFlexOrGrid): New helper method to identify grids and flexs.
3372         (WebCore::ComputedStyleExtractor::propertyValue): Return auto
3373         for flex items if min-width/height is auto.
3374         * css/CSSParser.cpp:
3375         (WebCore::CSSParser::parseValue):
3376         * html/shadow/SliderThumbElement.cpp:
3377         * rendering/RenderBox.cpp:
3378         (WebCore::RenderBox::constrainLogicalHeightByMinMax):
3379         (WebCore::RenderBox::constrainContentBoxLogicalHeightByMinMax):
3380         (WebCore::RenderBox::computeLogicalWidthInRegionUsing):
3381         (WebCore::RenderBox::computeLogicalHeight):
3382         (WebCore::RenderBox::computeLogicalHeightUsing):
3383         (WebCore::RenderBox::computeContentLogicalHeight):
3384         (WebCore::RenderBox::computeContentAndScrollbarLogicalHeightUsing):
3385         (WebCore::RenderBox::computeReplacedLogicalWidth):
3386         (WebCore::RenderBox::computeReplacedLogicalWidthRespectingMinMaxWidth):
3387         (WebCore::RenderBox::computeReplacedLogicalWidthUsing):
3388         (WebCore::RenderBox::computeReplacedLogicalHeight):
3389         (WebCore::RenderBox::computeReplacedLogicalHeightRespectingMinMaxHeight):
3390         (WebCore::RenderBox::computeReplacedLogicalHeightUsing):
3391         (WebCore::RenderBox::availableLogicalHeightUsing):
3392         (WebCore::RenderBox::computePositionedLogicalWidth):