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