d70fe5d84aae3fff85319a73df8c245bd1461fcb
[WebKit-https.git] / WebCore / ChangeLog
1 2008-01-06  Eric Seidel  <eric@webkit.org>
2
3         Reviewed by Sam.
4
5         Fix :checked matching type='text' and add test case
6         http://bugs.webkit.org/show_bug.cgi?id=16750
7
8         Test: fast/dom/HTMLInputElement/checked-pseudo-selector.html
9
10         * html/HTMLInputElement.h: isChecked() can only be true for RADIO or CHECKBOX
11
12 2008-01-05  Sam Weinig  <sam@webkit.org>
13
14         Reviewed by Eric Seidel.
15
16         Patch for http://bugs.webkit.org/show_bug.cgi?id=16758
17         ASSERT when using TreeWalker methods for a current node outside of the root (Acid3)
18
19         - Ensure that returned nodes are within the root node, or return 0, in adherence with the spec.
20
21         Test: fast/dom/TreeWalker/TreeWalker-currentNode.html
22
23         * dom/TreeWalker.cpp:
24         (WebCore::TreeWalker::parentNode):
25         (WebCore::TreeWalker::firstChild):
26         (WebCore::TreeWalker::lastChild):
27         (WebCore::TreeWalker::previousSibling):
28         (WebCore::TreeWalker::nextSibling):
29         (WebCore::TreeWalker::previousNode):
30         (WebCore::TreeWalker::nextNode):
31
32 2008-01-04  Oliver Hunt  <oliver@apple.com>
33
34         Reviewed by Beth Dakin.
35
36         Fix bounds computation bugs responsible for http://bugs.webkit.org/show_bug.cgi?id=16015
37         and other image repaint bugs.
38
39         We now cache the full local bounds for the <image> element, as otherwise certain
40         combinations of attribute changes could result in incorrect dirty rects.
41         Additionally we no longer use any of the integer bounds fields on RenderObject for
42         determining repaint bounds (this was the principle cause of bug #16015).
43
44         I also removed the outline painting code as it was both wrong, and not correctly
45         repainted.  I feel safe doing this as no other browser or viewer supports outline
46         properties on svg elements.
47
48         I was unable to make a testcase for this unfortunately, despite seemingly deterministic 
49         behaviour :(
50
51         * rendering/RenderSVGImage.cpp:
52         (WebCore::RenderSVGImage::layout):
53         (WebCore::RenderSVGImage::paint):
54         (WebCore::RenderSVGImage::nodeAtPoint):
55         (WebCore::RenderSVGImage::calculateAbsoluteBounds):
56         * rendering/RenderSVGImage.h:
57
58 2008-01-04  Beth Dakin  <bdakin@apple.com>
59
60         Reviewed by Oliver.
61
62         Fix for http://bugs.webkit.org/show_bug.cgi?id=16704 input with 
63         type="hidden" matches :enabled/:disabled (Acid3 bug)
64
65         Prevent :enabled and :disabled from applying to input type="hidden" 
66
67         * css/CSSStyleSelector.cpp:
68         (WebCore::CSSStyleSelector::checkOneSelector): Rather than 
69         allowing :enabled and :disabled to apply to all controls, only 
70         allow it to apply to non-"hidden" controls
71         * dom/Element.h:
72         (WebCore::Element::isInputTypeHidden): 
73         * html/HTMLInputElement.h:
74         (WebCore::HTMLInputElement::isInputTypeHidden):
75
76 2008-01-04  Sam Weinig  <sam@webkit.org>
77
78         Reviewed by Oliver Hunt.
79
80         - Match the spec when calling getFloatValue, getStringValue, getCounterValue,
81           getRectValue and getRGBColorValue of CSSPrimitiveValue by throwing exceptions
82           if the type of the CSSPrimitiveValue is not the same as the type requested.
83         - Fix the intermittent assertion failure seen in svg/css/glyph-orientation-rounding-test.xhtml
84
85         Test: fast/css/CSSPrimitiveValue-exceptions.html
86
87         * css/CSSPrimitiveValue.cpp:
88         (WebCore::CSSPrimitiveValue::getDoubleValue):
89         (WebCore::CSSPrimitiveValue::getStringValue):
90         (WebCore::CSSPrimitiveValue::getCounterValue):
91         (WebCore::CSSPrimitiveValue::getRectValue):
92         (WebCore::CSSPrimitiveValue::getRGBColorValue):
93         (WebCore::CSSPrimitiveValue::getPairValue):
94         * css/CSSPrimitiveValue.h:
95         (WebCore::CSSPrimitiveValue::getFloatValue):
96         (WebCore::CSSPrimitiveValue::getIntValue):
97         (WebCore::CSSPrimitiveValue::getCounterValue):
98         (WebCore::CSSPrimitiveValue::getRectValue):
99         (WebCore::CSSPrimitiveValue::getDashboardRegionValue):
100         * css/CSSPrimitiveValue.idl:
101
102 2008-01-04  Antti Koivisto  <antti@apple.com>
103
104         Reviewed by Darin.
105         
106         Windows part of <rdar://problem/5647034>
107         Media tests crash if an old version of QuickTime is installed
108
109         Check QuickTime version on Windows too.
110
111         * platform/graphics/MediaPlayer.cpp:
112         (WebCore::MediaPlayer::isAvailable):
113         * platform/graphics/gtk/MediaPlayerPrivateGStreamer.h:
114         (WebCore::MediaPlayerPrivate::isAvailable):
115         * platform/graphics/win/MediaPlayerPrivateQuickTimeWin.cpp:
116         (WebCore::MediaPlayerPrivate::isAvailable):
117         * platform/graphics/win/MediaPlayerPrivateQuickTimeWin.h:
118         * platform/graphics/win/QTMovieWin.cpp:
119         (QTMovieWin::initializeQuickTime):
120
121 2008-01-04  Darin Adler  <darin@apple.com>
122
123         Reviewed by Maciej and Alice.
124
125         - fix <rdar://problem/4404302> Borders where there should be none (canadasmountains.com)
126
127         Test: fast/images/border.html
128
129         * html/HTMLImageElement.cpp:
130         (WebCore::HTMLImageElement::parseMappedAttribute): Change the code that handles cases
131         where the border value is not a number to use the value "0" for the border width instead
132         of not setting the border width and style at all. This matches other browsers, and makes
133         more sense.
134
135 2008-01-04  Antti Koivisto  <antti@apple.com>
136
137         Try to fix 64-bit build
138
139         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
140         (WebCore::MediaPlayerPrivate::isAvailable):
141
142 2008-01-04  Stephanie  <slewis@apple.com>
143
144         Reviewed by Oliver.
145
146         WARNING: NO TEST CASES ADDED OR CHANGED
147
148         Fix another stringImpl leak.
149
150         * platform/text/StringImpl.cpp: remove an extra allocation
151         (WebCore::StringImpl::StringImpl):
152
153 2008-01-04  Alice Liu  <alice.liu@apple.com>
154
155         Reviewed by Mitz.
156
157         * platform/graphics/win/FontCacheWin.cpp:
158         fix loop condition that was causing crash
159
160 2008-01-04  Timothy Hatcher  <timothy@apple.com>
161
162         Reviewed by Adam Roben.
163
164         <rdar://problem/5671059> Always show the Timeline and Console buttons in the Inspector
165
166         * page/inspector/inspector.css: Remove styles related to the toggle button
167           and make the area always visible. 
168         * page/inspector/inspector.html: Remove the toggle button.
169         * page/inspector/inspector.js: Remove code to toggle the status area.
170
171 2008-01-04  Alexey Proskuryakov  <ap@webkit.org>
172
173         Reviewed by Adam Roben.
174
175         Temporarily restore BackwardDelete for Windows nightlies to work correctly.
176
177         * editing/EditorCommand.cpp: (WebCore::CommandEntry::):
178
179 2008-01-04  Alexey Proskuryakov  <ap@webkit.org>
180
181         Reviewed by Darin.
182
183         <rdar://problem/5611712> xsl:sort does not use a case folding sort, and the 'case-order' attribute is ignored (16077)
184
185         Enable the fix on Windows.
186
187         * xml/XSLTProcessor.cpp: (WebCore::XSLTProcessor::transformToString):
188         Always set a custom sort function, even if it doesn't implement proper collation on the platform.
189
190         * xml/XSLTUnicodeSort.cpp:
191         (WebCore::xsltUnicodeSortFunction):
192         * xml/XSLTUnicodeSort.h:
193         If the platform does not use ICU, or ICU has collation support disabled, fall back to binary comparison.
194
195 2008-01-04  Antti Koivisto  <antti@apple.com>
196
197         Fix build.
198
199         * bindings/js/JSHTMLElementWrapperFactory.cpp:
200
201 2008-01-04  Antti Koivisto  <antti@apple.com>
202
203         Reviewed by Darin.
204         
205         Partial fix for <rdar://problem/5647034>
206         Media tests crash if an old version of QuickTime is installed
207
208         Disable media support if QuickTime is not current enough (>=7.3).
209         
210         Windows patch coming soon.
211
212         * bindings/js/JSHTMLElementWrapperFactory.cpp:
213         (WebCore::createJSHTMLWrapper):
214         * bindings/js/kjs_window.cpp:
215         (KJS::Window::getValueProperty):
216         * html/HTMLElementFactory.cpp:
217         (WebCore::audioConstructor):
218         (WebCore::videoConstructor):
219         (WebCore::sourceConstructor):
220         * platform/graphics/MediaPlayer.cpp:
221         (WebCore::MediaPlayer::isAvailable):
222         * platform/graphics/MediaPlayer.h:
223         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
224         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
225         (WebCore::MediaPlayerPrivate::isAvailable):
226
227 2008-01-04  Timothy Hatcher  <timothy@apple.com>
228
229         Reviewed by Darin Adler.
230
231         <rdar://problem/5604409> JavaScript privilege escalation when Web Inspector accesses page unsafely (16011)
232
233         Check if the property is a getter before asking for the value.
234         If the property is a getter, we no longer show the value.
235
236         * page/inspector/PropertiesSidebarPane.js:
237         * page/inspector/inspector.css:
238
239 2008-01-04  Dan Bernstein  <mitz@apple.com>
240
241         Reviewed by Darin Adler.
242
243         - fix synthetic bold and italic on Windows
244
245         Covered by an existing test.
246
247         * platform/graphics/win/FontPlatformDataWin.cpp:
248         (WebCore::FontPlatformData::FontPlatformData):
249
250 2008-01-04  Alp Toker  <alp@atoker.com>
251
252         GTK+ autotools build fix. Terminate empty rules.
253
254         * GNUmakefile.am:
255
256 2008-01-04  Lars Knoll  <lars@trolltech.com>
257
258         Reviewed by Simon.
259
260         Remove most dependencies of Widget/ScrollView onto native QWidgets.
261
262         This also brings the code closer in line with the Windows code. Seems
263         to work nicely on first try :)
264
265         * page/qt/FrameQt.cpp:
266         (WebCore::Frame::createScriptInstanceForWidget):
267         * platform/Widget.h:
268         * platform/qt/PlatformScreenQt.cpp:
269         (WebCore::screenDepth):
270         (WebCore::screenDepthPerComponent):
271         (WebCore::screenIsMonochrome):
272         (WebCore::screenRect):
273         * platform/qt/PlatformScrollBarQt.cpp:
274         (WebCore::PlatformScrollbar::thumbPosition):
275         (WebCore::PlatformScrollbar::handleMouseMoveEvent):
276         * platform/qt/ScrollViewQt.cpp:
277         (WebCore::ScrollView::ScrollViewPrivate::ScrollViewPrivate):
278         (WebCore::ScrollView::ScrollViewPrivate::scrollBackingStore):
279         (WebCore::ScrollView::updateContents):
280         (WebCore::ScrollView::update):
281         (WebCore::ScrollView::scrollRectIntoViewRecursively):
282         (WebCore::ScrollView::updateScrollbars):
283         (WebCore::ScrollView::addChild):
284         (WebCore::ScrollView::removeChild):
285         (WebCore::ScrollView::paint):
286         * platform/qt/WidgetQt.cpp:
287         (WebCore::WidgetPrivate::WidgetPrivate):
288         (WebCore::WidgetPrivate::~WidgetPrivate):
289         (WebCore::Widget::frameGeometry):
290         (WebCore::Widget::setFrameGeometry):
291         (WebCore::Widget::setCursor):
292         (WebCore::Widget::show):
293         (WebCore::Widget::hide):
294         (WebCore::Widget::nativeWidget):
295         (WebCore::Widget::setNativeWidget):
296         (WebCore::Widget::suppressInvalidation):
297         (WebCore::Widget::setSuppressInvalidation):
298         (WebCore::Widget::invalidateRect):
299         (WebCore::Widget::topLevel):
300         (WebCore::Widget::containingWindow):
301
302 2008-01-04  Lars Knoll  <lars@trolltech.com>
303
304         Reviewed by Simon.
305
306         make QWebPage a QObject and get things to compile.
307
308         Nothing works currently though.
309
310         * platform/qt/ScrollViewQt.cpp:
311         (WebCore::ScrollView::updateContents):
312         (WebCore::ScrollView::update):
313         * platform/qt/WidgetQt.cpp:
314         (WebCore::Widget::qwidget):
315         (WebCore::Widget::invalidateRect):
316
317 2008-01-04  Alp Toker  <alp@atoker.com>
318
319         Reviewed by Mark Rowe.
320
321         http://bugs.webkit.org/show_bug.cgi?id=16667
322         make -j is failing with the autotools based system
323
324         Support parallel code generation. Nearly every use of explicit
325         multiple targets was a potential concurrency bug, though in practice
326         the bison rules were the first to be noticed because they took longer
327         to complete and broke the build immediately.
328
329         * GNUmakefile.am:
330
331 2008-01-04  Alp Toker  <alp@atoker.com>
332
333         Reviewed by Mark Rowe.
334
335         Re-use a single static dummy surface rather than creating and
336         destroying a surface for each CairoPath.
337
338         * platform/graphics/cairo/CairoPath.h:
339         (WebCore::CairoPath::CairoPath):
340
341 2008-01-04  Mark Rowe  <mrowe@apple.com>
342
343         Tiger build fix.
344
345         * platform/Threading.h: The OSAtomic functions take non-volatile pointers on Tiger.
346
347 2008-01-03  Mark Rowe  <mrowe@apple.com>
348
349         Reviewed by Maciej Stachowiak.
350
351         Use platform-provided atomic operations in place of inline assembly to
352         increase portability.
353
354         * platform/Threading.h:
355         (WebCore::atomicIncrement):
356         (WebCore::atomicDecrement):
357
358 2008-01-03  Oliver Hunt  <oliver@apple.com>
359
360         Reviewed by Maciej.
361
362         Fix <rdar://problem/5668517> REGRESSION: Major under painting issues in SVG (carto.net dock example)
363
364         We need to cache the absolute bounds of the <image>,
365         as there's no reliable way to recompute the old bounding
366         box one we have started layout.
367
368         * rendering/RenderSVGImage.cpp:
369         (WebCore::RenderSVGImage::layout):
370         (WebCore::RenderSVGImage::calculateAbsoluteBounds):
371         * rendering/RenderSVGImage.h:
372
373 2008-01-03  Alp Toker  <alp@atoker.com>
374
375         Reviewed by Mark Rowe.
376
377         Support building in Scratchbox, which has a version of make that fails
378         on wildcard syntax. Use a vpath to match IDL files instead.
379
380         * GNUmakefile.am:
381
382 2008-01-03  Jon Honeycutt  <jhoneycutt@apple.com>
383
384         Reviewed by Darin.
385
386         <rdar://problem/5504775> PDF page will not load first time after Adobe
387         Reader install, unless browser is relaunched
388
389         Refresh and re-search the plugin database if the MIME type is not
390         registered.
391
392         * plugins/win/PluginDatabaseWin.cpp:
393         (WebCore::PluginDatabaseWin::isMIMETypeRegistered):
394         * plugins/win/PluginDatabaseWin.h:
395
396 2008-01-03  Dan Bernstein  <mitz@apple.com>
397
398         Reviewed by Darin Adler.
399
400         - fix http://bugs.webkit.org/show_bug.cgi?id=16548
401           <rdar://problem/5659452> REGRESSION(r28810): Font style and sizes are weird for Japanese text
402
403         * platform/graphics/win/FontCacheWin.cpp:
404         (WebCore::linkedFontEnumProc): Added. This callback is used to fetch
405         a valid LOGFONT for a given family.
406         (WebCore::getLinkedFonts): Added. Returns a vector of font families
407         linked to the given font family by the Windows registry key
408         HKLM\Software\...\FontLink\SystemLink. The registry values typically
409         differ based on the installed language version of Windows.
410         (WebCore::FontCache::getFontDataForCharacters): Changed to not use MLang
411         font mapping, which is Windows code page based, except for characters in
412         the range U+2000..U+200F. Instead, this function gets the font Uniscribe
413         would use for the character. However, that font might not actually
414         contain the character, in which case GDI font linking would substitute a
415         different font. Therefore, this function walks the linked font list
416         until it finds a font that actually contains the character.
417
418 2008-01-03  Darin Adler  <darin@apple.com>
419
420         Reviewed by Mitz.
421
422         - fix http://bugs.webkit.org/show_bug.cgi?id=16723
423           tables/mozilla/bugs/bug30418.html test failing due to problems updating dynamic border rules
424
425         Test: fast/table/border-changes.html
426
427         * html/HTMLTableElement.h:
428         * html/HTMLTableElement.cpp:
429         (WebCore::HTMLTableElement::parseMappedAttribute): Check the border type before and after
430         parsing attributes, rather than doing this only for the rules attribute.
431         (WebCore::HTMLTableElement::cellBorders): Added.
432         (WebCore::HTMLTableElement::getSharedCellDecl): Changed to use cellBorders to factor out the
433         rule about what type of borders to use.
434
435 2008-01-02  Sam Weinig  <sam@webkit.org>
436
437         Reviewed by Darin.
438
439         Pass the prototype of WebCore JS objects up the constructor chain
440         rather than explicitly setting using setPrototype.  This removes many
441         redundant settings of the prototype on construction.  To avoid a CG 
442         hazard, the prototype must be constructed before calling the
443         constructor of the JS object.
444
445         - JS objects that inherit from DOMObject, which all bindings objects
446           (except Window) do, now can't implicitly have a jsNull prototype, but
447           must explicitly pass it up the construction chain.
448
449         * bindings/js/JSCSSRuleCustom.cpp:
450         (WebCore::toJS):
451         * bindings/js/JSCSSValueCustom.cpp:
452         (WebCore::toJS):
453         * bindings/js/JSDocumentCustom.cpp:
454         (WebCore::toJS):
455         * bindings/js/JSEventCustom.cpp:
456         (WebCore::toJS):
457         * bindings/js/JSEventTargetNode.cpp:
458         (WebCore::JSEventTargetNode::JSEventTargetNode):
459         * bindings/js/JSEventTargetNode.h:
460         * bindings/js/JSHTMLAllCollection.h:
461         (WebCore::JSHTMLAllCollection::JSHTMLAllCollection):
462         * bindings/js/JSHTMLAudioElementConstructor.cpp:
463         (WebCore::JSHTMLAudioElementConstructor::JSHTMLAudioElementConstructor):
464         * bindings/js/JSHTMLCollectionCustom.cpp:
465         (WebCore::getNamedItems):
466         (WebCore::toJS):
467         * bindings/js/JSHTMLElementWrapperFactory.cpp:
468         (WebCore::createJSHTMLWrapper):
469         * bindings/js/JSHTMLFormElementCustom.cpp:
470         (WebCore::JSHTMLFormElement::nameGetter):
471         * bindings/js/JSHTMLInputElementBase.cpp:
472         (WebCore::JSHTMLInputElementBase::JSHTMLInputElementBase):
473         * bindings/js/JSHTMLInputElementBase.h:
474         * bindings/js/JSHTMLOptionElementConstructor.cpp:
475         (WebCore::JSHTMLOptionElementConstructor::JSHTMLOptionElementConstructor):
476         * bindings/js/JSLocation.cpp:
477         (WebCore::JSLocation::JSLocation):
478         * bindings/js/JSLocation.h:
479         * bindings/js/JSNamedNodesCollection.cpp:
480         (WebCore::JSNamedNodesCollection::JSNamedNodesCollection):
481         * bindings/js/JSNamedNodesCollection.h:
482         * bindings/js/JSNodeCustom.cpp:
483         (WebCore::toJS):
484         * bindings/js/JSSVGElementWrapperFactory.cpp:
485         (WebCore::createJSSVGWrapper):
486         * bindings/js/JSSVGPathSegCustom.cpp:
487         (WebCore::toJS):
488         * bindings/js/JSStyleSheetCustom.cpp:
489         (WebCore::toJS):
490         * bindings/js/JSXMLHttpRequest.cpp:
491         (KJS::JSXMLHttpRequestConstructorImp::JSXMLHttpRequestConstructorImp):
492         (KJS::JSXMLHttpRequestConstructorImp::construct):
493         (KJS::JSXMLHttpRequest::JSXMLHttpRequest):
494         * bindings/js/JSXMLHttpRequest.h:
495         * bindings/js/JSXSLTProcessor.cpp:
496         (KJS::JSXSLTProcessor::JSXSLTProcessor):
497         (KJS::XSLTProcessorConstructorImp::XSLTProcessorConstructorImp):
498         (KJS::XSLTProcessorConstructorImp::implementsConstruct):
499         (KJS::XSLTProcessorConstructorImp::construct):
500         * bindings/js/JSXSLTProcessor.h:
501         * bindings/js/kjs_binding.h:
502         (KJS::DOMObject::DOMObject):
503         (KJS::cacheDOMObject):
504         (KJS::cacheSVGDOMObject):
505         * bindings/js/kjs_css.cpp:
506         (WebCore::JSRGBColor::JSRGBColor):
507         (WebCore::getJSRGBColor):
508         * bindings/js/kjs_css.h:
509         * bindings/js/kjs_events.cpp:
510         (WebCore::JSClipboard::JSClipboard):
511         (WebCore::toJS):
512         * bindings/js/kjs_events.h:
513         * bindings/js/kjs_html.cpp:
514         (WebCore::ImageConstructorImp::ImageConstructorImp):
515         * bindings/js/kjs_navigator.cpp:
516         (KJS::Navigator::Navigator):
517         (KJS::PluginBase::PluginBase):
518         * bindings/js/kjs_navigator.h:
519         * bindings/js/kjs_window.cpp:
520         (KJS::Window::Window):
521         (KJS::Window::location):
522         (KJS::Window::getValueProperty):
523         * bindings/js/kjs_window.h:
524         * bindings/scripts/CodeGeneratorJS.pm:
525
526 2008-01-03  Holger Hans Peter Freyther  <zecke@selfish.org>
527
528         Reviewed by Alp.
529
530         -This is from http://bugs.webkit.org/show_bug.cgi?id=16115
531
532         Change the Gtk ContextMenuItem code to generate the GtkMenuItem
533         or GtkCheckMenuItem on the fly. Currently we will create a
534         GtkCheckMenuItem if the ContextMenuItem has been checked. What needs
535         to be done is to change WebCore to tell the platform code if an item
536         is checkable or not.
537
538         * platform/ContextMenuItem.h:
539         (WebCore::PlatformMenuItemDescription::PlatformMenuItemDescription):
540         * platform/gtk/ContextMenuGtk.cpp:
541         (WebCore::ContextMenu::appendItem):
542         * platform/gtk/ContextMenuItemGtk.cpp:
543         (WebCore::ContextMenuItem::ContextMenuItem):
544         (WebCore::ContextMenuItem::~ContextMenuItem):
545         (WebCore::ContextMenuItem::createNativeMenuItem):
546         (WebCore::ContextMenuItem::releasePlatformDescription):
547         (WebCore::ContextMenuItem::type):
548         (WebCore::ContextMenuItem::setType):
549         (WebCore::ContextMenuItem::action):
550         (WebCore::ContextMenuItem::setAction):
551         (WebCore::ContextMenuItem::platformSubMenu):
552         (WebCore::ContextMenuItem::setSubMenu):
553         (WebCore::ContextMenuItem::setChecked):
554
555 2008-01-03  Dan Bernstein  <mitz@apple.com>
556
557         Rubber-stamped by Adam Roben.
558
559         - update the project hierarchy to match the on-disk organization of
560           the platform directory.
561
562         * WebCore.vcproj/WebCore.vcproj:
563
564 2008-01-03  Adam Roben  <aroben@apple.com>
565
566         Fix a buffer overrun and a leak introduced in r29098
567
568         Reviewed by Mark.
569
570         * platform/text/StringImpl.cpp:
571         (WebCore::StringImpl::StringImpl): Only allocate one buffer, and make
572         it be big enough to hold the string contents plus the null terminator.
573
574 2008-01-03  Simon Hausmann  <hausmann@webkit.org>
575
576         Reviewed by Lars.
577
578         Added the first revision of QWebView and started moving functionality from QWebPave over to QWebView and QWebFrame.
579
580         * WebCore.pro:
581
582 2008-01-03  Alp Toker  <alp@atoker.com>
583
584         Suggested by Mark Rowe.
585
586         Fix indentation and remove trailing whitespace.
587
588         * platform/network/curl/ResourceHandleManager.cpp:
589
590 2008-01-03  Luca Bruno  <lethalman88@gmail.com>
591
592         Reviewed by Alp Toker.
593
594         Fix HTTP POST-based logins to sites like Facebook, GMail by ensuring
595         that the two POST methods don't conflict.
596
597         * platform/network/curl/ResourceHandleManager.cpp:
598         (WebCore::ResourceHandleManager::setupPOST):
599
600 2008-01-02  Darin Adler  <darin@apple.com>
601
602         - touched some files to try to get the Windows buildbot building again
603
604 2008-01-02  Dan Bernstein  <mitz@apple.com>
605
606         Reviewed by Sam Weinig.
607
608         - fix small caps rendering
609
610         Covered by an existing test.
611
612         * platform/graphics/win/FontDataWin.cpp:
613         (WebCore::FontData::smallCapsFontData):
614
615 2008-01-02  Antti Koivisto  <antti@apple.com>
616
617         Reviewed by Oliver.
618
619         Calculate video position and size within the renderer box in WebCore. This
620         way the aspect ratio calculation is not needed in each MediaPlayer implementation.
621         
622         This fixes video aspect ratio on Windows.
623         
624         Covered by an existing pixel test.
625
626         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
627         (WebCore::MediaPlayerPrivate::createQTMovieView):
628         * rendering/RenderVideo.cpp:
629         (WebCore::RenderVideo::videoBox):
630         (WebCore::RenderVideo::paintReplaced):
631         (WebCore::RenderVideo::updatePlayer):
632         * rendering/RenderVideo.h:
633
634 2008-01-02  Ada Chan  <adachan@apple.com>
635
636         Fix windows build.
637
638         * WebCore.vcproj/WebCore.vcproj:
639
640 2008-01-02  John Sullivan  <sullivan@apple.com>
641
642         Reviewed by Dan Bernstein
643         
644         - fixed <rdar://problem/5579010> REGRESSION: Safari inserts newlines in tab names when U+2028 is present
645
646         * loader/DocumentLoader.cpp:
647         (WebCore::canonicalizedTitle):
648         in the code that replaces control characters with white space, also replace the unicode line separator
649         and paragraph separator characters
650
651 2008-01-02  Darin Adler  <darin@apple.com>
652
653         - fix buffer overruns seen on buildbot
654
655         * platform/text/StringImpl.cpp:
656         (WebCore::countCharacter): Added this.
657         (WebCore::StringImpl::toCoordsArray): Use countCharacter instead of incorrect find expression.
658         (WebCore::StringImpl::toLengthArray): Ditto.
659         (WebCore::StringImpl::replace): Added assertions.
660
661 2008-01-02  Darin Adler  <darin@apple.com>
662
663         Reviewed by Maciej.
664
665         - fix http://bugs.webkit.org/show_bug.cgi?id=16657
666           Acid3 failure since table.caption and table.thead do not work for nodes added by appendChild
667         - fix http://bugs.webkit.org/show_bug.cgi?id=16659
668           Acid3 expects HTMLTableElement.rows to include a <tr> element that is an immediate child of the <table>
669
670         Tests: dom/html/level2/html/HTMLCollection07.html
671                dom/html/level2/html/HTMLCollection08.html
672                dom/html/level2/xhtml/HTMLCollection07.xhtml
673                dom/html/level2/xhtml/HTMLCollection08.xhtml
674                fast/dom/HTMLTableElement/early-acid3-65-excerpt.html
675                fast/dom/HTMLTableElement/early-acid3-66-excerpt.html
676
677         * GNUmakefile.am: Added HTMLTableRowsCollection.
678         * WebCore.pro: Ditto.
679         * WebCore.vcproj/WebCore.vcproj: Ditto.
680         * WebCore.xcodeproj/project.pbxproj: Ditto.
681         * WebCoreSources.bkl: Ditto.
682
683         * dom/XMLTokenizer.cpp: Took out stray include.
684
685         * html/HTMLCollection.cpp:
686         (WebCore::HTMLCollection::itemAfter): Removed all the table rows code, since we now use
687         a separate class for that collection. Also got rid of the distinct types for custom collections
688         that don't need them (use Other for both).
689         * html/HTMLCollection.h: Also made firstItem non-virtual because it doesn't need to be virtual.
690
691         * html/HTMLFormCollection.cpp:
692         (WebCore::HTMLFormCollection::HTMLFormCollection): Use Other instead of FormElements
693         for the HTMLCollection type.
694
695         * html/HTMLTableElement.cpp:
696         (WebCore::HTMLTableElement::HTMLTableElement): Eliminated m_head, m_foot, m_firstBody, and m_caption.
697         (WebCore::HTMLTableElement::caption): Added non-inline version. Finds the caption rather than
698         keeping a pointer to it.
699         (WebCore::HTMLTableElement::setCaption): Rewrote.
700         (WebCore::HTMLTableElement::tHead): Ditto.
701         (WebCore::HTMLTableElement::setTHead): Ditto.
702         (WebCore::HTMLTableElement::tFoot): Ditto.
703         (WebCore::HTMLTableElement::setTFoot): Ditto.
704         (WebCore::HTMLTableElement::createTHead): Ditto.
705         (WebCore::HTMLTableElement::deleteTHead): Ditto.
706         (WebCore::HTMLTableElement::createTFoot): Ditto.
707         (WebCore::HTMLTableElement::deleteTFoot): Ditto.
708         (WebCore::HTMLTableElement::createCaption): Ditto.
709         (WebCore::HTMLTableElement::deleteCaption): Ditto.
710         (WebCore::HTMLTableElement::lastBody): Added.
711         (WebCore::HTMLTableElement::insertRow): Rewrote to use a loop based on code in HTMLTableRowsCollection.
712         This is different from the old code mainly in how it handles rows outside any section.
713         (WebCore::HTMLTableElement::deleteRow): Ditto.
714         (WebCore::HTMLTableElement::addChild): Removed code to set the various members. Keeping pointers to
715         these was a possible source of serious bugs too, including crashes with stale pointers, although I
716         didn't write any test cases to prove those bugs existed.
717         (WebCore::HTMLTableElement::parseMappedAttribute): Changed the rules code to visit all cells, not
718         just the cells of the first body. I believe this fixed rendering on some table tests. I think the code
719         visits too many cells and also the use of recursion is overkill, but I didn't try to fix that.
720         (WebCore::HTMLTableElement::rows): Changed to use the new HTMLTableRowsCollection.
721         * html/HTMLTableElement.h: Changed functions to return PassRefPtr, which can be important if strange
722         things like DOM mutation events take things ot of the tree before they are safely referenced by
723         JavaScript wrappers. Also changed functions to take PassRefPtr and added exceptions. Removed unneeded
724         firstTBody and setTBody functions and childrenChanged function override, as well as unused Rules and
725         Frame enums. Removed m_head, m_foot, m_firstBody, and m_caption, and added lastBody function. Removed
726         unneeded friend declaration for HTMLTableCellElement.
727         * html/HTMLTableElement.idl: Allow the setteres for caption, tHead, and tFoot to raise exceptions.
728
729         * html/HTMLTableRowsCollection.cpp: Added. Implements the HTML 5 rule for which rows are in the
730         collection in which order.
731         * html/HTMLTableRowsCollection.h: Added.
732
733         * loader/FTPDirectoryDocument.cpp:
734         (WebCore::FTPDirectoryTokenizer::appendEntry): Use the standard insertRow function instead of
735         coming up with our own way of inserting a row. Simplifies things -- we can remove the code to
736         create a tbody element.
737
738 2008-01-02  Darin Adler  <darin@apple.com>
739
740         Reviewed by Alice and Tim.
741
742         - try to fix GTK and Qt builds
743
744         * platform/win/ScrollViewWin.cpp:
745         (WebCore::ScrollView::scroll): Improve logic slightly for the case of
746         vertical scrolling when there's no vertical scroll bar.
747
748         * platform/gtk/ScrollViewGtk.cpp:
749         (WebCore::ScrollView::scroll): Copy the code from Windows. Maybe this
750         should be factored differently.
751         * platform/qt/ScrollViewQt.cpp:
752         (WebCore::ScrollView::scroll): Ditto.
753
754 2008-01-02  Darin Adler  <darin@apple.com>
755
756         Reviewed by Anders.
757
758         - http://bugs.webkit.org/show_bug.cgi?id=16712
759           change StringImpl to take and return PassRefPtr instead of raw pointers
760
761         Also eliminated use of const StringImpl. Since StringImpl is immutable there
762         is no distinction between a const and non-const one at the moment.
763
764         * WebCore.base.exp: Updated.
765
766         * css/CSSHelper.cpp:
767         (WebCore::parseURL): Make String directly, not by making a StringImpl.
768         * dom/Attr.cpp:
769         (WebCore::Attr::createTextChild): Convert AtomicString to String with domString,
770         not via StringImpl.
771         (WebCore::Attr::setValue): Remove unneed call to impl() when passing a String
772         to a function that takes a String.
773
774         * dom/CDATASection.cpp: Removed unused constructor.
775         (WebCore::CDATASection::cloneNode): Added a now-needed .get().
776         (WebCore::CDATASection::createNew): Changed function to take a PassRefPtr.
777         * dom/CDATASection.h:
778
779         * dom/CharacterData.cpp:
780         (WebCore::CharacterData::CharacterData): Removed unneeded initialization and
781         ref() now that the string is a RefPtr. Also updated to not call "new StringImpl".
782         (WebCore::CharacterData::~CharacterData): Removed unneeded deref() since it's
783         a RefPtr.
784         (WebCore::CharacterData::setData): More of that.
785         (WebCore::CharacterData::substringData): Ditto.
786         (WebCore::CharacterData::appendData): Ditto.
787         (WebCore::CharacterData::insertData): Ditto.
788         (WebCore::CharacterData::deleteData): Ditto.
789         (WebCore::CharacterData::replaceData): Ditto.
790         (WebCore::CharacterData::nodeValue): Ditto.
791         (WebCore::CharacterData::dispatchModifiedEvent): Ditto.
792         (WebCore::CharacterData::dump): Ditto.
793         * dom/CharacterData.h: Changed to use a RefPtr. I could have used a String
794         instead, but since String adds extra branches to handle 0, I figured it was
795         more conservative to just use RefPtr. Later it would be good to figure out
796         which is preferred style and be more consistent. Maybe we'll phase out
797         StringImpl, or maybe we'll go the other way and use it more since it can be
798         more efficient.
799
800         * dom/DOMImplementation.cpp:
801         (WebCore::addString): Changed set to use String rather than StringImpl.
802         (WebCore::isSVG10Feature): Ditto.
803         (WebCore::isSVG11Feature): Ditto.
804         (WebCore::DOMImplementation::createDocument): Replaced custom code to
805         find a colon with a call to String::find.
806
807         * dom/Range.cpp:
808         (WebCore::Range::insertNode): Updated since the result of splitText is now
809         a PassRefPtr.
810
811         * dom/Text.cpp:
812         (WebCore::Text::splitText): Updated since str is now a RefPtr. Also made the
813         result of this function be a PassRefPtr.
814         (WebCore::Text::createRenderer): Ditto.
815         (WebCore::Text::createNew): Made the parameter and result both be PassRefPtr.
816         * dom/Text.h:
817
818         * html/HTMLElement.cpp:
819         (WebCore::HTMLElement::nodeName): Use String::upper.
820
821         * html/HTMLInputElement.cpp:
822         (WebCore::numGraphemeClusters): Remove now-unneeded const.
823         (WebCore::numCharactersInGraphemeClusters): Ditto.
824
825         * html/HTMLTokenizer.cpp:
826         (WebCore::HTMLTokenizer::processToken): Updated for function name change.
827
828         * platform/text/AtomicString.cpp:
829         (WebCore::CStringTranslator::translate): Updated since there is no longer
830         a constructor that takes a string.
831
832         * platform/text/PlatformString.h: Added new constructors that take
833         PassRefPtr and RefPtr. Removed misleading comment.
834
835         * platform/text/String.cpp:
836         (WebCore::String::String): Changed to use StringImpl::create, which handles
837         the empty string automatically.
838         (WebCore::String::append): Ditto.
839         (WebCore::String::charactersWithNullTermination): Similar.
840         (WebCore::String::format): Ditto.
841
842         * platform/text/StringHash.h: Took out unneeded const.
843
844         * platform/text/StringImpl.cpp:
845         (WebCore::deleteUCharVector): Changed to take a const pointer since the
846         buffers are now const UChar buffers.
847         (WebCore::StringImpl::StringImpl): Removed some constructors. Got rid of the
848         separate init functions. The constructors are now private and used only in
849         the create functions and one or two other places.
850         (WebCore::StringImpl::containsOnlyWhitespace): Removed now-meaningless const.
851         (WebCore::StringImpl::substring): Ditto. Also changed return value to be a
852         PassRefPtr.
853         (WebCore::StringImpl::characterStartingAt): Ditto.
854         (WebCore::StringImpl::toLength): Ditto.
855         (WebCore::StringImpl::toCoordsArray): Ditto.
856         (WebCore::StringImpl::toLengthArray): Ditto.
857         (WebCore::StringImpl::isLower): Ditto.
858         (WebCore::StringImpl::lower): Ditto. Changed to use Vector and adopt so we
859         don't have to use new directly here. Makes empty string handling more consistent.
860         (WebCore::StringImpl::upper): Ditto.
861         (WebCore::StringImpl::secure): Ditto.
862         (WebCore::StringImpl::foldCase): Ditto.
863         (WebCore::StringImpl::stripWhiteSpace): Ditto.
864         (WebCore::StringImpl::simplifyWhiteSpace): Ditto.
865         (WebCore::StringImpl::capitalize): Ditto.
866         (WebCore::StringImpl::toInt): Removed now-meaningless const.
867         (WebCore::StringImpl::toInt64): Ditto.
868         (WebCore::StringImpl::toUInt64): Ditto.
869         (WebCore::StringImpl::toDouble): Ditto.
870         (WebCore::StringImpl::toFloat): Ditto.
871         (WebCore::StringImpl::find): Ditto.
872         (WebCore::StringImpl::reverseFind): Ditto.
873         (WebCore::StringImpl::endsWith): Ditto.
874         (WebCore::StringImpl::replace): Ditto.
875         (WebCore::equal): Ditto.
876         (WebCore::equalIgnoringCase): Ditto.
877         (WebCore::StringImpl::ascii): Ditto.
878         (WebCore::StringImpl::defaultWritingDirection): Ditto.
879         (WebCore::StringImpl::createStrippingNullCharacters): Ditto.
880         (WebCore::StringImpl::adopt): Added special case so this uses the shared
881         empty string like other functions. Also optimized the common case where the
882         vector happens to already have the right size so we don't do a fastRealloc
883         at all in those cases.
884         (WebCore::StringImpl::create): Added. These are now the public functions for
885         creating new StringImpl objects. They all implement the shared empty string.
886         (WebCore::StringImpl::createWithTerminatingNullCharacter):
887         * platform/text/StringImpl.h:
888
889         * platform/text/cf/StringCF.cpp:
890         (WebCore::String::String): Use StringImpl::create instead of new StringImpl.
891         * platform/text/cf/StringImplCF.cpp:
892         (WebCore::StringImpl::createCFString): Removed now-obsolete const.
893         * platform/text/mac/StringImplMac.mm:
894         (WebCore::StringImpl::operator NSString *): Ditto.
895         * platform/text/mac/StringMac.mm:
896         (WebCore::String::String): Use StringImpl::create instead of new StringImpl.
897         * platform/text/qt/StringQt.cpp:
898         (WebCore::String::String): Ditto.
899         * platform/text/wx/StringWx.cpp:
900         (WebCore::String::String): Ditto.
901         * rendering/RenderBR.cpp:
902         (WebCore::RenderBR::RenderBR): Ditto.
903
904         * rendering/RenderSVGInlineText.cpp:
905         (WebCore::RenderSVGInlineText::RenderSVGInlineText): Use PassRefPtr.
906         * rendering/RenderSVGInlineText.h:
907
908         * rendering/RenderText.cpp:
909         (WebCore::charactersAreAllASCII): Removed now-unneeded const.
910         * rendering/RenderTextFragment.cpp:
911         (WebCore::RenderTextFragment::originalText): Use RefPtr.
912
913 2008-01-02  Timothy Hatcher  <timothy@apple.com>
914
915         Reviewed by Oliver Hunt.
916
917         <rdar://problem/5618086> WebInspector does not expand the DOM tree after being closed
918
919         Closing the Web Inspector causes the DOM tree outline to be torn down, clearing the
920         internal element lookup tables. The represented DOM node object still holds the identifier
921         it was assigned, and a later call to findTreeElement will use that original identifier
922         against a cleared lookup table. In that case we need to fallback on DOM ancestor lookup.
923
924         * page/inspector/treeoutline.js:
925         (TreeOutline.prototype.findTreeElement): If the DOM node already had a __treeElementIdentifier,
926         but the TreeOutline no longer has the element in the _knownTreeElements list do an ancestor lookup
927         instead of an early return.
928
929 2008-01-02  Alice Liu  <alice.liu@apple.com>
930
931         Reviewed by Maciej.
932
933         Fixed <rdar://5283861> (problems scrolling in gmail message content area)
934
935         * platform/ScrollView.h:
936         * platform/win/ScrollViewWin.cpp:
937         (WebCore::ScrollView::scroll):
938          Changed return value to bool to reflect success of scroll attempt
939
940 2008-01-02  Alexey Proskuryakov  <ap@webkit.org>
941
942         Fixed a typo (pointed out in review, but I somehow missed it at first).
943
944         * editing/EditorCommand.cpp: (WebCore::executeDelete):
945
946 2008-01-02  Alexey Proskuryakov  <ap@webkit.org>
947
948         Reviewed by Darin.
949
950         Resolved several FIXMEs in EditorCommand.
951         Made recently added commands hidden from JS again.
952         Removed BackwardDelete implementation, which used to be dead code, but got exposed now.
953
954         Tests: editing/execCommand/delete-no-scroll.html
955                editing/execCommand/forward-delete-no-scroll.html
956                editing/execCommand/insert-line-break-no-scroll.html
957
958         * editing/EditorCommand.cpp:
959         (WebCore::executeDelete):
960         (WebCore::executeForwardDelete):
961         (WebCore::executeInsertLineBreak):
962         (WebCore::supportedFromMenuOrKeyBinding):
963         (WebCore::CommandEntry::):
964
965 2008-01-02  Alexey Proskuryakov  <ap@webkit.org>
966
967         Reviewed by Darin.
968
969         http://bugs.webkit.org/show_bug.cgi?id=14555
970         action=mailto + method=get - The generated mailto URI is incorrect and the hvalues are encoded twice
971
972         http://bugs.webkit.org/show_bug.cgi?id=14774
973         Submitted data only includes first input item
974
975         Reworked encoding of mailto URLs to match other browsers.
976         Moved most of related logic from FrameLoader::submitForm() to HTMLFormElement::submit().
977
978         Tests: fast/forms/mailto/advanced-get.html
979                fast/forms/mailto/advanced-put.html
980                fast/forms/mailto/get-multiple-items-text-plain.html
981                fast/forms/mailto/get-multiple-items-x-www-form-urlencoded.html
982                fast/forms/mailto/get-multiple-items.html
983                fast/forms/mailto/get-non-ascii.html
984                fast/forms/mailto/get-non-ascii-text-plain.html
985                fast/forms/mailto/get-overwrite-query.html
986                fast/forms/mailto/post-append-query.html
987                fast/forms/mailto/post-multiple-items-multipart-form-data.html
988                fast/forms/mailto/post-multiple-items-text-plain.html
989                fast/forms/mailto/post-multiple-items-x-www-form-urlencoded.html
990                fast/forms/mailto/post-multiple-items.html
991
992         * html/HTMLFormElement.cpp:
993         (WebCore::HTMLFormElement::submit):
994         * loader/FrameLoader.cpp:
995         (WebCore::FrameLoader::submitForm):
996
997 2008-01-02  Mark Rowe  <mrowe@apple.com>
998
999         Autotools build fix.
1000
1001         * GNUmakefile.am: Remove files before generating them, not after.
1002
1003 2008-01-02  Mark Rowe  <mrowe@apple.com>
1004
1005         Rubber-stamped by Alp Toker.
1006
1007         Add missing dependencies to some GNUmakefile.am rules.
1008
1009         * GNUmakefile.am:
1010
1011 2008-01-02  Mark Rowe  <mrowe@apple.com>
1012
1013         Reviewed by Alp Toker.
1014
1015         Autotools build fix.  Make can expand $@ to any of the targets for the rule,
1016         while we always want to use the name of the .cpp file as the output file.
1017
1018         * GNUmakefile.am:
1019
1020 2008-01-02  Luca Bruno  <lethalman88@gmail.com>
1021
1022         Reviewed by Alp Toker.
1023
1024         http://bugs.webkit.org/show_bug.cgi?id=16115
1025         [GTK] ContextMenu and ContextMenuItem lacks an implementation
1026
1027         Add context menu support.
1028
1029         Based on a patch by Holger Freyther.
1030
1031         * platform/gtk/ContextMenuGtk.cpp:
1032         (WebCore::menuItemActivated):
1033         (WebCore::ContextMenu::ContextMenu):
1034         (WebCore::ContextMenu::~ContextMenu):
1035         (WebCore::ContextMenu::appendItem):
1036         (WebCore::ContextMenu::setPlatformDescription):
1037         (WebCore::ContextMenu::releasePlatformDescription):
1038         * platform/gtk/ContextMenuItemGtk.cpp:
1039         (WebCore::ContextMenuItem::ContextMenuItem):
1040         (WebCore::ContextMenuItem::~ContextMenuItem):
1041         (WebCore::ContextMenuItem::releasePlatformDescription):
1042         (WebCore::ContextMenuItem::type):
1043         (WebCore::ContextMenuItem::action):
1044         (WebCore::ContextMenuItem::setAction):
1045         (WebCore::ContextMenuItem::platformSubMenu):
1046         (WebCore::ContextMenuItem::setSubMenu):
1047         (WebCore::ContextMenuItem::setChecked):
1048         (WebCore::ContextMenuItem::setEnabled):
1049
1050 2008-01-02  Alp Toker  <alp@atoker.com>
1051
1052         GTK+ autotools build fix. Track changes in r29073.
1053
1054         * GNUmakefile.am:
1055
1056 2008-01-01  Darin Adler  <darin@apple.com>
1057
1058         - fix release build
1059
1060         * bindings/js/kjs_binding.cpp:
1061         (KJS::setDOMException): Initialize to avoid uninitialized variable warning.
1062         Removed default so we get a warning if there's a missing case.
1063
1064 2008-01-01  David D. Kilzer  <ddkilzer@webkit.org>
1065
1066         Scripting MIME Types application/ecmascript, application/javascript not viewable
1067         <http://bugs.webkit.org/show_bug.cgi?id=11063>
1068
1069         Reviewed by Darin.
1070
1071         This patch consolidates the list of acceptable MIME types for JavaScript
1072         source into the MIMETypeRegistry class, and replaces checks for these
1073         types with a call to MIMETypeRegistry::isSupportedJavaScriptMIMEType().
1074
1075         No tests added since viewing JavaScript source is not testable.
1076
1077         * dom/DOMImplementation.cpp:
1078         (WebCore::DOMImplementation::isTextMIMEType): Use
1079         MIMETypeRegistry::isSupportedJavaScriptMIMEType() instead of a single
1080         hard-coded MIME type, "application/x-javascript".
1081
1082         * html/HTMLScriptElement.cpp:
1083         (WebCore::HTMLScriptElement::shouldExecuteAsJavaScript): Moved list of
1084         JavaScript MIME types from here to
1085         MIMETypeRegistry::initialiseSupportedJavaScriptMIMETypes().
1086
1087         * platform/MIMETypeRegistry.cpp:
1088         (WebCore::initialiseSupportedJavaScriptMIMETypes): Added. List of
1089         MIME types came from HTMLScriptElement::shouldExecuteAsJavaScript().
1090         (WebCore::initialiseSupportedNonImageMimeTypes): Remove single
1091         hard-coded MIME type, "application/x-javascript", from the list.
1092         (WebCore::initialiseMIMETypeRegistry): Initialise
1093         supportedJavaScriptMIMETypes, then pre-populate supportedNonImageMIMETypes
1094         with values in supportedJavaScriptMIMETypes.
1095         (WebCore::MIMETypeRegistry::isSupportedJavaScriptMIMEType): Added.
1096
1097         * platform/MIMETypeRegistry.h: Added isSupportedJavaScriptMIMEType().
1098
1099 2008-01-01  Sam Weinig  <sam@webkit.org>
1100
1101         Reviewed by Darin.
1102
1103         Patch for http://bugs.webkit.org/show_bug.cgi?id=16691
1104         Use real JS objects for the rest of the DOMExceptions (EventException, RangeException, etc)
1105
1106         - Create JS objects for all the different types of exceptions, each with there own prototype and constructor.
1107         - Abstract all the logic and storage for exception classes in to an ExceptionBase class.
1108         - Move specialized ExceptionCodes into the exception classes. (ie. the EventExceptionCode enum is now in EventException).
1109
1110         Tests: fast/dom/DOMException/EventException.html
1111                fast/dom/DOMException/RangeException.html
1112                fast/dom/DOMException/XPathException.html
1113                http/tests/xmlhttprequest/XMLHttpRequestException.html
1114                svg/custom/SVGException.html
1115
1116         * DerivedSources.make:
1117         * WebCore.pro:
1118         * WebCore.vcproj/WebCore.vcproj:
1119         * WebCore.xcodeproj/project.pbxproj:
1120         * WebCoreSources.bkl:
1121         * bindings/js/JSSVGMatrixCustom.cpp:
1122         (WebCore::JSSVGMatrix::inverse):
1123         (WebCore::JSSVGMatrix::rotateFromVector):
1124         * bindings/js/kjs_binding.cpp:
1125         (KJS::setDOMException):
1126         * bindings/scripts/CodeGeneratorJS.pm: Use the constant values defined
1127         in the IDL as the ObjC bindings do.
1128         * bindings/scripts/CodeGeneratorObjC.pm:
1129         * dom/DOMCoreException.cpp: Removed.
1130         * dom/DOMCoreException.h:
1131         (WebCore::DOMCoreException::DOMCoreException):
1132         * dom/DOMCoreException.idl:
1133         * dom/Event.h:
1134         * dom/EventException.h: Copied from WebCore/dom/DOMCoreException.h.
1135         (WebCore::EventException::EventException):
1136         (WebCore::EventException::):
1137         * dom/EventException.idl: Copied from WebCore/dom/DOMCoreException.idl.
1138         * dom/EventTargetNode.cpp:
1139         (WebCore::EventTargetNode::dispatchEvent):
1140         * dom/ExceptionBase.cpp: Copied from WebCore/dom/DOMCoreException.cpp.
1141         (WebCore::ExceptionBase::ExceptionBase):
1142         (WebCore::ExceptionBase::toString):
1143         * dom/ExceptionBase.h: Copied from WebCore/dom/DOMCoreException.h.
1144         (WebCore::ExceptionBase::code):
1145         * dom/ExceptionCode.cpp:
1146         (WebCore::getExceptionCodeDescription):
1147         * dom/ExceptionCode.h:
1148         (WebCore::):
1149         * dom/Range.cpp:
1150         (WebCore::Range::insertNode):
1151         (WebCore::Range::checkNodeWOffset):
1152         (WebCore::Range::checkNodeBA):
1153         (WebCore::Range::selectNode):
1154         (WebCore::Range::selectNodeContents):
1155         (WebCore::Range::surroundContents):
1156         * dom/RangeException.h:
1157         (WebCore::RangeException::RangeException):
1158         (WebCore::RangeException::):
1159         * dom/RangeException.idl:
1160         * page/DOMWindow.idl:
1161         * svg/SVGColor.cpp:
1162         (WebCore::SVGColor::setRGBColor):
1163         * svg/SVGException.h:
1164         (WebCore::SVGException::SVGException):
1165         (WebCore::SVGException::):
1166         * svg/SVGException.idl:
1167         * svg/SVGLocatable.cpp:
1168         (WebCore::SVGLocatable::getTransformToElement):
1169         * xml/XMLHttpRequest.cpp:
1170         (WebCore::XMLHttpRequest::dispatchEvent):
1171         (WebCore::XMLHttpRequest::open):
1172         (WebCore::XMLHttpRequest::send):
1173         * xml/XMLHttpRequest.h:
1174         * xml/XMLHttpRequestException.h: Copied from WebCore/dom/DOMCoreException.h.
1175         (WebCore::XMLHttpRequestException::XMLHttpRequestException):
1176         (WebCore::XMLHttpRequestException::):
1177         * xml/XMLHttpRequestException.idl: Copied from WebCore/dom/DOMCoreException.idl.
1178         * xml/XPathEvaluator.h:
1179         * xml/XPathException.h: Copied from WebCore/dom/DOMCoreException.h.
1180         (WebCore::XPathException::XPathException):
1181         (WebCore::XPathException::):
1182         * xml/XPathException.idl: Copied from WebCore/dom/DOMCoreException.idl.
1183         * xml/XPathParser.cpp:
1184         (WebCore::XPath::Parser::parseStatement):
1185         * xml/XPathResult.cpp:
1186         (WebCore::XPathResult::convertTo):
1187         (WebCore::XPathResult::numberValue):
1188         (WebCore::XPathResult::stringValue):
1189         (WebCore::XPathResult::booleanValue):
1190         (WebCore::XPathResult::singleNodeValue):
1191         (WebCore::XPathResult::snapshotLength):
1192         (WebCore::XPathResult::iterateNext):
1193         (WebCore::XPathResult::snapshotItem):
1194
1195 2008-01-01  Sam Weinig  <sam@webkit.org>
1196
1197         Remove JSDomExceptionConstructor.lut.h from clean step
1198         as it no longer exists.
1199
1200         * GNUmakefile.am:
1201
1202 2008-01-01  Dan Bernstein  <mitz@apple.com>
1203
1204         - Windows build fix
1205
1206         * WebCore.vcproj/WebCore.vcproj:
1207
1208 2008-01-01  Sam Weinig  <sam@webkit.org>
1209
1210         Try again to fix the builds
1211
1212         * DerivedSources.make:
1213
1214 2008-01-01  Sam Weinig  <sam@webkit.org>
1215
1216         Fix non-mac builds.
1217
1218         * WebCore.pro:
1219         * WebCore.vcproj/WebCore.vcproj:
1220         * WebCoreSources.bkl:
1221
1222 2008-01-01  Eric Seidel  <eric@webkit.org>
1223
1224         Reviewed by Alexey.
1225
1226         Don't replace \ with / in data: urls
1227         http://bugs.webkit.org/show_bug.cgi?id=16692
1228
1229         Test: fast/loader/url-data-replace-backslash.html
1230
1231         * platform/KURL.cpp:
1232         (WebCore::KURL::init):
1233
1234 2008-01-01  Alp Toker  <alp@atoker.com>
1235
1236         GTK+ autotools build fix. Track changes in r29051, r29058 and pass the
1237         correct parameter to AM_INIT_AUTOMAKE.
1238
1239         * GNUmakefile.am:
1240
1241 2007-12-31  Sam Weinig  <sam@webkit.org>
1242
1243         Reviewed by Darin.
1244
1245         Patch for http://bugs.webkit.org/show_bug.cgi?id=16637
1246         Acid3 expects ExeceptionCode constants to be defined on DOMException objects
1247
1248         - Make DOMException a real JS object.
1249
1250         Test: fast/dom/DOMException/prototype-object.html
1251
1252         * DerivedSources.make:
1253         * WebCore.xcodeproj/project.pbxproj:
1254
1255         This is no longer needed as the autogenerated classes now includes the
1256         constructor.
1257         * bindings/js/JSDOMExceptionConstructor.cpp: Removed.
1258         * bindings/js/JSDOMExceptionConstructor.h: Removed.
1259
1260         Create on demand and use the new class for DOMExceptions.
1261         * bindings/js/kjs_binding.cpp:
1262         (KJS::setDOMException):
1263
1264         Remove no longer needed custom constructor getter.
1265         * bindings/js/kjs_window.cpp:
1266         (KJS::Window::getValueProperty):
1267
1268         Don't expose DOMCoreException as the name of class by special casing
1269         the user visible class name to be DOMException.
1270         * bindings/scripts/CodeGeneratorJS.pm:
1271
1272         The DOMException class/file needs to be named DOMCoreException because there is
1273         name conflict with one of the Objective-C bindings classes.  It should be renamed
1274         to DOMException when the Objective-C bindings are moved into WebKit.
1275         * dom/DOMCoreException.cpp: Added.
1276         (WebCore::DOMCoreException::DOMCoreException):
1277         (WebCore::DOMCoreException::toString):
1278         * dom/DOMCoreException.h: Added.
1279         (WebCore::DOMCoreException::):
1280         (WebCore::DOMCoreException::code):
1281         (WebCore::DOMCoreException::name):
1282         (WebCore::DOMCoreException::message):
1283         * dom/DOMCoreException.idl: Added.
1284         * page/DOMWindow.idl:
1285
1286 2007-12-31  Sam Weinig  <sam@webkit.org>
1287
1288         Re-enable querySelector and querySelectorAll and touch the necessary files to not
1289         kill the windows build.
1290
1291         * WebCore.vcproj/build-generated-files.sh:
1292         * bindings/scripts/CodeGeneratorCOM.pm:
1293         * dom/Document.idl:
1294         * dom/Element.idl:
1295
1296 2007-12-31  Darin Adler  <darin@apple.com>
1297
1298         - fix Windows build
1299
1300         * dom/Document.idl: Temporarily disable querySelector and querySelectorAll, since they are showing
1301         up as pure virtual functions. Sam can fix this later.
1302         * dom/Element.idl: Ditto.
1303
1304 2007-12-31  Dan Bernstein  <mitz@apple.com>
1305
1306         Reviewed by Darin Adler.
1307
1308         - fix http://bugs.webkit.org/show_bug.cgi?id=14134
1309           <rdar://problem/5655160> REGRESSION (r25353): Whitespace nodes ignored between inline list items
1310
1311         Test: fast/dynamic/create-renderer-for-whitespace-only-text.html
1312
1313         * dom/Node.cpp:
1314         (WebCore::Node::attach): Added code to check if this node's renderer
1315         has become the "previous renderer" of any sibling text node, and if so,
1316         ensure that that node gets a renderer if it now needs one.
1317         (WebCore::Node::createRendererIfNeeded): Removed the assertion that the
1318         node is not attached.
1319
1320 2007-12-31  Darin Adler  <darin@apple.com>
1321
1322         Reviewed by Mitz.
1323
1324         - fix http://bugs.webkit.org/show_bug.cgi?id=16641
1325           Acid3 reveals HTMLFormElement.elements fails to update when element name changes
1326
1327         Test: fast/dom/HTMLFormElement/elements-not-in-document.html
1328
1329         This was a bug specific to forms that are not in the document tree.
1330         The fix was to change the code to increment the document version number to match
1331         up with other document change tracking. Maybe at some point we can clean these up
1332         so we don't have so many competing change notification systems.
1333
1334         * dom/ContainerNode.cpp:
1335         (WebCore::ContainerNode::replaceChild): Removed bogus comment.
1336         (WebCore::ContainerNode::addChild): Added an explicit incDOMTreeVersion
1337         call here, since this code path bypasses the subtree-modified event code.
1338
1339         * dom/Element.cpp:
1340         (WebCore::Element::setAttribute): Remove the inDocument() check -- not all HTML
1341         collections are for things in the document.
1342         (WebCore::Element::setAttributeMap): Ditto.
1343
1344         * dom/EventTargetNode.cpp:
1345         (WebCore::EventTargetNode::dispatchSubtreeModifiedEvent): Added a call to
1346         incDOMTreeVersion here; covers most cases of tree structure changes.
1347
1348         * dom/Node.cpp:
1349         (WebCore::Node::attach): Remove call to incDOMTreeVersion -- creating a renderer
1350         has nothing to do with changes to the DOM tree!
1351         (WebCore::Node::detach): Ditto.
1352
1353         * html/HTMLFormElement.cpp:
1354         (WebCore::HTMLFormElement::registerFormElement): Remove call to incDOMTreeVersion.
1355         This is handled at a lower level and doesn't need to be here.
1356         (WebCore::HTMLFormElement::removeFormElement): Ditto.
1357
1358 2007-12-31  Henry Mason  <hmason@mac.com>
1359
1360         Reviewed by Darin.
1361
1362         Patch for http://bugs.webkit.org/show_bug.cgi?id=14994
1363         Support for MessageEvent and cross-domain messaging
1364
1365         Test: http/tests/messaging/cross-domain-message-send.html
1366
1367         * DerivedSources.make:
1368         * WebCore.pro:
1369         * WebCore.vcproj/WebCore.vcproj:
1370         * WebCore.xcodeproj/project.pbxproj:
1371         * WebCoreSources.bkl:
1372         * bindings/js/JSDOMWindowCustom.cpp:
1373         (WebCore::JSDOMWindow::customGetOwnPropertySlot): Allow cross-domain access to the
1374         postMessage function.
1375         (WebCore::JSDOMWindow::postMessage):
1376         * bindings/js/JSEventCustom.cpp:
1377         (WebCore::toJS):
1378         * dom/Event.cpp:
1379         (WebCore::Event::isMessageEvent):
1380         * dom/Event.h:
1381         * dom/EventNames.h: New event name
1382         * dom/MessageEvent.cpp: Added.
1383         * dom/MessageEvent.h: Added.
1384         * dom/MessageEvent.idl: Added.
1385         * page/DOMWindow.cpp:
1386         (WebCore::DOMWindow::postMessage): Added.
1387         * page/DOMWindow.h:
1388         * page/DOMWindow.idl:
1389
1390 2007-12-31  Darin Adler  <darin@apple.com>
1391
1392         Suggested by Antti.
1393
1394         - turn ENABLE_VIDEO back off for Windows until we can install QuickTime on the build bots
1395
1396         * WebCore.vcproj/WebCore.vcproj: Removed ENABLE_VIDEO.
1397         * WebCore.vcproj/build-generated-files.sh: Ditto.
1398
1399 2007-12-30  Alp Toker  <alp@atoker.com>
1400
1401         Reviewed by Dan Bernstein.
1402
1403         Silence warning.
1404
1405         * dom/NodeList.h:
1406
1407 2007-12-30  Sam Weinig  <sam@webkit.org>
1408
1409         Reviewed by Oliver Hunt.
1410
1411         Fix for http://bugs.webkit.org/show_bug.cgi?id=16387
1412         Variable names can be enumerated across domains
1413         <rdar://problem/5640454>
1414
1415         Test: http/tests/security/cross-frame-access-enumeration.html
1416
1417         * bindings/js/kjs_window.cpp:
1418         (KJS::Window::getPropertyNames): Override method to test same-origin policy.
1419         * bindings/js/kjs_window.h:
1420
1421 2007-12-30  Sam Weinig  <sam@webkit.org>
1422
1423         Reviewed by Oliver Hunt.
1424
1425         Patch for http://bugs.webkit.org/show_bug.cgi?id=10686
1426         event instanceof MouseEvent throws exception
1427
1428         Add JS constructors for all the Event types.
1429
1430         Test: fast/events/event-instanceof.html
1431
1432         * WebCore.xcodeproj/project.pbxproj:
1433         * dom/KeyboardEvent.idl:
1434         * dom/MouseEvent.idl:
1435         * dom/MutationEvent.idl:
1436         * dom/OverflowEvent.idl:
1437         * dom/ProgressEvent.idl:
1438         * dom/TextEvent.idl:
1439         * dom/UIEvent.idl:
1440         * dom/WheelEvent.idl:
1441         * page/DOMWindow.idl:
1442
1443 2007-12-30  David Kilzer  <ddkilzer@webkit.org>
1444
1445         Reviewed by Darin.
1446
1447         - fix http://bugs.webkit.org/show_bug.cgi?id=15359
1448           JPEG image not shown when height is specified as percentage inside a table
1449
1450         The problem occurs when a replaced element (image, canvas, etc.) with
1451         a percent-height attribute is contained by a table cell with an auto-
1452         or percent-height attribute.  If there are no other conditions to cause
1453         the table cell's height to expand, an available height of zero will
1454         always be returned.  In these cases, the intrinsic height of the
1455         replaced element should be used if it is greater than the available
1456         height of the table cell.
1457
1458         Tests: fast/replaced/table-percent-height.html
1459                tables/mozilla/bugs/bug137388-1.html
1460                tables/mozilla/bugs/bug137388-2.html
1461
1462         * rendering/RenderBox.cpp:
1463         (WebCore::RenderBox::calcReplacedHeightUsing):
1464
1465 2007-12-30  Luca Bruno  <lethalman88@gmail.com>
1466
1467         Reviewed by Alp Toker.
1468
1469         http://bugs.webkit.org/show_bug.cgi?id=16099
1470         Crash in CURL for empty POST
1471
1472         We have to set POST even when the data is empty, otherwise cURL will
1473         hang while waiting for a response.
1474
1475         * platform/network/curl/ResourceHandleManager.cpp
1476         (ResourceHandleManager::setupPOST): allow empty POST
1477
1478 2007-12-29  Jan Michael Alonzo  <jmalonzo@unpluggable.com>
1479
1480         Reviewed by Alp Toker.
1481
1482         Move all SVG related stuff inside SVG block. Don't include
1483         SVGNames, SVGElementFactory, and XLinkNames when SVG is not
1484         enabled
1485
1486         * GNUmakefile.am:
1487
1488 2007-12-29  Alexey Proskuryakov  <ap@webkit.org>
1489
1490         Reviewed by Darin.
1491
1492         http://bugs.webkit.org/show_bug.cgi?id=14428
1493         FCKEditor: Images disappear on drag/drop and copy/paste
1494
1495         Test: editing/pasteboard/drag-image-in-about-blank-frame.html
1496
1497         * editing/markup.cpp: (WebCore::createFragmentFromMarkup): Don't use "about:blank" as a
1498         base URL, just like we don't use an empty one.
1499
1500 2007-12-29  Jan Michael Alonzo  <jmalonzo@unpluggable.com>
1501
1502         Reviewed by Alp Toker.
1503
1504         http://bugs.webkit.org/show_bug.cgi?id=16669
1505         autotools update and fixes
1506
1507         Autotools update and database/icon database inclusion guard fixes
1508
1509         * GNUmakefile.am:
1510           - Update autotools config as per -r29012 changes
1511           - Fix CSSGrammar.h/cpp generation (Seo Sanghyeon, sanxiyn)
1512         * dom/Document.cpp:
1513         * loader/icon/IconDatabase.h:
1514         * page/DOMWindow.cpp:
1515         * page/InspectorController.cpp:
1516         * page/Settings.cpp:
1517         * storage/Database.h:
1518           - Remove ENABLE(DATABASE) inclusion guard. Let the includer add the guard instead.
1519
1520 2007-12-29  Nikolas Zimmermann  <zimmermann@kde.org>
1521
1522         Reviewed by Alexey.
1523
1524         Respect horiz-origin-x / horiz-origin-y / vert-origin-x / vert-origin-y properties when drawing SVG Fonts.
1525         (Fixes fonts-elem-05-t.svg in a --svg-fonts build)
1526
1527         * svg/SVGFont.cpp:
1528         (WebCore::Font::drawGlyphsWithSVGFont):
1529
1530 2007-12-29  Nikolas Zimmermann  <zimmermann@kde.org>
1531
1532         Reviewed by Oliver.
1533
1534         Further SVG Font work. Parse all <glyph> attributes, using SVGGlyphElement::buildGlyphIdentifier.
1535         SVGFontElement::collectGlyphs() now uses this method. Per character advance values work well now.
1536
1537         * platform/graphics/FontData.cpp:
1538         (WebCore::SVGFontData::convertEmUnitToPixel): Add helper function.
1539         (WebCore::FontData::ascent):
1540         (WebCore::FontData::descent):
1541         * platform/graphics/FontData.h:
1542         * svg/SVGFont.cpp:
1543         (WebCore::isVerticalWritingMode): Add helper function.
1544         (WebCore::Font::drawGlyphsWithSVGFont):
1545         * svg/SVGFontElement.cpp:
1546         (WebCore::SVGFontElement::collectGlyphs): Simplified implementation - SVGGlyphIdentifier now build by SVGGlyphElement.
1547         * svg/SVGGlyphElement.cpp:
1548         (WebCore::parseArabicForm): Helper function.
1549         (WebCore::parseOrientation): Ditto.
1550         (WebCore::parsePathData): Ditto.
1551         (WebCore::SVGGlyphElement::buildGlyphIdentifier):
1552         * svg/SVGGlyphElement.h:
1553         (WebCore::SVGGlyphElement::rendererIsNeeded):
1554
1555 2007-12-29  Nikolas Zimmermann  <zimmermann@kde.org>
1556
1557         Reviewed by Oliver.
1558
1559         Refactor SVGAnimationElement::parseValues into a generic function parseDelimitedString.
1560         SVGAnimationElement needs to parse semicolon-seperated strings, SVGGlyphElement comma-seperated.
1561
1562         * svg/SVGAnimationElement.cpp:
1563         (WebCore::SVGAnimationElement::parseMappedAttribute):
1564         * svg/SVGParserUtilities.cpp:
1565         (WebCore::parseDelimitedString):
1566         * svg/SVGParserUtilities.h:
1567
1568 2007-12-29  Nikolas Zimmermann  <zimmermann@kde.org>
1569
1570         Reviewed by Maciej.
1571
1572         Add new helper structure SVGFontData - FontData holds this object as OwnPtr.
1573         Store several attribute values there (horiz-adv-x, horiz-origin-x etc..)
1574
1575         To optimize for the common case ('FontData' used for HTML rendering) it feels
1576         better to hold one OwnPtr in FontData, than several floats.
1577
1578         Parse all <font> attributes in SVGFontFaceElement::createFontData.
1579
1580         * platform/graphics/FontData.cpp:
1581         (WebCore::SVGFontData::SVGFontData):
1582         (WebCore::FontData::FontData):
1583         (WebCore::FontData::ascent):
1584         (WebCore::FontData::descent):
1585         * platform/graphics/FontData.h:
1586         (WebCore::FontData::isSVGFont):
1587         (WebCore::FontData::svgFontData):
1588         * svg/SVGFont.cpp:
1589         (WebCore::Font::drawGlyphsWithSVGFont):
1590         * svg/SVGFontElement.cpp:
1591         * svg/SVGFontElement.h:
1592         (WebCore::SVGFontElement::rendererIsNeeded):
1593         * svg/SVGFontFaceElement.cpp:
1594         (WebCore::SVGFontFaceElement::unitsPerEm):
1595         (WebCore::SVGFontFaceElement::createFontData):
1596
1597 2007-12-28  Darin Adler  <darin@apple.com>
1598
1599         - try to fix Windows and WX builds (broken by SVG Fonts check-in)
1600
1601         * platform/graphics/win/FontWin.cpp:
1602         (WebCore::Font::drawGlyphs): Pass font size to FontData::ascent, now that it requires it.
1603         I can't see how it can be right to require the font size for ascent and descent,
1604         but not for other metrics functions in FontData.
1605
1606         * platform/graphics/wx/FontWx.cpp:
1607         (WebCore::Font::drawGlyphs): Pass font size to FontData::ascent and FontData::descent.
1608
1609 2007-12-28  Dan Bernstein  <mitz@apple.com>
1610
1611         Reviewed by Mark Rowe.
1612
1613         - fix http://bugs.webkit.org/show_bug.cgi?id=16650
1614           <rdar://problem/5664872> REGRESSION (r28278-r28314): ATSUI uses LTR writing direction for all text runs
1615
1616         Covered by existing pixel tests.
1617
1618         * platform/graphics/mac/FontMac.mm:
1619         (WebCore::Font::drawComplexText): Corrected to maintain the style
1620         information in the adjusted text run when passing it to
1621         ATSUILayoutParameters. Prior to r28298 the style was passed separately.
1622
1623 2007-12-29  Nikolas Zimmermann  <zimmermann@kde.org>
1624
1625         Build fix, not reviewed.
1626
1627         Add wtf/OwnPtr.h include, to fix --svg-fonts build.
1628
1629         * css/SVGCSSFontFace.h:
1630
1631 2007-12-29  Nikolas Zimmermann  <zimmermann@kde.org>
1632
1633         Reviewed by Eric.
1634
1635         Fixes: http://bugs.webkit.org/show_bug.cgi?id=10649 (WebKit SVG needs SVG Fonts support)
1636
1637         Begin implementation of SVG Fonts module. Basic documents using SVG Fonts already work.
1638         Only local, in-document fonts who declare their glyphs using the <glyph d="..."> path syntax
1639         are supported. (<glyph> containing arbitary SVG content as child elements, not supported yet).
1640
1641         Limited to single char <-> glyph mapping, no ligatures supported yet.
1642         (ie. <glyph unicode='A'/> <glyph unicode='AB'/> - it ignores the 'AB' glyph definition for now)
1643
1644         Mark all SVG Font related classes & usages in ENABLE(SVG_FONTS) blocks.
1645
1646         No layout test changes for a --no-svg-fonts build, heavy changes if enabled. Because a lot of SVG Font
1647         attributes are not processed yet, the rendering looks wrong - hence disabled by default.)
1648
1649         * DerivedSources.make: Add SVGFontElement/SVGGlyphElement/SVGMissingGlyphElement
1650         * WebCore.pro: Updated build system.
1651         * WebCore.vcproj/WebCore.vcproj: Ditto.
1652         * WebCore.xcodeproj/project.pbxproj: Ditto.
1653         * bindings/js/JSSVGElementWrapperFactory.cpp: Add JSSVGFontElement/JSSVGGlyphElement/JSSVGMissingGlyphElement
1654         * bindings/objc/DOM.mm: Ditto (for DOMSVG*).
1655         (WebCore::createElementClassMap):
1656         * bindings/objc/DOMInternal.h: Ditto.
1657         * bindings/objc/DOMSVG.h: Ditto.
1658         * css/CSSFontFace.h: Mark three functions 'virtual', to be overriden by SVGCSSFontFace
1659         * css/CSSFontFaceSrcValue.h: Add functionality to identify as SVG CSS font face source.
1660         (WebCore::CSSFontFaceSrcValue::m_fontFaceElement): Hold a pointer to the font face which created it.
1661         (WebCore::CSSFontFaceSrcValue::svgFontFaceElement):
1662         (WebCore::CSSFontFaceSrcValue::setSVGFontFaceElement):
1663         * css/CSSFontSelector.cpp: Build 'SVGCSSFontFace' objects for local, in-document SVG fonts.
1664         (WebCore::CSSFontSelector::addFontFaceRule):
1665         * css/SVGCSSFontFace.cpp: Added. (Simplified implementation for SVG Fonts)
1666         (WebCore::SVGCSSFontFace::SVGCSSFontFace):
1667         (WebCore::SVGCSSFontFace::~SVGCSSFontFace):
1668         (WebCore::SVGCSSFontFace::isValid):
1669         (WebCore::SVGCSSFontFace::addSource):
1670         (WebCore::SVGCSSFontFace::getFontData):
1671         * css/SVGCSSFontFace.h: Added.
1672         * platform/graphics/cg/PathCG.cpp:
1673         (WebCore::Path::closeSubpath): Silence a CG warning when calling closeSubpath() on empty path.
1674         * platform/graphics/Font.cpp: Add some logic to call into SVG Font code when operating on SVG Fonts.
1675         (WebCore::Font::ascent): Pass font size to FontData::ascent() call
1676         (WebCore::Font::descent): Pass font size to FontData::descent() call
1677         (WebCore::Font::canUseGlyphCache): Always return true for SVG fonts here.
1678         (WebCore::Font::drawGlyphBuffer): Call drawGlyphsWithSVGFont (instead of drawGlyphs) if the primary font is a SVG font.
1679         * platform/graphics/Font.h: Add (SVG-only!) ability to store a RenderObject pointer, to the element which invoked the drawText() call.
1680         (WebCore::TextRun::TextRun):
1681         (WebCore::TextRun::referencingRenderObject):
1682         (WebCore::TextRun::setReferencingRenderObject):
1683         * platform/graphics/FontData.cpp:
1684         (WebCore::FontData::FontData):
1685         (WebCore::FontData::ascent):
1686         (WebCore::FontData::descent):
1687         * platform/graphics/FontData.h: Store a pointer to the SVGFontFaceElement, which created this FontData object - needed for drawGlyphsWithSVGFont().
1688         (WebCore::FontData::isSVGFont): Offer a way to determine wheter this is a FontData object, created by a SVGFontFaceElement.
1689         (WebCore::FontData::svgFontFace):
1690         * rendering/SVGInlineTextBox.cpp:
1691         (WebCore::SVGInlineTextBox::calculateGlyphWidth): Add assertion.
1692         * rendering/SVGRootInlineBox.cpp:
1693         (WebCore::svgTextRunForInlineTextBox): Always call 'setReferencingRenderObject(myRenderSVGText)' on the new TextRun
1694         * svg/SVGFont.cpp: Added.
1695         (WebCore::Font::drawGlyphsWithSVGFont): Outsourced implementation of SVG Fonts into it's own file.
1696         * svg/SVGFontElement.cpp: Added. (Note: this holds the GlyphHashMap which associates certain <glyph> objects with unicode values)
1697         (WebCore::SVGFontElement::SVGFontElement):
1698         (WebCore::SVGFontElement::~SVGFontElement):
1699         (WebCore::SVGFontElement::parseMappedAttribute):
1700         (WebCore::SVGFontElement::collectGlyphs):
1701         (WebCore::SVGFontElement::glyphIdentifierForGlyphCode):
1702         * svg/SVGFontElement.h: Added.
1703         (WebCore::GlyphHash::hash):
1704         (WebCore::GlyphHash::equal):
1705         (WebCore::GlyphHashTraits::deletedValue):
1706         (WebCore::SVGFontElement::rendererIsNeeded):
1707         (WebCore::SVGFontElement::contextElement):
1708         * svg/SVGFontElement.idl: Added.
1709         * svg/SVGFontFaceElement.cpp: Build SVG specific 'FontData' object
1710         (WebCore::SVGFontFaceElement::unitsPerEm):
1711         (WebCore::SVGFontFaceElement::fontFamily):
1712         (WebCore::SVGFontFaceElement::createFontData): Builds SVG specified 'FontData' object with the markup specified ascent/descent values etc..
1713         (WebCore::SVGFontFaceElement::rebuildFontFace): Construct CSSFontFaceSrc object (marked as 'isSVGFontFaceSrc') to satisfy CSSFontSelector::addFontFaceRule.
1714         (WebCore::SVGFontFaceElement::insertedIntoDocument): Rebuild font face.
1715         (WebCore::SVGFontFaceElement::glyphIdentifierForGlyphCode): Allows drawGlyphsWithSVGFont to access the glyph hash map living in the SVGFontElement.
1716         * svg/SVGFontFaceElement.h: Fixed code formatting issues & wrap in ENABLE(SVG_FONTS) blocks.
1717         * svg/SVGFontFaceElement.idl: Ditto.
1718         * svg/SVGFontFaceFormatElement.cpp: Ditto.
1719         * svg/SVGFontFaceFormatElement.h: Ditto.
1720         * svg/SVGFontFaceFormatElement.idl: Ditto.
1721         * svg/SVGFontFaceNameElement.cpp: Ditto.
1722         * svg/SVGFontFaceNameElement.h: Ditto.
1723         * svg/SVGFontFaceNameElement.idl: Ditto.
1724         * svg/SVGFontFaceSrcElement.cpp: Ditto.
1725         * svg/SVGFontFaceSrcElement.h: Ditto.
1726         * svg/SVGFontFaceSrcElement.idl: Ditto.
1727         * svg/SVGFontFaceUriElement.cpp: Ditto.
1728         * svg/SVGFontFaceUriElement.h: Ditto.
1729         * svg/SVGFontFaceUriElement.idl: Ditto.
1730         * svg/SVGDefinitionSrcElement.cpp: Ditto.
1731         * svg/SVGDefinitionSrcElement.h: Ditto.
1732         * svg/SVGDefinitionSrcElement.idl: Ditto.
1733         * svg/SVGGlyphElement.cpp: Added.
1734         (WebCore::SVGGlyphElement::SVGGlyphElement):
1735         (WebCore::SVGGlyphElement::parseMappedAttribute):
1736         (WebCore::SVGGlyphElement::childrenChanged):
1737         * svg/SVGGlyphElement.h: Added.
1738         (WebCore::SVGGlyphElement::rendererIsNeeded):
1739         (WebCore::SVGGlyphIdentifier::): Structure holding all data to represent a SVG glyph (origin, advance, orientation etc..)
1740         (WebCore::SVGGlyphIdentifier::SVGGlyphIdentifier):
1741         * svg/SVGGlyphElement.idl: Added.
1742         * svg/SVGMissingGlyphElement.cpp: Added. (stub implementation)
1743         (WebCore::SVGMissingGlyphElement::SVGMissingGlyphElement):
1744         (WebCore::SVGMissingGlyphElement::parseMappedAttribute):
1745         (WebCore::SVGMissingGlyphElement::childrenChanged):
1746         * svg/SVGMissingGlyphElement.h: Added.
1747         (WebCore::SVGMissingGlyphElement::rendererIsNeeded):
1748         * svg/SVGMissingGlyphElement.idl: Added.
1749         * svg/svgtags.in: Wrap all SVGFont* elements in ENABLE(SVG_FONTS) block - to assure --no-svg-fonts compilation works (which is the default for now!).
1750
1751 2007-12-27  Dan Bernstein  <mitz@apple.com>
1752
1753         Reviewed by Alexey Proskuryakov.
1754
1755         - fix http://bugs.webkit.org/show_bug.cgi?id=16628
1756           ASSERTION FAILED: m_resizeLayer (running layout tests)
1757
1758         * rendering/RenderLayer.cpp:
1759         (WebCore::RenderLayer::~RenderLayer): Avoid calling
1760         EventHandler::resizeLayerDestroyed() if the document is being destroyed.
1761
1762 2007-12-27  Dan Bernstein  <mitz@apple.com>
1763
1764         Reviewed by Oliver Hunt.
1765
1766         - fix http://bugs.webkit.org/show_bug.cgi?id=16603
1767           <rdar://problem/5664199> Crash when resizing text field
1768
1769         Test: fast/layers/resize-layer-deletion-crash.html
1770
1771         The event handler has only a weak reference to the layer that is
1772         currently in resize mode, so it is the layer's responsibility to let
1773         the event handler know if it has been destroyed while in that mode.
1774
1775         * page/EventHandler.cpp:
1776         (WebCore::EventHandler::resizeLayerDestroyed): Added. Resets
1777         m_resizeLayer to 0.
1778         * page/EventHandler.h:
1779         * rendering/RenderLayer.cpp:
1780         (WebCore::RenderLayer::~RenderLayer): Added a call to
1781         EventHandler::resizeLayerDestroyed() if the layer is in resize mode.
1782
1783 2007-12-27  Collin Jackson  <webkit@collinjackson.com>
1784
1785         Reviewed by Sam Weinig.
1786
1787         http://bugs.webkit.org/show_bug.cgi?id=16539
1788         <rdar://problem/5659269>
1789
1790         The same-origin check was missing in the implementation of 
1791         setTimeout, setInterval, addEventListener, and removeEventListener.
1792
1793         Suppose <http://www.badguy.com/> contains an iframe to 
1794         <http://www.goodguy.com/>. Now www.badguy.com can steal
1795         www.goodguy.com cookies by running this code:
1796
1797         setTimeout.call(frames[0], "alert(document.cookie)", 1000);
1798
1799         This patch changes the behavior so that setTimeout to does 
1800         nothing and returns an undefined value if the caller is not
1801         permitted to script the window whose setTimeout method is being
1802         called. The same applies to setInterval, addEventListener, and 
1803         removeEventListener.
1804
1805         Tests: http/tests/security/cross-frame-access-call.html
1806
1807         * bindings/js/kjs_window.cpp:
1808         (KJS::WindowProtoFuncSetTimeout::callAsFunction)
1809         (KJS::WindowProtoFuncSetInterval::callAsFunction)
1810         (KJS::WindowProtoFuncAddEventListener::callAsFunction)
1811         (KJS::WindowProtoFuncRemoveEventListener::callAsFunction)
1812
1813 2007-12-27  Dan Bernstein  <mitz@apple.com>
1814
1815         Reviewed by Dave Hyatt and Sam Weinig.
1816
1817         - fix <rdar://problem/5605937> Inspector: Disclosure triangle not drawn in node's properties panel until click
1818
1819         Test: fast/layers/add-layer-with-nested-stacking.html
1820         Test: fast/layers/remove-layer-with-nested-stacking.html
1821
1822         * rendering/RenderLayer.cpp:
1823         (WebCore::RenderLayer::addChild): If the new child is overflow-only
1824         but has children of its own, dirty the stacking context's z-order lists
1825         since the grandchildren might need to be in them.
1826         (WebCore::RenderLayer::removeChild): Similarly for the old child.
1827
1828 2007-12-27  Jan Michael Alonzo  <jmalonzo@unpluggable.com>
1829
1830         Reviewed by Alp Toker.
1831
1832         http://bugs.webkit.org/show_bug.cgi?id=16353
1833         [GTK] Check for deprecated API use (G_DISABLE_DEPRECATED etc.)
1834
1835         Added the flags mentioned in the bug only when doing 'debug'
1836         builds. -DGST_DISABLE_DEPRECATED only added when video is enabled.
1837
1838         * GNUmakefile.am:
1839         * WebCore.pro:
1840
1841 2007-12-27  Dan Bernstein  <mitz@apple.com>
1842
1843         Reviewed by Eric Seidel.
1844
1845         - fix http://bugs.webkit.org/show_bug.cgi?id=16490
1846           ASSERT in ~FrameView while viewing/reloading WICD test case
1847
1848         Test: fast/dynamic/paused-event-dispatch.html
1849
1850         * page/FrameView.cpp:
1851         (WebCore::FrameView::~FrameView):
1852         (WebCore::FrameView::layout): Changed to always pause event dispatch and
1853         always resume event dispatch, regardless of whether the post-layout
1854         task timer is active. However, if it is active, assert that event
1855         dispatch is still paused.
1856
1857 2007-12-27  Alexey Proskuryakov  <ap@webkit.org>
1858
1859         Reviewed by Maciej.
1860
1861         http://bugs.webkit.org/show_bug.cgi?id=14500
1862         need to be more generous about charset declaration with meta tag
1863         
1864         http://bugs.webkit.org/show_bug.cgi?id=12526
1865         <rdar://problem/4867183> Safari ignores encoding description "charset=Shift_JIS" in invalid html
1866
1867         <rdar://problem/4892428> Unlike other browsers, WebKit ignores <meta> charset definitions outside the head
1868
1869         <rdar://problem/5643774> REGRESSION: Text is garbled when clicking a link inside an Arabic website
1870
1871         Tests: fast/encoding/ahram-org-eg.html
1872                fast/encoding/bandai-co-jp-releases.html
1873                fast/encoding/floraexpress-ru.html
1874                fast/encoding/hanarei-blog32-fc2-com.html
1875                fast/encoding/yahoo-mail.html
1876
1877         * loader/TextResourceDecoder.cpp:
1878         (WebCore::TextResourceDecoder::checkForHeadCharset): Don't stop looking for <meta> until we've
1879         seen at least 512 bytes of input.
1880
1881 2007-12-26  Jan Michael Alonzo  <jmalonzo@unpluggable.com>
1882
1883         Reviewed by Alp Toker.
1884
1885         http://bugs.webkit.org/show_bug.cgi?id=16390
1886         Use autotools or GNU make as the build system for the GTK port
1887
1888         * GNUmakefile.am: Added.
1889
1890 2007-12-26  Alexey Proskuryakov  <ap@webkit.org>
1891
1892         Reviewed by Sam Weinig.
1893
1894         http://bugs.webkit.org/show_bug.cgi?id=16609
1895         Make manual-tests/xmlhttprequest-contenttype-empty.html test automatic
1896
1897         * manual-tests/xmlhttprequest-contenttype-empty.html: Removed (moved to LayoutTests/http).
1898
1899 2007-12-26  Mark Rowe  <mrowe@apple.com>
1900
1901         Windows build fix.
1902
1903         * platform/Threading.h:
1904
1905 2007-12-25  Rob Buis  <buis@kde.org>
1906
1907         Reviewed by Eric.
1908
1909         http://bugs.webkit.org/show_bug.cgi?id=15514
1910         <clipPath> with <use> not respected
1911         http://bugs.webkit.org/show_bug.cgi?id=16557
1912         SVG circle elements have been clipped away completely, instead of partially.
1913
1914         Add toClipPath to get clip path data for the clipping paths. Implement it for <use>, thereby allowing clip paths using use.
1915
1916         * svg/SVGClipPathElement.cpp:
1917         (WebCore::SVGClipPathElement::canvasResource):
1918         * svg/SVGStyledTransformableElement.h:
1919         (WebCore::SVGStyledTransformableElement::toClipPath):
1920         * svg/SVGUseElement.cpp:
1921         (WebCore::isDirectReference):
1922         (WebCore::SVGUseElement::toClipPath):
1923         * svg/SVGUseElement.h:
1924
1925 2007-12-25  Sam Weinig  <sam@webkit.org>
1926
1927         Reviewed by Eric Seidel.
1928
1929         Clean up the files relating to NodeLists.
1930
1931         * dom/ChildNodeList.cpp:
1932         (WebCore::ChildNodeList::ChildNodeList):
1933         (WebCore::ChildNodeList::length):
1934         (WebCore::ChildNodeList::item):
1935         (WebCore::ChildNodeList::nodeMatches):
1936         * dom/ChildNodeList.h:
1937         * dom/DynamicNodeList.cpp:
1938         (WebCore::DynamicNodeList::itemForwardsFromCurrent):
1939         (WebCore::DynamicNodeList::itemBackwardsFromCurrent):
1940         (WebCore::DynamicNodeList::itemWithName):
1941         * dom/DynamicNodeList.h:
1942         (WebCore::DynamicNodeList::needsNotifications):
1943         * dom/NameNodeList.cpp:
1944         (WebCore::NameNodeList::NameNodeList):
1945         (WebCore::NameNodeList::rootNodeAttributeChanged):
1946         (WebCore::NameNodeList::nodeMatches):
1947         * dom/NameNodeList.h:
1948         * dom/NodeList.h:
1949         * dom/SelectorNodeList.h:
1950
1951 2007-12-25  Sam Weinig  <sam@webkit.org>
1952
1953         Fix non-mac builds.
1954
1955         * WebCore.pro:
1956         * WebCore.vcproj/WebCore.vcproj:
1957         * WebCoreSources.bkl:
1958
1959 2007-12-25  Sam Weinig  <sam@webkit.org>
1960
1961         Rubber stamped by Eric Seidel.
1962
1963         Move TagNodeList into its own file.
1964
1965         * WebCore.xcodeproj/project.pbxproj:
1966         * dom/Node.cpp:
1967         * dom/TagNodeList.cpp: Copied from dom/Node.cpp.
1968         (WebCore::TagNodeList::TagNodeList):
1969         * dom/TagNodeList.h: Copied from dom/Node.cpp.
1970
1971 2007-12-25  Sam Weinig  <sam@webkit.org>
1972
1973         Reviewed by Eric Seidel.
1974
1975         Simplify the NodeList architecture.
1976         - Rename recursiveItem() to item(), since it is not recursive.
1977         - Make recursiveLength() iterative and rename to length().
1978         - Remove now unneeded overrides of item() and length() that used 
1979           to call the recursive variants.
1980
1981         * dom/ClassNodeList.cpp:
1982         * dom/ClassNodeList.h:
1983         * dom/DynamicNodeList.cpp:
1984         (WebCore::DynamicNodeList::length):
1985         (WebCore::DynamicNodeList::item):
1986         (WebCore::DynamicNodeList::rootNodeAttributeChanged): Move implementation 
1987         into the .cpp file since virtual methods can't be inlined.
1988         * dom/DynamicNodeList.h:
1989         * dom/NameNodeList.cpp:
1990         * dom/NameNodeList.h:
1991         * dom/Node.cpp:
1992
1993 2007-12-25  Alp Toker  <alp@atoker.com>
1994
1995         More complete GTK+/Qt/Wx/Win build fixes for breakage introduced in
1996         r28981.
1997
1998         * WebCore.pro:
1999         * WebCore.vcproj/WebCore.vcproj:
2000         * WebCoreSources.bkl:
2001
2002 2007-12-25  Alp Toker  <alp@atoker.com>
2003
2004         Win build fix for breakage introduced in r28981.
2005
2006         * WebCore.vcproj/WebCore.vcproj:
2007
2008 2007-12-25  Alp Toker  <alp@atoker.com>
2009
2010         Wx build fix for breakage introduced in r28981.
2011
2012         * WebCoreSources.bkl:
2013
2014 2007-12-25  Alp Toker  <alp@atoker.com>
2015
2016         GTK+/Qt build fix for breakage introduced in r28981.
2017
2018         * WebCore.pro:
2019
2020 2007-12-25  David Smith  <catfish.man@gmail.com> and Sam Weinig  <sam@webkit.org>
2021
2022         Reviewed by Oliver.
2023         
2024         - http://bugs.webkit.org/show_bug.cgi?id=16587
2025         Implement the most useful part of the W3C Selectors API.
2026
2027         * WebCore.xcodeproj/project.pbxproj:
2028         * css/CSSStyleSelector.h: Make Node a friend of CSSStyleSelector so it can use checkSelector()
2029         * dom/ChildNodeList.cpp:
2030         (WebCore::ChildNodeList::ChildNodeList): Change to being a DynamicNodeList
2031         * dom/ChildNodeList.h:
2032         * dom/ClassNodeList.cpp:
2033         (WebCore::ClassNodeList::ClassNodeList): Change to being a DynamicNodeList
2034         * dom/ClassNodeList.h:
2035         * dom/Document.idl: Add the new functions
2036         * dom/DynamicNodeList.cpp: Copied from WebCore/dom/NodeList.cpp.
2037         (WebCore::DynamicNodeList::DynamicNodeList): Rename NodeList to DynamicNodeList, to differentiate it from the new StaticNodeList
2038         (WebCore::DynamicNodeList::~DynamicNodeList):
2039         (WebCore::DynamicNodeList::recursiveLength):
2040         (WebCore::DynamicNodeList::itemForwardsFromCurrent):
2041         (WebCore::DynamicNodeList::itemBackwardsFromCurrent):
2042         (WebCore::DynamicNodeList::recursiveItem):
2043         (WebCore::DynamicNodeList::itemWithName):
2044         (WebCore::DynamicNodeList::rootNodeChildrenChanged):
2045         (WebCore::DynamicNodeList::Caches::Caches):
2046         (WebCore::DynamicNodeList::Caches::reset):
2047         * dom/DynamicNodeList.h: Copied from WebCore/dom/NodeList.h.
2048         (WebCore::DynamicNodeList::rootNodeAttributeChanged):
2049         * dom/Element.idl: Add the new functions
2050         * dom/NameNodeList.cpp: Change to being a DynamicNodeList
2051         (WebCore::NameNodeList::NameNodeList):
2052         * dom/NameNodeList.h:
2053         (WebCore::NameNodeList::rootNodeAttributeChanged):
2054         * dom/Node.cpp:
2055         (WebCore::TagNodeList::TagNodeList): Change to being a DynamicNodeList
2056         (WebCore::Node::registerDynamicNodeList):
2057         (WebCore::Node::unregisterDynamicNodeList):
2058         (WebCore::Node::getElementsByName):
2059         (WebCore::Node::getElementsByClassName):
2060         (WebCore::Node::querySelector): new
2061         (WebCore::Node::querySelectorAll): new
2062         * dom/Node.h:
2063         * dom/NodeList.cpp: Removed.
2064         * dom/NodeList.h: This is now an abstract superclass of DynamicNodeList and StaticNodeList
2065         (WebCore::NodeList::NodeList):
2066         (WebCore::NodeList::~NodeList):
2067         * dom/SelectorNodeList.cpp: Added.
2068         (WebCore::SelectorNodeList::SelectorNodeList): New StaticNodeList subclass that filters elements by CSS selector
2069         * dom/SelectorNodeList.h: Added.
2070         * dom/StaticNodeList.cpp: Added.
2071         (WebCore::StaticNodeList::length):
2072         (WebCore::StaticNodeList::item):
2073         (WebCore::StaticNodeList::itemWithName):
2074         * dom/StaticNodeList.h: Added.
2075         (WebCore::StaticNodeList::StaticNodeList):
2076         (WebCore::StaticNodeList::~StaticNodeList):
2077
2078 2007-12-25  Mark Rowe  <mrowe@apple.com>
2079
2080         Reviewed by Sam Weinig.
2081
2082         Implement a lock-free ThreadSafeShared for i386, x86_64, ppc and ppc64.
2083         http://bugs.webkit.org/show_bug.cgi?id=16596
2084
2085         This is a 1.7x as fast as the lock-based implementation on x86 for a single-threaded use
2086         of ThreadSafeShared but is closer to 280x as fast when there is heavy concurrent multi-threaded
2087         access to a single ThreadSafeShared object.
2088
2089         The atomic operations are based on those used by the Boost C++ library's shared_ptr implementation.
2090
2091         * platform/Threading.h:
2092         (WebCore::atomicIncrement):
2093         (WebCore::atomicDecrement):
2094         (WebCore::ThreadSafeShared::ThreadSafeShared):
2095         (WebCore::ThreadSafeShared::ref): Use lock-free operations if available.
2096         (WebCore::ThreadSafeShared::deref): Ditto.
2097         (WebCore::ThreadSafeShared::hasOneRef):
2098         (WebCore::ThreadSafeShared::refCount):
2099         (WebCore::ThreadSafeShared::isThreadSafe):
2100
2101 2007-12-24  Darin Adler  <darin@apple.com>
2102
2103         * platform/text/PlatformString.h: Removed now-incorrect comment.
2104         Added a comment about copy().
2105         * platform/text/StringImpl.h: Added a comment about copy().
2106
2107 2007-12-24  Darin Adler  <darin@apple.com>
2108
2109         Reviewed by Maciej.
2110
2111         - http://bugs.webkit.org/show_bug.cgi?id=16550
2112           make StringImpl immutable
2113
2114         I tried to keep the changes to a minimum. In some cases there is
2115         room for optimization -- I didn't try to add in the "single ref count"
2116         optimizations and there might be a tiny bit more string copying than
2117         we had before.
2118
2119         * WebCore.base.exp: Updated.
2120
2121         * dom/CharacterData.cpp:
2122         (WebCore::CharacterData::appendData): Changed to use String since
2123         StringImpl doesn't have mutating functions any more.
2124         (WebCore::CharacterData::insertData): Ditto.
2125         (WebCore::CharacterData::deleteData): Ditto.
2126         (WebCore::CharacterData::replaceData): Ditto.
2127         * dom/Text.cpp:
2128         (WebCore::Text::splitText): Changed to use substring instead of
2129         remove since StringImpl does't have mutating functions any more.
2130         * editing/CompositeEditCommand.cpp:
2131         (WebCore::CompositeEditCommand::deleteInsignificantText): Changed
2132         to use String instead of StringImpl so we can use remove.
2133
2134         * platform/text/PlatformString.h: Removed newUninitialized.
2135         Added append that takes a character pointer and length.
2136
2137         * platform/text/String.cpp:
2138         (WebCore::String::insert): Added an implementation that does not
2139         rely on an underlying StringImpl function.
2140         (WebCore::String::append): Ditto.
2141         (WebCore::String::truncate): Ditto.
2142         (WebCore::String::remove): Ditto.
2143         (WebCore::String::charactersWithNullTermination): Added an
2144         implementation that uses the new StringImpl null termination feature,
2145         which does not require modifying a string.
2146
2147         * platform/text/StringImpl.cpp:
2148         (WebCore::isSpace): Fix comment.
2149         (WebCore::StringImpl::StringImpl): Added a new constructor that makes
2150         a string with a trailing null character.
2151         (WebCore::StringImpl::substring): Marked const.
2152         (WebCore::StringImpl::replace): Marked const; had to add quite a few
2153         const_cast. Also rewrote one of these to work without modifying the
2154         existing string.
2155
2156         * platform/text/StringImpl.h: Fixed a mistake where the empty string had
2157         m_hasTerminatingNullCharacter uninitialized. Added a type and constructor
2158         for creating strings that have a trailing null character. Added a
2159         hasTerminatingNullCharacter function. Removed newUninitialized,
2160         charactersWithNullTermination, append, insert, truncate, and remove.
2161         Marked lots of other functions const.
2162
2163         * platform/text/TextCodecLatin1.cpp:
2164         (WebCore::TextCodecLatin1::decode): Rewrote to use a Vector instead of
2165         newUninitialized.
2166         * platform/text/TextCodecUTF16.cpp:
2167         (WebCore::TextCodecUTF16::decode): Ditto.
2168         * platform/text/TextCodecUserDefined.cpp:
2169         (WebCore::TextCodecUserDefined::decode): Ditto.
2170
2171         * rendering/RenderStyle.cpp:
2172         (WebCore::RenderStyle::setContent): Changed to use String since
2173         StringImpl doesn't have mutating functions any more.
2174
2175 2007-12-24  Alexey Proskuryakov  <ap@webkit.org>
2176
2177         Reviewed by Oliver.
2178
2179         Fix fast/events/arrow-keys-on-body.html, failing on Windows.
2180
2181         * platform/win/KeyEventWin.cpp:
2182         (WebCore::isKeypadEvent):
2183         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
2184         Use HIWORD() macro instead of shifting the value explicitly (no change in behavior).
2185
2186 2007-12-23  Alexey Proskuryakov  <ap@webkit.org>
2187
2188         Fix Debug and Release QTMovieWin bulds.
2189
2190         * WebCore.vcproj/QTMovieWin.vcproj:
2191         * WebCore.vcproj/debug.vsprops:
2192         * WebCore.vcproj/debug_internal.vsprops:
2193         * WebCore.vcproj/release.vsprops:
2194         Use LibraryConfigSuffix instead of WebKitConfigSuffix for pthreadVC2.
2195         Build release import lib into \lib, not \bin.
2196
2197 2007-12-23  Alp Toker  <alp@atoker.com>
2198
2199         Reviewed by Holger Freyther.
2200
2201         http://bugs.webkit.org/show_bug.cgi?id=15382
2202         [CAIRO] Canvas pattern support
2203
2204         http://bugs.webkit.org/show_bug.cgi?id=16577
2205         Merge Cairo enhancements from Apollo project
2206
2207         Add support for canvas patterns.
2208
2209         Make Image::nativeImageForCurrentFrame() public.
2210
2211         Fix some typos along the way.
2212
2213         The globalAlpha canvas fixes are not included in this patch as
2214         they're slightly more intrusive and may conflict conceptually with
2215         GraphicsContext::setAlpha().
2216
2217         * html/CanvasPattern.cpp:
2218         (WebCore::CanvasPattern::CanvasPattern):
2219         (WebCore::CanvasPattern::~CanvasPattern):
2220         (WebCore::CanvasPattern::createPattern):
2221         * html/CanvasPattern.h:
2222         (WebCore::CanvasPattern::platformImage):
2223         * html/CanvasRenderingContext2D.cpp:
2224         (WebCore::CanvasRenderingContext2D::setShadow):
2225         (WebCore::CanvasRenderingContext2D::applyShadow):
2226         (WebCore::CanvasRenderingContext2D::drawImage):
2227         (WebCore::CanvasRenderingContext2D::createPattern):
2228         (WebCore::CanvasRenderingContext2D::applyStrokePattern):
2229         (WebCore::CanvasRenderingContext2D::applyFillPattern):
2230         * platform/graphics/Image.h:
2231         (WebCore::Image::nativeImageForCurrentFrame):
2232
2233 2007-12-23  Kevin Ollivier  <kevino@theolliviers.com>
2234
2235         Reviewed by Eric Seidel.
2236
2237         Remove getWxBitmap as we have nativeImageForCurrentFrame now,
2238         and don't draw a border in fillRect.
2239
2240         * platform/graphics/BitmapImage.h:
2241         * platform/graphics/wx/GraphicsContextWx.cpp:
2242         (WebCore::GraphicsContext::fillRect):
2243         * platform/graphics/wx/ImageWx.cpp:
2244
2245 2007-12-23  Alp Toker  <alp@atoker.com>
2246
2247         Reviewed by Holger Freyther.
2248
2249         http://bugs.webkit.org/show_bug.cgi?id=16577
2250         Merge Cairo enhancements from Apollo project
2251
2252         This patch is based on initial merging work by Brent Fulgham. Adobe's
2253         code has been modified in a few places to better suit the existing
2254         coding style.
2255
2256         Implement more clipping and drawing functions.
2257
2258         Save and restore the fill rule manually when clipping.
2259
2260         Avoid image surface creation when the image buffer has height zero.
2261
2262         * platform/graphics/cairo/GraphicsContextCairo.cpp:
2263         (WebCore::GraphicsContext::clip):
2264         (WebCore::GraphicsContext::addInnerRoundedRectClip):
2265         (WebCore::GraphicsContext::addPath):
2266         (WebCore::GraphicsContext::clipOut):
2267         (WebCore::GraphicsContext::clipOutEllipseInRect):
2268         (WebCore::GraphicsContext::fillRoundedRect):
2269         * platform/graphics/cairo/ImageSourceCairo.cpp:
2270         (WebCore::ImageSource::createFrameAtIndex):
2271
2272 2007-12-23  Nikolas Zimmermann  <zimmermann@kde.org>
2273
2274         Reviewed by Mark.
2275
2276         Fix wrong placed ifdef - wrapping SVGDefsElement, instead of SVGDefinitionSrcElement in SVG_FONTS block.
2277
2278         * bindings/objc/DOM.mm:
2279         (WebCore::createElementClassMap):
2280
2281 2007-12-22  Alp Toker  <alp@atoker.com>
2282
2283         GTK+ build fix
2284
2285         GTK_TARGET_OTHER_APP is not available in older GTK+ versions. Pass
2286         empty target flags for now.
2287
2288         Check GTK+, not GLib versions, since they are different.
2289
2290         * platform/gtk/PasteboardGtk.cpp:
2291         (WebCore::Pasteboard::documentFragment):
2292
2293 2007-12-22  Luca Bruno  <lethalman88@gmail.com>
2294
2295         Reviewed by Alp Toker.
2296
2297         http://bugs.webkit.org/show_bug.cgi?id=16311
2298         [Gtk] Copy rich text to clipboard as text/plain and text/html.
2299
2300         Hook into the WebView to get the correct clipboard object on the
2301         appropriate display. This is necessary because GTK+ does not have
2302         global clipboards.
2303
2304         * WebCore.pro:
2305         * platform/Pasteboard.h:
2306         (WebCore::Pasteboard::setHelper): added for GTK
2307         (WebCore::Pasteboard::m_helper): private added for GTK
2308         * platform/gtk/PasteboardGtk.cpp:
2309         (WebCore::PasteboardSelectionData): added to support GTK selection data callback
2310         (WebCore::clipboard_get_contents_cb): added
2311         (WebCore::clipboard_clear_contents_cb): added
2312         (WebCore::Pasteboard::~Pasteboard):
2313         (WebCore::Pasteboard::setHelper):
2314         (WebCore::Pasteboard::writeSelection): copy rich text
2315         (WebCore::Pasteboard::documentFragment): 
2316         (WebCore::Pasteboard::plainText): 
2317         * platform/gtk/PasteboardHelper.h: Added.
2318
2319 2007-12-22  Nikolas Zimmermann  <zimmermann@kde.org>
2320
2321         Reviewed by Oliver.
2322
2323         Fixes: http://bugs.webkit.org/show_bug.cgi?id=15966 (Crash in SVGRootInlineBox::walkTextChunks() on mouse hover)
2324
2325         Add new isSVGRootInlineBox() function to InlineBox to be able to differentiate between RootInlineBox/SVGRootInlineBox.
2326         SVG assumed it's root inline box (for <text> elements) is always of type SVGRootInlineBox, which is not the case
2327         for HTML text in <foreignObject>. Text selection doesn't work so far as line box offsets are wrong - which is visible
2328         in Web Inspector.
2329
2330         * rendering/InlineBox.h:
2331         (WebCore::InlineBox::isSVGRootInlineBox):
2332         * rendering/SVGInlineTextBox.cpp:
2333         (WebCore::SVGInlineTextBox::svgRootInlineBox):
2334         (WebCore::SVGInlineTextBox::closestCharacterToPosition):
2335         (WebCore::SVGInlineTextBox::selectionRect):
2336         * rendering/SVGRenderTreeAsText.cpp:
2337         (WebCore::writeSVGInlineTextBox):
2338         * rendering/SVGRootInlineBox.h:
2339         (WebCore::SVGRootInlineBox::isSVGRootInlineBox):
2340
2341 2007-12-22  Alp Toker  <alp@atoker.com>
2342
2343         LOW_BANDWIDTH_DISPLAY build fix
2344
2345         Track recent KURL DeprecatedString changes.
2346
2347         * loader/FrameLoader.cpp:
2348         (WebCore::FrameLoader::switchOutLowBandwidthDisplayIfReady):
2349
2350 2007-12-22  Dan Bernstein  <mitz@apple.com>
2351
2352         - Windows build fix
2353
2354         * WebCore.vcproj/WebCore.vcproj:
2355
2356 2007-12-22  Xan Lopez  <xan@gnome.org>
2357
2358         Reviewed by Alp Toker.
2359
2360         Add missing return 0 to fix a compile warning.
2361
2362         * page/gtk/FrameGtk.cpp:
2363         (WebCore::Frame::createScriptInstanceForWidget):
2364
2365 2007-12-21  Antti Koivisto  <antti@apple.com>
2366
2367         Reviewed by Darin, Adam and Steve.
2368
2369         Add media playback support for Windows.
2370         
2371         The implementation uses low level QuickTime API. DLL is
2372         needed to work around CF use in both WebKit and QuickTime.
2373         
2374         This makes Windows build depend on the QuickTime SDK 
2375         
2376         http://developer.apple.com/quicktime/download/
2377         
2378         but not QuickTime itself.
2379         
2380         QTMovieWinTimer contains some copy code from SharedTimerWin. It
2381         is used in the QuickTime access DLL which can't use WebCore
2382         SharedTimer due to dependency problems.
2383
2384         * WebCore.vcproj/QTMovieWin.vcproj: Added.
2385         * WebCore.vcproj/WebCore.vcproj:
2386         * WebCore.vcproj/build-generated-files.sh:
2387         * html/HTMLMediaElement.cpp:
2388         (WebCore::HTMLMediaElement::setSrc):
2389         * platform/graphics/MediaPlayer.cpp:
2390         * platform/graphics/win/MediaPlayerPrivateQuickTimeWin.cpp: Added.
2391         (WebCore::MediaPlayerPrivate::MediaPlayerPrivate):
2392         (WebCore::MediaPlayerPrivate::~MediaPlayerPrivate):
2393         (WebCore::MediaPlayerPrivate::load):
2394         (WebCore::MediaPlayerPrivate::play):
2395         (WebCore::MediaPlayerPrivate::pause):
2396         (WebCore::MediaPlayerPrivate::duration):
2397         (WebCore::MediaPlayerPrivate::currentTime):
2398         (WebCore::MediaPlayerPrivate::seek):
2399         (WebCore::MediaPlayerPrivate::doSeek):
2400         (WebCore::MediaPlayerPrivate::cancelSeek):
2401         (WebCore::MediaPlayerPrivate::seekTimerFired):
2402         (WebCore::MediaPlayerPrivate::setEndTime):
2403         (WebCore::MediaPlayerPrivate::startEndPointTimerIfNeeded):
2404         (WebCore::MediaPlayerPrivate::endPointTimerFired):
2405         (WebCore::MediaPlayerPrivate::paused):
2406         (WebCore::MediaPlayerPrivate::seeking):
2407         (WebCore::MediaPlayerPrivate::naturalSize):
2408         (WebCore::MediaPlayerPrivate::hasVideo):
2409         (WebCore::MediaPlayerPrivate::setVolume):
2410         (WebCore::MediaPlayerPrivate::setMuted):
2411         (WebCore::MediaPlayerPrivate::setRate):
2412         (WebCore::MediaPlayerPrivate::dataRate):
2413         (WebCore::MediaPlayerPrivate::maxTimeBuffered):
2414         (WebCore::MediaPlayerPrivate::maxTimeSeekable):
2415         (WebCore::MediaPlayerPrivate::maxTimeLoaded):
2416         (WebCore::MediaPlayerPrivate::bytesLoaded):
2417         (WebCore::MediaPlayerPrivate::totalBytesKnown):
2418         (WebCore::MediaPlayerPrivate::totalBytes):
2419         (WebCore::MediaPlayerPrivate::cancelLoad):
2420         (WebCore::MediaPlayerPrivate::updateStates):
2421         (WebCore::MediaPlayerPrivate::didEnd):
2422         (WebCore::MediaPlayerPrivate::setRect):
2423         (WebCore::MediaPlayerPrivate::setVisible):
2424         (WebCore::MediaPlayerPrivate::paint):
2425         (WebCore::MediaPlayerPrivate::getSupportedTypes):
2426         (WebCore::MediaPlayerPrivate::movieEnded):
2427         (WebCore::MediaPlayerPrivate::movieLoadStateChanged):
2428         (WebCore::MediaPlayerPrivate::movieTimeChanged):
2429         (WebCore::MediaPlayerPrivate::movieNewImageAvailable):
2430         * platform/graphics/win/MediaPlayerPrivateQuickTimeWin.h: Added.
2431         (WebCore::MediaPlayerPrivate::networkState):
2432         (WebCore::MediaPlayerPrivate::readyState):
2433         * platform/graphics/win/QTMovieWin.cpp: Added.
2434         (updateTaskTimer):
2435         (QTMovieWinPrivate::QTMovieWinPrivate):
2436         (QTMovieWinPrivate::~QTMovieWinPrivate):
2437         (taskTimerFired):
2438         (QTMovieWinPrivate::startTask):
2439         (QTMovieWinPrivate::endTask):
2440         (QTMovieWinPrivate::task):
2441         (QTMovieWinPrivate::registerDrawingCallback):
2442         (QTMovieWinPrivate::drawingComplete):
2443         (QTMovieWinPrivate::createGWorld):
2444         (QTMovieWinPrivate::setSize):
2445         (QTMovieWinPrivate::deleteGWorld):
2446         (QTMovieWin::QTMovieWin):
2447         (QTMovieWin::~QTMovieWin):
2448         (QTMovieWin::play):
2449         (QTMovieWin::pause):
2450         (QTMovieWin::rate):
2451         (QTMovieWin::setRate):
2452         (QTMovieWin::duration):
2453         (QTMovieWin::currentTime):
2454         (QTMovieWin::setCurrentTime):
2455         (QTMovieWin::setVolume):
2456         (QTMovieWin::setMuted):
2457         (QTMovieWin::dataSize):
2458         (QTMovieWin::maxTimeLoaded):
2459         (QTMovieWin::loadState):
2460         (QTMovieWin::getNaturalSize):
2461         (QTMovieWin::setSize):
2462         (QTMovieWin::setVisible):
2463         (QTMovieWin::paint):
2464         (QTMovieWin::load):
2465         (movieDrawingCompleteProc):
2466         (initializeSupportedTypes):
2467         (QTMovieWin::countSupportedTypes):
2468         (QTMovieWin::getSupportedType):
2469         (QTMovieWin::initializeQuickTime):
2470         (DllMain):
2471         * platform/graphics/win/QTMovieWin.h: Added.
2472         * platform/graphics/win/QTMovieWinTimer.cpp: Added.
2473         (TimerWindowWndProc):
2474         (initializeOffScreenTimerWindow):
2475         (setSharedTimerFiredFunction):
2476         (timerFired):
2477         (setSharedTimerFireDelay):
2478         (stopSharedTimer):
2479         (setSharedTimerInstanceHandle):
2480         (systemTime):
2481         * platform/graphics/win/QTMovieWinTimer.h: Added.
2482         * rendering/RenderMedia.cpp:
2483         (WebCore::MediaControlPlayButtonElement::update):
2484
2485 2007-12-21  Brent Fulgham  <bfulgham@gmail.com>
2486
2487         Reviewed by Alp Toker.
2488
2489         http://bugs.webkit.org/show_bug.cgi?id=16558
2490         Cairo WebCore Rendering Fails on arc drawing
2491
2492         Fix for bug reported (and patched) by Apollo team in which
2493         arcs were draw in reverse (resulting in inverted images).
2494         Review of the source found that the 'clockwise' term was
2495         actually meant to mean 'anticlockwise' so the IDL and
2496         supporting classes have been changed to match this. 
2497
2498         * html/CanvasRenderingContext2D.cpp:
2499         (WebCore::CanvasRenderingContext2D::arc):
2500         * html/CanvasRenderingContext2D.idl:
2501         * platform/graphics/cairo/PathCairo.cpp:
2502         (WebCore::Path::addArc):
2503         (WebCore::Path::addEllipse):
2504         * platform/graphics/Path.h:
2505
2506 2007-12-21  Alexey Proskuryakov  <ap@webkit.org>
2507
2508         Reviewed by Oliver.
2509
2510         <rdar://problem/5629995> Incorrect display of Danish characters on web site.
2511
2512         Test: http/tests/xmlhttprequest/response-encoding.html
2513
2514         * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::didReceiveData):
2515         Default to UTF-8 for HTML, too. It's unfortunate that we have to use different
2516         rules for main content and XHR responses, but this matches both IE and Firefox.
2517
2518 2007-12-20  Jon Honeycutt  <jhoneycutt@apple.com>
2519
2520         Reviewed by Kevin Decker.
2521
2522         <rdar://problem/5655797> REGRESSION(304-306A10) Safari does not find
2523         shockwave plugin on freshly installed OS
2524
2525         Look for Director plugin in its native directory.
2526
2527         * plugins/win/PluginDatabaseWin.cpp:
2528         (WebCore::PluginDatabaseWin::getPluginsInPaths): The Director plugin
2529         doesn't start with "np," so special case its filename.
2530         (WebCore::addMacromediaPluginPaths): Add Flash and "Shockwave 10"
2531         directories to the plugin paths.
2532         (WebCore::PluginDatabaseWin::defaultPluginPaths):
2533
2534 2007-12-20  Peter Kasting  <zerodpx@gmail.com>
2535
2536         Reviewed by Alp Toker.
2537
2538         http://bugs.webkit.org/show_bug.cgi?id=16508
2539         Fix regression in GIFImageDecoder.cpp: "Haeberli hack" led to wrongly
2540         decoded transparent areas.
2541
2542         * platform/image-decoders/gif/GIFImageDecoder.cpp:
2543         (WebCore::GIFImageDecoder::haveDecodedRow):
2544         * platform/image-decoders/gif/GIFImageDecoder.h:
2545         * platform/image-decoders/gif/GIFImageReader.cpp:
2546         (GIFImageReader::output_row):
2547
2548 2007-12-20  Justin Garcia  <justin.garcia@apple.com>
2549
2550         Reviewed by Oliver Hunt.
2551
2552         <rdar://problem/5543472> GoogleDocs: Safari hangs when creating a list from a particular selection
2553         
2554         Still need to fix similar issues with the other operations that iterate 
2555         over selected paragraphs, like FormatBlock, Indent and Outdent (<rdar://problem/5658933>).
2556
2557         * editing/IndentOutdentCommand.cpp:
2558         (WebCore::IndentOutdentCommand::indentRegion): Added a FIXME.
2559         * editing/IndentOutdentCommand.h: Removed an unused function.
2560         * editing/InsertListCommand.cpp:
2561         (WebCore::InsertListCommand::modifyRange): 
2562         Renamed visibleStart to startOfSelection and visibleEnd to endOfSelection.
2563         Call the new selectionForParagraphIteration, which a) prevents operations like this
2564         one from being performed on a table that isn't fully selected (where the selection
2565         starts just before the table and ends inside it), and b) helps prevent paragraph
2566         iteration from going past the end of the selection.
2567         Call the new startOfNextParagraph, instead of using endOfParagraph(v).next(),
2568         since when v is in the last paragraph of the last cell of a table, that expression 
2569         will return the position after the table, not the start of the next paragraph.
2570         * editing/htmlediting.cpp:
2571         (WebCore::enclosingListChild): Don't go above a table cell, so that list operations
2572         take effect inside the table cell where they are performed.
2573         (WebCore::selectionForParagraphIteration): Added, see above.
2574         (WebCore::indexForVisiblePosition): Moved from IndentOutdentCommand.cpp.
2575         * editing/htmlediting.h:
2576         * editing/visible_units.cpp:
2577         (WebCore::startOfNextParagraph): Added, see above.
2578         * editing/visible_units.h:
2579         * editing/TextIterator.h:
2580         (WebCore::TextIterator::exitNode): Added a FIXME.
2581
2582 2007-12-20  Alp Toker  <alp@atoker.com>
2583
2584         Rubber-stamped by Maciej.
2585
2586         http://bugs.webkit.org/show_bug.cgi?id=16542
2587         [GTK] Text is missing with old Pango version
2588
2589         Back out commits r28880, r28876, r28865, r28864 which added Pango font
2590         selection support. These changes caused a regression where no text was
2591         displayed with older Pango versions.
2592
2593         * platform/graphics/gtk/FontCacheGtk.cpp:
2594         (WebCore::FontCache::fontExists):
2595         * platform/graphics/gtk/FontDataGtk.cpp:
2596         (WebCore::FontData::platformDestroy):
2597         (WebCore::FontData::containsCharacters):
2598         * platform/graphics/gtk/FontPlatformData.h:
2599         (WebCore::FontPlatformData::FontPlatformData):
2600         (WebCore::FontPlatformData::hash):
2601         * platform/graphics/gtk/FontPlatformDataGtk.cpp:
2602         (WebCore::FontPlatformData::FontPlatformData):
2603         (WebCore::FontPlatformData::init):
2604         (WebCore::FontPlatformData::~FontPlatformData):
2605         (WebCore::FontPlatformData::isFixedPitch):
2606         (WebCore::FontPlatformData::operator==):
2607         * platform/graphics/gtk/GlyphPageTreeNodeGtk.cpp:
2608         (WebCore::GlyphPage::fill):
2609
2610 2007-12-20  Timothy Hatcher  <timothy@apple.com>
2611
2612         Reviewed by Sam Weinig.
2613
2614         <rdar://problem/5604897> Double-clicking on JavaScript console error
2615         won't show the line where it occurred
2616
2617         Make the URLs clickable in the console, since double clicking is used for
2618         word text selection. Makes the word "line" localizable. Messages that don't
2619         have a URL will no longer print "undefined". Messages that have a line number
2620         less than or equal to 0 will no longer be printed.
2621
2622         * English.lproj/InspectorLocalizedStrings.js: Add "%s (line %d)".
2623         * page/inspector/ConsolePanel.js: Tweak how the DOM nodes are created
2624           and change the click handler to look for a link with the
2625           "console-message-url" class name.
2626         * page/inspector/SourcePanel.js: Call setupSourceFrameIfNeeded() if a
2627           line row is needed. 
2628         * page/inspector/inspector.css: Update the look of the URL in the console.
2629
2630 2007-12-20  Adam Barth  <hk9565@gmail.com>
2631
2632         Reviewed and landed by Sam Weinig.
2633
2634         http://bugs.webkit.org/show_bug.cgi?id=15313
2635         <rdar://problem/5514516>
2636
2637         The same-origin check was incorrect in two cases (both fixed in this
2638         patch):
2639
2640         A) If both the source and the target have set their document.domain
2641            to the same value, the protocol must also match in order for
2642            access to be allowed.  Without this requirement, the browser is
2643            vulnerable to the following attack:
2644
2645            1) Suppose there is an HTTPS site (www.example.com) that sets
2646               document.domain = "example.com".
2647            2) A network attacker redirects the browser to http://www.example.com/
2648               a) injects script to set document.domain = "example.com", and
2649               b) opens a window to https://www.example.com/
2650            3) Now the network attacker can inject script into the HTTPS page,
2651               stealing cookies and issuing banking transactions.
2652
2653         B) If only one of the source and target has set document.domain, then
2654            access should be denied.  With this behavior, the browser is
2655            vulnerable to the following attack:
2656
2657            1) Suppose http://foo.example.com/ opens an iframe to
2658               http://foo.example.com/frame.html that
2659               a) sets document.domain = "example.com", and
2660               b) opens an iframe to http://bar.example.com/
2661               This is a common usage of document.domain for cross-domain
2662               communication, see for example:
2663                 http://www.collinjackson.com/research/papers/fp801-jackson.pdf
2664            2) The inner-most iframe, which is from bar.example.com, sets
2665               document.domain = "example.com".
2666            3) Now the inner-most iframe can inject script into the middle
2667               iframe (say via document.write).  This bar.example.com script
2668               now has access to the outer-most frame (from foo.example.com).
2669
2670         Both these changes cause WebKit to match the behavior of Firefox 2 and
2671         IE6 in these cases.  This patch includes regression tests for both
2672         issues.
2673
2674         Internet Explorer 7 and Opera 9 are more strict in that they require
2675         the port numbers to match when both pages have document.domain set.
2676         Opera 9 allows access when only one page has set document.domain, but
2677         this is a security vulnerability.
2678
2679         Tests: http/tests/security/cross-frame-access-child-explicit-domain.html
2680                http/tests/security/cross-frame-access-parent-explicit-domain.html
2681
2682         * bindings/js/kjs_window.cpp:
2683         (KJS::createWindow):
2684         (KJS::Window::allowsAccessFrom):
2685         * dom/Document.cpp:
2686         (WebCore::Document::domain):
2687         (WebCore::Document::setDomain):
2688         (WebCore::Document::initSecurityOrigin):
2689         * dom/Document.h:
2690         (WebCore::Document::securityOrigin):
2691         * loader/FrameLoader.cpp:
2692         (WebCore::FrameLoader::begin):
2693         (WebCore::FrameLoader::checkCallImplicitClose):
2694         (WebCore::FrameLoader::shouldAllowNavigation):
2695         * platform/SecurityOrigin.cpp:
2696         (WebCore::SecurityOrigin::setForURL):
2697         (WebCore::SecurityOrigin::createForFrame):
2698         (WebCore::SecurityOrigin::canAccess):
2699         * platform/SecurityOrigin.h:
2700         (WebCore::SecurityOrigin::domain):
2701         * storage/Database.cpp:
2702         (WebCore::Database::openDatabase):
2703         (WebCore::Database::Database):
2704         (WebCore::Database::securityOriginData):
2705         * storage/Database.h:
2706         (WebCore::Database::databaseDebugName):
2707         * storage/DatabaseTracker.cpp:
2708         (WebCore::DatabaseTracker::canEstablishDatabase):
2709         * storage/SQLTransaction.cpp:
2710         (WebCore::SQLTransaction::postflightAndCommit):
2711         (WebCore::SQLTransaction::cleanupAfterTransactionErrorCallback):
2712
2713 2007-12-20  Rodney Dawes  <dobey@wayofthemonkey.com>
2714
2715         Reviewed by Darin Adler.
2716
2717         Define XP_UNIX when building with plugins on X11.
2718         Use new npruntime_internal.h instead of npruntime.h.
2719         http://bugs.webkit.org/show_bug.cgi?id=15669
2720
2721         * ForwardingHeaders/bindings/npruntime_internal.h
2722         * WebCore.pro:
2723         * html/HTMLPlugInElement.h:
2724
2725 2007-12-19  johnnyding.webkit  <johnnyding.webkit@gmail.com>
2726
2727         Reviewed by Alexey. Landed by Stephanie.
2728
2729         - fix http://bugs.webkit.org/show_bug.cgi?id=16179 | <rdar://problem/5619399>
2730           Any attribute name start with a unicode which like #xx00(x could be any hex number[0-9a-f]) will cause HTMLTokenizer parse error
2731           Actually any unicode characters which great than 255 in attribute name will cause Webkit parse the attribute name wrong. So after comparing 
2732           the same scenario in IE 6/7, FireFox 2/3, Opera, we should treat those characters as part of attribute name.
2733
2734
2735         * html/HTMLTokenizer.cpp:
2736         (WebCore::HTMLTokenizer::parseEntity): Handle Unicode Entity Name by using ASCII version of findEntity.
2737         (WebCore::HTMLTokenizer::parseTag): Let type of ptr match type of cBuffer.
2738         * html/HTMLTokenizer.h: Change type of cBuffer from char to UChar.
2739
2740 2007-12-20  Eric Seidel  <eric@webkit.org>
2741
2742         Reviewed by Nikolas Zimmermann.
2743
2744         WebKit claims to support SVG feature strings it shouldn't
2745         http://bugs.webkit.org/show_bug.cgi?id=15480
2746
2747         * dom/DOMImplementation.cpp:
2748         (WebCore::isSVG10Feature):
2749         (WebCore::isSVG11Feature):
2750
2751 2007-12-20  John Sullivan  <sullivan@apple.com>
2752
2753         Reviewed by Oliver and Geoff
2754         
2755         - fix <rdar://problem/5536858> Yellow highlight for find results is sometimes shorter 
2756           than white "hole" behind it
2757
2758         * rendering/RenderText.cpp:
2759         (WebCore::RenderText::addLineBoxRects):
2760         respect useSelectionHeight in all cases; we were only respecting it in one of the two cases
2761
2762 2007-12-20  Dan Bernstein  <mitz@apple.com>
2763
2764         Reviewed by Darin Adler.
2765
2766         - fix <rdar://problem/5656368> REGRESSION(3.0.4-ToT): Acid2 test fails to render anything
2767
2768         * platform/win/ScrollViewWin.cpp:
2769         (WebCore::ScrollView::maximumScroll): Changed back to return the maximum
2770         scroll offsets even if scrolling is not allowed, because navigation and
2771         scrollTo should still work.
2772         (WebCore::ScrollView::wheelEvent): Added early return if scrolling is
2773         not allowed.
2774
2775 2007-12-17  Tony Chang  <idealisms@gmail.com>
2776
2777         Reviewed by Darin.
2778
2779         - Fix for http://bugs.webkit.org/show_bug.cgi?id=16479
2780           text selection does not always begin at mouse down point
2781           Reset the m_dragSrc object on mouse down on all platforms.
2782
2783         Test: fast/text/reset-drag-on-mouse-down.html
2784
2785         * page/EventHandler.cpp:
2786         (WebCore::EventHandler::handleMousePressEvent):
2787         * page/mac/EventHandlerMac.mm:
2788         (WebCore::EventHandler::mouseDown):
2789
2790 2007-12-19  Geoffrey Garen  <ggaren@apple.com>
2791
2792         Reviewed by Oliver Hunt.
2793
2794         Build support:
2795         * ForwardingHeaders/kjs/SymbolTable.h: Added.
2796         * ForwardingHeaders/wtf/VectorTraits.h: Added.
2797
2798         * bindings/js/JSDOMWindowCustom.cpp:
2799         (WebCore::JSDOMWindow::customGetOwnPropertySlot): Replaced use of
2800         getDirectLocation with getOwnPropertySlot. getDirectLocation is no
2801         longer valid, since global declarations are not stored in the property
2802         map.
2803
2804         (WebCore::JSDOMWindow::customPut): Replaced use of JSObject::put with
2805         JSGlobalObject::put. JSObject::put is no longer valid, since global
2806         declarations are not stored in the property map.
2807
2808         * bindings/js/kjs_window.cpp: Replaced JSObject:: calls with Base::
2809         calls, since JSObject is not our base class. This was always a bug, but
2810         the bug is even more apparent after some of my changes.
2811
2812         (KJS::Window::clear): Removed call to clearProperties because
2813         JSGlobalObject::reset takes care of that now.
2814
2815         * history/CachedPage.cpp:
2816         * history/CachedPage.h: Added support for saving a symbol table and
2817         localStorage to the page cache, and restoring it.
2818
2819 2007-12-19  Dan Bernstein  <mitz@apple.com>
2820
2821         Reviewed by Darin Adler and Dave Hyatt.
2822
2823         - Substitute the user's preferred standard font for an unknown primary
2824           font before falling back on the platform's last resort font
2825
2826         Cannot be tested in DumpRenderTree because it sets the standard font to
2827         Times, which is also the hard-coded last resort font on Mac.
2828
2829         * css/CSSFontSelector.cpp:
2830         (WebCore::CSSFontSelector::getFontData): Changed the early bail out
2831         condition to allow getting generic font families from settings even if
2832         there are not @font-face rules. Fixed a typo that mapped fantasy to
2833         cursive. Added a mapping from -webkit-standard to the standard family.
2834         * css/CSSStyleSelector.cpp:
2835         (WebCore::CSSStyleSelector::CSSStyleSelector): Changed to always create
2836         a font selector.
2837         (WebCore::CSSRuleSet::addRulesFromSheet):
2838         (WebCore::CSSStyleSelector::applyProperty): Changed to always use the
2839         font selector.
2840         * css/CSSStyleSelector.h:
2841         (WebCore::CSSStyleSelector::fontSelector):
2842         * platform/graphics/FontCache.cpp:
2843         (WebCore::FontCache::getFontData): Try the user's preferred standard
2844         font before the platform's last resort font.
2845
2846 2007-12-19  Sven Herzberg  <sven@imendio.com>
2847
2848         Reviewed by Alp Toker.
2849
2850         Scaled font destruction takes place in FontData::platformDestroy(). No
2851         need to do it in FontPlatformData::~FontPlatformData().
2852
2853         Destroying platform data in platformDestroy() is a convention we
2854         borrow from the Mac and Win ports.
2855
2856         * platform/graphics/gtk/FontPlatformDataGtk.cpp:
2857
2858 2007-12-19  Alice Liu  <alice.liu@apple.com>
2859
2860         build fix (Windows)
2861
2862         Changed uint to unsigned int.  uint caused Windows build breakage
2863
2864         * page/Page.cpp:
2865         (WebCore::Page::markAllMatchesForText):
2866         * page/Page.h:
2867
2868 2007-12-19  Christian Dywan  <christian@twotoasts.de> 
2869
2870         Reviewed by Alp Toker.
2871
2872         http://bugs.webkit.org/show_bug.cgi?id=16222
2873         [GTK] Implement inline search and highlighting of matching strings.
2874
2875         Implement search and highlighting logic directly in WebCore.
2876
2877         * page/Page.cpp:
2878         (WebCore::incrementFrame):
2879         (WebCore::Page::findString):
2880         (WebCore::Page::markAllMatchesForText):
2881         (WebCore::Page::unmarkAllTextMatches):
2882         * page/Page.h:
2883
2884 2007-12-19  Geoffrey Garen  <ggaren@apple.com>
2885
2886         Reviewed by Sam Weinig, Dan Bernstein.
2887
2888         Tiger build fix: restored some graphics code still needed on Tiger.
2889
2890         * platform/graphics/GraphicsTypes.h:
2891         * platform/graphics/cg/GraphicsContextCG.cpp:
2892         * platform/graphics/mac/GraphicsContextMac.mm:
2893         (WebCore::GraphicsContext::setCompositeOperation):
2894
2895 2007-12-19  Alp Toker  <alp@atoker.com>
2896
2897         Build fix for Pango < 1.18.0 breakage introduced in r28864. Use Fc and
2898         the Pango backend API in these cases.
2899
2900         * platform/graphics/gtk/FontPlatformDataGtk.cpp:
2901         (WebCore::FontPlatformData::FontPlatformData):
2902         (WebCore::FontPlatformData::~FontPlatformData):
2903
2904 2007-12-19  Alice Liu  <alice.liu@apple.com>
2905
2906         Reviewed by Darin.
2907
2908         Fixed <rdar://problem/5592485> Safari crashed trying to get a motorcycle insurance quote
2909         on Geico.com WebCore::Document::inPageCache()
2910
2911         Calling Node::willRemove on the focusedNode would immediately tell the document to remove
2912         the focused node, and trigger JS events.  This means that the document is mutated while
2913         the engine is trying to tell all child nodes that it's about to removed.  To avoid
2914         crashing, we need to hold off on mutating the document until node traversal is finished.
2915
2916         * dom/ContainerNode.cpp:
2917         (WebCore::ContainerNode::removeChild):
2918         (WebCore::ContainerNode::removeChildren):
2919         * dom/Node.cpp:
2920         * dom/Node.h:
2921         (WebCore::Node::willRemove):
2922         * loader/FrameLoader.cpp:
2923         (WebCore::FrameLoader::clear):
2924
2925 2007-12-19  Andre Boule  <aboule@apple.com>
2926
2927         Reviewed by Dan Bernstein.
2928
2929         Test: fast/canvas/canvas-composite.html
2930
2931         Fix for:
2932         <rdar://problem/5640059> GraphicsContext::setCompositeOperation should use CGContextSetBlendMode
2933
2934         This fix makes setCompositeOperation consistent across all platforms that use CG.
2935
2936         The following compositing modes don't pass however that is covered by another bug:
2937         source-in
2938         source-out
2939         destination-in
2940         destination-atop
2941         copy
2942         <rdar://problem/5651783> Some canvas tag compositing modes don't render correctly
2943
2944         * platform/graphics/GraphicsTypes.h:
2945         * platform/graphics/cg/GraphicsContextCG.cpp:
2946         (WebCore::GraphicsContext::setCompositeOperation):
2947         * platform/graphics/mac/GraphicsContextMac.mm:
2948         * platform/win/GraphicsContextWin.cpp:
2949
2950 2007-12-19  Dan Bernstein  <mitz@apple.com>
2951
2952         Reviewed by Dave Hyatt.
2953
2954         - fix <rdar://problem/5650045> REGRESSION: major layout problems in svn r28754 WebKit on Vox.com page
2955
2956         Test: fast/dynamic/subtree-boundary-percent-height.html
2957
2958         * rendering/RenderObject.cpp:
2959         (WebCore::objectIsRelayoutBoundary): Do not allow overflows with
2960         percent heights because sometimes they compute to 'auto'.
2961
2962 2007-12-19  Sam Weinig  <sam@webkit.org>
2963
2964         Reviewed by Maciej.
2965
2966         http://bugs.webkit.org/show_bug.cgi?id=16511
2967         Speed up ClassNodeList and NamedNodeList by using the caching mechanism employed by ChildNodeList.
2968         - This give a ~2.15x speedup on the native test @ http://ejohn.org/apps/classname/
2969
2970         * dom/ChildNodeList.cpp: Use the caching NodeList constructor to turn on caching.
2971         (WebCore::ChildNodeList::ChildNodeList):
2972         * dom/ClassNodeList.cpp:
2973         (WebCore::ClassNodeList::ClassNodeList):
2974         * dom/ClassNodeList.h:
2975
2976         Move getElementsByName and getElementsByClassName to Node so they
2977         can use easily employ the caching already used by ChildNodeLists.  In the case of 
2978         getElementsByClassName, this reduces code duplication in Element as well
2979         * dom/Document.cpp:
2980         * dom/Document.h:
2981
2982         Move getElementsByClassName to Node.
2983         * dom/Element.cpp:
2984         * dom/Element.h:
2985
2986         * dom/NameNodeList.cpp: Use the caching NodeList constructor to turn on caching.
2987         (WebCore::NameNodeList::NameNodeList):
2988         (WebCore::NameNodeList::item):
2989         * dom/NameNodeList.h:
2990
2991         Add maps of caches for ClassNodeLists and NameNodeList to NodeListsNodeData.
2992         * dom/Node.cpp:
2993         (WebCore::TagNodeList::TagNodeList):
2994         (WebCore::Node::Node):
2995         (WebCore::Node::~Node):
2996         (WebCore::Node::childNodes):
2997         (WebCore::Node::registerNodeList):
2998         (WebCore::Node::getElementsByName):
2999         (WebCore::Node::getElementsByClassName):
3000         * dom/Node.h: Make m_nodeLists an OwnPtr.  Moved getElementsByName and getElementsByClassName here
3001
3002         Allow subclasses to choose whether they want to receive the notifications using a new bit.
3003         * dom/NodeList.cpp:
3004         (WebCore::NodeList::NodeList):
3005         * dom/NodeList.h:
3006         (WebCore::NodeList::needsNotifications):
3007
3008 2007-12-19  Dave Hyatt  <hyatt@apple.com>
3009
3010         Add support for GDI text rendering to WebKit.
3011       
3012         Reviewed by mitz
3013         
3014         * css/CSSStyleSelector.cpp:
3015         (WebCore::CSSStyleSelector::applyProperty):
3016         * dom/Document.cpp:
3017         (WebCore::Document::recalcStyle):
3018         * page/Settings.cpp:
3019         (WebCore::Settings::setFontRenderingMode):
3020         (WebCore::Settings::fontRenderingMode):
3021         * page/Settings.h:
3022         * platform/graphics/Font.h:
3023         (WebCore::Font::renderingMode):
3024         * platform/graphics/FontCache.cpp:
3025         (WebCore::FontPlatformDataCacheKey::FontPlatformDataCacheKey):
3026         (WebCore::FontPlatformDataCacheKey::operator==):
3027         (WebCore::computeHash):
3028         (WebCore::FontCache::getCachedFontPlatformData):
3029         * platform/graphics/FontDescription.h:
3030         (WebCore::):
3031         (WebCore::FontDescription::FontDescription):
3032         (WebCore::FontDescription::renderingMode):
3033         (WebCore::FontDescription::setRenderingMode):
3034         (WebCore::FontDescription::operator==):
3035         * platform/graphics/GraphicsContext.h:
3036         * platform/graphics/win/FontCacheWin.cpp:
3037         (WebCore::FontCache::fontExists):
3038         (WebCore::FontCache::createFontPlatformData):
3039         * platform/graphics/win/FontDataWin.cpp:
3040         (WebCore::FontData::platformInit):
3041         (WebCore::FontData::smallCapsFontData):
3042         (WebCore::FontData::containsCharacters):
3043         (WebCore::FontData::determinePitch):
3044         (WebCore::FontData::platformWidthForGlyph):
3045         * platform/graphics/win/FontPlatformData.h:
3046         (WebCore::FontPlatformData::FontPlatformData):
3047         (WebCore::FontPlatformData::useGDI):
3048         (WebCore::FontPlatformData::operator==):
3049         * platform/graphics/win/FontPlatformDataWin.cpp:
3050         (WebCore::FontPlatformData::FontPlatformData):
3051         * platform/graphics/win/FontWin.cpp:
3052         (WebCore::Font::drawGlyphs):
3053         * platform/graphics/win/IconWin.cpp:
3054         (WebCore::Icon::paint):
3055         * platform/win/GraphicsContextWin.cpp:
3056         (WebCore::GraphicsContext::getWindowsContext):
3057         (WebCore::GraphicsContext::releaseWindowsContext):
3058         * platform/win/UniscribeController.cpp:
3059         (WebCore::UniscribeController::shapeAndPlaceItem):
3060         * platform/win/UniscribeController.h:
3061         * plugins/win/PluginViewWin.cpp:
3062         (WebCore::PluginViewWin::paint):
3063
3064 2007-12-19  Sven Herzberg  <sven@imendio.com>
3065
3066         Reviewed by Alp Toker.
3067
3068         Replace the fontconfig/freetype based font management with a pango
3069         based one. Fixes:
3070         http://bugs.webkit.org/show_bug.cgi?id=15229
3071
3072         * platform/gtk/FontDataGtk.cpp (FontData::platformDestroy()): updated
3073         the platform specific destroy code
3074         (FontData::containsCharacters()): implemented font coverage with pango
3075         * platform/gtk/FontPlatformData.h: replaced fontconfig specific
3076         members with pango-specific ones
3077         * platform/gtk/FontPlatformDataGtk.cpp: added static members for the
3078         FontPlatformData class
3079         (FontPlatformData::FontPlatformData()): implemented the font-matching
3080         with a PangoFontDescription instead of an FcPattern; initialize the
3081         scaled font by using the API for PangoCairoFont
3082         (FontPlatformData::init()): initialize the PangoFontMap and set up a
3083         hash table to translate the font family name into a font family
3084         (FontPlatformData::isFixedPitch()): implemented by querying the
3085         PangoFontFamily
3086         (FontPlatformData::operator==): compare the FontPlatformData by
3087         comparing the font pointers or the described fonts
3088         * platform/gtk/GlyphPageTreeNodeGtk.cpp (pango_font_get_glyph()):
3089         added a function to query a glyph from a PangoFont
3090         (GlyphPage::fill()): implemented the fill function with Pango instead
3091         of fontconfig/freetype
3092
3093 2007-12-19  Alp Toker  <alp@atoker.com>
3094
3095         Reviewed by Holger Freyther.
3096
3097         Improve graphics operator approximations
3098         
3099         These changes match Cairo's own CG approximations.
3100
3101         * platform/graphics/cairo/GraphicsContextCairo.cpp:
3102         (WebCore::toCairoOperator):
3103
3104 2007-12-19  Alp Toker  <alp@atoker.com>
3105
3106         Reviewed by Holger Freyther.
3107
3108         Check the bounding box before doing a full hit test
3109
3110         * platform/graphics/cairo/PathCairo.cpp:
3111         (WebCore::Path::contains):
3112
3113 2007-12-18  Sam Weinig  <sam@webkit.org>
3114
3115         Reviewed by Geoff.
3116
3117         Fix for <rdar://problem/5646478>
3118         REGRESSION: fast/events/event-view-toString fails on Leopard
3119
3120         This fixes an issue where we were incorrectly setting the lastInPrototypeChain
3121         for the JSDOMWindow (the global object) before a call to setPrototype overwrote
3122         it. This fixes it by passing the prototype up the constructor chain so that it
3123         is set before any calls can be made.
3124
3125         * bindings/js/kjs_window.cpp:
3126         (KJS::Window::Window):
3127         * bindings/js/kjs_window.h:
3128         * bindings/scripts/CodeGeneratorJS.pm:
3129
3130 2007-12-18  Beth Dakin  <bdakin@apple.com>
3131
3132         Reviewed by Oliver.
3133
3134         Fix for <rdar://problem/5616982> SVGs with width and height 100% 
3135         fail to render when used as <img> or CSS image (16167)
3136
3137         This final part of the work fixes the <img> tag.
3138
3139         This is the real fix. 
3140         * rendering/RenderImage.cpp:
3141         (WebCore::RenderImage::calcReplacedWidth): Set the container size 
3142         on the image. Setting the container size only actually sticks if 
3143         the values are non-zero, so if the container size really was set, 
3144         use the imageSize that is calculated using the container size. If 
3145         it did not stick but the image does have relative width (meaning 
3146         that the container size is 0), set the width to 0 by hand. We want 
3147         to avoid setting the width before we have a container size or we 
3148         will end up incorrectly using the default size of 300x150.
3149         (WebCore::RenderImage::calcReplacedHeight): Same as above, but for 
3150         height.
3151
3152         A few more pieces of information have to be exposed through cached 
3153         image to make this happen.
3154         * loader/CachedImage.cpp:
3155         (WebCore::CachedImage::usesImageContainerSize): As mentioned above, 
3156         when setContainerSize() is called, the container size is only 
3157         actually set if the values are non-zero. This call tells you if it 
3158         was set.
3159         (WebCore::CachedImage::imageHasRelativeWidth):
3160         (WebCore::CachedImage::imageHasRelativeHeight):
3161         * loader/CachedImage.h:
3162         * platform/graphics/Image.h:
3163         (WebCore::Image::usesContainerSize):
3164         * svg/graphics/SVGImage.cpp:
3165         (WebCore::SVGImage::usesContainerSize):
3166         * svg/graphics/SVGImage.h:
3167
3168 2007-12-18  Mark Rowe  <mrowe@apple.com>
3169
3170         Rubber-stamped by Maciej Stachowiak.
3171
3172         Remove outdated and non-functioning project files for the Apollo port.
3173
3174         * WebCore.apolloproj: Removed.
3175
3176 2007-12-18  Steve Falkenburg  <sfalken@apple.com>
3177
3178         <rdar://problem/5649911> REGRESSION (304-306A9): Typing 'p' in popup menu for type-to-select brings up Safari Help
3179         
3180         Need to translate the char back into a key code for posting our WM_KEYDOWN.
3181         
3182         Reviewed by Ada.
3183
3184         * platform/win/PopupMenuWin.cpp:
3185         (WebCore::PopupWndProc):
3186
3187 2007-12-18  Steve Falkenburg  <sfalken@apple.com>
3188
3189         <rdar://problem/5651534> REGRESSION(r28764-r28765): GDI leak drawing text when no appropriate font is available
3190         
3191         Our captured metafile from Uniscribe may contain multiple calls to CreateFontIndirect.
3192         Only create a font with the last one.
3193         
3194         Reviewed by Mitz, Darin.
3195
3196         * platform/graphics/win/FontCacheWin.cpp:
3197         (WebCore::metaFileEnumProc):
3198         (WebCore::FontCache::getFontDataForCharacters):
3199
3200 2007-12-17  Brent Fulgham  <bfulgham@gmail.com>
3201
3202         Reviewed by Darin.
3203
3204         http://bugs.webkit.org/show_bug.cgi?id=16464
3205         Modify WebCore to use win32 thread primitives
3206
3207         Updates to support native windows threading primitives
3208         rather than pthreads emulation library.
3209
3210         * WebCore.vcproj/WebCore.vcproj:
3211         * config.h:
3212         * platform/Threading.h:
3213         * platform/win/MutexWin.cpp: Added.
3214         (WebCore::Mutex::Mutex):
3215         (WebCore::Mutex::~Mutex):
3216         (WebCore::Mutex::lock):
3217         (WebCore::Mutex::tryLock):
3218         (WebCore::Mutex::unlock):
3219         * platform/win/ThreadConditionWin.cpp: Added.
3220         (WebCore::ThreadCondition::ThreadCondition):
3221         (WebCore::ThreadCondition::~ThreadCondition):
3222         (WebCore::ThreadCondition::wait):
3223         (WebCore::ThreadCondition::signal):
3224         (WebCore::ThreadCondition::broadcast):
3225         * platform/win/ThreadingWin.cpp:
3226         (WebCore::threadMapMutex):
3227         (WebCore::threadMap):
3228         (WebCore::storeThreadHandleByIdentifier):
3229         (WebCore::identifierByThreadHandle):
3230         (WebCore::threadHandleForIdentifier):
3231         (WebCore::clearThreadHandleForIdentifier):
3232         (WebCore::createThread):
3233         (WebCore::waitForThreadCompletion):
3234         (WebCore::detachThread):
3235         (WebCore::currentThread):
3236
3237 2007-12-18  Rodney Dawes  <dobey@wayofthemonkey.com>
3238
3239         Reviewed by Darin Adler.
3240
3241         Handle EINTR when set by select() and try the select() again
3242         http://bugs.webkit.org/show_bug.cgi?id=16071
3243
3244         * platform/network/curl/ResourceHandleManager.cpp:
3245         (ResourceHandleManager::downloadTimerCallback):
3246
3247 2007-12-18  Dan Bernstein  <mitz@apple.com>
3248
3249         Reviewed by Dave Hyatt.
3250
3251         - avoid the simplified Chinese font linking code for characters that are
3252           not in any Windows code page
3253
3254         * platform/graphics/win/FontCacheWin.cpp:
3255         (WebCore::FontCache::getFontDataForCharacters):
3256
3257 2007-12-18  Brady Eidson <beidson@apple.com>
3258
3259         Reviewed by Adele
3260
3261         <rdar://problem/5525770> REGRESSION: HTTP Auth protected favicon request results in a password sheet
3262
3263         Some http-auth protected sites have the main resource(s) unprotected, but many subresources are
3264         protected by authentication.  Occasionally one can view the main page of a site but the favicon
3265         is behind the iron curtain - in these cases, we should *not* prompt for a username and password
3266         solely for the favicon.
3267
3268         * loader/ResourceLoader.h: Make didReceiveAuthenticationChallenge virtual
3269
3270         * loader/SubresourceLoader.cpp:
3271         (WebCore::SubresourceLoader::didReceiveAuthenticationChallenge): Now that this method
3272           is virtual from ResourceLoader, SubresourceLoader can override.  First call to the 
3273           SubresourceLoaderClient.  If they cancel the resource load, return early. Otherwise, let
3274           ResourceLoader work its magic (resulting in the auth sheet coming down)
3275         * loader/SubresourceLoader.h:
3276
3277         * loader/SubresourceLoaderClient.h:
3278         (WebCore::SubresourceLoaderClient::didReceiveAuthenticationChallenge):
3279
3280         * loader/icon/IconLoader.cpp:
3281         (WebCore::IconLoader::didReceiveAuthenticationChallenge): Cancel the resource load, since we should
3282           never prompt the user for credentials just for a favicon.
3283         * loader/icon/IconLoader.h:
3284
3285 2007-12-18  John Sullivan  <sullivan@apple.com>
3286
3287         Reviewed by Brady
3288         
3289         - fixed <rdar://problem/5652380> Initial prompt shows "" for databases with no user-visible name
3290
3291         * storage/DatabaseTracker.cpp:
3292         (WebCore::DatabaseTracker::canEstablishDatabase):
3293         pass "name" instead of "displayName" if there's no displayName
3294
3295 2007-12-17  Dan Bernstein  <mitz@apple.com>
3296
3297         Reviewed by Maciej Stachowiak.
3298
3299         - restore ButtonFace and ThreeDFace to their previous values for non-Mac
3300           platforms. The Mac port also uses the same values for now instead
3301           of NSColor-based ones.
3302
3303         * rendering/RenderTheme.cpp:
3304         (WebCore::RenderTheme::systemColor):
3305
3306 2007-12-17  Rodney Dawes  <dobey@wayofthemonkey.com>
3307
3308         Reviewed by Maciej Stachowiak.
3309
3310         Define WTF_USE_NPOBJECT and WTF_USE_JAVASCRIPTCORE_BINDINGS for GTK+
3311         Add required Frame::createScriptInstanceForWidget to FrameGtk
3312
3313         * config.h:
3314         * page/gtk/FrameGtk.cpp (Frame::createScriptInstanceForWidget):
3315
3316 2007-12-17  Alice Liu  <alice.liu@apple.com>
3317
3318         Reviewed by Adam.
3319
3320         Fixed <rdar://5566435> window with no scrollbars can be scrolled
3321
3322         * platform/win/ScrollViewWin.cpp:
3323         (WebCore::ScrollView::maximumScroll):
3324         corrected maximumScroll() to account for scrolling not allowed.
3325         (WebCore::ScrollView::wheelEvent):
3326
3327 2007-12-14  Juan A. Suarez Romero  <jasuarez@igalia.com>
3328
3329         Reviewed by Alp Toker.
3330
3331         http://bugs.webkit.org/show_bug.cgi?id=16042
3332         [GTK] Eliminate webkit_init()
3333
3334         Move webkit initialization to WebView class init.
3335
3336         * WebCore.pro:
3337
3338 2007-12-17  Jon Honeycutt  <jhoneycutt@apple.com>
3339
3340         Reviewed by Darin.
3341
3342         <rdar://problem/5651291> REGRESSION: Flash content doesn't display
3343         (www.adobe.com)
3344
3345         We were passing NPEvent** instead of NPEvent* to NPP_HandleEvent.
3346
3347         * plugins/win/PluginViewWin.cpp:
3348         (WebCore::PluginViewWin::dispatchNPEvent): Changed to take NPEvent&, not
3349         NPEvent*
3350         (WebCore::PluginViewWin::paint): Pass NPEvent, not NPEvent*
3351         (WebCore::PluginViewWin::handleKeyboardEvent): same
3352         (WebCore::PluginViewWin::handleMouseEvent): same
3353         * plugins/win/PluginViewWin.h:
3354
3355 2007-12-17  Alexey Proskuryakov  <ap@webkit.org>
3356
3357         Reviewed by Darin.
3358
3359         Live to the promise of never making AppKit special character codes visible via DOM.
3360
3361         Test: fast/events/arrow-keys-on-body.html
3362
3363         * page/EventHandler.cpp:
3364         (WebCore::EventHandler::keyEvent): Check for empty keypress characters after disambiguation,
3365         to let quirks-aware code strip special charactrers.
3366         * platform/mac/KeyEventMac.mm:
3367         (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent): If not in keyboard event quirks
3368         mode, remove the text if it's a special character.
3369
3370 2007-12-17  Mark Rowe  <mrowe@apple.com>
3371
3372         Reviewed by Darin Adler.
3373
3374         Fix incorrect array size and incorrect array index in convertNSColorToColor.
3375
3376         * rendering/RenderThemeMac.mm:
3377         (WebCore::convertNSColorToColor):
3378
3379 2007-12-17  Darin Adler  <darin@apple.com>
3380
3381         Reviewed by Mark Rowe.
3382
3383         - fix http://bugs.webkit.org/show_bug.cgi?id=16468
3384           REGRESSION(r28781): Crash running storage/transaction_callback_exception_crash.html
3385
3386         * storage/DatabaseThread.cpp:
3387         (WebCore::DatabaseThread::dispatchNextTaskIdentifier): Use a RefPtr for the database
3388         because there's no guarantee it won't lose its last reference otherwise.
3389
3390 2007-12-17  Dan Bernstein  <mitz@apple.com>
3391
3392         Reviewed by Maciej Stachowiak.
3393
3394         - fix <rdar://problem/5333260> Some Chinese characters in Text Encoding menu are bold, others are not
3395           and <rdar://problem/5280188> Chinese text looks worse on Safari for Windows cf. Safari for Mac
3396
3397         * platform/graphics/win/FontCacheWin.cpp:
3398         (WebCore::FontCache::getFontDataForCharacters): To ensure that font
3399         linking gives consistent results for characters that are exclusive to
3400         the simplified Chinese code page and characters that belong to that
3401         code page and other code pages, always ask to map to simplified Chinese
3402         alone first.
3403
3404 2007-12-17  Christian Dywan  <christian@twotoasts.de>
3405
3406         Reviewed by Alp Toker.
3407
3408         http://bugs.webkit.org/show_bug.cgi?id=16378
3409         Implement Icon for Gtk
3410
3411         Icon provides a GdkPixbuf containing a themed icon.
3412         The icon theme is probed for an icon name according to the
3413         Icon Naming Specification or conventional Gnome icon names respectively.
3414
3415         See http://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html
3416
3417         * platform/graphics/Icon.h:
3418         * platform/graphics/gtk/IconGtk.cpp:
3419         (WebCore::Icon::~Icon):
3420         (WebCore::lookupIconName):
3421         (WebCore::Icon::newIconForFile):
3422         (WebCore::Icon::paint):
3423
3424 2007-12-16  Sam Weinig  <sam@webkit.org>
3425
3426         Reviewed by Mitz.
3427
3428         Fix for http://bugs.webkit.org/show_bug.cgi?id=16466
3429         Move the JS Location object to its own file
3430
3431         - Move Location into its own file and rename it JSLocation.
3432
3433         * DerivedSources.make:
3434         * WebCore.pro:
3435         * WebCore.vcproj/WebCore.vcproj:
3436         * WebCore.xcodeproj/project.pbxproj:
3437         * WebCoreSources.bkl:
3438         * bindings/js/JSDocumentCustom.cpp:
3439         * bindings/js/JSLocation.cpp: Copied from WebCore/bindings/js/kjs_window.cpp.
3440         (WebCore::):
3441         (WebCore::JSLocation::JSLocation):
3442         (WebCore::JSLocation::getValueProperty):
3443         (WebCore::JSLocation::getOwnPropertySlot):
3444         (WebCore::JSLocation::put):
3445         (WebCore::JSLocationProtoFuncReplace::callAsFunction):
3446         (WebCore::JSLocationProtoFuncReload::callAsFunction):
3447         (WebCore::JSLocationProtoFuncAssign::callAsFunction):
3448         (WebCore::JSLocationProtoFuncToString::callAsFunction):
3449         * bindings/js/JSLocation.h: Copied from WebCore/bindings/js/kjs_window.h.
3450         (WebCore::JSLocation::):
3451         (WebCore::JSLocation::frame):
3452         (WebCore::JSLocation::classInfo):
3453         * bindings/js/kjs_window.cpp:
3454         (KJS::Window::location):
3455         * bindings/js/kjs_window.h:
3456         * history/CachedPage.cpp:
3457
3458 2007-12-16  Dan Bernstein  <mitz@apple.com>
3459
3460         Reviewed by Sam Weinig.
3461
3462         - make 'cursor: copy' and 'cursor: none' work.
3463
3464         Already covered by manual-tests/cursor.html
3465
3466         * rendering/RenderStyle.h: Increase the _cursor_style field to 6 bits,
3467         needed for the 33rd and 34th cursor values.
3468
3469 2007-12-16  Mark Rowe  <mrowe@apple.com>
3470
3471         Reviewed by Maciej Stachowiak.
3472
3473         Refactor Mac plugin stream code to use the shared NetscapePlugInStreamLoader implementation.
3474
3475         * WebCore.base.exp:
3476         * WebCore.xcodeproj/project.pbxproj:
3477         * loader/NetscapePlugInStreamLoader.h:
3478         * loader/mac/NetscapePlugInStreamLoaderMac.mm: Removed.
3479         * loader/mac/WebPlugInStreamLoaderDelegate.h: Moved to WebKit.
3480
3481 2007-12-16  Sam Weinig  <sam@webkit.org>
3482
3483         Reviewed by Maciej.
3484
3485         Yet more of http://bugs.webkit.org/show_bug.cgi?id=16385
3486         Cleanup kjs_window
3487
3488         - Move ScheduledAction into its own file and put it in the WebCore namespace.
3489
3490         * WebCore.pro:
3491         * WebCore.vcproj/WebCore.vcproj:
3492         * WebCore.xcodeproj/project.pbxproj:
3493         * WebCoreSources.bkl:
3494         * bindings/js/PausedTimeouts.cpp:
3495         * bindings/js/PausedTimeouts.h:
3496         * bindings/js/ScheduledAction.cpp: Copied from bindings/js/kjs_window.cpp.
3497         (WebCore::ScheduledAction::ScheduledAction):
3498         (WebCore::ScheduledAction::execute):
3499         * bindings/js/ScheduledAction.h: Copied from bindings/js/kjs_window.h.
3500         (WebCore::ScheduledAction::ScheduledAction):
3501         * bindings/js/kjs_window.cpp:
3502         (KJS::DOMWindowTimer::DOMWindowTimer):
3503         (KJS::DOMWindowTimer::action):
3504         (KJS::DOMWindowTimer::takeAction):
3505         (KJS::Window::installTimeout):
3506         (KJS::Window::timerFired):
3507         * bindings/js/kjs_window.h:
3508
3509 2007-12-16  Alp Toker  <alp@atoker.com>
3510
3511         Reviewed by Maciej.
3512
3513         http://bugs.webkit.org/show_bug.cgi?id=16356
3514         [GTK] Integrate GStreamer video with the graphics backend
3515
3516         Integrate the GStreamer media backend with the Cairo graphics backend.
3517         There are still some issues: Data is copied more often than necessary,
3518         and repaint() is not called, causing transformed video not to update
3519         sometimes.
3520
3521         * WebCore.pro:
3522         * platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp:
3523         (WebCore::MediaPlayerPrivate::MediaPlayerPrivate):
3524         (WebCore::MediaPlayerPrivate::~MediaPlayerPrivate):
3525         (WebCore::MediaPlayerPrivate::currentTime):
3526         (WebCore::MediaPlayerPrivate::setEndTime):
3527         (WebCore::MediaPlayerPrivate::seeking):
3528         (WebCore::MediaPlayerPrivate::naturalSize):
3529         (WebCore::MediaPlayerPrivate::setMuted):
3530         (WebCore::MediaPlayerPrivate::setRect):
3531         (WebCore::MediaPlayerPrivate::setVisible):
3532         (WebCore::MediaPlayerPrivate::repaint):
3533         (WebCore::MediaPlayerPrivate::paint):
3534         (WebCore::MediaPlayerPrivate::createGSTPlayBin):
3535         * platform/graphics/gtk/MediaPlayerPrivateGStreamer.h:
3536         * platform/graphics/gtk/VideoSinkGStreamer.cpp: Added.
3537         (webkit_video_sink_base_init):
3538         (webkit_video_sink_init):
3539         (webkit_video_sink_idle_func):
3540         (webkit_video_sink_render):
3541         (webkit_video_sink_set_caps):
3542         (webkit_video_sink_dispose):
3543         (webkit_video_sink_finalize):
3544         (webkit_video_sink_set_property):
3545         (webkit_video_sink_get_property):
3546         (webkit_video_sink_stop):
3547         (webkit_video_sink_class_init):
3548         (webkit_video_sink_new):
3549         (webkit_video_sink_set_surface):
3550         (plugin_init):
3551         * platform/graphics/gtk/VideoSinkGStreamer.h: Added.
3552
3553 2007-12-16  Mark Rowe  <mrowe@apple.com>
3554
3555         Mac build fix.
3556
3557         * WebCore.xcodeproj/project.pbxproj: Remove NetscapePlugInStreamLoader.cpp from the WebCore target.
3558         Mac currently has its own implementation in NetscapePlugInStreamLoaderMac.mm which conflicts with the
3559         new shared implementation.
3560
3561 2007-12-16  Rodney Dawes  <dobey@wayofthemonkey.com>
3562
3563         Reviewed by Maciej Stachowiak.
3564
3565         http://bugs.webkit.org/show_bug.cgi?id=16389
3566         Bug 16389: Common Implementation of NetscapePlugInStreamLoader
3567
3568         * WebCore.vcproj/WebCore.vcproj: Remove NetscapePlugInStreamLoaderWin.cpp.
3569         * loader/NetscapePlugInStreamLoader.cpp: Copy method implementations from NetscapePlugInStreamLoaderWin.cpp.
3570         * loader/win/NetscapePlugInStreamLoaderWin.cpp: Removed.
3571
3572 2007-12-16  Grace Kloba  <klobag@gmail.com>
3573
3574         Reviewed by Darin Adler.
3575
3576         Fix http://bugs.webkit.org/show_bug.cgi?id=16433.
3577         Bug 16433: LOW_BANDWIDTH_DISPLAY build is broken
3578
3579         * dom/Document.cpp:
3580         (WebCore::Document::Document):
3581         * loader/FrameLoader.cpp:
3582         (WebCore::FrameLoader::addLowBandwidthDisplayRequest):
3583         (WebCore::FrameLoader::switchOutLowBandwidthDisplayIfReady):
3584
3585 2007-12-16  Darin Adler  <darin@apple.com>
3586
3587         Reviewed by Maciej.
3588
3589         - fix <rdar://problem/5636065> First form of SQLTransaction.executeSql() fails with TYPE_ERROR dom exception
3590
3591         Test: storage/execute-sql-args.html
3592
3593         * bindings/js/JSSQLTransactionCustom.cpp:
3594         (WebCore::JSSQLTransaction::executeSql): Added exception handling code so that once an
3595         exception happens, we won't try to do any more argument processing. Changed processing
3596         of the second argument so that we allow an undefined value or null, and simply omit the
3597         array. Changed processing of the second argument so that we don't require an actual
3598         JavaScript array. Instead, as with the JavaScript array operations themselves, we use
3599         the length property and corresponding numeric properties of the object, allowing other
3600         objects to act as arrays. Changed processing of the third and fourth arguments to
3601         allow the undefined value as well as null; we check the value of the argument rather
3602         than looking at the size of the passed-in arguments list.
3603
3604 2007-12-16  Sam Weinig  <sam@webkit.org>
3605
3606         Reviewed by Darin.
3607
3608         More of http://bugs.webkit.org/show_bug.cgi?id=16385
3609         Cleanup kjs_window
3610
3611         - Move PausedTimeouts into its own file and put it in the WebCore namespace.
3612
3613         * WebCore.pro:
3614         * WebCore.vcproj/WebCore.vcproj:
3615         * WebCore.xcodeproj/project.pbxproj:
3616         * WebCoreSources.bkl:
3617         * bindings/js/PausedTimeouts.cpp: Copied from bindings/js/kjs_window.cpp.
3618         * bindings/js/PausedTimeouts.h: Copied from bindings/js/kjs_window.h.
3619         * bindings/js/kjs_window.cpp:
3620         (KJS::Window::pauseTimeouts):
3621         * bindings/js/kjs_window.h:
3622         * history/CachedPage.cpp:
3623         * history/CachedPage.h:
3624         * page/Chrome.cpp:
3625
3626 2007-12-16  Beth Dakin  <bdakin@apple.com>
3627
3628         Reviewed by Geoff.
3629
3630         Make relative-size SVGs work in border-image.
3631
3632         * rendering/RenderBox.cpp:
3633         (WebCore::RenderBox::calculateBackgroundSize):
3634         * rendering/RenderObject.cpp:
3635         (WebCore::RenderObject::paintBorderImage):
3636
3637 2007-12-16  Darin Adler  <darin@apple.com>
3638
3639         - fix Tiger build (my fault it was broken)
3640
3641         * rendering/RenderThemeMac.mm: Define NSUInteger if on Tiger.
3642
3643 2007-12-16  Andrew Wellington  <proton@wiretapped.net>
3644
3645         Reviewed by Darin.
3646         
3647         http://bugs.webkit.org/show_bug.cgi?id=6129
3648         Incomplete implementation of CSS 2.1 system colors
3649
3650         Test: fast/css/css2-system-color.html
3651         
3652         Based on original patch by Rob Buis.
3653         
3654         System colors are retrieved from NSColor as appropriate. If the color is a pattern color
3655         (and therefore NSColor won't let us retrieve a color from it) we draw a 1x1 image of the
3656         color and sample that to get a solid color.
3657
3658         * css/CSSStyleSelector.cpp:
3659         (WebCore::):
3660         (WebCore::colorForCSSValue):
3661         * rendering/RenderTheme.cpp:
3662         (WebCore::RenderTheme::systemColor):
3663         * rendering/RenderTheme.h:
3664         * rendering/RenderThemeMac.h:
3665         * rendering/RenderThemeMac.mm:
3666         (WebCore::getSystemColor):
3667         (WebCore::RenderThemeMac::platformColorsDidChange):
3668         (WebCore::RenderThemeMac::systemColor):
3669
3670 2007-12-16  Dan Bernstein  <mitz@apple.com>
3671
3672         Reviewed by Darin Adler.
3673
3674         - fix http://bugs.webkit.org/show_bug.cgi?id=16426
3675           Divs with overflow:auto: scrollbars not correctly updated when contents change
3676
3677         Test: fast/overflow/scrollbar-position-update.html
3678
3679         * platform/mac/PlatformScrollBarMac.mm:
3680         (WebCore::PlatformScrollbar::updateThumbProportion): Update the
3681         NSScroller's value for the new proportions.
3682         * rendering/RenderLayer.cpp:
3683         (WebCore::RenderLayer::updateScrollInfoAfterLayout): Removed unnecessary
3684         repaint(). Scrollbars repaint themselves as needed.
3685
3686 2007-12-16  Alexey Proskuryakov  <ap@webkit.org>
3687
3688         Reviewed by Darin.
3689
3690         http://bugs.webkit.org/show_bug.cgi?id=14140
3691         <rdar://problem/5270958> REGRESSION: Complex system KeyBindings don't work properly
3692
3693         * dom/KeyboardEvent.h:
3694         (WebCore::KeypressCommand::KeypressCommand):
3695         (WebCore::KeyboardEvent::keypressCommands):
3696         Change stored command class to preserve complete information about commands.
3697
3698         * editing/EditorCommand.cpp: (WebCore::CommandEntry::): Mark InsertText as a text insertion
3699         command, which it is. Previously, we couldn't do it because WebKit didn't really treat insertText:
3700         as a command.
3701
3702         * page/EventHandler.cpp: (WebCore::EventHandler::keyEvent): Copy commands saved while interpreting
3703         a keydown event into keypress, to avoid losing state when running interpretKeyEvents: again.
3704
3705 2007-12-16  Alexey Proskuryakov  <ap@webkit.org>
3706
3707         Reviewed by Darin.
3708
3709         http://bugs.webkit.org/show_bug.cgi?id=16462
3710         REGRESSION: access keys broken on Windows
3711
3712         * page/EventHandler.cpp:
3713         (WebCore::EventHandler::handleAccessKey):
3714         (WebCore::EventHandler::keyEvent):
3715         * page/EventHandler.h:
3716         Make handleAccessKey a class method; rely on WebKit to call it on Windows and wxWidgets.
3717
3718 2007-12-16  Xan Lopez  <xan@gnome.org>
3719
3720         Reviewed by Alexey Proskuryakov.
3721
3722         http://bugs.webkit.org/show_bug.cgi?id=16454
3723         [GTK] Text input doesn't work consistently on PPC
3724
3725         * platform/gtk/KeyEventGtk.cpp:
3726         (WebCore::singleCharacterString):
3727
3728         UChar is 2 bytes (UTF-16), so transform accordingly from
3729         gunichar (UCS-4). Fixes keyboard input on big endian systems.
3730
3731 2007-12-15  Darin Adler  <darin@apple.com>
3732
3733         Reviewed by Mark Rowe.
3734
3735         - better build fix for the problem affecting GTK and some other platforms
3736           "this time for sure"
3737
3738         * WebCore.xcodeproj/project.pbxproj:
3739         * bindings/js/JSEventTargetBase.cpp: Move the include of the .lut.h file here.
3740         * bindings/js/JSEventTargetBase.h: Instead of including the .lut.h file in the header,
3741         which won't work, declare the tables that are in the .lut.h file in the header.
3742
3743 2007-12-12  Kevin Watters  <kevin@dotsyntax.com>
3744
3745         Reviewed by Darin Adler.
3746
3747         Fixed the Wx port's FontPlatformData for use in HashTable.
3748         - FontPlatformData(Deleted) made unequal to FontPlatformData()
3749
3750         * platform/graphics/wx/FontPlatformData
3751
3752 2007-12-15  Dan Bernstein  <mitz@apple.com>
3753
3754         Reviewed by Darin Adler.
3755
3756         - fix <rdar://problem/5636090> Text in Georgia, Armenian, Inuktitut, Cree, or Cherokee (KA, HY, IU, CR, CHR) draws as all missing glyphs
3757
3758         * platform/graphics/win/FontCacheWin.cpp:
3759         (WebCore::metaFileEnumProc): Added. Called during metafile record
3760         enumeration and extracts the font from the create font record.
3761         (WebCore::FontCache::getFontDataForCharacters): If font linking fails,
3762         let Uniscribe draw the characters and see what font it chooses.
3763
3764 2007-12-15  Darin Adler  <darin@apple.com>
3765
3766         * WebCore.pro: Roll my last change out. Was wrong and didn't fix the build.
3767
3768 2007-12-15  Darin Adler  <darin@apple.com>
3769
3770         Another try at a GTK build fix.
3771
3772         * WebCore.pro: Add JSEventTargetBase.cpp to LUT_TABLE_FILES instead of LUT_FILES.
3773
3774 2007-12-15  Sam Weinig  <sam@webkit.org>
3775
3776         Force windows to regenerate COM DOM bindings.
3777
3778         * WebCore.vcproj/build-generated-files.sh: Add license. 
3779         * bindings/scripts/CodeGeneratorCOM.pm: Use shared WK_ucfirst.
3780
3781 2007-12-15  Sam Weinig  <sam@webkit.org>
3782
3783         Fix Windows and wx builds.
3784
3785         * WebCore.vcproj/WebCore.vcproj:
3786         * WebCoreSources.bkl:
3787
3788 2007-12-15  Mark Rowe  <mrowe@apple.com>
3789
3790         Gtk build fix.  Add JSEventTargetBase.cpp to SOURCES.
3791
3792         * WebCore.pro:
3793
3794 2007-12-15  Sam Weinig  <sam@webkit.org>
3795
3796         Fix wx build.
3797
3798         * WebCoreSources.bkl:
3799
3800 2007-12-15  Nikolas Zimmermann  <zimmermann@kde.org>
3801
3802         Not reviewed. Build fix for Qt/Gtk.
3803
3804         * WebCore.pro: Include JSEventTargetBase.lut.h in generation
3805
3806 2007-12-15  Nikolas Zimmermann  <zimmermann@kde.org>
3807
3808         Reviewed by Eric.
3809
3810         Fixes: http://bugs.webkit.org/show_bug.cgi?id=16445 (Refactor EventTargetNode & JSEventTargetNode for an upcoming SVG patch)
3811
3812         Split up JSEventTargetNode in JSEventTargetNode & JSEventTargetBase - where most functionality has been moved down
3813         in the base class. Applied the same refactorization to EventTargetNode.
3814
3815         This makes it possible for the upcoming patch implementing the EventTarget interface for SVGElementInstance
3816         to share as much code as possible with the EventTargetNode classes.
3817
3818         * DerivedSources.make:
3819         * WebCore.xcodeproj/project.pbxproj:
3820         * bindings/js/JSEventTargetBase.cpp: Added.
3821         (WebCore::retrieveEventTargetAndCorrespondingNode):
3822         (WebCore::eventNameForPropertyToken):
3823         * bindings/js/JSEventTargetBase.h: Added.
3824         (WebCore::JSEventTargetProperties::):
3825         (WebCore::JSEventTargetPrototypeFunctionBase::JSEventTargetPrototypeFunctionBase):
3826         (WebCore::JSEventTargetPrototypeFunction::JSEventTargetPrototypeFunction):
3827         (WebCore::):
3828         (WebCore::::create):
3829         (WebCore::JSEventTargetBase::JSEventTargetBase):
3830         (WebCore::JSEventTargetBase::getValueProperty):
3831         (WebCore::JSEventTargetBase::putValueProperty):
3832         (WebCore::JSEventTargetBase::getOwnPropertySlot):
3833         (WebCore::JSEventTargetBase::put):
3834         (WebCore::JSEventTargetPrototype::JSEventTargetPrototype):
3835         (WebCore::JSEventTargetPrototype::self):
3836         (WebCore::JSEventTargetPrototype::getOwnPropertySlot):
3837         (WebCore::JSEventTargetPrototype::classInfo):
3838         * bindings/js/JSEventTargetNode.cpp:
3839         (WebCore::JSEventTargetNode::getOwnPropertySlot):
3840         (WebCore::JSEventTargetNode::getValueProperty):
3841         (WebCore::JSEventTargetNode::put):
3842         (WebCore::JSEventTargetNode::putValueProperty):
3843         (WebCore::JSEventTargetNode::setListener):
3844         (WebCore::toEventTargetNode):
3845         * bindings/js/JSEventTargetNode.h:
3846         (WebCore::JSEventTargetPrototypeInformation::prototypeClassName):
3847         (WebCore::JSEventTargetPrototypeInformation::prototypeIdentifier):
3848         * dom/EventTarget.cpp:
3849         (WebCore::EventTarget::addEventListener):
3850         (WebCore::EventTarget::removeEventListener):
3851         (WebCore::EventTarget::dispatchGenericEvent):
3852         (WebCore::EventTarget::removeAllEventListeners):
3853         (WebCore::EventTarget::insertedIntoDocument):
3854         (WebCore::EventTarget::removedFromDocument):
3855         (WebCore::EventTarget::handleLocalEvents):
3856         (WebCore::EventTarget::applySVGEventTargetRules):
3857         (WebCore::forbidEventDispatch):
3858         (WebCore::allowEventDispatch):
3859         (WebCore::eventDispatchForbidden):
3860         * dom/EventTarget.h:
3861         (WebCore::EventTarget::preDispatchEventHandler):
3862         (WebCore::EventTarget::postDispatchEventHandler):
3863         (WebCore::forbidEventDispatch):
3864         (WebCore::allowEventDispatch):
3865         * dom/EventTargetNode.cpp:
3866         (WebCore::EventTargetNode::~EventTargetNode):
3867         (WebCore::EventTargetNode::insertedIntoDocument):
3868         (WebCore::EventTargetNode::removedFromDocument):
3869         (WebCore::EventTargetNode::addEventListener):
3870         (WebCore::EventTargetNode::removeEventListener):
3871         (WebCore::EventTargetNode::removeAllEventListeners):
3872         (WebCore::EventTargetNode::handleLocalEvents):
3873         (WebCore::EventTargetNode::dispatchEvent):
3874         (WebCore::EventTargetNode::dispatchWindowEvent):
3875         * dom/EventTargetNode.h:
3876         (WebCore::EventTargetNode::localEventListeners):
3877         * svg/SVGElement.cpp:
3878         (WebCore::SVGElement::sendSVGLoadEventIfPossible):
3879         (WebCore::SVGElement::dispatchEvent):
3880
3881 2007-12-15  Eric Seidel  <eric@webkit.org>
3882
3883         Reviewed by Oliver.
3884         
3885         Width of SVG elements not applied to container elements
3886         http://bugs.webkit.org/show_bug.cgi?id=16305
3887         Added calcPrefWidths for RenderSVGRoot (copied from RenderReplaced)
3888         This is caused by poor factoring in the render tree.  RenderContainer probably should be a template.
3889
3890         svg/css/css-box-min-width.html
3891
3892         * rendering/RenderSVGRoot.cpp:
3893         (WebCore::RenderSVGRoot::calcPrefWidths): Added.
3894         * rendering/RenderSVGRoot.h:
3895         * css/SVGCSSStyleSelector::applySVGProperty: fixed ASSERT in debug builds
3896
3897 2007-12-15  David Kilzer  <ddkilzer@apple.com>
3898
3899         Fix comment after isSafeScript() was renamed to allowsAccessFrom().
3900
3901         * bindings/js/kjs_window.cpp:
3902         (KJS::createWindow):
3903
3904 2007-12-15  Alp Toker  <alp@atoker.com>
3905
3906         Reviewed by Mark Rowe.
3907
3908         http://bugs.webkit.org/show_bug.cgi?id=16449
3909         cairo_arc() functions hang or crash when passed inf as radius or start/end angle
3910
3911         Add checks. This matches a similar workaround for a CG bug in the CG
3912         graphics backend: <rdar://problem/5189233>
3913
3914         Fixes:
3915           fast/canvas/arc-crash.html
3916           fast/canvas/canvas-with-incorrect-args.html
3917
3918         * platform/graphics/cairo/PathCairo.cpp:
3919         (WebCore::Path::addArc):
3920
3921 2007-12-15  Alexey Proskuryakov  <ap@webkit.org>
3922
3923         Reviewed by Darin.
3924
3925         http://bugs.webkit.org/show_bug.cgi?id=16078
3926         Google Maps zooming via the scroll wheel (almost) always zooms IN only.
3927
3928         * dom/WheelEvent.cpp: (WebCore::WheelEvent::WheelEvent):
3929         Ensure that delta is never rounded down to zero - we are getting values less than 1 from 
3930         many mice on OS X, and Google Maps code assumes scrolling up if event.wheelDelta is zero.
3931
3932 2007-12-14  Dan Bernstein  <mitz@apple.com>
3933
3934         - Windows build fix
3935
3936         * WebCore.vcproj/WebCore.vcproj:
3937
3938 2007-12-14  Alp Toker  <alp@atoker.com>
3939
3940         GTK+/Qt build fix. Track added files in r28722.
3941
3942         * WebCore.pro:
3943
3944 2007-12-14  Sam Weinig  <sam@webkit.org>
3945
3946         Reviewed by Geoff.
3947
3948         Speed up getElementByClassName.
3949         - This makes getElementByClassName 33% faster on the stress test
3950           linked to at http://bugs.webkit.org/show_bug.cgi?id=15760.
3951
3952         * platform/text/StringImpl.cpp:
3953         (WebCore::StringImpl::foldCase): Optimize the case when all the characters are ASCII.
3954
3955 2007-12-14  Alp Toker  <alp@atoker.com>
3956
3957         Reviewed by Maciej.
3958
3959         http://bugs.webkit.org/show_bug.cgi?id=16432
3960         [GTK] Update license headers
3961
3962         Consent has been given by the authors of these files to change license
3963         to the LGPL as outlined in the bug report.
3964
3965         * platform/gtk/ClipboardGtk.cpp:
3966         * platform/gtk/ContextMenuGtk.cpp:
3967         * platform/gtk/ContextMenuItemGtk.cpp:
3968         * platform/gtk/CookieJarGtk.cpp:
3969         * platform/gtk/CursorGtk.cpp:
3970         * platform/gtk/DragDataGtk.cpp:
3971         * platform/gtk/DragImageGtk.cpp:
3972         * platform/gtk/PasteboardGtk.cpp:
3973         * platform/gtk/PlatformScreenGtk.cpp:
3974         * platform/gtk/PlatformScrollBarGtk.cpp:
3975         * platform/gtk/SearchPopupMenuGtk.cpp:
3976         * platform/gtk/WidgetGtk.cpp:
3977
3978 2007-12-14  Darin Adler  <darin@apple.com>
3979
3980         Reviewed by Adele.
3981
3982         - fix http://bugs.webkit.org/show_bug.cgi?id=16442
3983           navigation policy delegate gets called twice for each load
3984
3985         * loader/MainResourceLoader.cpp:
3986         (WebCore::MainResourceLoader::willSendRequest): Removed call to checkNavigationPolicy.
3987         That's handled by FrameLoader.
3988
3989         * loader/MainResourceLoader.h: Removed callContinueAfterNavigationPolicy
3990         and continueAfterNavigationPolicy.
3991
3992 2007-12-14  Anders Carlsson  <andersca@apple.com>
3993
3994         Reviewed by Brady.
3995
3996         Make document.open count as committing a document load, so that -[WebFrame dataSource:] won't
3997         return nil in that case.
3998         
3999         * loader/FrameLoader.cpp:
4000         (WebCore::FrameLoader::didExplicitOpen):
4001
4002 2007-12-14  David Smith  <catfish.man@gmail.com>
4003
4004         Reviewed by Mitz.
4005
4006         - fix http://bugs.webkit.org/show_bug.cgi?id=14955
4007           Implement getElementsByClassName.
4008
4009         This patch also renames AtomicStringList to ClassNames to better reflect its actual use,
4010         and takes advantage of admitting that it's class-specific to encapsulate class attribute 
4011         parsing so it can be shared.  It also changes the class to use a Vector, rather than a linked
4012         list to store the class names.
4013
4014         Tests: fast/dom/getElementsByClassName/001.html
4015                fast/dom/getElementsByClassName/002.html
4016                fast/dom/getElementsByClassName/003.html
4017                fast/dom/getElementsByClassName/004.html
4018                fast/dom/getElementsByClassName/005.html
4019                fast/dom/getElementsByClassName/006.html
4020                fast/dom/getElementsByClassName/007.html
4021                fast/dom/getElementsByClassName/008.html
4022                fast/dom/getElementsByClassName/009.html
4023                fast/dom/getElementsByClassName/010.xml
4024                fast/dom/getElementsByClassName/011.xml
4025                fast/dom/getElementsByClassName/012.html
4026                fast/dom/getElementsByClassName/013.html
4027                fast/dom/getElementsByClassName/014.html
4028                fast/dom/getElementsByClassName/array/001.html
4029                fast/dom/getElementsByClassName/array/002.html
4030                fast/dom/getElementsByClassName/array/003.html
4031                fast/dom/getElementsByClassName/array/004.html
4032                fast/dom/getElementsByClassName/dumpNodeList.html
4033
4034         * WebCore.xcodeproj/project.pbxproj:
4035         * css/CSSStyleSelector.cpp:
4036         (WebCore::CSSStyleSelector::matchRules):
4037         (WebCore::CSSStyleSelector::checkOneSelector):
4038         * dom/AtomicStringList.h: Removed.
4039         * dom/ClassNames.cpp: Added.
4040         (WebCore::ClassNames::contains):
4041         (WebCore::ClassNames::parseClassAttribute):
4042         * dom/ClassNames.h: Copied from WebCore/dom/AtomicStringList.h.
4043         (WebCore::ClassNames::ClassNames):
4044         (WebCore::ClassNames::size):
4045         (WebCore::ClassNames::clear):
4046         (WebCore::ClassNames::operator[]):
4047         (WebCore::isClassWhitespace):
4048         * dom/ClassNodeList.cpp: Added.
4049         (WebCore::ClassNodeList::ClassNodeList):
4050         (WebCore::ClassNodeList::length):
4051         (WebCore::ClassNodeList::item):
4052         (WebCore::ClassNodeList::nodeMatches):
4053         * dom/ClassNodeList.h: Added.
4054         * dom/Document.cpp:
4055         (WebCore::Document::getElementsByName):
4056         (WebCore::Document::getElementsByClassName):
4057         * dom/Document.h:
4058         * dom/Document.idl:
4059         * dom/Element.cpp:
4060         (WebCore::Element::getClassNames):
4061         (WebCore::Element::getElementsByClassName):
4062         * dom/Element.h:
4063         * dom/Element.idl:
4064         * dom/NameNodeList.cpp:
4065         (WebCore::NameNodeList::NameNodeList):
4066         (WebCore::NameNodeList::item):
4067         (WebCore::NameNodeList::nodeMatches):
4068         * dom/NameNodeList.h:
4069         * dom/NamedMappedAttrMap.cpp:
4070         (WebCore::NamedMappedAttrMap::clearAttributes):
4071         (WebCore::NamedMappedAttrMap::parseClassAttribute):
4072         * dom/NamedMappedAttrMap.h:
4073         (WebCore::NamedMappedAttrMap::getClassNames):
4074         * dom/StyledElement.cpp:
4075         (WebCore::StyledElement::getClassNames):
4076         * dom/StyledElement.h:
4077
4078 2007-12-14  Darin Adler  <darin@apple.com>
4079
4080         Reviewed by Sam.
4081
4082         - fix http://bugs.webkit.org/show_bug.cgi?id=16351
4083           FontFallbackList.h doesn't include wtf/PassRefPtr.h
4084           
4085         * platform/graphics/FontFallbackList.h: Added include of <wtf/Forward.h>
4086         * platform/graphics/GlyphPageTreeNode.h: Removed an unneeded include.
4087
4088 2007-12-14  Darin Adler  <darin@apple.com>
4089
4090         Reviewed by Alexey.
4091
4092         - http://bugs.webkit.org/show_bug.cgi?id=16420
4093           change regression tests to use document.execCommand instead of textInputController.doCommand
4094
4095         Add a few more operations to document.execCommand.
4096
4097         Finished up the transition to the new Editor::Command, including removing
4098         the Editor::execCommand function.
4099
4100         * WebCore.base.exp: Added Editor::Command::isSupported.
4101         * editing/Editor.h: Removed execCommand.
4102         * editing/EditorCommand.cpp:
4103         (WebCore::expandSelectionToGranularity): Added.
4104         (WebCore::verticalScrollDistance): Added; replaces canScroll.
4105         (WebCore::executeDeleteBackward): Added. Moved code here from WebHTMLView.
4106         (WebCore::executeDeleteBackwardByDecomposingPreviousCharacter): Ditto.
4107         (WebCore::executeDeleteForward): Ditto.
4108         (WebCore::executeDeleteToBeginningOfLine): Ditto.
4109         (WebCore::executeDeleteToBeginningOfParagraph): Ditto.
4110         (WebCore::executeDeleteToEndOfLine): Ditto.
4111         (WebCore::executeDeleteToEndOfParagraph): Ditto.
4112         (WebCore::executeMovePageDown): Renamed this command to be consistent with all the other
4113         Move commands. They all modify the caret. Reimplemented to match the Mac OS X version by
4114         removing the explicit scrolling, and letting it be done automatically by code that makes
4115         the caret visible. In some cases the old code would scroll twice which was harmless but
4116         unnecessary.
4117         (WebCore::executeMovePageDownAndModifySelection): Added. Moved code here from WebHTMLView.
4118         (WebCore::executeMovePageUp): See MovePageDown above.
4119         (WebCore::executeMovePageUpAndModifySelection): Added. Moved code here from WebHTMLView.
4120         (WebCore::executeSelectLine): Ditto.
4121         (WebCore::executeSelectParagraph): Ditto.
4122         (WebCore::executeSelectSentence): Ditto.
4123         (WebCore::executeSelectWord): Ditto.
4124         (WebCore::executeSwapWithMark): Some small tweaks.
4125
4126         * page/ContextMenuController.cpp:
4127         (WebCore::ContextMenuController::contextMenuItemSelected): Changed to use Editor::command()
4128         instead of Editor::execCommand(). This code could be changed to use Editor::Command quite a
4129         bit more, but I didn't do that this time.
4130
4131         - Removed some obsolete unused code.
4132
4133         * page/mac/EventHandlerMac.mm:
4134         (WebCore::EventHandler::passMouseDownEventToWidget): Removed the special case code for
4135         NSTextView. This was left over from when we used NSTextField and NSTextView for form
4136         elements and is no longer used at all.
4137
4138         * page/mac/WebCoreFrameBridge.h: Removed 20 unused methods that were still on one side
4139         of the bridge or another. We really need to find a time to tear down the rest of the
4140         bridge, but that's not this patch.
4141
4142         * page/mac/WebCoreFrameBridge.mm:
4143         (-[WebCoreFrameBridge addData:]): Changed to get at the _shouldCreateRenderers field directly
4144         instead of using a method.
4145         (-[WebCoreFrameBridge rangeByAlteringCurrentSelection:SelectionController::direction:SelectionController::granularity:]):
4146         Took out obsolete comment about matching enums (we use a single enum now and have for some
4147         time).
4148         (-[WebCoreFrameBridge selectionGranularity]): Ditto.
4149
4150 2007-12-14  Justin Garcia  <justin.garcia@apple.com>
4151
4152         Reviewed by Darin Adler.
4153
4154         <rdar://problem/5575101> GoogleDocs: Hang in SplitElementCommand::doApply when outdenting a list item in a particular list
4155
4156         * editing/CompositeEditCommand.cpp:
4157         (WebCore::CompositeEditCommand::splitTreeToNode): Moved here.
4158         * editing/CompositeEditCommand.h:
4159         * editing/IndentOutdentCommand.cpp: Moved splitTreeToNode.
4160         * editing/IndentOutdentCommand.h: Ditto, and removed unimplemented splitTreeTo.
4161         * editing/InsertListCommand.cpp:
4162         (WebCore::InsertListCommand::doApply): Split ancestors of listChildNode between
4163         it and listNode, if they exists, so that moving listChildNode doesn't put it out
4164         of order.  Added a test case to cover each change.
4165         * editing/SplitElementCommand.cpp:
4166         (WebCore::SplitElementCommand::doApply): Added an ASSERT to catch code that
4167         tries to split a container at a bogus child, and an early return to avoid a
4168         hang in that case.
4169
4170 2007-12-14  Anders Carlsson  <andersca@apple.com>
4171
4172         Reviewed by Darin and Geoff.
4173
4174         <rdar://problem/5619295> 
4175         REGRESSION: 303-304: Embedded YouTube video fails to render- JS errors (16150) (Flash 9)
4176
4177         _NPN_CreateScriptObject doesn't take an origin root object anymore.
4178         
4179         * html/HTMLPlugInElement.cpp:
4180         (WebCore::HTMLPlugInElement::createNPObject):
4181         * page/Frame.cpp:
4182         (WebCore::Frame::windowScriptNPObject):
4183
4184 2007-12-14  Dan Bernstein  <mitz@apple.com>
4185
4186         Reviewed by Darin Adler.
4187
4188         - fix <rdar://problem/5643663> text-shadow and box-shadow offsets 1px smaller than specified
4189           which is the root cause of:
4190           http://bugs.webkit.org/show_bug.cgi?id=12943
4191           box-shadow: small values don't affect shadow position
4192           http://bugs.webkit.org/show_bug.cgi?id=14736
4193           Safari implementation of text-shadow off by 1px
4194
4195         * platform/graphics/cg/GraphicsContextCG.cpp:
4196         (WebCore::GraphicsContext::setShadow): Slightly increase the magnitude
4197         of the offsets passed to CGContextSetShadow* to ensure that the end
4198         result after truncation is the desired integer offsets.
4199
4200 2007-12-13  Alp Toker  <alp@atoker.com>
4201
4202         curl backend build fix for breakage introduced in r28709.
4203
4204         * platform/network/ResourceHandleInternal.h:
4205         (WebCore::ResourceHandleInternal::ResourceHandleInternal):
4206
4207 2007-12-13  Justin Garcia  <justin.garcia@apple.com>
4208
4209         Reviewed by Oliver Hunt.
4210
4211         <rdar://problem/5607069> In Mail, a crash occurs at WebCore::AppendNodeCommand() after dragging image into a <FORM> element
4212
4213         * editing/InsertLineBreakCommand.cpp:
4214         (WebCore::InsertLineBreakCommand::shouldUseBreakElement): Equip this function to
4215         handle editing positions, like [input, 0];
4216         * editing/InsertParagraphSeparatorCommand.cpp:
4217         (WebCore::InsertParagraphSeparatorCommand::doApply): Pass enclosingBlock a node peeled
4218         off of a non-editing position, to fix a bug where the enclosing block of [input, 0] was
4219         the input element itself.
4220         Insert a <br> when a <form> element is the enclosing block instead of splitting/cloning or
4221        &