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