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