HTMLCollection should use CollectionIndexCache
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2013-11-06  Antti Koivisto  <antti@apple.com>
2
3         HTMLCollection should use CollectionIndexCache
4         https://bugs.webkit.org/show_bug.cgi?id=123906
5
6         Reviewed by Ryosuke Niwa.
7         
8         More code sharing.
9
10         * bindings/js/JSDOMWindowCustom.cpp:
11         (WebCore::namedItemGetter):
12         * bindings/js/JSHTMLDocumentCustom.cpp:
13         (WebCore::JSHTMLDocument::nameGetter):
14         * dom/ChildNodeList.h:
15         * dom/CollectionIndexCache.h:
16         (WebCore::::nodeBeforeCached):
17         (WebCore::::nodeAfterCached):
18         (WebCore::::nodeAt):
19             
20             Add a mechanism for disabling use of backward traversal.
21
22         * dom/LiveNodeList.h:
23         (WebCore::LiveNodeList::collectionCanTraverseBackward):
24         * html/HTMLCollection.cpp:
25         (WebCore::HTMLCollection::HTMLCollection):
26         (WebCore::isMatchingElement):
27         (WebCore::HTMLCollection::iterateForPreviousElement):
28         (WebCore::firstMatchingElement):
29         (WebCore::nextMatchingElement):
30         (WebCore::HTMLCollection::length):
31         (WebCore::HTMLCollection::item):
32         (WebCore::nameShouldBeVisibleInDocumentAll):
33         (WebCore::firstMatchingChildElement):
34         (WebCore::nextMatchingSiblingElement):
35         (WebCore::HTMLCollection::firstElement):
36         (WebCore::HTMLCollection::traverseForward):
37         (WebCore::HTMLCollection::collectionFirst):
38         (WebCore::HTMLCollection::collectionLast):
39         (WebCore::HTMLCollection::collectionTraverseForward):
40         (WebCore::HTMLCollection::collectionTraverseBackward):
41         (WebCore::HTMLCollection::invalidateCache):
42         (WebCore::HTMLCollection::namedItem):
43         (WebCore::HTMLCollection::updateNameCache):
44         * html/HTMLCollection.h:
45         (WebCore::HTMLCollection::collectionCanTraverseBackward):
46         
47             Disable use of backward traversal for collections that use custom traversal.
48
49 2013-11-06  Brendan Long  <b.long@cablelabs.com>
50
51         Add "id" attribute to TextTrack
52         https://bugs.webkit.org/show_bug.cgi?id=123825
53
54         Reviewed by Eric Carlson.
55
56         Test: media/track/track-id.html
57
58         * html/HTMLMediaElement.cpp:
59         (HTMLMediaElement::addTextTrack): Add emptyString() for track id.
60         * html/track/AudioTrack.cpp:
61         (WebCore::AudioTrack::AudioTrack): Pass trackPrivate->id() to TrackBase.
62         (WebCore::AudioTrack::idChanged): Added, set id.
63         * html/track/AudioTrack.h: Move m_id to TrackBase.
64         * html/track/InbandTextTrack.cpp:
65         (WebCore::InbandTextTrack::InbandTextTrack): Pass trackPrivate->id() to TrackBase.
66         (WebCore::InbandTextTrack::idChanged): Added, set id.
67         * html/track/InbandTextTrack.h: Add idChanged().
68         * html/track/LoadableTextTrack.cpp:
69         (WebCore::LoadableTextTrack::LoadableTextTrack): Add emptyString() for track id.
70         (WebCore::LoadableTextTrack::id): Override to return the track element's id.
71         * html/track/TextTrack.cpp:
72         (WebCore::TextTrack::captionMenuOffItem): Add empty string for track id.
73         (WebCore::TextTrack::captionMenuAutomaticItem): Add empty string for track id.
74         (WebCore::TextTrack::TextTrack): Pass id to TrackBase.
75         * html/track/TextTrack.h:
76         (WebCore::TextTrack::create): Add id parameter.
77         * html/track/TextTrack.idl: Add id attribute.
78         * html/track/TrackBase.cpp:
79         (WebCore::TrackBase::TrackBase): Add m_id.
80         * html/track/TrackBase.h: Add id attribute / m_id.
81         * html/track/VideoTrack.cpp:
82         (WebCore::VideoTrack::VideoTrack): Pass trackPrivate->id() to TrackBase.
83         (WebCore::VideoTrack::idChanged): Added, set id.
84         * html/track/VideoTrack.h: Move m_id to TrackBase.
85         * platform/graphics/TrackPrivateBase.h: Add idChanged() callback.
86
87 2013-11-06  Antti Koivisto  <antti@apple.com>
88
89         Move array position caching out from HTMLCollection
90         https://bugs.webkit.org/show_bug.cgi?id=123895
91
92         Reviewed by Darin Adler.
93
94         This caching complicates the logic but is used by a single subclass
95         (HTMLFormControlsCollection) only. The subclass can do the caching itself.
96
97         * html/HTMLAllCollection.cpp:
98         (WebCore::HTMLAllCollection::HTMLAllCollection):
99         * html/HTMLCollection.cpp:
100         (WebCore::HTMLCollection::HTMLCollection):
101         (WebCore::HTMLCollection::create):
102         (WebCore::HTMLCollection::item):
103         (WebCore::HTMLCollection::elementBeforeOrAfterCachedElement):
104         (WebCore::HTMLCollection::firstElement):
105         
106             Renamed from traverseFirstElement.
107
108         (WebCore::HTMLCollection::traverseForwardToOffset):
109         (WebCore::HTMLCollection::invalidateCache):
110         
111             Make cache invalidation virtual so we can clear HTMLTableRowsCollection index cache.
112
113         (WebCore::HTMLCollection::namedItem):
114         (WebCore::HTMLCollection::updateNameCache):
115         
116             Use traverseForwardToOffset instead traverseNextElement. This allows removal of traverseNextElement.
117
118         * html/HTMLCollection.h:
119         (WebCore::HTMLCollection::usesCustomForwardOnlyTraversal):
120         
121             Renamed the enum and the accessor to be more informative.
122
123         (WebCore::HTMLCollection::setCachedElement):
124         (WebCore::HTMLCollection::customElementAfter):
125         
126             Renamed from virtualItemAfter.
127
128         * html/HTMLFormControlsCollection.cpp:
129         (WebCore::HTMLFormControlsCollection::HTMLFormControlsCollection):
130         (WebCore::findFormAssociatedElement):
131         (WebCore::HTMLFormControlsCollection::customElementAfter):
132         
133             Move the array position caching logic here.
134
135         (WebCore::HTMLFormControlsCollection::invalidateCache):
136         * html/HTMLFormControlsCollection.h:
137         * html/HTMLNameCollection.cpp:
138         (WebCore::HTMLNameCollection::HTMLNameCollection):
139         * html/HTMLOptionsCollection.cpp:
140         (WebCore::HTMLOptionsCollection::HTMLOptionsCollection):
141         * html/HTMLTableRowsCollection.cpp:
142         (WebCore::HTMLTableRowsCollection::HTMLTableRowsCollection):
143         (WebCore::HTMLTableRowsCollection::customElementAfter):
144         * html/HTMLTableRowsCollection.h:
145
146 2013-11-06  Michał Pakuła vel Rutka  <m.pakula@samsung.com>
147
148         [ATK] accessibility/title-ui-element-correctness.html fails
149         https://bugs.webkit.org/show_bug.cgi?id=99825
150
151         Reviewed by Mario Sanchez Prada.
152
153         When calling setAtkRelationSetFromCoreObject a new ATK_LABELLED_BY_RELATION
154         is added, adding proper label element as a relation. When the document structure
155         has been changed and a different label should be linked as a relation, current ATK
156         implementation adds it as a next target on relation's target list, while
157         WTR/DumpRenderTree implementation takes only first one into account.
158         This patch adds a new function removing current relations before adding new ones.
159
160         Covered by existing tests.
161
162         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
163         (removeAtkRelationFromRelationSetByType):
164         (setAtkRelationSetFromCoreObject):
165
166 2013-11-06  Daniel Bates  <dabates@apple.com>
167
168         Add ENABLE(TEXT_SELECTION)
169         https://bugs.webkit.org/show_bug.cgi?id=123827
170
171         Reviewed by Ryosuke Niwa.
172
173         Add compile-time guard, ENABLE(TEXT_SELECTION), to enable or
174         disable selection painting in WebCore (enabled by default).
175
176         On iOS we disable WebCore selection painting and have UIKit
177         paint the selection.
178
179         * rendering/InlineTextBox.cpp:
180         (WebCore::InlineTextBox::paintSelection): Only paint selection when
181         TEXT_SELECTION is enabled.
182         * rendering/LogicalSelectionOffsetCaches.h:
183         (WebCore::LogicalSelectionOffsetCaches::LogicalSelectionOffsetCaches):
184         For now, add a ENABLE(TEXT_SELECTION)-guard around an assertion. Added
185         a FIXME comment to investigate the callers and either move the assertion
186         to the appropriate callers or structure the code such that we can remove
187         the assertion.
188         * rendering/RenderBlock.cpp:
189         (WebCore::RenderBlock::paintSelection): Only paint selection when
190         TEXT_SELECTION is enabled.
191         * rendering/TextPaintStyle.cpp:
192         (WebCore::computeTextSelectionPaintStyle): Only compute the selection
193         paint style when TEXT_SELECTION is enabled. Otherwise, return a paint
194         style identical to the text paint style. Also, substitute nullptr for 0.
195
196 2013-11-06  Jer Noble  <jer.noble@apple.com>
197
198         Unrevewied Windows build fix after r158736; add InlineElementBox.cpp to the RenderingAllInOne.cpp file.
199
200         * rendering/RenderingAllInOne.cpp:
201
202 2013-11-06  Sergio Villar Senin  <svillar@igalia.com>
203
204         Unreviewed build fix, style() return type is now a reference.
205
206         * rendering/RenderGrid.cpp:
207         (WebCore::RenderGrid::resolveGridPositionFromStyle):
208
209 2013-11-06  Jer Noble  <jer.noble@apple.com>
210
211         Unreviewed 32-bit Mac build fix; use an explicit FloatSize -> IntSize conversion function.
212
213         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
214         (WebCore::MediaPlayerPrivateAVFoundationObjC::sizeChanged):
215
216 2013-11-04  Jer Noble  <jer.noble@apple.com>
217
218         Playing many sounds with HTML5 Audio makes WebKit unresponsive
219         https://bugs.webkit.org/show_bug.cgi?id=116145
220
221         Reviewed by Eric Carlson.
222
223         Cache as much information as possible from AVPlayerItem to eliminate unneccesary
224         calls into AVFoundation.
225
226         Add WillChange/DidChange functions to handle the results of KVO notifications
227         from AVPlayerItem and AVPlayer:
228         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
229         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformPlay):
230         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformPause):
231         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateRate):
232         (WebCore::MediaPlayerPrivateAVFoundationObjC::playerItemStatusDidChange):
233         (WebCore::MediaPlayerPrivateAVFoundationObjC::playbackLikelyToKeepUpWillChange):
234         (WebCore::MediaPlayerPrivateAVFoundationObjC::playbackLikelyToKeepUpDidChange):
235         (WebCore::MediaPlayerPrivateAVFoundationObjC::playbackBufferEmptyWillChange):
236         (WebCore::MediaPlayerPrivateAVFoundationObjC::playbackBufferEmptyDidChange):
237         (WebCore::MediaPlayerPrivateAVFoundationObjC::playbackBufferFullWillChange):
238         (WebCore::MediaPlayerPrivateAVFoundationObjC::playbackBufferFullDidChange):
239         (WebCore::MediaPlayerPrivateAVFoundationObjC::seekableTimeRangesDidChange):
240         (WebCore::MediaPlayerPrivateAVFoundationObjC::loadedTimeRangesDidChange):
241         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksDidChange):
242         (WebCore::MediaPlayerPrivateAVFoundationObjC::hasEnabledAudioDidChange):
243         (WebCore::MediaPlayerPrivateAVFoundationObjC::presentationSizeDidChange):
244         (WebCore::MediaPlayerPrivateAVFoundationObjC::durationDidChange):
245         (WebCore::MediaPlayerPrivateAVFoundationObjC::rateDidChange):
246         (WebCore::itemKVOProperties):
247         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
248
249         Instruct the HTMLMediaElement to cache the currentTime value for 5 seconds:
250         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
251         (WebCore::MediaPlayerPrivateAVFoundationObjC::maximumDurationToCacheMediaTime):
252
253         Add and initialize member variables to hold these cached values:
254         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
255         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
256         (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
257         (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
258
259         Add a new Notification type which can take (and call) a Function object:
260         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
261         (WebCore::MediaPlayerPrivateAVFoundation::dispatchNotification):
262         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
263         (WebCore::MediaPlayerPrivateAVFoundation::Notification::Notification):
264         (WebCore::MediaPlayerPrivateAVFoundation::Notification::function):
265
266         Implement queries in terms of the cached values of AVPlayerItem and AVPlayer
267         properties:
268         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
269         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
270         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
271         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem):
272         (WebCore::MediaPlayerPrivateAVFoundationObjC::playerItemStatus):
273         (WebCore::MediaPlayerPrivateAVFoundationObjC::rate):
274         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformBufferedTimeRanges):
275         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMinTimeSeekable):
276         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMaxTimeSeekable):
277         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMaxTimeLoaded):
278         (WebCore::MediaPlayerPrivateAVFoundationObjC::totalBytes):
279         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):
280         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateAudioTracks):
281         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoTracks):
282         (WebCore::MediaPlayerPrivateAVFoundationObjC::sizeChanged):
283         (WebCore::MediaPlayerPrivateAVFoundationObjC::processLegacyClosedCaptionsTracks):
284
285         Invalidate the cached currentTime before calling scheduleTimeUpdate so that the
286         correct movieTime is saved in m_clockTimeAtLastUpdateEvent:
287         * html/HTMLMediaElement.cpp:
288         (HTMLMediaElement::setReadyState):
289
290 2013-10-24  Sergio Villar Senin  <svillar@igalia.com>
291
292         [CSS Grid Layout] Add support for named grid areas
293         https://bugs.webkit.org/show_bug.cgi?id=120045
294
295         Reviewed by Andreas Kling.
296
297         From Blink r155555, r155850 and r155889 by <jchaffraix@chromium.org>
298
299         Added support for named grid areas. Basically a named grid area is
300         now a valid grid position. The shorthand parsing of grid-area was
301         split from the grid-{row|column} as the rules for expanding are
302         slightly different.
303
304         Unknown grid area names are treated as 'auto' as per the
305         specification. This means that for those cases we need to trigger
306         the auto-placement algorithm.
307
308         Tests: fast/css-grid-layout/grid-item-bad-named-area-auto-placement.html
309                fast/css-grid-layout/grid-item-named-grid-area-resolution.html
310
311         * css/CSSComputedStyleDeclaration.cpp:
312         (WebCore::valueForGridPosition):
313         * css/CSSParser.cpp:
314         (WebCore::CSSParser::parseValue):
315         (WebCore::CSSParser::parseGridPosition):
316         (WebCore::gridMissingGridPositionValue):
317         (WebCore::CSSParser::parseGridItemPositionShorthand):
318         (WebCore::CSSParser::parseGridAreaShorthand):
319         (WebCore::CSSParser::parseSingleGridAreaLonghand):
320         * css/CSSParser.h:
321         * css/StyleResolver.cpp:
322         (WebCore::StyleResolver::adjustRenderStyle):
323         (WebCore::StyleResolver::adjustGridItemPosition):
324         (WebCore::createGridPosition):
325         * css/StyleResolver.h:
326         * rendering/RenderGrid.cpp:
327         (WebCore::RenderGrid::resolveGridPositionFromStyle):
328         * rendering/style/GridPosition.h:
329         (WebCore::GridPosition::isNamedGridArea):
330         (WebCore::GridPosition::setNamedGridArea):
331         (WebCore::GridPosition::namedGridLine):
332
333 2013-11-06  Chris Fleizach  <cfleizach@apple.com>
334
335         AX: Audio and Video attachments are not output to VoiceOver
336         https://bugs.webkit.org/show_bug.cgi?id=123479
337
338         Reviewed by Mario Sanchez Prada.
339
340         Video and audio elements don't appear as distinct objects in the AX hierarchy,
341         nor are they treated as replaceable objects when emitting the text. We should
342         treat these characters like attachments, for one. On the Mac platform, we should
343         also identify them with special subroles.
344
345         Tests: platform/mac/accessibility/media-emits-object-replacement.html
346                platform/mac/accessibility/media-role-descriptions.html
347
348         * accessibility/AccessibilityNodeObject.cpp:
349         (WebCore::AccessibilityNodeObject::isGenericFocusableElement):
350         * accessibility/AccessibilityObject.h:
351         * accessibility/AccessibilityRenderObject.cpp:
352         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
353         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
354         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
355         (createAccessibilityRoleMap):
356         (-[WebAccessibilityObjectWrapper subrole]):
357         (-[WebAccessibilityObjectWrapper roleDescription]):
358         * editing/TextIterator.cpp:
359         (WebCore::isRendererReplacedElement):
360
361
362 2013-11-06  Ryosuke Niwa  <rniwa@webkit.org>
363
364         Notify nodes removal to Range/Selection after dispatching blur and mutation event
365         https://bugs.webkit.org/show_bug.cgi?id=123880
366
367         Reviewed by Andreas Kling.
368
369         Merge https://chromium.googlesource.com/chromium/blink/+/b60576a0560d14f8757e58d55d37b7cefa48a6ac
370
371         In willRemoveChildren in ContainerNode.cpp, call Document::nodeChildrenWillBeRemoved after instead of
372         before dispatching mutation events because we need to update ranges created by those mutation event
373         listeners. willRemoveChild was fixed in r115686.
374
375         Tests: editing/selection/selection-change-in-blur-event-by-remove-children.html
376                editing/selection/selection-change-in-mutation-event-by-remove-children.html
377                fast/dom/Range/range-created-during-remove-children.html
378
379         * dom/ContainerNode.cpp:
380         (WebCore::willRemoveChildren):
381
382 2013-11-06  Ryosuke Niwa  <rniwa@webkit.org>
383
384         Fix out-of-date offset in selection range code in range.surroundContents
385         https://bugs.webkit.org/show_bug.cgi?id=123871
386
387         Reviewed by Andreas Kling.
388         
389         Merge https://chromium.googlesource.com/chromium/blink/+/c89b413ff0fc4aafa0c71d180b0b1e131bb37707
390
391         The code in Range::insertNode assumeed that the start offset of the selection range within its container
392         doesn't change across a call to insertBefore on the container but this is wrong. This patch recomputes
393         the start offset when it is used after the insertBefore call.
394
395         Test: editing/selection/range-surroundContents-with-preceding-node.html
396
397         * dom/Range.cpp:
398         (WebCore::Range::insertNode):
399
400 2013-11-06  Andreas Kling  <akling@apple.com>
401
402         Add InlineElementBox and stop instantiating InlineBox directly.
403         <https://webkit.org/b/123882>
404
405         Make the InlineBox constructors protected and add a new class
406         called InlineElementBox on top. This is somewhat analogous to the
407         split between RenderText and RenderElement, and allows us to make
408         renderer() return a far tighter RenderBoxModelObject& instead
409         of a RenderObject&.
410
411         Moved over attachLine(), deleteLine() and extractLine() to start
412         things off. More things will follow.
413
414         Reviewed by Antti Koivisto.
415
416 2013-11-06  Piotr Grad  <p.grad@samsung.com>
417
418         Seek for video doesn't work when playback rate is negative
419         https://bugs.webkit.org/show_bug.cgi?id=123791
420
421         In MediaPlayerPrivateGStreamer::seek negative playback rate was not taken to account.
422
423         Reviewed by Philippe Normand.
424
425         Test: media/video-seek-with-negative-playback.html
426
427         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
428         (WebCore::MediaPlayerPrivateGStreamer::seek):
429
430 2013-11-06  Andreas Kling  <akling@apple.com>
431
432         Reinstate an annoying assertion that I accidentally commented out.
433
434         * loader/icon/IconDatabase.cpp:
435         (WebCore::IconDatabase::synchronousIconForPageURL):
436
437 2013-11-06  Brendan Long  <b.long@cablelabs.com>
438
439         [GStreamer] Override label() and language() in Audio and VideoTrackPrivateGStreamer
440         https://bugs.webkit.org/show_bug.cgi?id=123836
441
442         The tests are currently flakey because we only get the label and language if we get
443         tags after the track client is set.
444
445         Reviewed by Philippe Normand.
446
447         No new tests because the tests already exist (this fixes flakeyness).
448
449         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h: Override label() and language() to use m_label and m_language.
450         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h: Same.
451         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h: Make m_label and m_language protected so they can be used in the functions above.
452
453 2013-11-05  Andreas Kling  <akling@apple.com>
454
455         RenderBlockFlow should only expose its line boxes as RootInlineBox.
456         <https://webkit.org/b/123878>
457
458         The line boxes attached directly to a RenderBlockFlow are always
459         RootInlineBox objects, so call sites should always use the tightly
460         typed firstRootBox() and lastRootBox().
461
462         This allows the compiler to devirtualize calls to member functions
463         of RootInlineBox that are marked FINAL.
464
465         Reviewed by Antti Koivisto.
466
467 2013-11-06  Ryosuke Niwa  <rniwa@webkit.org>
468
469         Assertion failure end < m_runCount in WebCore::BidiRunList<WebCore::BidiRun>::reverseRuns
470         https://bugs.webkit.org/show_bug.cgi?id=123863
471
472         Reviewed by Andreas Kling.
473
474         Merge https://chromium.googlesource.com/chromium/blink/+/cbaa92c763a37d89eeabd01658e522219299290c
475
476         Test: fast/text/bidi-reverse-runs-crash.html
477
478         * platform/text/BidiResolver.h:
479         (WebCore::BidiResolver<Iterator, Run>::createBidiRunsForLine): Don't reverse the runs if there's
480         nothing to be reversed.
481
482 2013-11-05  Ryosuke Niwa  <rniwa@webkit.org>
483
484         Address the review comment after r158724.
485
486         * html/RangeInputType.cpp:
487         (WebCore::RangeInputType::handleMouseDownEvent):
488
489 2013-11-05  Zalan Bujtas  <zalan@apple.com>
490
491         Widget's position change should not initiate layout, only when its size changes.
492         https://bugs.webkit.org/show_bug.cgi?id=123860
493
494         Reviewed by Andreas Kling.
495
496         RenderWidgets initiate unnecessary layouts while scrolling when they are embedded to
497         overflow:scroll containers. Scroll position change doesn't dirty the render tree
498         so it should not trigger layout either.
499
500         Manual test added. Unfortunately we can't test against the number of layouts yet.
501
502         * rendering/RenderWidget.cpp:
503         (WebCore::RenderWidget::setWidgetGeometry):
504         (WebCore::RenderWidget::updateWidgetGeometry):
505         (WebCore::RenderWidget::updateWidgetPosition):
506
507 2013-11-05  Ryosuke Niwa  <rniwa@webkit.org>
508
509         Use-after-free in SliderThumbElement::dragFrom
510         https://bugs.webkit.org/show_bug.cgi?id=123873
511
512         Reviewed by Andreas Kling.
513
514         Ref the SliderThumbElement since it could go away inside dragFrom.
515
516         Test: fast/forms/range/range-type-change-onchange-2.html
517
518         * html/RangeInputType.cpp:
519         (WebCore::RangeInputType::handleMouseDownEvent):
520
521 2013-11-05  Ryosuke Niwa  <rniwa@webkit.org>
522
523         Change the order of conditions to avoid computing rendererIsEditable()
524         https://bugs.webkit.org/show_bug.cgi?id=123868
525
526         Reviewed by Andreas Kling.
527
528         Merge https://chromium.googlesource.com/chromium/blink/+/c89b413ff0fc4aafa0c71d180b0b1e131bb37707
529
530         When we need both Node::renderer() and Node::rendererIsEditable() conditions to be true to perform
531         some operation, it is more effective to check for renderer() first, so that if this condition fails
532         we can avoid unnecessary computation of rendererIsEditable().
533
534         * dom/Position.cpp:
535         (WebCore::nextRenderedEditable):
536         (WebCore::previousRenderedEditable):
537         * page/EventHandler.cpp:
538         (WebCore::EventHandler::handleMouseReleaseEvent):
539
540 2013-11-05  Ryosuke Niwa  <rniwa@webkit.org>
541
542         simpleUserAgentStyleSheet doesn't have focus ring on anchor element
543         https://bugs.webkit.org/show_bug.cgi?id=123867
544
545         Reviewed by Andreas Kling.
546
547         Merge https://chromium.googlesource.com/chromium/blink/+/08ecc23c4d80be9969918c4baf0ac83dc6cb6cbd
548
549         * css/CSSDefaultStyleSheets.cpp:
550
551 2013-11-05  Ryosuke Niwa  <rniwa@webkit.org>
552
553         valueForBorderRadiusShorthand returns wrong values in some case
554         https://bugs.webkit.org/show_bug.cgi?id=123866
555
556         Reviewed by Andreas Kling.
557
558         Merge https://chromium.googlesource.com/chromium/blink/+/0933728126f2db06ab8e945efc98bffa2d42af1c
559
560         Because valueForBorderRadiusShorthand misses the followings:
561         - showHorizontalBottomRight depends on showHorizontalBottomLeft.
562         - showHorizontalTopRight depends on showHorizontalBottomRight (including showHorizontalBottomLeft).
563
564         See also http://dev.w3.org/csswg/css-backgrounds/#the-border-radius
565
566         Test: fast/css/getComputedStyle/getComputedStyle-borderRadius-2.html
567
568         * css/CSSComputedStyleDeclaration.cpp:
569         (WebCore::getBorderRadiusShorthandValue):
570
571 2013-11-05  Ryosuke Niwa  <rniwa@webkit.org>
572
573         Protect DOM nodes in IndentOutdentCommand::tryIndentingAsListItem()
574         https://bugs.webkit.org/show_bug.cgi?id=123861
575
576         Reviewed by Benjamin Poulain.
577
578         Merge https://chromium.googlesource.com/chromium/blink/+/297442eb539a2b764fdad323de79099a70179186 partially.
579
580         * editing/IndentOutdentCommand.cpp:
581         (WebCore::IndentOutdentCommand::tryIndentingAsListItem): Make selectedListItem, previousList, and nextList
582         RefPtr since they're are used after calling insertNodeBefore.
583
584 2013-11-05  Andreas Kling  <akling@apple.com>
585
586         Apply more unique_ptr to line box management.
587         <https://webkit.org/b/123857>
588
589         Make all of the functions that return newly-created line boxes
590         return them packed up in std::unique_ptrs.
591
592         There is one exception in RenderBlockLineLayout where the function
593         createInlineBoxForRenderer() is inconsistent about the ownership of
594         the returned object. This will be addressed by a subsequent patch.
595
596         We now "release" the line boxes into their various home structures,
597         so the pointer smartness doesn't go end-to-end just yet.
598
599         Reviewed by Anders Carlsson.
600
601 2013-11-05  Ryosuke Niwa  <rniwa@webkit.org>
602
603         getComputedStyle(x).lineHeight is affected by zooming
604         https://bugs.webkit.org/show_bug.cgi?id=123847
605
606         Reviewed by Benjamin Poulain.
607
608         Merge https://chromium.googlesource.com/chromium/blink/+/7957097afbab2899ababd0d9c8acbf6e3eddb870
609
610         Test: fast/css/line-height-zoom-get-computed-style.html
611
612         * css/CSSComputedStyleDeclaration.cpp:
613         (WebCore::lineHeightFromStyle): Don't round line-height values.
614         * css/DeprecatedStyleBuilder.cpp:
615         (WebCore::ApplyPropertyLineHeight::applyValue): Use the computed value instead of the used value.
616
617 2013-11-05  James Craig  <jcraig@apple.com>
618
619         AX: media controls accessibility needs more work
620         https://bugs.webkit.org/show_bug.cgi?id=123749
621
622         Reviewed by Jer Noble.
623
624         Updated some of the control labels/roles to improve accessibility.
625           - Volume slider is now keyboard/screenreader accessible.
626           - muteButton was a checkbox toggling checked state, now a button that toggles label "mute/unmute"
627           - fullscreenButton was a checkbox toggling checked state, now a button that toggles label "display/exit full screen"
628           - captionButton was a checkbox, now a popup button that launches the newly accessible menu.
629         Subtitles menu is now keyboard/screenreader accessible (uses roaming tabindex).
630         Render dump expectations changed because volume slider is now hidden via... 
631         ...opacity/size (to make accessible without hover) instead of display:none.
632
633         Updated existing test coverage.
634
635         * Modules/mediacontrols/mediaControlsApple.css:
636         (audio::-webkit-media-controls-panel .volume-box):
637         (audio::-webkit-media-controls-panel .volume-box:active):
638         (audio::-webkit-media-controls-toggle-closed-captions-button):
639         (audio::-webkit-media-controls-closed-captions-container .list):
640         (audio::-webkit-media-controls-closed-captions-container li:focus):
641         * Modules/mediacontrols/mediaControlsApple.js:
642         (Controller.prototype.createControls):
643         (Controller.prototype.handleFullscreenChange):
644         (Controller.prototype.handleMuteButtonClicked):
645         (Controller.prototype.handleMinButtonClicked):
646         (Controller.prototype.handleMaxButtonClicked):
647         (Controller.prototype.handleVolumeSliderChange):
648         (Controller.prototype.buildCaptionMenu):
649         (Controller.prototype.focusSiblingCaptionItem):
650         (Controller.prototype.handleCaptionItemKeyUp):
651
652 2013-11-05  Andreas Kling  <akling@apple.com>
653
654         Move some plugin-specific code from RenderWidget to RenderEmbeddedObject.
655         <https://webkit.org/b/123845>
656
657         All RenderWidgets representing plugins will be RenderEmbeddedObjects.
658         Move some of the plugin-specific logic to RenderEmbeddedObject since it
659         doesn't make sense for all RenderWidgets (frames, embedded documents)
660         to care about this.
661
662         Reviewed by Anders Carlsson.
663
664 2013-11-05  Tim Horton  <timothy_horton@apple.com>
665
666         Fix the 32-bit build.
667
668         * WebCore.exp.in:
669
670 2013-11-05  Alexandru Chiculita  <achicu@adobe.com>
671
672         Web Inspector: Moving an element while in the DOMNodeRemoved handler will hide it in the inspector
673         https://bugs.webkit.org/show_bug.cgi?id=123516
674
675         Reviewed by Timothy Hatcher.
676
677         InspectorInstrumentation::willRemoveDOMNode was actually calling both willRemoveDOMNodeImpl and
678         didRemoveDOMNodeImpl, making the DOMAgent unbind the element even if it was still part of the DOM.
679
680         Because of that the DOMAgent was sending two events:
681         1. When the element was about to be removed, just before JS "DOMNodeRemoved" was triggered.
682         2. When the element was actually removed.
683
684         Note that inspector's event #2 will not know about the node, as it just removed it from the
685         internal hashmap, so it will just use a nodeID == 0 for it.
686
687         This patch adds a separate call to InspectorInstrumentation::didRemoveDOMNode, just before the
688         element is about to be removed. The InspectorInstrumentation::willRemoveDOMNode call is now only used
689         by the DOMDebugger to trigger the DOM breakpoints in the Web Inspector. That feature is not exposed
690         in the new Inspector UI, but can be used/tested using the protocol directly.
691
692         Tests: inspector-protocol/dom-debugger/node-removed.html
693                inspector-protocol/dom/dom-remove-events.html
694                inspector-protocol/dom/remove-multiple-nodes.html
695
696         * dom/ContainerNode.cpp:
697         (WebCore::ContainerNode::removeBetween):
698         * inspector/InspectorInstrumentation.h:
699         (WebCore::InspectorInstrumentation::willRemoveDOMNode):
700         (WebCore::InspectorInstrumentation::didRemoveDOMNode):
701
702 2013-11-05  Ryuan Choi  <ryuan.choi@samsung.com>
703
704         Unreviewed build fix on CMake based ports with GLES.
705
706         * CMakeLists.txt:
707         Added OPENGLES2_LIBRARIES and OPENGLES2_INCLUDE_DIR into the includes and
708         libraries list.
709
710 2013-11-05  Tim Horton  <timothy_horton@apple.com>
711
712         platformCALayerDeviceScaleFactor should be const
713         https://bugs.webkit.org/show_bug.cgi?id=123842
714
715         Reviewed by Simon Fraser.
716
717         * WebCore.exp.in:
718         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
719         (WebCore::LayerClient::platformCALayerDeviceScaleFactor):
720         * platform/graphics/ca/GraphicsLayerCA.cpp:
721         (WebCore::GraphicsLayerCA::platformCALayerDeviceScaleFactor):
722         * platform/graphics/ca/GraphicsLayerCA.h:
723         * platform/graphics/ca/PlatformCALayerClient.h:
724         * platform/graphics/ca/mac/TileController.h:
725         * platform/graphics/ca/mac/TileController.mm:
726         (WebCore::TileController::platformCALayerDeviceScaleFactor):
727         * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp:
728         (WebCore::MediaPlayerPrivateQuickTimeVisualContext::LayerClient::platformCALayerDeviceScaleFactor):
729         Constify PlatformCALayerClient::platformCALayerDeviceScaleFactor.
730
731 2013-11-05  Gavin Barraclough  <barraclough@apple.com>
732
733         Subresource loads should not prevent page throttling
734         https://bugs.webkit.org/show_bug.cgi?id=123757
735
736         Reviewed by Alexey Proskuryakov.
737
738         The page-is-loading test for inhibiting process supression is currently
739         too conservative, preventing supression of pages with infinitely loading
740         resources (commonly XHRs). Instead, just rely on the FrameLoader being
741         active (with hysteresis).
742
743         * loader/SubresourceLoader.cpp:
744         (WebCore::SubresourceLoader::init):
745         (WebCore::SubresourceLoader::checkForHTTPStatusCodeError):
746         (WebCore::SubresourceLoader::didFinishLoading):
747         (WebCore::SubresourceLoader::didFail):
748         (WebCore::SubresourceLoader::willCancel):
749         * loader/SubresourceLoader.h:
750             - remove m_activityAssertion from SubresourceLoader.
751
752 2013-11-05  Tim Horton  <timothy_horton@apple.com>
753
754         [mac] PDFDocumentImage is too big if PDF has a crop box smaller than the media box
755         https://bugs.webkit.org/show_bug.cgi?id=123840
756         <rdar://problem/15308765>
757
758         Reviewed by Alexey Proskuryakov.
759
760         Test: fast/images/pdf-as-image-crop-box.html
761
762         * platform/graphics/cg/PDFDocumentImage.cpp:
763         (WebCore::PDFDocumentImage::size):
764         Use the crop box when determining the size of the image.
765
766         (WebCore::PDFDocumentImage::computeBoundsForCurrentPage):
767         * platform/graphics/cg/PDFDocumentImage.h:
768         * platform/graphics/mac/PDFDocumentImageMac.mm:
769         (WebCore::PDFDocumentImage::computeBoundsForCurrentPage):
770         Get rid of m_mediaBox, since we don't need it anymore.
771
772         (WebCore::PDFDocumentImage::drawPDFPage):
773         PDFKit does the translation by the crop box origin for us;
774         if we do it additionally, we'll be painting the wrong part of the image.
775         So, don't do the translation here.
776
777 2013-11-05  Antti Koivisto  <antti@apple.com>
778
779         Factor index cache for NodeLists and HTMLCollections to a class
780         https://bugs.webkit.org/show_bug.cgi?id=123823
781
782         Reviewed by Ryosuke Niwa.
783
784         Implement index cache class that can used by NodeLists and HTMLCollections that currently
785         each have implementations of their own.
786         
787         This patch also implements ChildNodeList and LiveNodeList using CollectionIndexCache.
788         HTMLCollection is will be transitioned later.
789
790         * GNUmakefile.list.am:
791         * WebCore.vcxproj/WebCore.vcxproj:
792         * WebCore.xcodeproj/project.pbxproj:
793         * dom/ChildNodeList.cpp:
794         (WebCore::ChildNodeList::ChildNodeList):
795         (WebCore::ChildNodeList::length):
796         (WebCore::ChildNodeList::item):
797         
798             The client calls to cache to for indexed and size access.
799
800         (WebCore::ChildNodeList::collectionFirst):
801         (WebCore::ChildNodeList::collectionLast):
802         (WebCore::ChildNodeList::collectionTraverseForward):
803         (WebCore::ChildNodeList::collectionTraverseBackward):
804         
805             Cache calls back to these as needed to do the actual traversal.
806
807         (WebCore::ChildNodeList::invalidateCache):
808         * dom/ChildNodeList.h:
809         * dom/CollectionIndexCache.h: Added.
810         
811             Templated cache class itself.
812
813         (WebCore::::CollectionIndexCache):
814         (WebCore::::nodeCount):
815         (WebCore::::nodeBeforeCached):
816         (WebCore::::nodeAfterCached):
817         (WebCore::::nodeAt):
818         (WebCore::::invalidate):
819         * dom/LiveNodeList.cpp:
820         (WebCore::firstMatchingElement):
821         (WebCore::nextMatchingElement):
822         (WebCore::traverseMatchingElementsForward):
823         (WebCore::LiveNodeList::collectionFirst):
824         (WebCore::LiveNodeList::collectionLast):
825         (WebCore::LiveNodeList::collectionTraverseForward):
826         (WebCore::LiveNodeList::collectionTraverseBackward):
827         (WebCore::LiveNodeList::length):
828         (WebCore::LiveNodeList::item):
829         (WebCore::LiveNodeList::invalidateCache):
830         * dom/LiveNodeList.h:
831         (WebCore::LiveNodeList::LiveNodeList):
832
833 2013-11-05  Enrica Casucci  <enrica@apple.com>
834
835         Full width semicolon is wrong in vertical text.
836         https://bugs.webkit.org/show_bug.cgi?id=123814
837         <rdar://problem/15312541>
838
839         Reviewed by Benjamin Poulain.
840
841         The full width semicolon should always be upright.
842         Adding it to the list of characters that should
843         ignore rotation.
844
845         * platform/graphics/FontGlyphs.cpp:
846         (WebCore::shouldIgnoreRotation):
847
848 2013-11-05  Andreas Kling  <akling@apple.com>
849
850         Remove unused RenderWidget::notifyWidget().
851
852         Rubber-stamped by Anders Carlsson.
853
854 2013-11-05  Commit Queue  <commit-queue@webkit.org>
855
856         Unreviewed, rolling out r158678.
857         http://trac.webkit.org/changeset/158678
858         https://bugs.webkit.org/show_bug.cgi?id=123820
859
860         Causes a new debug assertion failure on the Mavericks test
861         system. (Requested by bfulgham on #webkit).
862
863         * rendering/mathml/RenderMathMLOperator.cpp:
864
865 2013-11-05  Renata Hodovan  <reni@webkit.org>
866
867         ASSERTION FAILED: isHTMLTitleElement(m_titleElement.get()) in WebCore::Document::setTitle
868         https://bugs.webkit.org/show_bug.cgi?id=122092
869
870         Reviewed by Darin Adler.
871
872         Remove a bogus assert in Document::setTitle().
873         m_titleElement can be either of HTMLTitleElement or SVGTitleElement. The assertion was wrong.
874         
875         Backported from Blink:
876         https://src.chromium.org/viewvc/blink?revision=158620&view=revision
877
878         Test: svg/custom/title-assertion.html
879
880         * dom/Document.cpp:
881         (WebCore::Document::setTitle):
882         * svg/SVGTitleElement.cpp:
883         (WebCore::SVGTitleElement::insertedInto):
884
885 2013-11-05  Martin Robinson  <mrobinson@igalia.com>
886
887         [MathML] Poor spacing around delimiters in MathML Torture Test 14
888         https://bugs.webkit.org/show_bug.cgi?id=122837
889
890         Reviewed by Brent Fulgham.
891
892         Instead of stretching the vertical bar with the stretchable version, just repeat
893         the normal vertical bar. This follows what Gecko does when rendering tall vertical
894         bars and also works around an issue with STIX fonts leading to poor spacing in
895         formulas.
896
897         * rendering/mathml/RenderMathMLOperator.cpp: Stretch the vertical bar with the
898         normal variant.
899
900 2013-11-05  Daniel Bates  <dabates@apple.com>
901
902         XSSAuditor should catch reflected srcdoc properties even without a <frame> tag injection
903
904         From Blink r160615 by <tsepez@chromium.org>
905         https://src.chromium.org/viewvc/blink?view=rev&revision=160615
906
907         Test: http/tests/security/xssAuditor/iframe-srcdoc-property-blocked.html
908
909         * html/parser/XSSAuditor.cpp:
910         (WebCore::XSSAuditor::filterIframeToken):
911
912 2013-11-05  Éva Balázsfalvi  <balazsfalvi.eva@stud.u-szeged.hu>
913
914         Delete maketokenizer.
915         https://bugs.webkit.org/show_bug.cgi?id=115155
916
917         Reviewed by Zoltan Herczeg.
918
919         This script was used to generate the old flex based CSS tokenizer. It
920         was replaced by a custom tokenizer in r106217 but the script wasn't
921         removed. Since there is no mention of it in the original bug nor any
922         reference to maketokenizer in our build files, it's probably an
923         oversight.
924
925         Merge from blink:
926         https://chromium.googlesource.com/chromium/blink/+/2a1c8aaf867f707ccdcd8893446e907e2aa2e1c2
927
928         * css/maketokenizer: Removed.
929
930 2013-11-05  Zan Dobersek  <zdobersek@igalia.com>
931
932         Unreviewed. Unbreaking GCC builds.
933
934         * html/HTMLCollection.cpp:
935         (WebCore::isMatchingElement): This inline function is not a template anymore.
936
937 2013-11-05  Antti Koivisto  <antti@apple.com>
938
939         Make it compile.
940
941         * dom/LiveNodeList.h:
942         (WebCore::LiveNodeList::LiveNodeList):
943         (WebCore::LiveNodeList::~LiveNodeList):
944         * dom/NodeRareData.h:
945         (WebCore::NodeListsNodeData::adoptDocument):
946         * html/HTMLCollection.cpp:
947         (WebCore::HTMLCollection::HTMLCollection):
948         (WebCore::HTMLCollection::~HTMLCollection):
949
950 2013-11-05  Antti Koivisto  <antti@apple.com>
951
952         HTMLCollection should not be NodeList
953         https://bugs.webkit.org/show_bug.cgi?id=123794
954
955         Reviewed by Andreas Kling.
956
957         HTMLCollection and NodeList are unrelated types in DOM yet our HTMLCollection inherits NodeList
958         for code sharing reasons. While some code does get shared the types are sufficiently different 
959         that this results in lots of unnecessary branches, complexity and general awkwardness. Code sharing 
960         can be better achieved by means other than inheritance.
961         
962         This patch splits HTMLCollection from NodeList by copy-pasting and eliminating resulting redundancies. 
963         Sharing comes later.
964
965         * dom/Attr.cpp:
966         (WebCore::Attr::setValue):
967         (WebCore::Attr::childrenChanged):
968         * dom/ClassNodeList.cpp:
969         (WebCore::ClassNodeList::~ClassNodeList):
970         * dom/ContainerNode.cpp:
971         (WebCore::ContainerNode::childrenChanged):
972         (WebCore::ContainerNode::getElementsByTagName):
973         (WebCore::ContainerNode::getElementsByName):
974         (WebCore::ContainerNode::getElementsByClassName):
975         (WebCore::ContainerNode::radioNodeList):
976         * dom/Document.cpp:
977         (WebCore::Document::Document):
978         (WebCore::Document::~Document):
979         (WebCore::Document::registerNodeList):
980         (WebCore::Document::unregisterNodeList):
981         (WebCore::Document::registerCollection):
982         (WebCore::Document::unregisterCollection):
983         (WebCore::Document::ensureCachedCollection):
984         
985             Add separate functions and map for registering HTMLCollections.
986
987         (WebCore::Document::all):
988         (WebCore::Document::windowNamedItems):
989         (WebCore::Document::documentNamedItems):
990         * dom/Document.h:
991         * dom/Element.cpp:
992         (WebCore::Element::attributeChanged):
993         (WebCore::Element::ensureCachedHTMLCollection):
994         (WebCore::Element::cachedHTMLCollection):
995         * dom/LiveNodeList.cpp:
996         (WebCore::LiveNodeList::rootNode):
997         (WebCore::isMatchingElement):
998         (WebCore::LiveNodeList::iterateForPreviousElement):
999         (WebCore::LiveNodeList::itemBefore):
1000         (WebCore::firstMatchingElement):
1001         (WebCore::nextMatchingElement):
1002         (WebCore::traverseMatchingElementsForwardToOffset):
1003         (WebCore::LiveNodeList::traverseLiveNodeListFirstElement):
1004         (WebCore::LiveNodeList::traverseLiveNodeListForwardToOffset):
1005         (WebCore::LiveNodeList::isLastItemCloserThanLastOrCachedItem):
1006         (WebCore::LiveNodeList::isFirstItemCloserThanCachedItem):
1007         (WebCore::LiveNodeList::length):
1008         (WebCore::LiveNodeList::item):
1009         (WebCore::LiveNodeList::elementBeforeOrAfterCachedElement):
1010         
1011             This code used to live in HTMLCollection.cpp. Copy-paste here and remove all branches not needed for NodeLists.
1012
1013         (WebCore::LiveNodeList::invalidateCache):
1014         
1015             NodeLists have no name caches.
1016
1017         * dom/LiveNodeList.h:
1018         (WebCore::LiveNodeList::LiveNodeList):
1019         (WebCore::LiveNodeList::~LiveNodeList):
1020         (WebCore::LiveNodeList::isRootedAtDocument):
1021         (WebCore::LiveNodeList::type):
1022         (WebCore::LiveNodeList::invalidateCache):
1023         (WebCore::LiveNodeList::setCachedElement):
1024         
1025             Merge LiveNodeListBase and LiveNodeList.
1026             Remove fields and code supporting HTMLCollection.
1027
1028         (WebCore::shouldInvalidateTypeOnAttributeChange):
1029         
1030             Move to global scope. This function is used both HTMLCollections and LiveNodeLists.
1031
1032         * dom/NameNodeList.cpp:
1033         (WebCore::NameNodeList::~NameNodeList):
1034         * dom/NameNodeList.h:
1035         (WebCore::NameNodeList::create):
1036         * dom/Node.cpp:
1037         (WebCore::shouldInvalidateNodeListCachesForAttr):
1038         (WebCore::Document::shouldInvalidateNodeListAndCollectionCaches):
1039         (WebCore::Document::invalidateNodeListAndCollectionCaches):
1040         (WebCore::Node::invalidateNodeListAndCollectionCachesInAncestors):
1041         (WebCore::NodeListsNodeData::invalidateCaches):
1042         * dom/Node.h:
1043         * dom/NodeRareData.h:
1044         (WebCore::NodeListsNodeData::addCacheWithAtomicName):
1045         (WebCore::NodeListsNodeData::addCacheWithName):
1046         (WebCore::NodeListsNodeData::addCacheWithQualifiedName):
1047         (WebCore::NodeListsNodeData::addCachedCollection):
1048         (WebCore::NodeListsNodeData::cachedCollection):
1049         (WebCore::NodeListsNodeData::removeCacheWithAtomicName):
1050         (WebCore::NodeListsNodeData::removeCacheWithName):
1051         (WebCore::NodeListsNodeData::removeCachedCollection):
1052         (WebCore::NodeListsNodeData::isEmpty):
1053         (WebCore::NodeListsNodeData::adoptDocument):
1054         (WebCore::NodeListsNodeData::namedCollectionKey):
1055         (WebCore::NodeListsNodeData::namedNodeListKey):
1056         (WebCore::NodeListsNodeData::deleteThisAndUpdateNodeRareDataIfAboutToRemoveLastList):
1057         
1058             Add separate cache for HTMLCollections.
1059
1060         * dom/TagNodeList.cpp:
1061         (WebCore::TagNodeList::TagNodeList):
1062         (WebCore::TagNodeList::~TagNodeList):
1063         * dom/TagNodeList.h:
1064         (WebCore::TagNodeList::create):
1065         (WebCore::HTMLTagNodeList::create):
1066         * html/CollectionType.h:
1067         
1068             Remove NodeList types.
1069
1070         * html/HTMLCollection.cpp:
1071         (WebCore::shouldOnlyIncludeDirectChildren):
1072         (WebCore::rootTypeFromCollectionType):
1073         (WebCore::invalidationTypeExcludingIdAndNameAttributes):
1074         (WebCore::HTMLCollection::HTMLCollection):
1075         (WebCore::HTMLCollection::~HTMLCollection):
1076         (WebCore::HTMLCollection::rootNode):
1077         (WebCore::isMatchingElement):
1078         (WebCore::HTMLCollection::iterateForPreviousElement):
1079         (WebCore::HTMLCollection::itemBefore):
1080         (WebCore::firstMatchingElement):
1081         (WebCore::nextMatchingElement):
1082         (WebCore::traverseMatchingElementsForwardToOffset):
1083         (WebCore::HTMLCollection::isLastItemCloserThanLastOrCachedItem):
1084         (WebCore::HTMLCollection::isFirstItemCloserThanCachedItem):
1085         (WebCore::HTMLCollection::setCachedElement):
1086         (WebCore::HTMLCollection::length):
1087         (WebCore::HTMLCollection::item):
1088         (WebCore::HTMLCollection::elementBeforeOrAfterCachedElement):
1089         (WebCore::HTMLCollection::traverseFirstElement):
1090         (WebCore::HTMLCollection::traverseNextElement):
1091         (WebCore::HTMLCollection::traverseForwardToOffset):
1092         (WebCore::HTMLCollection::invalidateCache):
1093         (WebCore::HTMLCollection::invalidateIdNameCacheMaps):
1094         (WebCore::HTMLCollection::namedItem):
1095         
1096             Remove NodeList specific branches and functions.
1097             LiveNodeListBase functions are now HTMLCollection functions.
1098
1099         * html/HTMLCollection.h:
1100         (WebCore::HTMLCollection::isRootedAtDocument):
1101         (WebCore::HTMLCollection::invalidationType):
1102         (WebCore::HTMLCollection::type):
1103         (WebCore::HTMLCollection::ownerNode):
1104         (WebCore::HTMLCollection::invalidateCache):
1105         (WebCore::HTMLCollection::document):
1106         (WebCore::HTMLCollection::overridesItemAfter):
1107         (WebCore::HTMLCollection::isElementCacheValid):
1108         (WebCore::HTMLCollection::cachedElement):
1109         (WebCore::HTMLCollection::cachedElementOffset):
1110         (WebCore::HTMLCollection::isLengthCacheValid):
1111         (WebCore::HTMLCollection::cachedLength):
1112         (WebCore::HTMLCollection::setLengthCache):
1113         (WebCore::HTMLCollection::setCachedElement):
1114         (WebCore::HTMLCollection::isItemRefElementsCacheValid):
1115         (WebCore::HTMLCollection::setItemRefElementsCacheValid):
1116         (WebCore::HTMLCollection::rootType):
1117         (WebCore::HTMLCollection::hasNameCache):
1118         (WebCore::HTMLCollection::setHasNameCache):
1119         
1120             Copy-paste functions and fields from former LiveNodeListBase.
1121
1122         * html/HTMLNameCollection.cpp:
1123         (WebCore::HTMLNameCollection::~HTMLNameCollection):
1124         * html/LabelableElement.cpp:
1125         (WebCore::LabelableElement::labels):
1126         * html/LabelsNodeList.cpp:
1127         (WebCore::LabelsNodeList::~LabelsNodeList):
1128         * html/LabelsNodeList.h:
1129         * html/RadioNodeList.cpp:
1130         (WebCore::RadioNodeList::~RadioNodeList):
1131         * html/RadioNodeList.h:
1132         (WebCore::RadioNodeList::create):
1133
1134 2013-11-05  Emilio Pozuelo Monfort  <pochu27@gmail.com>
1135
1136         [GTK] Add stubs for missing symbols in dom bindings
1137         https://bugs.webkit.org/show_bug.cgi?id=123663
1138
1139         Reviewed by Carlos Garcia Campos.
1140
1141         * bindings/gobject/WebKitDOMCustom.cpp:
1142         (webkit_dom_html_head_element_get_profile):
1143         (webkit_dom_html_head_element_set_profile):
1144         (webkit_dom_processing_instruction_get_data):
1145         (webkit_dom_processing_instruction_set_data):
1146         * bindings/gobject/WebKitDOMCustom.h:
1147         * bindings/gobject/WebKitDOMCustom.symbols:
1148
1149 2013-11-05  Zan Dobersek  <zdobersek@igalia.com>
1150
1151         Main thread tasks in ThreadableBlobRegistry should use std::unique_ptr
1152         https://bugs.webkit.org/show_bug.cgi?id=122946
1153
1154         Reviewed by Darin Adler.
1155
1156         The new BlobRegistryContext objects don't have to be adopted into OwnPtr and then have OwnPtr's leaked pointer
1157         passed into the WTF::callOnMainThread call - the pointer to the new heap-allocated object is passed in directly,
1158         with the object ending up being managed by std::unique_ptr in the designated main thread task.
1159
1160         * fileapi/ThreadableBlobRegistry.cpp:
1161         (WebCore::registerBlobURLTask):
1162         (WebCore::ThreadableBlobRegistry::registerBlobURL):
1163         (WebCore::registerBlobURLFromTask):
1164         (WebCore::unregisterBlobURLTask):
1165         (WebCore::ThreadableBlobRegistry::unregisterBlobURL):
1166
1167 2013-11-05  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1168
1169         [CSS] Enable css-image-orientation on EFL and GTK ports.
1170         https://bugs.webkit.org/show_bug.cgi?id=123698
1171
1172         Reviewed by Beth Dakin.
1173
1174         r157909 added wrong early return for css-image-orientation. It causes about 20 regressions in layout test
1175         when enabling css-image-orientation. This fixes those wrong implementation as well as enables it on EFL
1176         and GTK ports by default.
1177
1178         Test: fast/css/image-orientation/image-orientation.html
1179
1180         * loader/cache/CachedImage.cpp:
1181         (WebCore::CachedImage::imageSizeForRenderer):
1182         * platform/graphics/BitmapImage.cpp:
1183         (WebCore::BitmapImage::updateSize):
1184
1185 2013-11-05  Andreas Kling  <akling@apple.com>
1186
1187         RenderEmbeddedObject shouldn't know about fallback content.
1188         <https://webkit.org/b/123781>
1189
1190         Stop caching the presence of fallback (DOM) content in a flag on
1191         RenderEmbeddedObject and have SubframeLoader fetch it directly from
1192         HTMLObjectElement instead.
1193
1194         Also made SubframeLoader::requestObject() take the owner element
1195         by reference since we don't support owner-less embedded objects.
1196
1197         Reviewed by Antti Koivisto.
1198
1199 2013-11-05  Xabier Rodriguez Calvar  <calvaris@igalia.com>
1200
1201         [GStreamer] Remove NATIVE_FULLSCREEN_VIDEO support
1202         https://bugs.webkit.org/show_bug.cgi?id=123437
1203
1204         Reviewed by Philippe Normand.
1205
1206         Removed some dead code as no GStreamer port is using the native
1207         fullscreen video support.
1208
1209         * GNUmakefile.list.am:
1210         * PlatformEfl.cmake:
1211         * PlatformGTK.cmake: Removed compilation of deleted files.
1212         * platform/graphics/MediaPlayer.h: Removed structures related to
1213         GStreamer and NATIVE_FULLSCREEN_VIDEO.
1214         * platform/graphics/gstreamer/FullscreenVideoControllerGStreamer.cpp: Removed.
1215         * platform/graphics/gstreamer/FullscreenVideoControllerGStreamer.h: Removed.
1216         * platform/graphics/gstreamer/GStreamerGWorld.cpp: Removed.
1217         * platform/graphics/gstreamer/GStreamerGWorld.h: Removed.
1218         * platform/graphics/gstreamer/ImageGStreamerCairo.cpp: Removed
1219         gst/video/video.h include.
1220         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1221         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
1222         (WebCore::MediaPlayerPrivateGStreamerBase::platformMedia):
1223         (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink):
1224         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1225         Removed code related to GStreamer and NATIVE_FULLSCREEN_VIDEO.
1226         * platform/graphics/gstreamer/PlatformVideoWindow.h: Removed.
1227         * platform/graphics/gstreamer/PlatformVideoWindowEfl.cpp: Removed.
1228         * platform/graphics/gstreamer/PlatformVideoWindowGtk.cpp: Removed.
1229         * platform/graphics/gstreamer/PlatformVideoWindowMac.mm: Removed.
1230         * platform/graphics/gstreamer/PlatformVideoWindowNix.cpp: Removed.
1231         * platform/graphics/gstreamer/PlatformVideoWindowPrivate.h: Removed.
1232         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
1233         (webkitVideoSinkRender):
1234         (webkitVideoSinkNew):
1235         * platform/graphics/gstreamer/VideoSinkGStreamer.h: Removed code
1236         related to GStreamer and NATIVE_FULLSCREEN_VIDEO.
1237         * platform/graphics/gtk/FullscreenVideoControllerGtk.cpp: Removed.
1238         * platform/graphics/gtk/FullscreenVideoControllerGtk.h: Removed.
1239
1240 2013-11-05  Andreas Kling  <akling@apple.com>
1241
1242         Remove RenderWidget::viewCleared().
1243         <https://webkit.org/b/123777>
1244
1245         This was some ancient hand-waving code from the KHTML era.
1246
1247         It was obviously confused (e.g RenderEmbeddedObject trying to handle
1248         iframe owners, even though that setup is impossible.)
1249
1250         Reviewed by Anders Carlsson.
1251
1252 2013-11-04  Brady Eidson  <beidson@apple.com>
1253
1254         IDB: Split backend Cursors and Transactions into their own files
1255         https://bugs.webkit.org/show_bug.cgi?id=123789
1256
1257         Reviewed by Alexey Proskuryakov.
1258
1259         No new tests (Rename, no change in behavior).
1260
1261         * CMakeLists.txt:
1262         * GNUmakefile.list.am:
1263         * WebCore.xcodeproj/project.pbxproj:
1264
1265         * Modules/indexeddb/IDBBackingStoreCursorInterface.h:
1266         (WebCore::IDBBackingStoreCursorInterface::~IDBBackingStoreCursorInterface):
1267
1268         * Modules/indexeddb/IDBBackingStoreInterface.h:
1269
1270         * Modules/indexeddb/IDBBackingStoreTransactionInterface.h: Added.
1271         (WebCore::IDBBackingStoreTransactionInterface::~IDBBackingStoreTransactionInterface):
1272
1273         * Modules/indexeddb/IDBCursorBackendImpl.cpp:
1274         (WebCore::IDBCursorBackendImpl::IDBCursorBackendImpl):
1275         * Modules/indexeddb/IDBCursorBackendImpl.h:
1276         (WebCore::IDBCursorBackendImpl::create):
1277
1278         * Modules/indexeddb/IDBFactoryBackendInterface.h:
1279
1280         * Modules/indexeddb/IDBIndexWriter.cpp:
1281         (WebCore::IDBIndexWriter::writeIndexKeys):
1282         (WebCore::IDBIndexWriter::verifyIndexKeys):
1283         (WebCore::IDBIndexWriter::addingKeyAllowed):
1284         * Modules/indexeddb/IDBIndexWriter.h:
1285
1286         * Modules/indexeddb/IDBTransactionBackendImpl.cpp:
1287         (WebCore::IDBTransactionBackendImpl::createCursorBackend):
1288         * Modules/indexeddb/IDBTransactionBackendImpl.h:
1289         * Modules/indexeddb/IDBTransactionBackendInterface.h:
1290
1291         * Modules/indexeddb/IDBTransactionBackendOperations.cpp:
1292         (WebCore::GetOperation::perform):
1293         (WebCore::OpenCursorOperation::perform):
1294         (WebCore::CountOperation::perform):
1295         (WebCore::DeleteRangeOperation::perform):
1296
1297         * Modules/indexeddb/leveldb/IDBBackingStoreCursorLevelDB.cpp: Added.
1298         (WebCore::IDBBackingStoreCursorLevelDB::IDBBackingStoreCursorLevelDB):
1299         (WebCore::IDBBackingStoreCursorLevelDB::firstSeek):
1300         (WebCore::IDBBackingStoreCursorLevelDB::advance):
1301         (WebCore::IDBBackingStoreCursorLevelDB::continueFunction):
1302         (WebCore::IDBBackingStoreCursorLevelDB::haveEnteredRange):
1303         (WebCore::IDBBackingStoreCursorLevelDB::isPastBounds):
1304         * Modules/indexeddb/leveldb/IDBBackingStoreCursorLevelDB.h: Added.
1305         (WebCore::IDBBackingStoreCursorLevelDB::~IDBBackingStoreCursorLevelDB):
1306         (WebCore::IDBBackingStoreCursorLevelDB::IDBBackingStoreCursorLevelDB):
1307
1308         * Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.cpp:
1309         (WebCore::IDBBackingStoreLevelDB::compareIndexKeys):
1310         (WebCore::IDBBackingStoreLevelDB::updateIDBDatabaseVersion):
1311         (WebCore::IDBBackingStoreLevelDB::createObjectStore):
1312         (WebCore::IDBBackingStoreLevelDB::deleteObjectStore):
1313         (WebCore::IDBBackingStoreLevelDB::getRecord):
1314         (WebCore::IDBBackingStoreLevelDB::putRecord):
1315         (WebCore::IDBBackingStoreLevelDB::clearObjectStore):
1316         (WebCore::IDBBackingStoreLevelDB::deleteRecord):
1317         (WebCore::IDBBackingStoreLevelDB::getKeyGeneratorCurrentNumber):
1318         (WebCore::IDBBackingStoreLevelDB::maybeUpdateKeyGeneratorCurrentNumber):
1319         (WebCore::IDBBackingStoreLevelDB::keyExistsInObjectStore):
1320         (WebCore::IDBBackingStoreLevelDB::createIndex):
1321         (WebCore::IDBBackingStoreLevelDB::deleteIndex):
1322         (WebCore::IDBBackingStoreLevelDB::putIndexDataForRecord):
1323         (WebCore::findGreatestKeyLessThanOrEqual):
1324         (WebCore::IDBBackingStoreLevelDB::findKeyInIndex):
1325         (WebCore::IDBBackingStoreLevelDB::getPrimaryKeyViaIndex):
1326         (WebCore::IDBBackingStoreLevelDB::keyExistsInIndex):
1327         (WebCore::ObjectStoreKeyCursorImpl::create):
1328         (WebCore::ObjectStoreKeyCursorImpl::clone):
1329         (WebCore::ObjectStoreKeyCursorImpl::ObjectStoreKeyCursorImpl):
1330         (WebCore::ObjectStoreCursorImpl::create):
1331         (WebCore::ObjectStoreCursorImpl::clone):
1332         (WebCore::ObjectStoreCursorImpl::ObjectStoreCursorImpl):
1333         (WebCore::objectStoreCursorOptions):
1334         (WebCore::indexCursorOptions):
1335         (WebCore::IDBBackingStoreLevelDB::openObjectStoreCursor):
1336         (WebCore::IDBBackingStoreLevelDB::openObjectStoreKeyCursor):
1337         (WebCore::IDBBackingStoreLevelDB::openIndexKeyCursor):
1338         (WebCore::IDBBackingStoreLevelDB::openIndexCursor):
1339         (WebCore::IDBBackingStoreLevelDB::createBackingStoreTransaction):
1340         * Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.h:
1341  
1342        * Modules/indexeddb/leveldb/IDBBackingStoreTransactionLevelDB.cpp: Added.
1343         (WebCore::IDBBackingStoreTransactionLevelDB::IDBBackingStoreTransactionLevelDB):
1344         (WebCore::IDBBackingStoreTransactionLevelDB::begin):
1345         (WebCore::IDBBackingStoreTransactionLevelDB::commit):
1346         (WebCore::IDBBackingStoreTransactionLevelDB::rollback):
1347         * Modules/indexeddb/leveldb/IDBBackingStoreTransactionLevelDB.h:
1348
1349         * Modules/indexeddb/leveldb/IDBFactoryBackendLevelDB.cpp:
1350         (WebCore::IDBFactoryBackendLevelDB::createCursorBackend):
1351         * Modules/indexeddb/leveldb/IDBFactoryBackendLevelDB.h:
1352
1353 2013-11-04  Zalan Bujtas  <zalan@apple.com>
1354
1355         Do not call setFrameRect on Widget unless its boundaries changed.
1356         https://bugs.webkit.org/show_bug.cgi?id=123781
1357
1358         Reviewed by Andreas Kling.
1359
1360         Call Widget:setFrameRect only when the frame's rect actually changes. It also
1361         cleans up the related weak reference code a bit.
1362         
1363         Covered by existing tests.
1364
1365         * rendering/RenderWidget.cpp:
1366         (WebCore::RenderWidget::setWidgetGeometry): 
1367
1368 2013-11-04  Santosh Mahto  <santosh.ma@samsung.com>
1369
1370         [webcore/html] remove extra header includes from cpp files.
1371         https://bugs.webkit.org/show_bug.cgi?id=123740
1372
1373         Reviewed by Darin Adler.
1374
1375         Removing redundant headers.
1376
1377         * html/BaseDateAndTimeInputType.cpp:
1378         * html/ColorInputType.cpp:
1379         * html/DOMFormData.cpp:
1380         * html/DOMURL.cpp:
1381         * html/DateInputType.cpp:
1382         * html/DateTimeInputType.cpp:
1383         * html/DateTimeLocalInputType.cpp:
1384         * html/FTPDirectoryDocument.cpp:
1385         * html/FileInputType.cpp:
1386         * html/FormController.cpp:
1387         * html/HTMLAnchorElement.cpp:
1388         * html/HTMLAreaElement.cpp:
1389         * html/HTMLCanvasElement.cpp:
1390         * html/HTMLCollection.cpp:
1391         * html/HTMLDetailsElement.cpp:
1392         * html/HTMLDocument.cpp:
1393         * html/HTMLElement.cpp:
1394         * html/HTMLFormControlsCollection.cpp:
1395         * html/HTMLFormElement.cpp:
1396         * html/HTMLImageElement.cpp:
1397         * html/HTMLInputElement.cpp:
1398         * html/HTMLLegendElement.cpp:
1399         * html/HTMLMapElement.cpp:
1400         * html/HTMLMediaElement.cpp:
1401         * html/HTMLOptionElement.cpp:
1402         * html/HTMLOptionsCollection.cpp:
1403         * html/HTMLPlugInImageElement.cpp:
1404         * html/HTMLProgressElement.cpp:
1405         * html/HTMLSummaryElement.cpp:
1406         * html/HTMLTemplateElement.cpp:
1407         * html/HTMLVideoElement.cpp:
1408         * html/HTMLViewSourceDocument.cpp:
1409         * html/MediaController.cpp:
1410         * html/MediaKeyEvent.cpp:
1411         * html/MonthInputType.cpp:
1412         * html/RangeInputType.cpp:
1413         * html/StepRange.cpp:
1414         * html/TextFieldInputType.cpp:
1415         * html/TimeInputType.cpp:
1416         * html/WeekInputType.cpp:
1417         * html/canvas/CanvasRenderingContext.cpp:
1418         * html/canvas/CanvasRenderingContext2D.cpp:
1419         * html/canvas/CanvasStyle.cpp:
1420         * html/canvas/OESVertexArrayObject.cpp:
1421         * html/parser/BackgroundHTMLParser.cpp:
1422         * html/parser/CSSPreloadScanner.cpp:
1423         * html/parser/CompactHTMLToken.cpp:
1424         * html/parser/HTMLConstructionSite.cpp:
1425         * html/parser/HTMLDocumentParser.cpp:
1426         * html/parser/HTMLElementStack.cpp:
1427         * html/parser/HTMLFormattingElementList.cpp:
1428         * html/parser/HTMLMetaCharsetParser.cpp:
1429         * html/parser/HTMLParserIdioms.cpp:
1430         * html/parser/HTMLPreloadScanner.cpp:
1431         * html/parser/HTMLTokenizer.cpp:
1432         * html/parser/HTMLTreeBuilder.cpp:
1433         * html/parser/HTMLTreeBuilderSimulator.cpp:
1434         * html/parser/HTMLViewSourceParser.cpp:
1435         * html/parser/TextDocumentParser.cpp:
1436         * html/parser/XSSAuditor.cpp:
1437         * html/shadow/ContentDistributor.cpp:
1438         * html/shadow/InsertionPoint.cpp:
1439         * html/shadow/MediaControlElements.cpp:
1440         * html/shadow/MediaControlsApple.cpp:
1441         * html/shadow/MediaControlsBlackBerry.cpp:
1442         * html/shadow/MediaControlsGtk.cpp:
1443         * html/shadow/SliderThumbElement.cpp:
1444         * html/track/AudioTrack.cpp:
1445         * html/track/InbandGenericTextTrack.cpp:
1446         * html/track/InbandTextTrack.cpp:
1447         * html/track/InbandWebVTTTextTrack.cpp:
1448         * html/track/TextTrack.cpp:
1449         * html/track/TextTrackCueGeneric.cpp:
1450         * html/track/TextTrackList.cpp:
1451         * html/track/TextTrackRegion.cpp:
1452         * html/track/TrackListBase.cpp:
1453         * html/track/VideoTrack.cpp:
1454         * html/track/WebVTTParser.cpp:
1455
1456 2013-11-04  Brady Eidson  <beidson@apple.com>
1457
1458         IDB: deleteDatabase() interface should be asynchronous
1459         https://bugs.webkit.org/show_bug.cgi?id=123787
1460
1461         Reviewed by Tim Horton.
1462
1463         No new tests (No behavior change for a tested port).
1464
1465         deleteDatabase now has no return value, but calls back to a bool function:
1466         * Modules/indexeddb/IDBBackingStoreInterface.h:
1467         * Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.cpp:
1468         (WebCore::IDBBackingStoreLevelDB::deleteDatabase):
1469         * Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.h:
1470
1471         Refactor to account for the new async deleteDatabase:
1472         * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
1473         (WebCore::IDBDatabaseBackendImpl::processPendingCalls):
1474         (WebCore::IDBDatabaseBackendImpl::deleteDatabase):
1475         (WebCore::IDBDatabaseBackendImpl::deleteDatabaseAsync):
1476         * Modules/indexeddb/IDBDatabaseBackendImpl.h:
1477
1478 2013-11-04  Brady Eidson  <beidson@apple.com>
1479
1480         Add Modules/indexeddb/leveldb to the WebCore.xcodeproj
1481
1482         Rubberstamped by Andreas Kling.
1483
1484         This will make hacking on IDB much easier for Mac developers as they won’t have
1485         to constantly add and then subtract the leveldb subdirectory.
1486
1487         The USE(LEVELDB) flag is still disabled so these files won’t actually build by default.
1488
1489         * WebCore.xcodeproj/project.pbxproj:
1490
1491 2013-11-04  Brady Eidson  <beidson@apple.com>
1492
1493         Address review feedback I forgot to commit in r158641
1494
1495         * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
1496         (WebCore::IDBDatabaseBackendImpl::processPendingOpenCalls):
1497
1498 2013-11-04  Brady Eidson  <beidson@apple.com>
1499
1500         IDB: Make opening/establishing a database asynchronous.
1501         https://bugs.webkit.org/show_bug.cgi?id=123775
1502
1503         Reviewed by Andreas Kling.
1504
1505         No new tests (No behavior change for a tested port).
1506
1507         * Modules/indexeddb/IDBBackingStoreInterface.h: Add getOrEstablishIDBDatabaseMetadata with a callback,
1508           removing getIDBDatabaseMetaData, getObjectStores, and createIDBDatabaseMetaData in the process.
1509
1510         * Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.cpp:
1511         (WebCore::IDBBackingStoreLevelDB::getOrEstablishIDBDatabaseMetadata): Adapted from getIDBDatabaseMetaData,
1512           implement the asynchronous interface in terms of other LevelDB methods, always calling back synchronously.
1513         (WebCore::IDBBackingStoreLevelDB::createIDBDatabaseMetaData):
1514         * Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.h:
1515
1516         * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
1517         (WebCore::IDBDatabaseBackendImpl::create):
1518         (WebCore::IDBDatabaseBackendImpl::openInternalAsync): Broken off from openInternal.
1519         (WebCore::IDBDatabaseBackendImpl::didOpenInternalAsync): Broken off from openInternal.
1520         (WebCore::IDBDatabaseBackendImpl::processPendingCalls):
1521         (WebCore::IDBDatabaseBackendImpl::processPendingOpenCalls): Broken off to allow didOpenInternalAsync
1522           to perform open callbacks in the failure case.
1523         (WebCore::IDBDatabaseBackendImpl::openConnection): Always queue open connection calls, then immediately processPendingCalls.
1524         (WebCore::IDBDatabaseBackendImpl::openConnectionInternal): Actually perform open connection calls.
1525         * Modules/indexeddb/IDBDatabaseBackendImpl.h:
1526
1527
1528 2013-11-04  Andreas Kling  <akling@apple.com>
1529
1530         CTTE: RenderFrameBase's widget is always a FrameView.
1531         <https://webkit.org/b/123771>
1532
1533         Delete widget() from RenderFrameBase and supplant a childView()
1534         that returns FrameView*. Strip away unnecessary casts and asserts.
1535
1536         Reviewed by Antti Koivisto.
1537
1538 2013-11-04  Zoltan Horvath  <zoltan@webkit.org>
1539
1540         [CSS Regions][CSS Shapes] Content in region doesn't respect shape-outside after initial layout pass
1541         <https://webkit.org/b/114829>
1542
1543         Although we set the size of a shape for shape-outside in RenderBlockFlow::insertFloatingObject based on the
1544         float's size, the actual height of the float is not always resolved at that point. (Look at cases when the shape
1545         has percentage based height or percentage based radius.) ShapeInfo::setShapeSize triggers a layout for 0 height
1546         value, which will be overriden later, when RenderBlockFlow::positionNewFloats sets the actual size of the float (shape).
1547         Thus it doesn't make sense to set the shape's size in insertFloatingObject and run those extra unnecessary layout passes,
1548         since it'll be overriden anyways. I moved the shape size setting logic into RenderBlockFlow::positionNewFloats.
1549
1550         The problem showed up when we had a shape-outside ellipse with percentage based radius, and we inserted the content
1551         with JavaScript into a region flow. The content has been layed out based on the 0 border radius, and relayout hasn't been
1552         triggered when it flew into the flow. This change sets the shape size only when we already have the height of the float,
1553         so the radius(es) can be resolved correctly, thus no unnecessary layout passes will happen and the layout will be correct as well.
1554
1555         Reviewed by David Hyatt.
1556
1557         Test: fast/shapes/shape-outside-floats/shape-outside-floats-layout-after-initial-layout-pass.html
1558
1559         * rendering/RenderBlockFlow.cpp:
1560         (WebCore::RenderBlockFlow::insertFloatingObject): Remove setting the size of the shape.
1561         (WebCore::RenderBlockFlow::positionNewFloats): Set the size of the shape here.
1562
1563 2013-11-04  Samuel White  <samuel_white@apple.com>
1564
1565         AX: AXShowMenu doesn't always work.
1566         https://bugs.webkit.org/show_bug.cgi?id=123649
1567
1568         Reviewed by Chris Fleizach.
1569
1570         No new tests, the change occurs in a code path that forces the context menu to show which
1571         locks up DRT if we try to test it (platform menu is shown). The change itself gives the mouse
1572         event handler a chance to handle our platform mouse event BEFORE the event ends up in the show
1573         context menu machinery. This is necessary because without it, the element will not become
1574         focused. Without focus, accessibility shows different/less menu items than a mouse click. The
1575         end result is that context menus shown via accessibility are consistent with menus shown via click.
1576
1577         * page/ContextMenuController.cpp:
1578         (WebCore::ContextMenuController::showContextMenuAt):
1579
1580 2013-11-04  Jeffrey Pfau  <jpfau@apple.com>
1581
1582         SMIL timers can still fire after the containing document has been torn down
1583         <https://webkit.org/b/123291>
1584
1585         Reviewed by Darin Adler.
1586
1587         Ensure that the timers get paused when the document is preparing to be torn down.
1588
1589         Test: svg/animations/smil-timers-not-disabled-crash.html
1590
1591         * dom/Document.cpp:
1592         (WebCore::Document::dropChildren):
1593         (WebCore::Document::commonTeardown):
1594         (WebCore::Document::prepareForDestruction):
1595         * dom/Document.h:
1596
1597 2013-11-04  Brendan Long  <b.long@cablelabs.com>
1598
1599         Move duplicate code in TrackPrivate classes to a common base class
1600         https://bugs.webkit.org/show_bug.cgi?id=123619
1601
1602         Reviewed by Darin Adler.
1603
1604         No new tests because this is just refactoring.
1605
1606         * GNUmakefile.list.am: Add TrackPrivateBase.
1607         * WebCore.vcxproj/WebCore.vcxproj: Same.
1608         * WebCore.vcxproj/WebCore.vcxproj.filters: Same.
1609         * WebCore.xcodeproj/project.pbxproj: Same.
1610         * html/track/AudioTrack.cpp:
1611         (WebCore::AudioTrack::inbandTrackIndex): Renamed audioTrackIndex() to trackIndex().
1612         (WebCore::AudioTrack::labelChanged): First argument is now a TrackPrivateBase*.
1613         (WebCore::AudioTrack::languageChanged): Same.
1614         (WebCore::AudioTrack::willRemove): Same.
1615         * html/track/AudioTrack.h: Update TrackPrivateBaseClient function signatures.
1616         * html/track/InbandTextTrack.cpp:
1617         (WebCore::InbandTextTrack::inbandTrackIndex): Renamed textTrackIndex() to trackIndex().
1618         (WebCore::InbandTextTrack::labelChanged): First argument is now a TrackPrivateBase*.
1619         (WebCore::InbandTextTrack::languageChanged): Same.
1620         (WebCore::InbandTextTrack::willRemove): Same.
1621         * html/track/InbandTextTrack.h: Update TrackPrivateBaseClient function signatures.
1622         * html/track/VideoTrack.cpp:
1623         (WebCore::VideoTrack::inbandTrackIndex): Renamed videoTrackIndex() to trackIndex().
1624         (WebCore::VideoTrack::labelChanged): First argument is now a TrackPrivateBase*.
1625         (WebCore::VideoTrack::languageChanged): Same.
1626         (WebCore::VideoTrack::willRemove): Same.
1627         * html/track/VideoTrack.h: Update TrackPrivateBaseClient function signatures.
1628         * platform/graphics/AudioTrackPrivate.h: Remove code that was moved to TrackPrivateBase.
1629         * platform/graphics/InbandTextTrackPrivate.h: Same.
1630         * platform/graphics/InbandTextTrackPrivateClient.h: Same.
1631         * platform/graphics/VideoTrackPrivate.h: Same.
1632         * platform/graphics/TrackPrivateBase.h: Refactored out duplicate code in AudioTrackPrivate, InbandTextTrackPrivate and VideoTrackPrivate.
1633         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.h: Renamed textTrackIndex() to trackIndex().
1634         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h: Same.
1635         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h: Renamed audioTrackIndex() to trackIndex().
1636         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h: Renamed videoTrackIndex() to trackIndex90.
1637
1638 2013-11-04  Andreas Kling  <akling@apple.com>
1639
1640         FrameView destructor is worried about being retained by a renderer.
1641         <https://webkit.org/b/123763>
1642
1643         There's no way we can be in ~FrameView() while also being owned by
1644         a RenderWidget. Remove some overly paranoid code that was making sure
1645         the renderer didn't have a reference on us.
1646
1647         Reviewed by Anders Carlsson.
1648
1649 2013-11-04  Eric Carlson  <eric.carlson@apple.com>
1650
1651         REGRESSION(r158311): media/media-fragments/TC0054.html and TC0061.html hit assertions
1652         https://bugs.webkit.org/show_bug.cgi?id=123555
1653
1654         Reviewed by Darin Adler.
1655
1656         No new tests, covered by existing tests.
1657
1658         * html/MediaFragmentURIParser.cpp:
1659         (WebCore::MediaFragmentURIParser::parseFragments): Don't add a fragment with empty key or value as
1660             they will not processed.
1661         (WebCore::MediaFragmentURIParser::parseNPTFragment): Remove excess whitespace.
1662
1663 2013-11-04  Patrick Gansterer  <paroga@webkit.org>
1664
1665         Remove code duplications in createFontCustomPlatformData()
1666         https://bugs.webkit.org/show_bug.cgi?id=123706
1667
1668         Reviewed by Darin Adler.
1669
1670         Move OpenTypeSanitizer and WOFF handling from the port specific
1671         implementations in createFontCustomPlatformData() into the only
1672         caller of this function CachedFont::ensureCustomFontData().
1673         Also change the parameter passing the SharedBuffer from a
1674         pointer to a reference since it is never null.
1675
1676         * loader/cache/CachedFont.cpp:
1677         (WebCore::CachedFont::ensureCustomFontData):
1678         * platform/graphics/blackberry/FontCustomPlatformData.h:
1679         * platform/graphics/blackberry/FontCustomPlatformDataBlackBerry.cpp:
1680         (WebCore::FontCustomPlatformData::FontCustomPlatformData):
1681         (WebCore::createFontCustomPlatformData):
1682         * platform/graphics/cairo/FontCustomPlatformData.h:
1683         * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
1684         (WebCore::FontCustomPlatformData::FontCustomPlatformData):
1685         (WebCore::createFontCustomPlatformData):
1686         * platform/graphics/mac/FontCustomPlatformData.cpp:
1687         (WebCore::createFontCustomPlatformData):
1688         * platform/graphics/mac/FontCustomPlatformData.h:
1689         * platform/graphics/win/FontCustomPlatformData.cpp:
1690         (WebCore::createFontCustomPlatformData):
1691         * platform/graphics/win/FontCustomPlatformData.h:
1692         * platform/graphics/win/FontCustomPlatformDataCairo.cpp:
1693         (WebCore::createFontCustomPlatformData):
1694         * platform/graphics/wince/FontCustomPlatformData.cpp:
1695         (WebCore::createFontCustomPlatformData):
1696         * platform/graphics/wince/FontCustomPlatformData.h:
1697
1698 2013-11-04  Thiago de Barros Lacerda  <thiago.lacerda@openbossa.org>
1699
1700         Fixing MediaStreamDescriptor addSource and addTrack methods
1701         https://bugs.webkit.org/show_bug.cgi?id=123755
1702
1703         Reviewed by Eric Carlson.
1704
1705         We must store the track and source that is passed as parameter in a RefPtr,
1706         otherwise we will refer to a null pointer.
1707
1708         No new tests needed.
1709
1710         * platform/mediastream/MediaStreamDescriptor.cpp:
1711         (WebCore::MediaStreamDescriptor::addSource):
1712         (WebCore::MediaStreamDescriptor::addTrack):
1713
1714 2013-11-04  Tim Horton  <timothy_horton@apple.com>
1715
1716         Remove PlatformCALayer::playerLayer
1717         https://bugs.webkit.org/show_bug.cgi?id=123764
1718
1719         Reviewed by Sam Weinig.
1720
1721         * platform/graphics/ca/PlatformCALayer.h:
1722         * platform/graphics/ca/mac/PlatformCALayerMac.h:
1723         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
1724         (PlatformCALayerMac::clone):
1725         Remove playerLayer(), fold it into clone().
1726
1727 2013-11-04  Chris Fleizach  <cfleizach@apple.com>
1728
1729         AX: Mail attachments at the start of an email are not output by VoiceOver
1730         https://bugs.webkit.org/show_bug.cgi?id=123697
1731
1732         Reviewed by Ryosuke Niwa.
1733
1734         VoiceOver is expecting that "replaced elements" (attachments in a Mail message in this case) to be
1735         represented by the replacement character when asking for a stringForRange.
1736
1737         However, when that replaced element is at the beginning of the document, the logic does not work because
1738         there is a few code places that will take that first Position and advance it forward, not accounting for replaced elements.
1739         When using the TextIterator normally, it does account for these, so that's why it's only affecting as at the beginning of the document.
1740
1741         Also a "replaced element" can be more than just renderer->isReplaced(), hence the externing of the isRendererReplacedElement method
1742         and using that it in pertinent places.
1743
1744         Tests: platform/mac/accessibility/object-replacement-with-no-rendered-children-at-node-start.html
1745                platform/mac/accessibility/object-replacement-with-rendered-children-at-node-start.html
1746
1747         * accessibility/AccessibilityObject.cpp:
1748         (WebCore::replacedNodeNeedsCharacter):
1749         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1750         (nsStringForReplacedNode):
1751         * dom/Position.cpp:
1752         (WebCore::Position::isCandidate):
1753         * dom/PositionIterator.cpp:
1754         * dom/Range.cpp:
1755         (WebCore::Range::firstNode):
1756         * editing/TextIterator.cpp:
1757         (WebCore::isRendererReplacedElement):
1758         * editing/TextIterator.h:
1759
1760 2013-11-04  Andreas Kling  <akling@apple.com>
1761
1762         Use RenderAncestorIterator in a couple of places.
1763         <https://webkit.org/b/123725>
1764
1765         Take the ancestorsOfType<RenderMoo>() thingy out for a spin.
1766
1767         Found a bunch of parent chain walking loops that were really just
1768         looking for the first ancestor renderer of a certain type.
1769         They were a perfect fit for this pattern:
1770
1771             if (auto svgRoot = ancestorsOfType<RenderSVGRoot>(renderer).first())
1772                 svgRoot->shakeMoneyMaker();
1773
1774         Quite a bit clearer than the previous:
1775
1776             for (auto ancestor = renderer.parent(); ancestor; ancestor = ancestor->parent()) {
1777                 if (ancestor->isSVGRoot())
1778                     toRenderSVGRoot(ancestor)->makeMoneyShaker();
1779             }
1780
1781         Reviewed by Antti Koivisto.
1782
1783 2013-10-25  Jer Noble  <jer.noble@apple.com>
1784
1785         [MSE] Add a SourceBufferPrivateClient interface for platform -> html communication.
1786         https://bugs.webkit.org/show_bug.cgi?id=123373
1787
1788         Reviewed by Eric Carlson.
1789
1790         To enable communication between SourceBuffer and SourceBufferPrivate without introducing
1791         layering violations, add a new interface class SourceBufferPrivateInterface from which
1792         SourceBuffer will inherit.
1793
1794         * Modules/mediasource/SourceBuffer.cpp:
1795         (WebCore::SourceBuffer::SourceBuffer): Set the private's client.
1796         (WebCore::SourceBuffer::~SourceBuffer): Clear the private's client.
1797         (WebCore::SourceBuffer::sourceBufferPrivateDidEndStream): Added stub.
1798         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment): Hinno.
1799         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): Ditto.
1800         (WebCore::SourceBuffer::sourceBufferPrivateHasAudio): Ditto.
1801         (WebCore::SourceBuffer::sourceBufferPrivateHasVideo): Ditto.
1802         * Modules/mediasource/SourceBuffer.h:
1803         * WebCore.xcodeproj/project.pbxproj: Add new files to project.
1804         * platform/graphics/SourceBufferPrivate.h:
1805         * platform/graphics/SourceBufferPrivateClient.h: Added.
1806         (WebCore::SourceBufferPrivateClient::~SourceBufferPrivateClient): Empty destructor.
1807
1808 2013-11-01  Jer Noble  <jer.noble@apple.com>
1809
1810         [PluginProxy] Add a setting to disable video plugin proxy support in HTMLMediaElement.
1811         https://bugs.webkit.org/show_bug.cgi?id=123621
1812
1813         Reviewed by Eric Carlson.
1814
1815         Add a new Setting which will disable the video plugin proxy. Enable support for AVFoundation
1816         in iOS (which requries fixing a few compile errors resulting from classes and methods which
1817         are not available on iOS.
1818
1819         * WebCore.exp.in: Export wkAVAssetResolvedURL.
1820         * css/StyleResolver.cpp:
1821         (WebCore::StyleResolver::canShareStyleWithElement): Make conditional upon
1822             new isVideoPluginProxyEnabled() setting.
1823         * html/HTMLMediaElement.cpp:
1824         (WebCore::HTMLMediaElement::parseAttribute): Ditto.
1825         * html/HTMLMediaElement.h:
1826         * html/HTMLVideoElement.cpp:
1827         (WebCore::HTMLVideoElement::createRenderer): Ditto.
1828         (WebCore::HTMLVideoElement::attach): Ditto.
1829         (WebCore::HTMLVideoElement::parseAttribute): Ditto.
1830         (HTMLVideoElement::setDisplayMode): Ditto.
1831         * html/HTMLVideoElement.h:
1832         * page/Settings.cpp:
1833         (WebCore::Settings::setVideoPluginProxyEnabled): Simple setter.
1834         * page/Settings.h:
1835         (WebCore::Settings::isVideoPluginProxyEnabled): Simple getter.
1836         * platform/graphics/MediaPlayer.cpp:
1837         (WebCore::installedMediaEngines): Conditionally add MediaPlayerPrivateIOS and always add
1838             MediaPlayerPriateAVFoundationObjC.
1839         * platform/graphics/MediaPlayerPrivate.h:
1840         (WebCore::MediaPlayerPrivateInterface::deliverNotification): Add default implementation.
1841         (WebCore::MediaPlayerPrivateInterface::setMediaPlayerProxy): Ditto.
1842         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1843         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1844         (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC): Use new
1845             HAS_ and USE_ macros instead of __MAC_OS_MIN_VERNSION_REQUIRED.
1846         (WebCore::MediaPlayerPrivateAVFoundationObjC::~MediaPlayerPrivateAVFoundationObjC): Ditto.
1847         (WebCore::MediaPlayerPrivateAVFoundationObjC::hasContextRenderer): Ditto.
1848         (WebCore::MediaPlayerPrivateAVFoundationObjC::createContextVideoRenderer): Ditto.
1849         (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyContextVideoRenderer): Ditto.
1850         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): Ditto.
1851         (WebCore::MediaPlayerPrivateAVFoundationObjC::paint): Ditto.
1852         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoLayer): Use cachedCGColor instead
1853             of CGColorGetConstantColor.
1854         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput): Use CVPixelBuffer pixel
1855             format constant instead of QuickDraw constant.
1856         (WebCore::MediaPlayerPrivateAVFoundationObjC::createPixelBuffer): Ditto.
1857         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput): Draw to intermediary
1858             CGImage on iOS.
1859         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.h:
1860         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
1861         * platform/ios/WebCoreSystemInterfaceIOS.mm:
1862         * platform/mac/WebCoreSystemInterface.h:
1863
1864 2013-11-04  Andreas Kling  <akling@apple.com>
1865
1866         REGRESSION(r158561): fast/block/float/float-append-child-crash.html asserting.
1867
1868         The non-const ancestor iterator was walking siblings, not ancestors.
1869
1870         Rubber-stamped by Antti Koivisto.
1871
1872 2013-10-31  Jer Noble  <jer.noble@apple.com>
1873
1874         [MSE] [Mac] Disclaim support for MSE in AVFoundation and QTKit engines
1875         https://bugs.webkit.org/show_bug.cgi?id=123593
1876
1877         Reviewed by Eric Carlson.
1878
1879         Immediately fail if asked to load a Media Source in engines which do not support
1880         them.
1881
1882         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
1883         (WebCore::MediaPlayerPrivateAVFoundation::load):
1884         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
1885         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1886         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType):
1887         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
1888         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
1889         (WebCore::MediaPlayerPrivateQTKit::load):
1890         (WebCore::MediaPlayerPrivateQTKit::supportsType):
1891
1892 2013-11-04  Hans Muller  <hmuller@adobe.com>
1893
1894         [CSS Shapes] image valued shape element margin can cause an ASSERT fail
1895         https://bugs.webkit.org/show_bug.cgi?id=123743
1896
1897         Reviewed by Andreas Kling.
1898
1899         When margin-top is specified for a shape's element, the Y coordinates passed
1900         to RasterShapeIntervals::getExcludedIntervals() may be negative. This is
1901         because the incoming logical coordinates are relative to the content or
1902         padding box, depending on the box-sizing property. The RasterShape::getExcludedIntervals()
1903         method now clips the incoming Y coordinates to the shape's bounds before
1904         accessing the shape's intervals.
1905
1906         Test: fast/shapes/shape-outside-floats/shape-outside-floats-margin-crash.html
1907
1908         * rendering/shapes/RasterShape.cpp:
1909         (WebCore::RasterShapeIntervals::getExcludedIntervals):
1910
1911 2013-11-04  Antti Koivisto  <antti@apple.com>
1912
1913         Make LiveNodeListBase use Elements instead of Nodes
1914         https://bugs.webkit.org/show_bug.cgi?id=123745
1915
1916         Reviewed by Anders Carlsson.
1917
1918         * WebCore.exp.in:
1919         * dom/Element.cpp:
1920         (WebCore::Element::firstElementChild):
1921         (WebCore::Element::lastElementChild):
1922         
1923             Switch to correct calls. ElementTraversal::previous and previousChild are no longer equivalent.
1924
1925         * dom/ElementTraversal.h:
1926         (WebCore::::lastWithinTemplate):
1927         (WebCore::::previousTemplate):
1928         
1929             Fix ElementTraversal::lastWithin and previous. They had no real clients and didn't work correctly.
1930             With LiveNodeListBase starting to use these they get excellent test coverage.
1931
1932         * dom/LiveNodeList.cpp:
1933         (WebCore::LiveNodeListBase::invalidateCache):
1934         * dom/LiveNodeList.h:
1935         (WebCore::LiveNodeListBase::LiveNodeListBase):
1936         (WebCore::LiveNodeListBase::isElementCacheValid):
1937         (WebCore::LiveNodeListBase::cachedElement):
1938         (WebCore::LiveNodeListBase::cachedElementOffset):
1939         (WebCore::LiveNodeListBase::setCachedElement):
1940         
1941             Make the cache Element based.
1942             Switch to Elements in all helpers.
1943             Rename item -> element for clarity.
1944
1945         * dom/NodeIterator.cpp:
1946         (WebCore::NodeIterator::NodePointer::moveToPrevious):
1947         (WebCore::NodeIterator::updateForNodeRemoval):
1948         
1949             This code expected the old inconsistent NodeTraversal::previous behavior where the traversal includes
1950             the root as the last item. Drop the stayWithin parameter and handle the one case where it is needed here.
1951
1952         * dom/NodeTraversal.cpp:
1953         (WebCore::NodeTraversal::last):
1954         (WebCore::NodeTraversal::deepLastChild):
1955         * dom/NodeTraversal.h:
1956         
1957             Support ElementTraversal::previous/lastWithin.
1958
1959         (WebCore::NodeTraversal::previous):
1960         
1961             This was slightly wrong too.
1962
1963         * html/HTMLCollection.cpp:
1964         (WebCore::previousElement):
1965         (WebCore::lastElement):
1966         (WebCore::LiveNodeListBase::iterateForPreviousElement):
1967         (WebCore::LiveNodeListBase::itemBefore):
1968         (WebCore::LiveNodeListBase::isLastItemCloserThanLastOrCachedItem):
1969         (WebCore::LiveNodeListBase::isFirstItemCloserThanCachedItem):
1970         (WebCore::LiveNodeListBase::setCachedElement):
1971         (WebCore::LiveNodeListBase::item):
1972         (WebCore::LiveNodeListBase::elementBeforeOrAfterCachedElement):
1973         * html/HTMLCollection.h:
1974         (WebCore::HTMLCollection::isEmpty):
1975         (WebCore::HTMLCollection::hasExactlyOneItem):
1976
1977 2013-11-04  Michael Saboff  <msaboff@apple.com>
1978
1979         Eliminate HostCall bit from JSC Stack CallerFrame
1980         https://bugs.webkit.org/show_bug.cgi?id=123642
1981
1982         Reviewed by Geoffrey Garen.
1983
1984         Updated JavaScript stack walking as a result of the corresponding changes made in
1985         JavaScriptCore.
1986
1987         * bindings/js/ScriptController.cpp:
1988         (WebCore::ScriptController::shouldBypassMainWorldContentSecurityPolicy):
1989         * bindings/js/ScriptDebugServer.cpp:
1990         (WebCore::ScriptDebugServer::stepOutOfFunction):
1991         (WebCore::ScriptDebugServer::returnEvent):
1992         (WebCore::ScriptDebugServer::didExecuteProgram):
1993
1994 2013-11-04  Bem Jones-Bey  <bjonesbe@adobe.com>
1995
1996         [css shapes] Fix support for shape-outside on a float with padding
1997         https://bugs.webkit.org/show_bug.cgi?id=123590
1998
1999         Reviewed by Alexandru Chiculita.
2000
2001         The line top was being improperly converted to the coordinates of the
2002         shape, causing the shape to be positioned incorrectly when the float
2003         had padding. This fixes that problem.
2004
2005         No new tests, covered by updates to existing ones.
2006
2007         * rendering/shapes/ShapeOutsideInfo.cpp:
2008         (WebCore::ShapeOutsideInfo::updateDeltasForContainingBlockLine):
2009
2010 2013-11-04  Alexey Proskuryakov  <ap@apple.com>
2011
2012         Implement generateKey for HMAC and AES-CBC
2013         https://bugs.webkit.org/show_bug.cgi?id=123669
2014
2015         Reviewed by Dan Bernstein.
2016
2017         Tests: crypto/subtle/aes-cbc-generate-key.html
2018                crypto/subtle/hmac-generate-key.html
2019
2020         * WebCore.xcodeproj/project.pbxproj: Added new files.
2021
2022         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
2023         (WebCore::createAesKeyGenParams): Added bindings for AesKeyGenParams.
2024         (WebCore::JSCryptoAlgorithmDictionary::createParametersForGenerateKey): Handle
2025         algorithms that generate AES and HMAC keys.
2026
2027         * bindings/js/JSSubtleCryptoCustom.cpp: (WebCore::JSSubtleCrypto::generateKey): Added.
2028
2029         * crypto/CryptoAlgorithmAesKeyGenParams.h: Added.
2030
2031         * crypto/CryptoKey.cpp: (WebCore::CryptoKey::randomData):
2032         * crypto/CryptoKey.h:
2033         * crypto/CryptoKeyMac.cpp: Added
2034         Expose a function that produces random data for symmetric crypto keys. Cross-platform
2035         implementation uses ARC4 code from WTF, while Mac uses a system function that
2036         provides a FIPS validated random number generator.
2037
2038         * crypto/CryptoKeyAES.cpp: (WebCore::CryptoKeyAES::generate):
2039         * crypto/CryptoKeyAES.h:
2040         Added a function that creates AES keys.
2041
2042         * crypto/SubtleCrypto.idl: Added generateKey.
2043
2044         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
2045         (WebCore::CryptoAlgorithmAES_CBC::generateKey): Added.
2046
2047         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
2048         (WebCore::CryptoAlgorithmHMAC::generateKey): Added.
2049
2050         * crypto/keys/CryptoKeyHMAC.cpp: (WebCore::CryptoKeyHMAC::generate):
2051         * crypto/keys/CryptoKeyHMAC.h:
2052         Added a function that creates HMAC keys.
2053
2054         * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp: Removed generateKey stub, the implementation
2055         ended up in cross-platform file.
2056
2057         * crypto/mac/CryptoAlgorithmHMACMac.cpp: Ditto.
2058
2059 2013-11-04  Daniel Bates  <dabates@apple.com>
2060
2061         Revert SetCGFontRenderingMode() build fix for Chromium Mac
2062         https://bugs.webkit.org/show_bug.cgi?id=123633
2063
2064         Reviewed by Darin Adler.
2065
2066         Reverts <http://trac.webkit.org/changeset/134380>, which
2067         was a Chromium Mac build fix for <http://trac.webkit.org/changeset/134348>
2068         (https://bugs.webkit.org/show_bug.cgi?id=101787). Chromium doesn't
2069         build against top-of-tree WebKit.
2070
2071         * platform/graphics/mac/FontMac.mm:
2072         (WebCore::Font::drawGlyphs):
2073         * platform/mac/WebCoreSystemInterface.h:
2074         * platform/mac/WebCoreSystemInterface.mm:
2075
2076 2013-11-04  Commit Queue  <commit-queue@webkit.org>
2077
2078         Unreviewed, rolling out r158526.
2079         http://trac.webkit.org/changeset/158526
2080         https://bugs.webkit.org/show_bug.cgi?id=123744
2081
2082         it broke the build (Requested by jessieberlin on #webkit).
2083
2084         * WebCore.xcodeproj/project.pbxproj:
2085         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
2086         (WebCore::createAesCbcParams):
2087         (WebCore::createHmacParams):
2088         (WebCore::createHmacKeyParams):
2089         (WebCore::JSCryptoAlgorithmDictionary::createParametersForGenerateKey):
2090         * bindings/js/JSSubtleCryptoCustom.cpp:
2091         * crypto/CryptoAlgorithmAesKeyGenParams.h: Removed.
2092         * crypto/CryptoKey.cpp:
2093         * crypto/CryptoKey.h:
2094         * crypto/CryptoKeyAES.cpp:
2095         * crypto/CryptoKeyAES.h:
2096         * crypto/CryptoKeyMac.cpp: Removed.
2097         * crypto/SubtleCrypto.idl:
2098         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
2099         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
2100         * crypto/keys/CryptoKeyHMAC.cpp:
2101         * crypto/keys/CryptoKeyHMAC.h:
2102         * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
2103         (WebCore::CryptoAlgorithmAES_CBC::generateKey):
2104         * crypto/mac/CryptoAlgorithmHMACMac.cpp:
2105         (WebCore::CryptoAlgorithmHMAC::generateKey):
2106
2107 2013-11-04  Przemyslaw Szymanski  <p.szymanski3@samsung.com>
2108
2109         [Texmap] Remove redundant calls in CoordinatedGraphicsScene
2110         https://bugs.webkit.org/show_bug.cgi?id=123737
2111
2112         Reviewed by Noam Rosenthal.
2113
2114         Removing unused code left after few refactoring patches.
2115
2116         No new tests. Covered by existing ones.
2117
2118         * platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp:
2119         (WebCore::CoordinatedGraphicsScene::paintToCurrentGLContext):
2120
2121 2013-11-04  Andreas Kling  <akling@apple.com>
2122
2123         CSSPrimitiveValue color constructors should return PassRef.
2124         <https://webkit.org/b/123728>
2125
2126         Make CSSPrimitiveValue::createColor() and the corresponding
2127         CSSValuePool helper functions return PassRef<CSSPrimitiveValue>.
2128
2129         Also made CSSValuePool slightly less stupid when hitting the upper
2130         size limit on the color value cache: instead of throwing out cache
2131         and rebuilding it from scratch, just remove one value at random.
2132
2133         Reviewed by Antti Koivisto.
2134
2135 2013-11-04  Andreas Kling  <akling@apple.com>
2136
2137         Some more RenderChildIterator deployment.
2138         <https://webkit.org/b/123735>
2139
2140         Convert another handful of loops to use childrenOfType<RenderFoo>
2141         iterators, mostly for skipping over uninteresting text renderers.
2142
2143         Reviewed by Antti Koivisto.
2144
2145 2013-11-04  Andreas Kling  <akling@apple.com>
2146
2147         LabelsNodeList always is always rooted at a LabelableElement.
2148         <https://webkit.org/b/123730>
2149
2150         Tighten up LabelsNodeList by enforcing that it's only rooted to
2151         a LabelableElement. Also marked the class FINAL and made its
2152         create() helper return PassRef.
2153
2154         Reviewed by Antti Koivisto.
2155
2156 2013-11-04  Andreas Kling  <akling@apple.com>
2157
2158         REGRESSION: RenderStyle is leaked when not creating renderer for display:none
2159         <https://webkit.org/b/123726>
2160
2161         Explicitly drop the RenderStyle reference in RenderElement::createFor
2162         if we decide to not create any renderer.
2163
2164         Reviewed by Antti Koivisto.
2165
2166         Test: fast/css/renderstyle-leak-with-display-none.html
2167
2168         * rendering/RenderElement.cpp:
2169         (WebCore::RenderElement::createFor):
2170
2171 2013-11-04  Santosh Mahto  <santosh.ma@samsung.com>
2172
2173         [webcore/dom] Remove extra header includes from cpp files.
2174         https://bugs.webkit.org/show_bug.cgi?id=123720
2175
2176         Reviewed by Andreas Kling.
2177
2178         Removing redundant headers from dom related cpp files.
2179
2180         * dom/Attr.cpp:
2181         * dom/CharacterData.cpp:
2182         * dom/ChildListMutationScope.cpp:
2183         * dom/ChildNodeList.cpp:
2184         * dom/ContainerNode.cpp:
2185         * dom/ContainerNodeAlgorithms.cpp:
2186         * dom/DOMNamedFlowCollection.cpp:
2187         * dom/DatasetDOMStringMap.cpp:
2188         * dom/Document.cpp:
2189         * dom/DocumentEventQueue.cpp:
2190         * dom/DocumentMarkerController.cpp:
2191         * dom/DocumentOrderedMap.cpp:
2192         * dom/DocumentStyleSheetCollection.cpp:
2193         * dom/Element.cpp:
2194         * dom/ElementRareData.cpp:
2195         * dom/Event.cpp:
2196         * dom/EventContext.cpp:
2197         * dom/EventDispatcher.cpp:
2198         * dom/EventTarget.cpp:
2199         * dom/ExceptionBase.cpp:
2200         * dom/FocusEvent.cpp:
2201         * dom/InlineStyleSheetOwner.cpp:
2202         * dom/KeyboardEvent.cpp:
2203         * dom/LiveNodeList.cpp:
2204         * dom/MessageEvent.cpp:
2205         * dom/MessagePort.cpp:
2206         * dom/MouseRelatedEvent.cpp:
2207         * dom/MutationEvent.cpp:
2208         * dom/MutationObserver.cpp:
2209         * dom/MutationObserverInterestGroup.cpp:
2210         * dom/MutationObserverRegistration.cpp:
2211         * dom/MutationRecord.cpp:
2212         * dom/NameNodeList.cpp:
2213         * dom/NamedFlowCollection.cpp:
2214         * dom/NamedNodeMap.cpp:
2215         * dom/Node.cpp:
2216         * dom/NodeIterator.cpp:
2217         * dom/NodeTraversal.cpp:
2218         * dom/PositionIterator.cpp:
2219         * dom/ProcessingInstruction.cpp:
2220         * dom/Range.cpp:
2221         * dom/RegisteredEventListener.cpp:
2222         * dom/ScopedEventQueue.cpp:
2223         * dom/ScriptElement.cpp:
2224         * dom/ScriptRunner.cpp:
2225         * dom/SelectorQuery.cpp:
2226         * dom/ShadowRoot.cpp:
2227         * dom/StyledElement.cpp:
2228         * dom/TagNodeList.cpp:
2229         * dom/Text.cpp:
2230         * dom/TextEvent.cpp:
2231         * dom/TouchEvent.cpp:
2232         * dom/TreeScope.cpp:
2233         * dom/TreeScopeAdopter.cpp:
2234         * dom/TreeWalker.cpp:
2235         * dom/UIEvent.cpp:
2236         * dom/UserActionElementSet.cpp:
2237         * dom/UserTypingGestureIndicator.cpp:
2238         * dom/VisitedLinkState.cpp:
2239         * dom/WebKitNamedFlow.cpp:
2240
2241 2013-11-04  Andreas Kling  <akling@apple.com>
2242
2243         HTMLAllCollection is always rooted at a Document.
2244         <https://webkit.org/b/123724>
2245
2246         Tighten up HTMLAllCollection by making the constructor take a
2247         Document& instead of a ContainerNode&. Drive-by application of
2248         FINAL and PassRef also happened.
2249
2250         Reviewed by Antti Koivisto.
2251
2252 2013-11-04  Andreas Kling  <akling@apple.com>
2253
2254         Make more CSSValue subclass constructors return PassRef.
2255         <https://webkit.org/b/123731>
2256
2257         Make the constructor helpers for the following classes return
2258         PassRef instead of PassRefPtr:
2259
2260             - CSSFontValue
2261             - CSSImageSetValue
2262             - CSSUnicodeRangeValue
2263             - WebKitCSSArrayFunctionValue
2264             - WebKitCSSFilterValue
2265             - WebKitCSSMatFunctionValue
2266             - WebKitCSSMixFunctionValue
2267             - WebKitCSSShaderValue
2268             - WebKitCSSTransformValue
2269
2270         Reviewed by Antti Koivisto.
2271
2272 2013-11-04  Jozsef Berta  <jberta@inf.u-szeged.hu>
2273
2274         Buildfix after r158182 for GCC 4.6
2275         https://bugs.webkit.org/show_bug.cgi?id=123442
2276
2277         Reviewed by Csaba Osztrogonác.
2278
2279         Added explicit "friend class", because  GCC 4.6 doesn't support extended friend declaration (c++11)
2280
2281         * dom/ScopedEventQueue.h:
2282
2283 2013-11-04  Andreas Kling  <akling@apple.com>
2284
2285         HTMLTableRowsCollection is always rooted at a HTMLTableElement.
2286         <https://webkit.org/b/123721>
2287
2288         Tighten up HTMLTableRowsCollection by making the create() helper
2289         take a HTMLTableElement& and adding a HTMLSelectElement& getter.
2290
2291         Reviewed by Antti Koivisto.
2292
2293 2013-11-04  Andreas Kling  <akling@apple.com>
2294
2295         HTMLNameCollection and friends are always rooted at a Document.
2296         <https://webkit.org/b/123722>
2297
2298         Tighten WindowNameCollection and DocumentNameCollection by making
2299         their constructors take a Document&, and add a slightly better
2300         document() than the one we inherit from LiveNodeListBase.
2301
2302         Also marked the classes FINAL and made create() helpers return
2303         PassRef instead of PassRefPtr.
2304
2305         Reviewed by Antti Koivisto.
2306
2307 2013-11-04  Andreas Kling  <akling@apple.com>
2308
2309         Add an ancestor renderer iterator.
2310         <https://webkit.org/b/123718>
2311
2312         Add ancestor iterators for renderers, analogous to element ancestor
2313         iterators. They walk the chain of parent renderers, stopping at each
2314         ancestor of a certain type.
2315
2316         Just like child renderer iterators, this requires isRendererOfType()
2317         to be implemented for the targeted renderer class.
2318
2319         You use them like this:
2320
2321         auto frameSets = ancestorsOfType<RenderFrameSet>(*this);
2322         for (auto frameSet = frameSets.begin(), end = frameSets.end(); frameSet != end; ++frameSet)
2323             frameSet->thisOrThat();
2324
2325         To complete the patch, I put them to use in a couple of random places.
2326
2327         Reviewed by Antti Koivisto.
2328
2329 2013-11-04  Mihnea Ovidenie  <mihnea@adobe.com>
2330
2331         [CSSRegions] Use auto keyword to clean-up for loops
2332         https://bugs.webkit.org/show_bug.cgi?id=123699
2333
2334         Reviewed by Anders Carlsson.
2335
2336         Start using auto keyword for loops.
2337         Also, since region breaks (forced breaks) can be added only on boxes,
2338         i changed RenderFlowThread::addForcedRegionBreak to use a RenderBox* instead of RenderObject*.
2339
2340         No change in functionality, no new tests.
2341
2342         * dom/WebKitNamedFlow.cpp:
2343         (WebCore::WebKitNamedFlow::firstEmptyRegionIndex):
2344         * rendering/FlowThreadController.cpp:
2345         (WebCore::FlowThreadController::ensureRenderFlowThreadWithName):
2346         (WebCore::FlowThreadController::styleDidChange):
2347         (WebCore::FlowThreadController::layoutRenderNamedFlowThreads):
2348         (WebCore::FlowThreadController::updateFlowThreadsChainIfNecessary):
2349         (WebCore::FlowThreadController::updateFlowThreadsNeedingLayout):
2350         (WebCore::FlowThreadController::updateFlowThreadsNeedingTwoStepLayout):
2351         (WebCore::FlowThreadController::resetFlowThreadsWithAutoHeightRegions):
2352         (WebCore::FlowThreadController::updateFlowThreadsIntoConstrainedPhase):
2353         (WebCore::FlowThreadController::updateFlowThreadsIntoOverflowPhase):
2354         (WebCore::FlowThreadController::updateFlowThreadsIntoMeasureContentPhase):
2355         (WebCore::FlowThreadController::updateFlowThreadsIntoFinalPhase):
2356         (WebCore::FlowThreadController::updateRenderFlowThreadLayersIfNeeded):
2357         (WebCore::FlowThreadController::collectFixedPositionedLayers):
2358         (WebCore::FlowThreadController::isAutoLogicalHeightRegionsCountConsistent):
2359         * rendering/RenderFlowThread.cpp:
2360         (WebCore::RenderFlowThread::validateRegions):
2361         (WebCore::RenderFlowThread::hasCompositingRegionDescendant):
2362         (WebCore::RenderFlowThread::getLayerListForRegion):
2363         (WebCore::RenderFlowThread::updateLayerToRegionMappings):
2364         (WebCore::RenderFlowThread::updateLogicalWidth):
2365         (WebCore::RenderFlowThread::computeLogicalHeight):
2366         (WebCore::RenderFlowThread::repaintRectangleInRegions):
2367         (WebCore::RenderFlowThread::removeRenderBoxRegionInfo):
2368         (WebCore::RenderFlowThread::logicalWidthChangedInRegionsForBlock):
2369         (WebCore::RenderFlowThread::clearRenderObjectCustomStyle):
2370         (WebCore::RenderFlowThread::clearRenderBoxRegionInfoAndCustomStyle):
2371         (WebCore::RenderFlowThread::setRegionRangeForBox):
2372         (WebCore::RenderFlowThread::getRegionRangeForBox):
2373         (WebCore::RenderFlowThread::regionInRange):
2374         (WebCore::RenderFlowThread::checkRegionsWithStyling):
2375         (WebCore::RenderFlowThread::objectInFlowRegion):
2376         (WebCore::RenderFlowThread::isAutoLogicalHeightRegionsCountConsistent):
2377         (WebCore::RenderFlowThread::initializeRegionsComputedAutoHeight):
2378         (WebCore::RenderFlowThread::markAutoLogicalHeightRegionsForLayout):
2379         (WebCore::RenderFlowThread::markRegionsForOverflowLayoutIfNeeded):
2380         (WebCore::RenderFlowThread::updateRegionsFlowThreadPortionRect):
2381         (WebCore::RenderFlowThread::addForcedRegionBreak):
2382         (WebCore::RenderFlowThread::collectLayerFragments):
2383         (WebCore::RenderFlowThread::fragmentsBoundingBox):
2384         (WebCore::RenderFlowThread::addRegionsVisualEffectOverflow):
2385         (WebCore::RenderFlowThread::addRegionsVisualOverflowFromTheme):
2386         (WebCore::RenderFlowThread::addRegionsOverflowFromChild):
2387         (WebCore::RenderFlowThread::addRegionsLayoutOverflow):
2388         (WebCore::RenderFlowThread::clearRegionsOverflow):
2389         * rendering/RenderFlowThread.h:
2390         * rendering/RenderNamedFlowThread.cpp:
2391         (WebCore::RenderNamedFlowThread::nextRendererForNode):
2392         (WebCore::RenderNamedFlowThread::previousRendererForNode):
2393         (WebCore::RenderNamedFlowThread::dependsOn):
2394         (WebCore::addRegionToList):
2395         (WebCore::RenderNamedFlowThread::computeOversetStateForRegions):
2396         (WebCore::RenderNamedFlowThread::checkInvalidRegions):
2397         (WebCore::RenderNamedFlowThread::pushDependencies):
2398         * rendering/RenderRegion.cpp:
2399         (WebCore::RenderRegion::setRegionObjectsRegionStyle):
2400         (WebCore::RenderRegion::restoreRegionObjectsOriginalStyle):
2401         (WebCore::RenderRegion::computeChildrenStyleInRegion):
2402
2403 2013-11-03  Zan Dobersek  <zdobersek@igalia.com>
2404
2405         PingLoader objects unnecessarily pass through OwnPtr
2406         https://bugs.webkit.org/show_bug.cgi?id=122942
2407
2408         Reviewed by Darin Adler.
2409
2410         There's no need to store new PingLoader objects into an OwnPtr just to leak them out a few lines later
2411         into an unused variable. New objects are created through a new helper method and then left unmanaged as
2412         they're guaranteed to destroy themselves when they receive a response of any kind.
2413
2414         * loader/PingLoader.cpp:
2415         (WebCore::PingLoader::loadImage): Call the new createPingLoader method to spawn the PingLoader.
2416         (WebCore::PingLoader::sendPing): Ditto.
2417         (WebCore::PingLoader::sendViolationReport): Ditto.
2418         (WebCore::PingLoader::createPingLoader): A helper method that creates a new PingLoader object
2419         * loader/PingLoader.h: Declare the new PingLoader::createPingLoader method.
2420
2421 2013-11-03  Andreas Kling  <akling@apple.com>
2422
2423         HTMLOptionsCollection is always rooted at a HTMLSelectElement.
2424         <https://webkit.org/b/123719>
2425
2426         Tighten up HTMLOptionsCollection by making the constructor take
2427         a HTMLSelectElement& and adding a HTMLSelectElement& getter instead
2428         of casting all over the place. Removed now-pointless assertions.
2429
2430         Reviewed by Sam Weinig.
2431
2432 2013-11-03  Andreas Kling  <akling@apple.com>
2433
2434         RenderTextFragment: Tighten first-letter logic.
2435         <https://webkit.org/b/123714>
2436
2437         Reviewed by Antti Koivisto.
2438
2439         * editing/TextIterator.cpp:
2440         (WebCore::firstRenderTextInFirstLetter):
2441
2442             Use iterator helper to find first RenderText child.
2443
2444         (WebCore::TextIterator::handleTextNodeFirstLetter):
2445
2446             Tightening through type inference.
2447
2448         * rendering/RenderBlock.cpp:
2449         (WebCore::RenderBlock::updateFirstLetterStyle):
2450         (WebCore::RenderBlock::createFirstLetterRenderer):
2451         * rendering/RenderTextFragment.h:
2452
2453             The first letter renderer is always a RenderBoxModelObject,
2454             so make the code deal in that instead of RenderObject.
2455
2456         * rendering/RenderChildIterator.h:
2457         (WebCore::RenderChildIteratorAdapter::first):
2458         (WebCore::RenderChildIteratorAdapter::last):
2459
2460             Remove excess ampersands that were keeping this from building.
2461
2462 2013-11-03  Andreas Kling  <akling@apple.com>
2463
2464         CSSPrimitiveValue identifier constructors should return PassRef.
2465         <https://webkit.org/b/123712>
2466
2467         Make CSSPrimitiveValue::createIdentifier() and the corresponding
2468         CSSValuePool helper return PassRef<CSSPrimitiveValue>.
2469
2470         Reviewed by Antti Koivisto.
2471
2472 2013-11-03  Andreas Kling  <akling@apple.com>
2473
2474         Use RenderChildIterator in two more loops.
2475         <https://webkit.org/b/123713>
2476
2477         Switch two more renderer child traversal loops to childrenOfType.
2478
2479         Reviewed by Antti Koivisto.
2480
2481 2013-11-03  Andreas Kling  <akling@apple.com>
2482
2483         CSSShadowValue constructor should return PassRef.
2484         <https://webkit.org/b/123711>
2485
2486         Make CSSShadowValue::create() return a PassRef since it will never
2487         return null.
2488
2489         Reviewed by Sam Weinig.
2490
2491 2013-11-03  Andreas Kling  <akling@apple.com>
2492
2493         CSSLineBoxContainValue constructor should return PassRef.
2494         <https://webkit.org/b/123710>
2495
2496         Make CSSLineBoxContainValue::create() return a PassRef since it
2497         will never return null.
2498
2499         Reviewed by Sam Weinig.
2500
2501 2013-11-03  Antti Koivisto  <antti@apple.com>
2502
2503         LiveNodeLists should have non-null ContainerNode as root
2504         https://bugs.webkit.org/show_bug.cgi?id=123709
2505
2506         Reviewed by Andreas Kling.
2507
2508         After moving ChildNodeList off from LiveNodeList the root is now always at least a ContainerNode.
2509
2510         * dom/ContainerNode.cpp:
2511         (WebCore::ContainerNode::getElementsByTagName):
2512         (WebCore::ContainerNode::getElementsByTagNameNS):
2513         (WebCore::ContainerNode::getElementsByName):
2514         (WebCore::ContainerNode::getElementsByClassName):
2515         (WebCore::ContainerNode::radioNodeList):
2516         
2517             Also these move from Node to ContainerNode to make tighter typing work.
2518
2519 2013-11-03  Antti Koivisto  <antti@apple.com>
2520
2521         Switch createContextualFragment to element iterator
2522         https://bugs.webkit.org/show_bug.cgi?id=123704
2523
2524         Reviewed by Andreas Kling.
2525
2526         * editing/FrameSelection.cpp:
2527         (WebCore::scanForForm):
2528         
2529             Use type helpers instead of hasTagName
2530
2531         * editing/markup.cpp:
2532         (WebCore::collectElementsToRemoveFromFragment):
2533         (WebCore::removeElementFromFragmentPreservingChildren):
2534         (WebCore::createContextualFragment):
2535         * html/HTMLFormElement.cpp:
2536         (WebCore::HTMLFormElement::formElementIndex):
2537         
2538             Use type helpers instead of hasTagName
2539
2540         * html/HTMLTagNames.in:
2541         
2542             Generate type helpers for <html>.
2543
2544 2013-11-03  Antti Koivisto  <antti@apple.com>
2545
2546         ChildNodeList should not be LiveNodeList
2547         https://bugs.webkit.org/show_bug.cgi?id=123708
2548
2549         Reviewed by Sam Weinig.
2550
2551         ChildNodeList is a poor fit to be a LiveNodeList. It is heavily special-cased. It is also
2552         the only subtype that returns non-Elements thus preventing tightening.
2553
2554         * bindings/js/JSNodeListCustom.cpp:
2555         (WebCore::JSNodeListOwner::isReachableFromOpaqueRoots):
2556         
2557             Support new types.
2558
2559         * dom/ChildNodeList.cpp:
2560         (WebCore::EmptyNodeList::~EmptyNodeList):
2561         (WebCore::ChildNodeList::ChildNodeList):
2562         (WebCore::ChildNodeList::~ChildNodeList):
2563         (WebCore::ChildNodeList::length):
2564         (WebCore::childFromFirst):
2565         (WebCore::childFromLast):
2566         (WebCore::ChildNodeList::nodeBeforeCached):
2567         (WebCore::ChildNodeList::nodeAfterCached):
2568         (WebCore::ChildNodeList::item):
2569         (WebCore::ChildNodeList::namedItem):
2570         (WebCore::ChildNodeList::invalidateCache):
2571         
2572             Implement the same caching optimizations as LiveNodeList with tighter, less generic code.
2573
2574         * dom/ChildNodeList.h:
2575         
2576             Inherit ChildNodeList directly from NodeList.
2577
2578             Add new EmptyNodeList type. This is only ever used if NodeList is requested for a non-container node.
2579             It allows tighter typing in ChildNodeList.
2580
2581         * dom/LiveNodeList.cpp:
2582         (WebCore::LiveNodeList::namedItem):
2583         * dom/LiveNodeList.h:
2584         (WebCore::LiveNodeListBase::LiveNodeListBase):
2585         (WebCore::LiveNodeListBase::~LiveNodeListBase):
2586         (WebCore::LiveNodeList::LiveNodeList):
2587         
2588             Remove ChildNodeList specific code and branches.
2589
2590         * dom/Node.cpp:
2591         (WebCore::Node::childNodes):
2592         
2593             Return EmptyNodeList for non-containers.
2594
2595         * dom/NodeList.h:
2596         (WebCore::NodeList::~NodeList):
2597         (WebCore::NodeList::isLiveNodeList):
2598         (WebCore::NodeList::isChildNodeList):
2599         (WebCore::NodeList::isEmptyNodeList):
2600         
2601             For isReachableFromOpaqueRoots.
2602
2603         * dom/NodeRareData.h:
2604         (WebCore::NodeListsNodeData::ensureChildNodeList):
2605         (WebCore::NodeListsNodeData::removeChildNodeList):
2606         (WebCore::NodeListsNodeData::ensureEmptyChildNodeList):
2607         (WebCore::NodeListsNodeData::removeEmptyChildNodeList):
2608         (WebCore::NodeListsNodeData::NodeListsNodeData):
2609         (WebCore::NodeListsNodeData::deleteThisAndUpdateNodeRareDataIfAboutToRemoveLastList):
2610         
2611             EmptyNodeList support.
2612
2613         * html/CollectionType.h:
2614         * html/HTMLCollection.cpp:
2615         (WebCore::shouldOnlyIncludeDirectChildren):
2616         (WebCore::rootTypeFromCollectionType):
2617         (WebCore::invalidationTypeExcludingIdAndNameAttributes):
2618         (WebCore::isMatchingElement):
2619         (WebCore::LiveNodeListBase::itemBefore):
2620         (WebCore::LiveNodeListBase::traverseLiveNodeListFirstElement):
2621         (WebCore::LiveNodeListBase::traverseLiveNodeListForwardToOffset):
2622         (WebCore::LiveNodeListBase::item):
2623         (WebCore::LiveNodeListBase::itemBeforeOrAfterCachedItem):
2624         
2625             Remove ChildNodeList specific code and branches.
2626
2627 2013-11-03  Patrick Gansterer  <paroga@webkit.org>
2628
2629         [WINCE] Replace OwnPtr with GDIObject
2630         https://bugs.webkit.org/show_bug.cgi?id=123670
2631
2632         Reviewed by Anders Carlsson.
2633
2634         * page/win/FrameGdiWin.cpp:
2635         (WebCore::imageFromRect):
2636         * platform/graphics/wince/FontPlatformData.cpp:
2637         (WebCore::FixedSizeFontData::create):
2638         (WebCore::FontPlatformData::hfont):
2639         (WebCore::FontPlatformData::getScaledFontHandle):
2640         * platform/graphics/wince/GraphicsContextWinCE.cpp:
2641         (WebCore::createPen):
2642         (WebCore::createBrush):
2643         (WebCore::GraphicsContext::drawRect):
2644         (WebCore::GraphicsContext::drawLine):
2645         (WebCore::GraphicsContext::drawEllipse):
2646         (WebCore::GraphicsContext::drawConvexPolygon):
2647         (WebCore::GraphicsContext::fillRect):
2648         (WebCore::GraphicsContext::clip):
2649         (WebCore::GraphicsContext::strokeRect):
2650         (WebCore::GraphicsContext::fillRoundedRect):
2651         (WebCore::GraphicsContext::drawRoundCorner):
2652         (WebCore::GraphicsContext::fillPath):
2653         (WebCore::GraphicsContext::strokePath):
2654         (WebCore::GraphicsContext::drawText):
2655         * platform/graphics/wince/ImageWinCE.cpp:
2656         (WebCore::BitmapImage::getHBITMAPOfSize):
2657         * platform/graphics/wince/SharedBitmap.cpp:
2658         (WebCore::SharedBitmap::createHandle):
2659         (WebCore::SharedBitmap::draw):
2660         (WebCore::SharedBitmap::clipBitmap):
2661         (WebCore::drawPatternSimple):
2662         (WebCore::SharedBitmap::drawPattern):
2663         (WebCore::SharedBitmap::DCProvider::getDC):
2664         * platform/graphics/wince/SharedBitmap.h:
2665
2666 2013-11-03  Antti Koivisto  <antti@apple.com>
2667
2668         Add helpers for partial descendant traversal to element iterators
2669         https://bugs.webkit.org/show_bug.cgi?id=123703
2670
2671         Reviewed by Andreas Kling.
2672
2673         * dom/ElementAncestorIterator.h:
2674         (WebCore::lineageOfType):
2675         
2676             lineageOfType definition didn't match the declaration.
2677
2678         * dom/ElementDescendantIterator.h:
2679         (WebCore::::find):
2680         (WebCore::::from):
2681         
2682             Add find and from for getting begin iterator for partial traversals.
2683
2684         * editing/FrameSelection.cpp:
2685         (WebCore::scanForForm):
2686         (WebCore::FrameSelection::currentForm):
2687         * html/HTMLFormElement.cpp:
2688         (WebCore::HTMLFormElement::formElementIndex):
2689         (WebCore::HTMLFormElement::findClosestFormAncestor):
2690         
2691             Use them in a few places.
2692
2693 2013-11-03  Andreas Kling  <akling@apple.com>
2694
2695         Inline RenderStyle functions for getting/setting pseudo style bits.
2696         <https://webkit.org/b/123702>
2697
2698         hasPseudoStyle() actually shows up on html5-full-render.html,
2699         and it's pretty crazy to eat the cost of a function call just
2700         to do some basic bit twiddling.
2701
2702         Reviewed by Antti Koivisto.
2703
2704 2013-11-03  Xabier Rodriguez Calvar  <calvaris@igalia.com>
2705
2706         Remove HTMLMediaElement.initialTime
2707         https://bugs.webkit.org/show_bug.cgi?id=123572
2708
2709         Reviewed by Eric Carlson.
2710
2711         Patch based on one by: philipj@opera.com
2712         Blink review URL: https://codereview.chromium.org/35033002
2713
2714         initialTime has been removed from the HTMLMediaElement.
2715
2716         * bindings/gobject/WebKitDOMCustom.cpp:
2717         (webkit_dom_html_media_element_get_initial_time):
2718         * bindings/gobject/WebKitDOMCustom.h:
2719         * bindings/gobject/WebKitDOMCustom.symbols: Added phony function.
2720         * html/HTMLMediaElement.cpp:
2721         * html/HTMLMediaElement.h:
2722         * html/HTMLMediaElement.idl: Removed HTMLMediaElement::initialTime.
2723
2724 2013-11-02  Alexey Proskuryakov  <ap@apple.com>
2725
2726         Implement generateKey for HMAC and AES-CBC
2727         https://bugs.webkit.org/show_bug.cgi?id=123669
2728
2729         Reviewed by Dan Bernstein.
2730
2731         Tests: crypto/subtle/aes-cbc-generate-key.html
2732                crypto/subtle/hmac-generate-key.html
2733
2734         * WebCore.xcodeproj/project.pbxproj: Added new files.
2735
2736         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
2737         (WebCore::createAesKeyGenParams): Added bindings for AesKeyGenParams.
2738         (WebCore::JSCryptoAlgorithmDictionary::createParametersForGenerateKey): Handle
2739         algorithms that generate AES and HMAC keys.
2740
2741         * bindings/js/JSSubtleCryptoCustom.cpp: (WebCore::JSSubtleCrypto::generateKey): Added.
2742
2743         * crypto/CryptoAlgorithmAesKeyGenParams.h: Added.
2744
2745         * crypto/CryptoKey.cpp: (WebCore::CryptoKey::randomData):
2746         * crypto/CryptoKey.h:
2747         * crypto/CryptoKeyMac.cpp: Added
2748         Expose a function that produces random data for symmetric crypto keys. Cross-platform
2749         implementation uses ARC4 code from WTF, while Mac uses a system function that
2750         provides a FIPS validated random number generator.
2751
2752         * crypto/CryptoKeyAES.cpp: (WebCore::CryptoKeyAES::generate):
2753         * crypto/CryptoKeyAES.h:
2754         Added a function that creates AES keys.
2755
2756         * crypto/SubtleCrypto.idl: Added generateKey.
2757
2758         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
2759         (WebCore::CryptoAlgorithmAES_CBC::generateKey): Added.
2760
2761         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
2762         (WebCore::CryptoAlgorithmHMAC::generateKey): Added.
2763
2764         * crypto/keys/CryptoKeyHMAC.cpp: (WebCore::CryptoKeyHMAC::generate):
2765         * crypto/keys/CryptoKeyHMAC.h:
2766         Added a function that creates HMAC keys.
2767
2768         * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp: Removed generateKey stub, the implementation
2769         ended up in cross-platform file.
2770
2771         * crypto/mac/CryptoAlgorithmHMACMac.cpp: Ditto.
2772
2773 2013-11-02  Christophe Dumez  <ch.dumez@samsung.com>
2774
2775         EnforceRange doesn't enforce range of a short
2776         https://bugs.webkit.org/show_bug.cgi?id=123661
2777
2778         Reviewed by Alexey Proskuryakov.
2779
2780         Handle Web IDL short / unsigned short types as per the
2781         specification:
2782         - http://www.w3.org/TR/WebIDL/#es-short
2783         - http://www.w3.org/TR/WebIDL/#es-unsigned-short
2784
2785         Specifically, we used to treat short / unsigned short as 32bit
2786         integers, which was wrong. We now properly handle them as 16bit
2787         integers.
2788
2789         No new tests, added test cases to js/dom/webidl-type-mapping.html.
2790
2791         * WebCore.exp.in:
2792         * bindings/js/JSDOMBinding.cpp:
2793         (WebCore::toSmallerInt):
2794         (WebCore::toSmallerUInt):
2795         (WebCore::toInt8):
2796         (WebCore::toUInt8):
2797         (WebCore::toInt16):
2798         (WebCore::toUInt16):
2799         * bindings/js/JSDOMBinding.h:
2800         * bindings/scripts/CodeGeneratorJS.pm:
2801         (JSValueToNative):
2802         * bindings/scripts/test/JS/JSTestObj.cpp:
2803         (WebCore::setJSTestObjShortAttr):
2804         (WebCore::setJSTestObjUnsignedShortAttr):
2805         * testing/TypeConversions.h:
2806         (WebCore::TypeConversions::testShort):
2807         (WebCore::TypeConversions::setTestShort):
2808         (WebCore::TypeConversions::testEnforceRangeShort):
2809         (WebCore::TypeConversions::setTestEnforceRangeShort):
2810         (WebCore::TypeConversions::testUnsignedShort):
2811         (WebCore::TypeConversions::setTestUnsignedShort):
2812         (WebCore::TypeConversions::testEnforceRangeUnsignedShort):
2813         (WebCore::TypeConversions::setTestEnforceRangeUnsignedShort):
2814         * testing/TypeConversions.idl:
2815
2816 2013-11-02  Patrick Gansterer  <paroga@webkit.org>
2817
2818         Cleanup OpenTypeUtilities
2819         https://bugs.webkit.org/show_bug.cgi?id=123686
2820
2821         Reviewed by Darin Adler.
2822
2823         Merge the WinCE specific code into the general Windows code to
2824         make the compilation of WinCE port on WinNT easier.
2825
2826         * platform/graphics/opentype/OpenTypeUtilities.cpp:
2827         (WebCore::renameFont):
2828         (WebCore::renameAndActivateFont):
2829         * platform/graphics/opentype/OpenTypeUtilities.h:
2830         * platform/graphics/win/FontCustomPlatformData.cpp:
2831         (WebCore::createFontCustomPlatformData):
2832         * platform/graphics/win/FontCustomPlatformDataCairo.cpp:
2833         (WebCore::createFontCustomPlatformData):
2834         * platform/graphics/wince/FontCustomPlatformData.cpp:
2835         (WebCore::createFontCustomPlatformData):
2836
2837 2013-11-02  Andreas Kling  <akling@apple.com>
2838
2839         CSSFontFaceSrcValue constructors should return PassRef.
2840         <https://webkit.org/b/123692>
2841
2842         Make functions that return non-null CSSFontFaceSrcValues return
2843         PassRef instead of PassRefPtr. Tweak some call sites to be
2844         slightly more efficient.
2845
2846         Reviewed by Anders Carlsson.
2847
2848 2013-11-02  Andreas Kling  <akling@apple.com>
2849
2850         CSSStyleSheet::contents() should return a reference.
2851         <https://webkit.org/b/123689>
2852
2853         Make CSSStyleSheet::contents() return a StyleSheetContents& instead
2854         of a pointer. The object was already stored in a Ref.
2855
2856         Reviewed by Anders Carlsson.
2857
2858 2013-11-02  Andreas Kling  <akling@apple.com>
2859
2860         CSSReflectValue constructor should return PassRef.
2861         <https://webkit.org/b/123963>
2862
2863         Make CSSReflectValue::create() return a PassRef. Tweak one call
2864         site to be slightly more efficient.
2865
2866         Reviewed by Anders Carlsson.
2867
2868 2013-11-02  Andreas Kling  <akling@apple.com>
2869
2870         CSSFontFeatureValue constructor should return PassRef.
2871         <https://webkit.org/b/123691>
2872
2873         Make CSSFontFeatureValue::create() return PassRef, since it never
2874         returns null. Tweak one call site to be slightly more efficient.
2875
2876         Reviewed by Anders Carlsson.
2877
2878 2013-11-02  Andreas Kling  <akling@apple.com>
2879
2880         Tighten typing in SVGResources::buildCachedResources().
2881         <https://webkit.org/b/123690>
2882
2883         Make this function take a RenderElement&/SVGRenderStyle& pair instead
2884         of a RenderObject*/SVGRenderStyle* pair. Also tweaked the code a bit,
2885         removing ampersands and asserts as appropriate.
2886
2887         Reviewed by Anders Carlsson.
2888
2889 2013-11-02  Andreas Kling  <akling@apple.com>
2890
2891         CSSImageValue constructors should return PassRef.
2892         <https://webkit.org/b/123688>
2893
2894         Make the CSSImageValue::create() helpers return PassRef.
2895         Tightened call sites to avoid null checks and destructor calls.
2896
2897         Reviewed by Anders Carlsson.
2898
2899 2013-11-02  Patrick Gansterer  <paroga@webkit.org>
2900
2901         Fix compilation of SynchronousLoaderClient
2902         https://bugs.webkit.org/show_bug.cgi?id=123676
2903
2904         Reviewed by Darin Adler.
2905
2906         Assign a ResourceRequest varibale an empty ResourceRequest instead of 0.
2907         The current solution only works for ports which can create a
2908         ResourceRequest from a pointer, which might not be true for all ports.
2909
2910         * platform/network/SynchronousLoaderClient.cpp:
2911         (WebCore::SynchronousLoaderClient::willSendRequest):
2912
2913 2013-11-02  Patrick Gansterer  <paroga@webkit.org>
2914
2915         Port LoggingWin.cpp to WinCE
2916         https://bugs.webkit.org/show_bug.cgi?id=123678
2917
2918         Reviewed by Darin Adler.
2919
2920         This makes it easier to use a common list of files
2921         for the different Windows ports later.
2922
2923         * PlatformWin.cmake:
2924         * platform/win/LoggingWin.cpp:
2925         (WebCore::logLevelString):
2926
2927 2013-11-02  Patrick Gansterer  <paroga@webkit.org>
2928
2929         Fix UnicodeWchar after r157330.
2930         https://bugs.webkit.org/show_bug.cgi?id=123668
2931
2932         Reviewed by Darin Adler.
2933
2934         * editing/TextIterator.cpp:
2935         (WebCore::SearchBuffer::append):
2936         * platform/graphics/wince/FontWinCE.cpp:
2937         (WebCore::generateComponents):
2938         * platform/graphics/wince/GraphicsContextWinCE.cpp:
2939         (WebCore::GraphicsContext::drawText):
2940         * platform/text/wchar/TextBreakIteratorWchar.cpp:
2941         (WebCore::isCharStop):
2942         (WebCore::isLineStop):
2943         (WebCore::isSentenceStop):
2944         (WebCore::WordBreakIterator::next):
2945         (WebCore::WordBreakIterator::previous):
2946
2947 2013-11-02  Andreas Kling  <akling@apple.com>
2948
2949         Use RenderChildIterator in a couple of places.
2950         <https://webkit.org/b/123684>
2951
2952         Added isRendererOfType() for RenderBox and RenderBlock and switch
2953         some loops over to using childrenOfType<>. Also sprinkled const
2954         and references on touched code.
2955
2956         Reviewed by Antti Koivisto.
2957
2958 2013-11-02  Zan Dobersek  <zdobersek@igalia.com>
2959
2960         Manage FileReaderLoader through std::unique_ptr
2961         https://bugs.webkit.org/show_bug.cgi?id=123666
2962
2963         Reviewed by Anders Carlsson.
2964
2965         Construct FileReaderLoader objects through std::make_unique and store them in std::unique_ptr.
2966
2967         * fileapi/FileReader.cpp:
2968         (WebCore::FileReader::readInternal):
2969         * fileapi/FileReader.h:
2970
2971 2013-11-02  Andreas Kling  <akling@apple.com>
2972
2973         Add a child renderer iterator.
2974         <https://webkit.org/b/123662>
2975
2976         Introduce an ElementIterator-style iterator for renderers and put
2977         it to use in a childrenOfType() implementation.
2978
2979         It's used just like the Element iterators:
2980
2981         auto sections = childrenOfType<RenderTableSection>(*this);
2982         for (auto section = sections.begin(), section = sections.end(); section != sections.end(); ++section)
2983             section->thisOrThat();
2984
2985         Just like the DOM counterpart, it relies on a templatized helper:
2986
2987             bool isRendererOfType<T>(const RenderObject&)
2988
2989         This patch puts the iterator to use in a couple of random places.
2990
2991         Reviewed by Antti Koivisto.
2992
2993 2013-11-02  Alexey Proskuryakov  <ap@apple.com>
2994
2995         Implement remaining SHA variations for WebCrypto
2996         https://bugs.webkit.org/show_bug.cgi?id=123659
2997
2998         Reviewed by Anders Carlsson.
2999
3000         Tests: crypto/subtle/sha-224.html
3001                crypto/subtle/sha-256.html
3002                crypto/subtle/sha-384.html
3003                crypto/subtle/sha-512.html
3004
3005         * WebCore.xcodeproj/project.pbxproj:
3006         * crypto/algorithms/CryptoAlgorithmSHA224.cpp: Added.
3007         (WebCore::CryptoAlgorithmSHA224::CryptoAlgorithmSHA224):
3008         (WebCore::CryptoAlgorithmSHA224::~CryptoAlgorithmSHA224):
3009         (WebCore::CryptoAlgorithmSHA224::create):
3010         (WebCore::CryptoAlgorithmSHA224::identifier):
3011         * crypto/algorithms/CryptoAlgorithmSHA224.h: Added.
3012         * crypto/algorithms/CryptoAlgorithmSHA256.cpp: Added.
3013         (WebCore::CryptoAlgorithmSHA256::CryptoAlgorithmSHA256):
3014         (WebCore::CryptoAlgorithmSHA256::~CryptoAlgorithmSHA256):
3015         (WebCore::CryptoAlgorithmSHA256::create):
3016         (WebCore::CryptoAlgorithmSHA256::identifier):
3017         * crypto/algorithms/CryptoAlgorithmSHA256.h: Added.
3018         * crypto/algorithms/CryptoAlgorithmSHA384.cpp: Added.
3019         (WebCore::CryptoAlgorithmSHA384::CryptoAlgorithmSHA384):
3020         (WebCore::CryptoAlgorithmSHA384::~CryptoAlgorithmSHA384):
3021         (WebCore::CryptoAlgorithmSHA384::create):
3022         (WebCore::CryptoAlgorithmSHA384::identifier):
3023         * crypto/algorithms/CryptoAlgorithmSHA384.h: Added.
3024         * crypto/algorithms/CryptoAlgorithmSHA512.cpp: Added.
3025         (WebCore::CryptoAlgorithmSHA512::CryptoAlgorithmSHA512):
3026         (WebCore::CryptoAlgorithmSHA512::~CryptoAlgorithmSHA512):
3027         (WebCore::CryptoAlgorithmSHA512::create):
3028         (WebCore::CryptoAlgorithmSHA512::identifier):
3029         * crypto/algorithms/CryptoAlgorithmSHA512.h: Added.
3030         * crypto/mac/CryptoAlgorithmRegistryMac.cpp:
3031         (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
3032         * crypto/mac/CryptoAlgorithmSHA224Mac.cpp: Added.
3033         (WebCore::CryptoAlgorithmSHA224::digest):
3034         * crypto/mac/CryptoAlgorithmSHA256Mac.cpp: Added.
3035         (WebCore::CryptoAlgorithmSHA256::digest):
3036         * crypto/mac/CryptoAlgorithmSHA384Mac.cpp: Added.
3037         (WebCore::CryptoAlgorithmSHA384::digest):
3038         * crypto/mac/CryptoAlgorithmSHA512Mac.cpp: Added.
3039         (WebCore::CryptoAlgorithmSHA512::digest):
3040
3041 2013-11-02  Patrick Gansterer  <paroga@webkit.org>
3042
3043         Various small WinCE build fixes
3044
3045         * editing/TextIterator.cpp:
3046         (WebCore::SearchBuffer::append):
3047         * platform/graphics/BitmapImage.h:
3048         * platform/graphics/wince/ImageWinCE.cpp:
3049         (WebCore::BitmapImage::getHBITMAPOfSize):
3050         (WebCore::BitmapImage::drawFrameMatchingSourceSize):
3051         * platform/graphics/wince/PlatformPathWinCE.h:
3052         * platform/win/PopupMenuWin.h:
3053         * rendering/RenderThemeWinCE.cpp:
3054         (WebCore::RenderThemeWinCE::adjustMenuListButtonStyle):
3055
3056 2013-11-01  Alexey Proskuryakov  <ap@apple.com>
3057
3058         Add WebCrypto AES-CBC
3059         https://bugs.webkit.org/show_bug.cgi?id=123647
3060
3061         Reviewed by Anders Carlsson.
3062
3063         Tests: crypto/subtle/aes-cbc-192-encrypt-decrypt.html
3064                crypto/subtle/aes-cbc-256-encrypt-decrypt.html
3065                crypto/subtle/aes-cbc-encrypt-decrypt-with-padding.html
3066                crypto/subtle/aes-cbc-encrypt-decrypt.html
3067                crypto/subtle/aes-cbc-invalid-length.html
3068                crypto/subtle/aes-cbc-wrong-key-class.html
3069
3070         * WebCore.xcodeproj/project.pbxproj: Added new files.
3071         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
3072         (WebCore::getProperty): Factored out a function to get a property as JSValue.
3073         (WebCore::getHashAlgorithm): Use it.
3074         (WebCore::createAesCbcParams): Added converter for AesCbcParams.
3075         (WebCore::JSCryptoAlgorithmDictionary::createParametersForEncrypt): Support AES_CBC.
3076         (WebCore::JSCryptoAlgorithmDictionary::createParametersForDecrypt): Ditto.
3077         (WebCore::JSCryptoAlgorithmDictionary::createParametersForImportKey): Support all
3078         algorithms, all the new ones just have trivial dictionaries.
3079         (WebCore::JSCryptoAlgorithmDictionary::createParametersForExportKey): Ditto.
3080
3081         * bindings/js/JSCryptoOperationData.cpp: Added.
3082         (WebCore::sequenceOfCryptoOperationDataFromJSValue):
3083         (WebCore::cryptoOperationDataFromJSValue):
3084         * bindings/js/JSCryptoOperationData.h: Added.
3085         Moved CryptoOperationData bindings out of JSSubtleCryptoCustom.cpp, so that we
3086         could use them in JSCryptoAlgorithmDictionary.cpp.
3087
3088         * bindings/js/JSDOMPromise.h: (WebCore::PromiseWrapper::reject): Added a specialization
3089         to reject with null result. The spec doesn't actually say how algorithms fail.
3090
3091         * bindings/js/JSSubtleCryptoCustom.cpp:
3092         (WebCore::JSSubtleCrypto::encrypt): Added.
3093         (WebCore::JSSubtleCrypto::decrypt): Ditto.
3094         (WebCore::JSSubtleCrypto::sign): Style fix.
3095
3096         * crypto/CryptoAlgorithmAesCbcParams.h: Added.
3097
3098         * crypto/CryptoKey.h:
3099         (WebCore::CryptoKeyClass):
3100         * crypto/keys/CryptoKeyHMAC.h:
3101         (WebCore::asCryptoKeyHMAC):
3102         Added poor man's RTTI, so that we can safely upcast Keys passed fro JavaScript code.
3103
3104         * crypto/CryptoKeyAES.cpp: Added.
3105         (WebCore::CryptoKeyAES::CryptoKeyAES):
3106         (WebCore::CryptoKeyAES::~CryptoKeyAES):
3107         (WebCore::CryptoKeyAES::buildAlgorithmDescription):
3108         * crypto/CryptoKeyAES.h: Added.
3109         (WebCore::asCryptoKeyAES):
3110         AES keys are the same for all algorithms, but they still need to remember the algorithm.
3111
3112         * crypto/SubtleCrypto.idl: Added encrypt/decrypt.
3113
3114         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp: Added.
3115         (WebCore::CryptoAlgorithmAES_CBC::CryptoAlgorithmAES_CBC):
3116         (WebCore::CryptoAlgorithmAES_CBC::~CryptoAlgorithmAES_CBC):
3117         (WebCore::CryptoAlgorithmAES_CBC::create):
3118         (WebCore::CryptoAlgorithmAES_CBC::identifier):
3119         (WebCore::CryptoAlgorithmAES_CBC::importKey):
3120         (WebCore::CryptoAlgorithmAES_CBC::exportKey):
3121         * crypto/algorithms/CryptoAlgorithmAES_CBC.h: Added.
3122         * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp: Added.
3123         (WebCore::transformAES_CBC):
3124         (WebCore::CryptoAlgorithmAES_CBC::encrypt):
3125         (WebCore::CryptoAlgorithmAES_CBC::decrypt):
3126         (WebCore::CryptoAlgorithmAES_CBC::generateKey):
3127         Added.
3128
3129         * crypto/mac/CryptoAlgorithmHMACMac.cpp:
3130         (WebCore::CryptoAlgorithmHMAC::sign):
3131         (WebCore::CryptoAlgorithmHMAC::verify):
3132         Check key class before casting it to CryptoKeyHMAC.
3133
3134         * crypto/mac/CryptoAlgorithmRegistryMac.cpp:
3135         (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms): Register AES-CBC
3136         on Mac, so that it can be used.
3137
3138 2013-11-01  Andreas Kling  <akling@apple.com>
3139
3140         SVGRenderStyle accessors should return references.
3141         <https://webkit.org/b/123656>
3142
3143         RenderStyle::svgStyle() and accessSVGStyle() never return null,
3144         so make them return references instead.
3145         
3146         This flushed out a myriad of pointless null checks and assertions.
3147
3148         Reviewed by Anders Carlsson.
3149
3150 2013-11-01  Thiago de Barros Lacerda  <thiago.lacerda@openbossa.org>
3151
3152         Removing MediaStreamTrackVector and MediaStreamSourceVector typedefs
3153         https://bugs.webkit.org/show_bug.cgi?id=123648
3154
3155         Reviewed by Eric Carlson.
3156
3157         No new tests needed.
3158
3159         * Modules/mediastream/MediaStream.cpp:
3160         (WebCore::MediaStream::create):
3161         (WebCore::MediaStream::clone):
3162         (WebCore::MediaStream::cloneMediaStreamTrackVector):
3163         (WebCore::MediaStream::addTrack):
3164         (WebCore::MediaStream::removeTrack):
3165         (WebCore::MediaStream::haveTrackWithSource):
3166         (WebCore::MediaStream::getTrackById):
3167         (WebCore::MediaStream::trackVectorForType):
3168         * Modules/mediastream/MediaStream.h:
3169         * Modules/mediastream/MediaStreamTrack.h:
3170         * Modules/mediastream/UserMediaRequest.cpp:
3171         (WebCore::UserMediaRequest::callSuccessHandler):
3172         * Modules/webaudio/AudioContext.cpp:
3173         (WebCore::AudioContext::createMediaStreamSource):
3174         * Modules/webaudio/MediaStreamAudioDestinationNode.cpp:
3175         (WebCore::MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode):
3176         * platform/mediastream/MediaStreamDescriptor.cpp:
3177         (WebCore::MediaStreamDescriptor::create):
3178         (WebCore::MediaStreamDescriptor::MediaStreamDescriptor):
3179         * platform/mediastream/MediaStreamDescriptor.h:
3180         * platform/mediastream/MediaStreamSource.h:
3181
3182 2013-11-01  Andreas Kling  <akling@apple.com>
3183
3184         createFontFaceValue() should be smarter about overgrown cache.
3185         <https://webkit.org/b/123643>
3186
3187         Instead of clearing the whole font-face value cache when it passes
3188         128 entries, just delete one entry at random.
3189
3190         Reviewed by Geoffrey Garen.
3191
3192 2013-11-01  Thiago de Barros Lacerda  <thiago.lacerda@openbossa.org>
3193
3194         Fixing mac code to use new MediaStreamDescriptor create method
3195         https://bugs.webkit.org/show_bug.cgi?id=123653
3196
3197         Reviewed by Eric Carlson.
3198
3199         No new tests needed.
3200
3201         * platform/mediastream/mac/MediaStreamCenterMac.cpp:
3202         (WebCore::MediaStreamCenterMac::createMediaStream):
3203
3204 2013-11-01  Andreas Kling  <akling@apple.com>
3205
3206         Re-use existing RenderStyle local in textWidth().
3207         <https://webkit.org/b/123392>
3208
3209         We already have the RenderStyle cached in a local here, so avoid
3210         getting it from RenderText since that has to go via the parent.
3211
3212         Reviewed by Antti Koivisto.
3213
3214 2013-11-01  Andreas Kling  <akling@apple.com>
3215
3216         Neuter WTF_MAKE_FAST_ALLOCATED in GLOBAL_FASTMALLOC_NEW builds.
3217         <https://webkit.org/b/123639>
3218
3219         WebCore::TimerBase really needed to have the new/delete operators
3220         overridden, in order for WebCore::SuspendableTimer to be able to
3221         choose that "operator new" out of the two it inherits.
3222
3223         Reviewed by Anders Carlsson.
3224
3225 2013-11-01  Andreas Kling  <akling@apple.com>
3226
3227         CSSCanvasValue construction helper should return PassRef.
3228         <https://webkit.org/b/123650>
3229
3230         Return PassRef instead of PassRefPtr from functions that return
3231         ownership-passing pointers that are known to be non-null.
3232
3233         Reviewed by Anders Carlsson.
3234
3235 2013-11-01  Joseph Pecoraro  <pecoraro@apple.com>
3236
3237         Move CF/Mac WTF String implementations down into WTF
3238         https://bugs.webkit.org/show_bug.cgi?id=123635
3239
3240         Reviewed by Sam Weinig.
3241
3242         * WebCore.vcxproj/WebCore.vcxproj:
3243         * WebCore.vcxproj/WebCore.vcxproj.filters:
3244         * WebCore.xcodeproj/project.pbxproj:
3245
3246 2013-11-01  Thiago de Barros Lacerda  <thiago.lacerda@openbossa.org>
3247
3248         Removing unnecessary early returns in addTrack, removeTrack and removeRemoteSource methods
3249         https://bugs.webkit.org/show_bug.cgi?id=123644
3250
3251         Reviewed by Eric Carlson.
3252
3253         No new tests needed.
3254
3255         * Modules/mediastream/MediaStream.cpp:
3256         (WebCore::MediaStream::addTrack):
3257         (WebCore::MediaStream::removeTrack):
3258         (WebCore::MediaStream::removeRemoteSource):
3259         (WebCore::MediaStream::trackVectorForType):
3260         * Modules/mediastream/MediaStream.h:
3261
3262 2013-11-01  Andreas Kling  <akling@apple.com>
3263
3264         CSSAspectRatioValue construction helper should return PassRef.
3265         <https://webkit.org/b/123645>
3266
3267         Return PassRef instead of PassRefPtr from functions that return
3268         ownership-passing pointers that are known to be non-null.
3269
3270         Reviewed by Darin Adler.
3271
3272 2013-11-01  Myles C. Maxfield  <mmaxfield@apple.com>
3273
3274         Initial implementation of text-decoration-skip ink
3275         https://bugs.webkit.org/show_bug.cgi?id=121806
3276
3277         Reviewed by Darin Adler.
3278
3279         text-decoration-skip: ink is implemented by the following steps:
3280         1. Before drawing any decorations, figure out the bounding box for the decorations that will be drawn
3281         2. Create an ImageBuffer with these dimensions
3282         3. Draw text into this ImageBuffer with a thicker stroke
3283         4. Apply the ImageBuffer as a mask to the context
3284         5. Draw decorations like normal
3285         6. Clean up
3286
3287         Test: fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-ink.html
3288
3289         * platform/graphics/cg/GraphicsContextCG.cpp:
3290         (WebCore::computeLineBoundsAndAntialiasingModeForText): Don't call GraphicsContext::roundToDevicePixels
3291         when painting is disabled
3292         * rendering/InlineTextBox.cpp:
3293         (WebCore::InlineTextBox::paint): Pass the TextPainter to paintDecoration
3294         (WebCore::computeUnderlineOffset): Small cleanup
3295         (WebCore::getWavyStrokeControlPointDistance): Pulling out of strokeWavyTextDecoration()
3296         (WebCore::getWavyStrokeStep): Ditto
3297         (WebCore::strokeWavyTextDecoration): Use the previous 2 functions
3298         (WebCore::getSingleDecorationBoundingBox): Pulling out repeated code into a function
3299         (WebCore::getDecorationBoundingBox): Compute the bounding box for an underline which
3300         hasn't been drawn yet
3301         (WebCore::InlineTextBox::paintDecoration): Construct a mask and apply it to the GraphicsContext
3302         * rendering/InlineTextBox.h: paintDecoration needs the TextPainter
3303         * rendering/style/RenderStyle.cpp:
3304         (WebCore::RenderStyle::changeRequiresRepaintIfTextOrBorderOrOutline): Redraw the underline when
3305         text-decoration-skip changes
3306
3307 2013-11-01  Andreas Kling  <akling@apple.com>
3308
3309         CSS 'initial' and 'inherit' value constructors should return PassRef.
3310         <https://webkit.org/b/123641>
3311
3312         Make the helpers involved in constructing CSS{Initial,Inherited}Value
3313         all return PassRef instead of PassRefPtr. This avoids generating
3314         pointless null checks at the call sites.
3315
3316         Reviewed by Darin Adler.
3317
3318 2013-11-01  Andreas Kling  <akling@apple.com>
3319
3320         Kill RenderArena.
3321         <https://webkit.org/b/123634>
3322
3323         There are no remaining users of the RenderArena allocator.
3324
3325         Reviewed by Geoffrey Garen.
3326
3327 2013-11-01  James Craig  <jcraig@apple.com>
3328
3329         AX: Regression: media controls are no longer accessible
3330         https://bugs.webkit.org/show_bug.cgi?id=121990
3331
3332         Reviewed by Jer Noble.
3333
3334         Updated existing test coverage.
3335         Added ARIA roles, attrs, and labels to the new media controls shadow DOM.
3336         Localization will be handled in http://webkit.org/b/120956
3337
3338         * Modules/mediacontrols/mediaControlsApple.js:
3339         (Controller.prototype.UIString):
3340         (Controller.prototype.createControls):
3341         (Controller.prototype.handleLoadStart):
3342         (Controller.prototype.handleError):
3343         (Controller.prototype.handleAbort):
3344         (Controller.prototype.handleSuspend):
3345         (Controller.prototype.handleStalled):
3346         (Controller.prototype.handleWaiting):
3347         (Controller.prototype.handleFullscreenChange):
3348         (Controller.prototype.handleMuteButtonClicked):
3349         (Controller.prototype.handleMinButtonClicked):
3350         (Controller.prototype.handleMaxButtonClicked):
3351         (Controller.prototype.handleVolumeSliderChange):
3352         (Controller.prototype.updatePlaying):
3353
3354 2013-11-01  Andreas Kling  <akling@apple.com>
3355
3356         Take BidiRuns out of the arena.
3357         <https://webkit.org/b/123630>
3358
3359         Stop arena-allocating BidiRun objects and use regular new/delete.
3360
3361         With this, there are no remaining clients of RenderArena.
3362         It will be removed in a subsequent patch.
3363
3364         Reviewed by Anders Carlsson.
3365
3366 2013-11-01  Afonso R. Costa Jr.  <afonso.costa@samsung.com>
3367
3368         Expose setApplicationCacheOriginQuota via window.internals
3369         https://bugs.webkit.org/show_bug.cgi?id=87838
3370
3371         Reviewed by Joseph Pecoraro.
3372
3373         Also reset the default origin quota in resetToConsistentState().
3374
3375         * testing/Internals.cpp: Add setApplicationCacheOriginQuota.
3376         (WebCore::Internals::resetToConsistentState): Reset the default origin
3377         quota.
3378         (WebCore::Internals::setApplicationCacheOriginQuota): Added.
3379         * testing/Internals.h: Add setApplicationCacheOriginQuota.
3380         * testing/Internals.idl: Ditto.
3381
3382 2013-11-01  Nick Diego Yamane  <nick.yamane@openbossa.org>
3383
3384         Explicitly initialize RefCounted base class in MediaStreamTrack's constructors
3385         https://bugs.webkit.org/show_bug.cgi?id=123620
3386
3387         Reviewed by Andreas Kling.
3388
3389         No new tests needed.
3390
3391         * Modules/mediastream/MediaStreamTrack.cpp:
3392         (WebCore::MediaStreamTrack::MediaStreamTrack):
3393
3394 2013-11-01  Thiago de Barros Lacerda  <thiago.lacerda@openbossa.org>
3395
3396         Adding addRemoteTrack and removeRemoteTrack functions to MediaStreamDescriptor and MediaStream
3397         https://bugs.webkit.org/show_bug.cgi?id=123477
3398
3399         Reviewed by Eric Carlson.
3400
3401         When the backend report that a remote track has been added or removed by a remote peer, we must be able to add
3402         it to its MediaStream
3403
3404         No new tests needed.
3405
3406         * Modules/mediastream/MediaStream.cpp:
3407         (WebCore::MediaStream::addTrack): Splitted in two parts that can be used by old addTrack and new addRemoteTrack.
3408         (WebCore::MediaStream::removeTrack): Splitted in two parts that can be used by old removeTrack and new
3409         removeRemoteTrack.
3410         (WebCore::MediaStream::addRemoteSource): Reusing code in new addTrack method.
3411         (WebCore::MediaStream::removeRemoteSource): Refactored.
3412         (WebCore::MediaStream::addRemoteTrack): Added.
3413         (WebCore::MediaStream::removeRemoteTrack): Added.
3414         (WebCore::MediaStream::getTrackVectorForType): Helper method that returns a vector of tracks according to
3415         track's type (Audio or Video).
3416
3417         * Modules/mediastream/MediaStream.h:
3418         * Modules/mediastream/MediaStreamTrack.cpp:
3419         (WebCore::MediaStreamTrack::MediaStreamTrack):
3420         * platform/mediastream/MediaStreamDescriptor.cpp:
3421         (WebCore::MediaStreamDescriptor::addRemoteTrack): Added.
3422         (WebCore::MediaStreamDescriptor::removeRemoteTrack): Added.
3423         * platform/mediastream/MediaStreamDescriptor.h:
3424
3425 2013-11-01  Brendan Long  <b.long@cablelabs.com>
3426
3427         [GStreamer] Support audio and video tracks
3428         https://bugs.webkit.org/show_bug.cgi?id=117039
3429
3430         Reviewed by Philippe Normand.
3431
3432         Tests: media/track/audio/audio-track-mkv-vorbis-addtrack.html
3433                media/track/audio/audio-track-mkv-vorbis-enabled.html
3434                media/track/audio/audio-track-mkv-vorbis-language.html
3435                media/track/in-band/track-in-band-kate-ogg-addtrack.html
3436                media/track/in-band/track-in-band-srt-mkv-addtrack.html
3437                media/track/video/video-track-mkv-theora-addtrack.html
3438                media/track/video/video-track-mkv-theora-language.html
3439                media/track/video/video-track-mkv-theora-selected.html
3440
3441         * GNUmakefile.list.am: Add audio and video track files.
3442         * PlatformEfl.cmake: Same.
3443         * html/HTMLMediaElement.cpp:
3444         (WebCore::HTMLMediaElement::audioTrackEnabledChanged): Schedule "change" event.
3445         (WebCore::HTMLMediaElement::videoTrackSelectedChanged): Same.
3446         * html/track/AudioTrack.cpp:
3447         (WebCore::AudioTrack::setEnabled): Call m_private->setEnabled
3448         (WebCore::AudioTrack::enabledChanged): Added callback.
3449         (WebCore::AudioTrack::labelChanged): Same.
3450         (WebCore::AudioTrack::languageChanged): Same.
3451         (WebCore::AudioTrack::willRemoveAudioTrackPrivate): Use ASSERT_UNUSED for consistence.
3452         * html/track/AudioTrack.h: Add new enabled, label and language callbacks.
3453         * html/track/VideoTrack.cpp:
3454         (WebCore::VideoTrack::setSelected): Call m_private->setEnabled
3455         (WebCore::VideoTrack::selectedChanged): Added callback.
3456         (WebCore::VideoTrack::labelChanged): Same.
3457         (WebCore::VideoTrack::languageChanged): Same.
3458         (WebCore::VideoTrack::willRemoveVideoTrackPrivate): Use ASSERT_UNUSED for consistence.
3459         * html/track/VideoTrack.h: Add new selected, label and language callbacks.
3460         * platform/graphics/AudioTrackPrivate.h:
3461         (WebCore::AudioTrackPrivate::setEnabled): Call m_client->enabledChanged
3462         * platform/graphics/VideoTrackPrivate.h:
3463         (WebCore::VideoTrackPrivate::setSelected): Call m_client->selectedChanged
3464         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
3465         (WebCore::InbandTextTrackPrivateGStreamer::InbandTextTrackPrivateGStreamer): Add ASSERT(m_pad)
3466         (WebCore::InbandTextTrackPrivateGStreamer::notifyTrackOfTagsChanged): Look at all tag events instead of just the first one.
3467         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3468         (WebCore::mediaPlayerPrivateVideoSinkCapsChangedCallback): Separated callback when caps change from callback when number of videos change.
3469         (WebCore::mediaPlayerPrivateVideoCapsChangeTimeoutCallback): Same.
3470         (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer): Initialize m_videoCapsTimerHandler.
3471         (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer): Disconnect audio and video tracks and remove callbacks.
3472         (WebCore::MediaPlayerPrivateGStreamer::videoCapsChanged): Separated callback when caps change from callback when number of videos change.
3473         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo): Create video tracks for each stream.
3474         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideoCaps): Separated callback when caps change from callback when number of videos change.
3475         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio): Create audio tracks for each stream.
3476         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Add audio and video tracks, and a pointer to keep track of the default audio stream.
3477         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp: Added.
3478         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h: Added.
3479         * platform/graphics/gstreamer/GRefPtrGStreamer.cpp: Add GRefPtr<GstTagList>
3480         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp: Added, handles tags and "active" property of audio and video tracks.
3481         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h: Added.
3482         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp: Added.
3483         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h: Added.
3484
3485 2013-11-01  Patrick Gansterer  <paroga@webkit.org>
3486
3487         Buildfix for !ENABLE(INSPECTOR) after 157288.
3488
3489         * inspector/InspectorInstrumentation.h:
3490         (WebCore::InspectorInstrumentation::willDispatchEvent):
3491
3492 2013-11-01  Mario Sanchez Prada  <mario.prada@samsung.com>
3493
3494         [ATK] Avoid explicit traversal of text controls and the render tree in AtkText implementation
3495         https://bugs.webkit.org/show_bug.cgi?id=123153
3496
3497         Reviewed by Chris Fleizach.
3498
3499         Remove functions from the AtkText implementation that manually
3500         walk the render tree to compose the text for a exposed objects in
3501         certain cases (e.g. anonymous blocks, text controls).
3502
3503         The reason for this change is that the current implementation
3504         follows an error-prone approach, since by doing things like
3505         manually walking the render tree from here we are not properly
3506         considering all the possible scenarios that might happen when
3507         traversing text. This, however, is a task that is better suited
3508         for the TextIterator, which is already written to consider all
3509         those cases and to emit the proper character in every single
3510         situation: text nodes, replaced objects and so on.
3511
3512         So, by removing all that too specific code (textForObject() and
3513         textForRenderer() mainly) from WebKitAccessibleInterfaceText.cpp
3514         and relying in AccessibilityObject::textUnderElement(), which it
3515         ends up using the TextIterator for certain cases, we have a much
3516         better and robust method of retrieving the text associated with an
3517         instance of AtkObject implementing the AtkText interface.
3518
3519         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
3520         (webkitAccessibleTextGetText): Removed call to textForObject(), now that
3521         we have just removed that function, together with textForRenderer().
3522
3523         Make AccessibilityRenderObject::textUnderElement() able to deal with
3524         anonymous blocks directly, by creating a range based in the boundaries
3525         defined by the first and last child renderers for that block. This will
3526         make possible to treat an anonymous block as a whole instead of having
3527         to rely in the concatenation of each of its children, as it does now.
3528
3529         * accessibility/AccessibilityRenderObject.cpp:
3530         (WebCore::AccessibilityRenderObject::textUnderElement): Added a new code
3531         path to deal with anonymous blocks for text renderers, or when including
3532         all the children is explicitly requested.
3533
3534         Modified TextIterator so text for children of replaced objects are
3535         ignored if we are emmiting the special character for those objects.
3536
3537         * editing/TextIterator.cpp:
3538         (WebCore::TextIterator::handleReplacedElement): Make sure no children are
3539         handled a replaced object if m_emitsObjectReplacementCharacters is set.
3540         * editing/TextIterator.h: Updated m_emitsObjectReplacementCharacters
3541         description to reflect the new behavior.
3542
3543 2013-11-01  Alexey Proskuryakov  <ap@apple.com>
3544
3545         Add a Mac WebCrypto implementation of HMAC importKey/sign/verify
3546         https://bugs.webkit.org/show_bug.cgi?id=123598
3547
3548         Reviewed by Anders Carlsson.
3549
3550         Test: crypto/subtle/hmac-sign-verify.html
3551
3552         * WebCore.xcodeproj/project.pbxproj:
3553         * bindings/js/JSSubtleCryptoCustom.cpp: Added property svn:eol-style.
3554         (WebCore::createAlgorithmFromJSValue):
3555         (WebCore::cryptoOperationDataFromJSValue):
3556         (WebCore::cryptoKeyFormatFromJSValue):
3557         (WebCore::cryptoKeyUsagesFromJSValue):
3558         (WebCore::JSSubtleCrypto::sign):
3559         (WebCore::JSSubtleCrypto::verify):
3560         (WebCore::JSSubtleCrypto::digest):
3561         (WebCore::JSSubtleCrypto::importKey):
3562         * crypto/SubtleCrypto.idl:
3563         * crypto/algorithms/CryptoAlgorithmHMAC.cpp: Added.
3564         (WebCore::CryptoAlgorithmHMAC::CryptoAlgorithmHMAC):
3565         (WebCore::CryptoAlgorithmHMAC::~CryptoAlgorithmHMAC):
3566         (WebCore::CryptoAlgorithmHMAC::create):
3567         (WebCore::CryptoAlgorithmHMAC::identifier):
3568         (WebCore::CryptoAlgorithmHMAC::importKey):
3569         (WebCore::CryptoAlgorithmHMAC::exportKey):
3570         * crypto/algorithms/CryptoAlgorithmHMAC.h: Added.
3571         * crypto/keys: Added.
3572         * crypto/keys/CryptoKeyHMAC.cpp: Added.
3573         (WebCore::CryptoKeyHMAC::CryptoKeyHMAC):
3574         (WebCore::CryptoKeyHMAC::~CryptoKeyHMAC):
3575         (WebCore::CryptoKeyHMAC::buildAlgorithmDescription):
3576         * crypto/keys/CryptoKeyHMAC.h: Added.
3577         * crypto/mac/CryptoAlgorithmHMACMac.cpp: Added.
3578         (WebCore::getCommonCryptoAlgorithm):
3579         (WebCore::calculateSignature):
3580         (WebCore::CryptoAlgorithmHMAC::sign):
3581         (WebCore::CryptoAlgorithmHMAC::verify):
3582         (WebCore::CryptoAlgorithmHMAC::generateKey):
3583         * crypto/mac/CryptoAlgorithmRegistryMac.cpp:
3584         (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
3585
3586 2013-10-31  Joseph Pecoraro  <pecoraro@apple.com>
3587
3588         Web Inspector: Clean up a few Inspector interfaces
3589         https://bugs.webkit.org/show_bug.cgi?id=123594
3590
3591         Reviewed by Timothy Hatcher.
3592
3593         * WebCore.exp.in:
3594         * inspector/InjectedScriptHost.cpp:
3595         * inspector/InspectorBaseAgent.h:
3596         (WebCore::InspectorBaseAgentInterface::name):
3597         * inspector/InspectorConsoleAgent.cpp:
3598         * inspector/InspectorConsoleAgent.h:
3599         (WebCore::InspectorConsoleAgent::enabled):
3600         * inspector/InspectorController.cpp:
3601         (WebCore::InspectorController::profilerEnabled):
3602         * inspector/InspectorController.h:
3603         * inspector/InspectorDebuggerAgent.cpp:
3604         * inspector/InspectorDebuggerAgent.h:
3605         (WebCore::InspectorDebuggerAgent::enabled):
3606         * inspector/InspectorRuntimeAgent.h:
3607         (WebCore::InspectorRuntimeAgent::enabled):
3608
3609 2013-10-31  Tim Horton  <timothy_horton@apple.com>
3610
3611         Remote Layer Tree: Vend layer contents via IOSurfaces
3612         https://bugs.webkit.org/show_bug.cgi?id=123600
3613
3614         Reviewed by Anders Carlsson.
3615
3616         * WebCore.exp.in:
3617         Export sRGBColorSpaceRef.
3618
3619         * WebCore.xcodeproj/project.pbxproj:
3620         Expose GraphicsContextCG.h.
3621
3622 2013-10-31  Joseph Pecoraro  <pecoraro@apple.com>
3623
3624         Remove unused Page::setDebuggerForAllPages
3625         https://bugs.webkit.org/show_bug.cgi?id=123602
3626
3627         Reviewed by Timothy Hatcher.
3628
3629         * page/Page.cpp:
3630         * page/Page.h:
3631
3632 2013-10-31  Joseph Pecoraro  <pecoraro@apple.com>
3633
3634         Web Inspector: Remove InspectorState
3635         https://bugs.webkit.org/show_bug.cgi?id=123547
3636
3637         Reviewed by Timothy Hatcher.
3638
3639         * CMakeLists.txt:
3640         * GNUmakefile.list.am:
3641         * WebCore.vcxproj/WebCore.vcxproj:
3642         * WebCore.vcxproj/WebCore.vcxproj.filters:
3643         * WebCore.xcodeproj/project.pbxproj:
3644         * inspector/InspectorAgent.cpp:
3645         (WebCore::InspectorAgent::InspectorAgent):
3646         * inspector/InspectorAgent.h:
3647         (WebCore::InspectorAgent::create):
3648         * inspector/InspectorAllInOne.cpp:
3649         * inspector/InspectorApplicationCacheAgent.cpp:
3650         (WebCore::InspectorApplicationCacheAgent::InspectorApplicationCacheAgent):
3651         * inspector/InspectorApplicationCacheAgent.h:
3652         (WebCore::InspectorApplicationCacheAgent::create):
3653         * inspector/InspectorBaseAgent.cpp:
3654         (WebCore::InspectorBaseAgentInterface::InspectorBaseAgentInterface):
3655         * inspector/InspectorBaseAgent.h:
3656         (WebCore::InspectorBaseAgent::InspectorBaseAgent):
3657         * inspector/InspectorCSSAgent.cpp:
3658         (WebCore::InspectorCSSAgent::InspectorCSSAgent):
3659         * inspector/InspectorCSSAgent.h:
3660         (WebCore::InspectorCSSAgent::create):
3661         * inspector/InspectorCanvasAgent.cpp:
3662         (WebCore::InspectorCanvasAgent::InspectorCanvasAgent):
3663         * inspector/InspectorCanvasAgent.h:
3664         (WebCore::InspectorCanvasAgent::create):
3665         * inspector/InspectorClient.h:
3666         * inspector/InspectorConsoleAgent.cpp:
3667         (WebCore::InspectorConsoleAgent::InspectorConsoleAgent):
3668         * inspector/InspectorConsoleAgent.h:
3669         * inspector/InspectorController.cpp:
3670         (WebCore::InspectorController::InspectorController):
3671         (WebCore::InspectorController::connectFrontend):
3672         (WebCore::InspectorController::disconnectFrontend):
3673         * inspector/InspectorController.h:
3674         * inspector/InspectorDOMAgent.cpp:
3675         (WebCore::InspectorDOMAgent::InspectorDOMAgent):
3676         * inspector/InspectorDOMAgent.h:
3677         (WebCore::InspectorDOMAgent::create):
3678         * inspector/InspectorDOMDebuggerAgent.cpp:
3679         (WebCore::InspectorDOMDebuggerAgent::create):
3680         (WebCore::InspectorDOMDebuggerAgent::InspectorDOMDebuggerAgent):
3681         * inspector/InspectorDOMDebuggerAgent.h:
3682         * inspector/InspectorDOMStorageAgent.cpp:
3683         (WebCore::InspectorDOMStorageAgent::InspectorDOMStorageAgent):
3684         * inspector/InspectorDOMStorageAgent.h:
3685         (WebCore::InspectorDOMStorageAgent::create):
3686         * inspector/InspectorDatabaseAgent.cpp:
3687         (WebCore::InspectorDatabaseAgent::InspectorDatabaseAgent):
3688         * inspector/InspectorDatabaseAgent.h:
3689         (WebCore::InspectorDatabaseAgent::create):
3690         * inspector/InspectorDebuggerAgent.cpp:
3691         (WebCore::InspectorDebuggerAgent::InspectorDebuggerAgent):
3692         * inspector/InspectorDebuggerAgent.h:
3693         * inspector/InspectorHeapProfilerAgent.cpp:
3694         (WebCore::InspectorHeapProfilerAgent::create):
3695         (WebCore::InspectorHeapProfilerAgent::InspectorHeapProfilerAgent):
3696         * inspector/InspectorHeapProfilerAgent.h:
3697         * inspector/InspectorIndexedDBAgent.cpp:
3698         (WebCore::InspectorIndexedDBAgent::InspectorIndexedDBAgent):
3699         * inspector/InspectorIndexedDBAgent.h:
3700         (WebCore::InspectorIndexedDBAgent::create):
3701         * inspector/InspectorInputAgent.cpp:
3702         (WebCore::InspectorInputAgent::InspectorInputAgent):
3703         * inspector/InspectorInputAgent.h:
3704         (WebCore::InspectorInputAgent::create):
3705         * inspector/InspectorLayerTreeAgent.cpp:
3706         (WebCore::InspectorLayerTreeAgent::InspectorLayerTreeAgent):
3707         * inspector/InspectorLayerTreeAgent.h:
3708         (WebCore::InspectorLayerTreeAgent::create):
3709         * inspector/InspectorMemoryAgent.cpp:
3710         (WebCore::InspectorMemoryAgent::InspectorMemoryAgent):
3711         (WebCore::InspectorMemoryAgent::create):
3712         * inspector/InspectorMemoryAgent.h:
3713         * inspector/InspectorPageAgent.cpp:
3714         (WebCore::InspectorPageAgent::create):
3715         (WebCore::InspectorPageAgent::InspectorPageAgent):
3716         * inspector/InspectorPageAgent.h:
3717         * inspector/InspectorProfilerAgent.cpp:
3718         (WebCore::PageProfilerAgent::PageProfilerAgent):
3719         (WebCore::InspectorProfilerAgent::create):
3720         (WebCore::WorkerProfilerAgent::WorkerProfilerAgent):
3721         (WebCore::InspectorProfilerAgent::InspectorProfilerAgent):
3722         * inspector/InspectorProfilerAgent.h:
3723         * inspector/InspectorResourceAgent.cpp:
3724         (WebCore::InspectorResourceAgent::InspectorResourceAgent):
3725         * inspector/InspectorResourceAgent.h:
3726         (WebCore::InspectorResourceAgent::create):
3727         * inspector/InspectorRuntimeAgent.cpp:
3728         (WebCore::InspectorRuntimeAgent::InspectorRuntimeAgent):
3729         * inspector/InspectorRuntimeAgent.h:
3730         * inspector/InspectorState.cpp: Removed.
3731         * inspector/InspectorState.h: Removed.
3732         * inspector/InspectorStateClient.h: Removed.
3733         * inspector/InspectorTimelineAgent.cpp:
3734         (WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
3735         * inspector/InspectorTimelineAgent.h:
3736         (WebCore::InspectorTimelineAgent::create):
3737         * inspector/InspectorWorkerAgent.cpp:
3738         (WebCore::InspectorWorkerAgent::create):
3739         (WebCore::InspectorWorkerAgent::InspectorWorkerAgent):
3740         * inspector/InspectorWorkerAgent.h:
3741         * inspector/PageConsoleAgent.cpp:
3742         (WebCore::PageConsoleAgent::PageConsoleAgent):
3743         * inspector/PageConsoleAgent.h:
3744         (WebCore::PageConsoleAgent::create):
3745         * inspector/PageDebuggerAgent.cpp:
3746         (WebCore::PageDebuggerAgent::create):
3747         (WebCore::PageDebuggerAgent::PageDebuggerAgent):
3748         * inspector/PageDebuggerAgent.h:
3749         * inspector/PageRuntimeAgent.cpp:
3750         (WebCore::PageRuntimeAgent::PageRuntimeAgent):
3751         * inspector/PageRuntimeAgent.h:
3752         (WebCore::PageRuntimeAgent::create):
3753         * inspector/WorkerConsoleAgent.cpp:
3754         (WebCore::WorkerConsoleAgent::WorkerConsoleAgent):
3755         * inspector/WorkerConsoleAgent.h:
3756         (WebCore::WorkerConsoleAgent::create):
3757         * inspector/WorkerDebuggerAgent.cpp:
3758         (WebCore::WorkerDebuggerAgent::create):
3759         (WebCore::WorkerDebuggerAgent::WorkerDebuggerAgent):
3760         * inspector/WorkerDebuggerAgent.h:
3761         * inspector/WorkerInspectorController.cpp:
3762         (WebCore::WorkerInspectorController::WorkerInspectorController):
3763         (WebCore::WorkerInspectorController::connectFrontend):
3764         (WebCore::WorkerInspectorController::disconnectFrontend):
3765         * inspector/WorkerInspectorController.h:
3766         * inspector/WorkerRuntimeAgent.cpp:
3767         (WebCore::WorkerRuntimeAgent::WorkerRuntimeAgent):
3768         * inspector/WorkerRuntimeAgent.h:
3769         (WebCore::WorkerRuntimeAgent::create):
3770         * workers/DefaultSharedWorkerRepository.cpp:
3771         (WebCore::SharedWorkerProxy::postMessageToPageInspector):
3772         * workers/WorkerMessagingProxy.cpp:
3773         (WebCore::WorkerMessagingProxy::postMessageToPageInspector):
3774         * workers/WorkerMessagingProxy.h:
3775         * workers/WorkerReportingProxy.h:
3776
3777 2013-10-31  Brady Eidson  <beidson@apple.com>
3778
3779         Split PendingDeleteCall into its own header
3780         https://bugs.webkit.org/show_bug.cgi?id=123597
3781
3782         Reviewed by Beth “Okay I guess so, bro” Dakin.
3783
3784         * GNUmakefile.list.am:
3785         * WebCore.xcodeproj/project.pbxproj:
3786
3787         * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
3788         (WebCore::IDBDatabaseBackendImpl::processPendingCalls):
3789         (WebCore::IDBDatabaseBackendImpl::deleteDatabase):
3790         * Modules/indexeddb/IDBDatabaseBackendImpl.h:
3791
3792         * Modules/indexeddb/IDBPendingDeleteCall.h: Added.
3793         (WebCore::IDBPendingDeleteCall::create):
3794         (WebCore::IDBPendingDeleteCall::callbacks):
3795         (WebCore::IDBPendingDeleteCall::IDBPendingDeleteCall):
3796
3797 2013-10-31  Joseph Pecoraro  <pecoraro@apple.com>
3798
3799         Web Inspector: Convert some InspectorObject member variables to HashSet/HashMap
3800         https://bugs.webkit.org/show_bug.cgi?id=123579
3801
3802         Reviewed by Timothy Hatcher.
3803
3804         * inspector/InspectorDOMDebuggerAgent.h:
3805         * inspector/InspectorDOMDebuggerAgent.cpp:
3806         (WebCore::InspectorDOMDebuggerAgent::InspectorDOMDebuggerAgent):
3807         (WebCore::InspectorDOMDebuggerAgent::setBreakpoint):
3808         (WebCore::InspectorDOMDebuggerAgent::removeBreakpoint):
3809         (WebCore::InspectorDOMDebuggerAgent::pauseOnNativeEventIfNeeded):
3810         (WebCore::InspectorDOMDebuggerAgent::setXHRBreakpoint):
3811         (WebCore::InspectorDOMDebuggerAgent::removeXHRBreakpoint):
3812         (WebCore::InspectorDOMDebuggerAgent::willSendXMLHttpRequest):
3813         Make m_eventListenerBreakpoints and m_xhrBreakpoints HashSet.
3814
3815         * inspector/InspectorDebuggerAgent.h:
3816         * inspector/InspectorDebuggerAgent.cpp:
3817         (WebCore::InspectorDebuggerAgent::InspectorDebuggerAgent):
3818         (WebCore::InspectorDebuggerAgent::disable):
3819         (WebCore::InspectorDebuggerAgent::setBreakpointByUrl):
3820         (WebCore::InspectorDebuggerAgent::removeBreakpoint):
3821         (WebCore::InspectorDebuggerAgent::didParseSource):
3822         Make m_javaScriptBreakpoints a HashMap.
3823
3824 2013-10-31  Youenn Fablet  <youennf@gmail.com>
3825
3826         Correct the elapsedTime calculation in SVG animations
3827         https://bugs.webkit.org/show_bug.cgi?id=119289
3828
3829         Reviewed by Brent Fulgham.
3830
3831         Merged from Blink: https://chromium.googlesource.com/chromium/blink/+/338f9badca7fb7880abdb0cecd5f02493c1f7d2e
3832
3833         Test: svg/animations/getCurrentTime-pause-unpause.html
3834
3835         * svg/animation/SMILTimeContainer.cpp:
3836         (WebCore::SMILTimeContainer::SMILTimeContainer):
3837         (WebCore::SMILTimeContainer::elapsed):
3838         (WebCore::SMILTimeContainer::begin):
3839         (WebCore::SMILTimeContainer::pause):
3840         (WebCore::SMILTimeContainer::resume):
3841         (WebCore::SMILTimeContainer::setElapsed):
3842         * svg/animation/SMILTimeContainer.h:
3843
3844 2013-10-31  Andreas Kling  <akling@apple.com>
3845
3846         Manage line-grid RootInlineBox with unique_ptr.
3847         <https://webkit.org/b/123583>
3848
3849         Use smart pointers for the RenderBlockFlow's optional line-grid box
3850         instead of manual new/delete.
3851
3852         Reviewed by Antti Koivisto.
3853
3854 2013-10-31  Alexey Proskuryakov  <ap@apple.com>
3855
3856         Enable WebCrypto on Mac
3857         https://bugs.webkit.org/show_bug.cgi?id=123587
3858
3859         Reviewed by Anders Carlsson.
3860
3861         * Configurations/FeatureDefines.xcconfig: Enable it.
3862
3863         * bindings/js/JSCryptoAlgorithmDictionary.cpp: Build fix.
3864
3865         * crypto/CryptoAlgorithmRegistry.cpp: (WebCore::CryptoAlgorithmRegistry::getIdentifierForName):
3866         Special case empty keys to avoid upsetting HashMap.
3867
3868         * crypto/algorithms/CryptoAlgorithmSHA1.cpp: (WebCore::CryptoAlgorithmSHA1::create):
3869         Build fix. Can't use make_unique, because constructor is private.
3870
3871 2013-10-31  Myles C. Maxfield  <mmaxfield@apple.com>
3872
3873         Underline bounds cannot be queried before underline itself is drawn
3874         https://bugs.webkit.org/show_bug.cgi?id=123310
3875
3876         Reviewed by Dean Jackson.
3877
3878         GraphicsContext's drawLineForText function is used to draw underlines,
3879         strikethroughs, and overlines. Before drawing the line, this function
3880         modifies the bounds given to it in order to make underlines crisp. However,
3881         this means that it is impossible to know where an underline will be drawn
3882         before drawing it. This patch pulls out this adjustment computation into
3883         GraphicsContext::computeLineBoundsForText, then passes the result to
3884         drawLineForText
3885
3886         Because there should be no observable difference, no tests need to be updated.
3887
3888         * platform/graphics/GraphicsContext.h: Signature of new computeLineBoundsForText
3889         function
3890         * platform/graphics/blackberry/PathBlackBerry.cpp:
3891         (WebCore::GraphicsContext::computeLineBoundsForText): Implement new function
3892         * platform/graphics/cairo/GraphicsContextCairo.cpp:
3893         (WebCore::GraphicsContext::computeLineBoundsForText): Ditto
3894         (WebCore::GraphicsContext::drawLineForText): Use computeLineBoundsForText
3895         * platform/graphics/cg/GraphicsContextCG.cpp:
3896         (WebCore::computeLineBoundsAndAntialiasingModeForText): Static function that
3897         performs the actual bounds computation
3898         (WebCore::GraphicsContext::computeLineBoundsForText): Calls
3899         computeLineBoundsAndAntialiasingModeForText
3900         (WebCore::GraphicsContext::drawLineForText): Use new function
3901         * platform/graphics/wince/GraphicsContextWinCE.cpp:
3902         (WebCore::GraphicsContext::computeLineBoundsForText): Implement new function
3903
3904 2013-10-31  Beth Dakin  <bdakin@apple.com>
3905
3906         Repro scrolling crash with scrollbars that use setPresentationValue on the 
3907         scrolling thread
3908         https://bugs.webkit.org/show_bug.cgi?id=123549
3909         -and corresponding-
3910         <rdar://problem/15246606>
3911
3912         Reviewed by Brady Eidson.
3913
3914         Here's another speculative fix. If a scrollbar was removed, we would not properly 
3915         inform the scrolling thread. Instead of checking supportsUpdateOnSecondaryThread() 
3916         before calling setScrollbarPaintersFromScrollbars(), check it from within 
3917         setScrollbarPaintersFromScrollbars(), and this will allow the ScrollbarPainter to 
3918         be properly updated.
3919
3920         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
3921         (WebCore::ScrollingCoordinatorMac::frameViewLayoutUpdated):
3922         * page/scrolling/mac/ScrollingStateScrollingNodeMac.mm:
3923         (WebCore::ScrollingStateScrollingNode::setScrollbarPaintersFromScrollbars):
3924
3925 2013-10-31  Csaba Osztrogonác  <ossy@webkit.org>
3926
3927         Unreviewed typo fix after 158386. (buildfix after r158365)
3928
3929         * Modules/mediastream/UserMediaRequest.cpp:
3930         (WebCore::UserMediaRequest::callSuccessHandler):
3931
3932 2013-10-31  Myles C. Maxfield  <mmaxfield@apple.com>
3933
3934         Move CSS3 text decoration implementation behind ENABLE(CSS3_TEXT_DECORATION)
3935         https://bugs.webkit.org/show_bug.cgi?id=123541
3936
3937         Reviewed by Tim Horton.
3938
3939         Enabled CSS3 text decoration tests
3940
3941         * css/CSSComputedStyleDeclaration.cpp:
3942         (WebCore::renderTextDecorationStyleFlagsToCSSValue): Mapping internal
3943         representation to a CSSValue
3944         (WebCore::ComputedStyleExtractor::propertyValue): Ditto
3945         * css/CSSParser.cpp: Moving parsing functions behind new flag
3946         (WebCore::isColorPropertyID):
3947         (WebCore::CSSParser::parseValue):
3948         (WebCore::CSSParser::addTextDecorationProperty):
3949         (WebCore::CSSParser::parseTextDecorationSkip):
3950         (WebCore::CSSParser::parseTextUnderlinePosition):
3951         * css/CSSParser.h:
3952         * css/CSSPrimitiveValueMappings.h:
3953         * css/CSSPropertyNames.in: Marking the new properties behind new flag
3954         * css/CSSValueKeywords.in: Marking new values behind new flag
3955         * css/DeprecatedStyleBuilder.cpp:
3956         (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
3957         * css/StylePropertyShorthand.cpp:
3958         (WebCore::shorthandForProperty): Move text decoration shorthand
3959         (WebCore::matchingShorthandsForLonghand):
3960         * css/StylePropertyShorthand.h:
3961         * css/StyleResolver.cpp:
3962         (WebCore::isValidVisitedLinkProperty):
3963         (WebCore::StyleResolver::applyProperty):
3964         * platform/graphics/GraphicsContext.h:
3965         * platform/graphics/cairo/GraphicsContextCairo.cpp:
3966         (WebCore::GraphicsContext::setPlatformStrokeStyle):
3967         * platform/graphics/cg/GraphicsContextCG.cpp:
3968         (WebCore::GraphicsContext::drawLine):
3969         * platform/graphics/wince/GraphicsContextWinCE.cpp:
3970         (WebCore::createPen):
3971         * rendering/InlineFlowBox.cpp:
3972         * rendering/InlineFlowBox.h:
3973         * rendering/InlineTextBox.cpp:
3974         (WebCore::textDecorationStyleToStrokeStyle):
3975         (WebCore::computeUnderlineOffset):
3976         (WebCore::InlineTextBox::paintDecoration):
3977         * rendering/RenderObject.cpp:
3978         (WebCore::decorationColor):
3979         * rendering/RootInlineBox.cpp:
3980         * rendering/RootInlineBox.h:
3981         * rendering/style/RenderStyle.cpp:
3982         (WebCore::RenderStyle::changeRequiresRepaintIfTextOrBorderOrOutline):
3983         (WebCore::RenderStyle::colorIncludingFallback):
3984         (WebCore::RenderStyle::visitedDependentColor):
3985         * rendering/style/RenderStyle.h:
3986         * rendering/style/RenderStyleConstants.h:
3987         * rendering/style/StyleRareInheritedData.cpp:
3988         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
3989         (WebCore::StyleRareInheritedData::operator==):
3990         * rendering/style/StyleRareInheritedData.h:
3991         * rendering/style/StyleRareNonInheritedData.cpp:
3992         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
3993         (WebCore::StyleRareNonInheritedData::operator==):
3994         * rendering/style/StyleRareNonInheritedData.h:
3995
3996 2013-10-31  Alexey Proskuryakov  <ap@apple.com>
3997
3998         [WebCrypto] Add SHA-1
3999         https://bugs.webkit.org/show_bug.cgi?id=123582
4000
4001         Reviewed by Anders Carlsson.
4002
4003         Tests: security/crypto-subtle-arguments.html
4004                security/crypto-subtle-sha1.html
4005
4006         * WebCore.xcodeproj/project.pbxproj: Added new files.
4007
4008         * bindings/js/JSSubtleCryptoCustom.cpp:
4009         (WebCore::createAlgorithmFromJSValue):
4010         (WebCore::sequenceOfCryptoOperationDataFromJSValue):
4011         (WebCore::JSSubtleCrypto::digest):
4012         * crypto/SubtleCrypto.idl:
4013         Added bindings for crypto.digest.
4014
4015         * crypto/algorithms: Added.
4016         * crypto/algorithms/CryptoAlgorithmSHA1.cpp: Added.
4017         * crypto/algorithms/CryptoAlgorithmSHA1.h: Added.
4018         * crypto/mac/CryptoAlgorithmRegistryMac.cpp:
4019         (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms): Register SHA-1.
4020
4021         * crypto/mac/CryptoAlgorithmSHA1Mac.cpp: Added.
4022         (WebCore::CryptoAlgorithmSHA1::digest): Performs the work synchronously, because
4023         otherwise we'd have to copy the data first, which is crazy for something as simple
4024         as hashing. We can change to a dispatch queue later if we find that it's actually
4025         better to copy and do the work asynchronously.
4026
4027 2013-10-31  Sudarsana Nagineni  <sudarsana.nagineni@intel.com>
4028
4029         REGRESSION(r158348): Breaks Debug build
4030         https://bugs.webkit.org/show_bug.cgi?id=123562
4031
4032         Reviewed by Brady Eidson.
4033
4034         Remove an unnecessary check that cause compilation failure.
4035
4036         No new tests since this just fixes the build failure.
4037
4038         * Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.cpp:
4039         (WebCore::IDBBackingStoreLevelDB::updateIDBDatabaseVersion):
4040
4041 2013-10-31  Csaba Osztrogonác  <ossy@webkit.org>
4042
4043         One more speculative buildfix after r158365.
4044
4045         * Modules/mediastream/UserMediaRequest.cpp:
4046         (WebCore::UserMediaRequest::callSuccessHandler):
4047
4048 2013-10-31  Csaba Osztrogonác  <ossy@webkit.org>
4049
4050         One more speculative buildfix after r158365.
4051
4052         * Modules/mediastream/RTCPeerConnection.cpp:
4053         (WebCore::RTCPeerConnection::didAddRemoteStream):
4054
4055 2013-10-31  Csaba Osztrogonác  <ossy@webkit.org>
4056
4057         Speculative buildfix after r158365.
4058
4059         * Modules/mediastream/VideoStreamTrack.cpp:
4060         (WebCore::VideoStreamTrack::create):
4061         (WebCore::VideoStreamTrack::VideoStreamTrack):
4062         * Modules/mediastream/VideoStreamTrack.h:
4063
4064 2013-10-31  Myles C. Maxfield  <mmaxfield@apple.com>
4065
4066         Decorated text sometimes does not draw its decorations
4067         https://bugs.webkit.org/show_bug.cgi?id=123539
4068
4069         Reviewed by Antti Koivisto.
4070
4071         Decorated text should opt-out of the simple line layout, because
4072         SimpleLineLayout::paintFlow doesn't draw decorations
4073