Reviewed by Geoff.
[WebKit-https.git] / WebCore / ChangeLog
1 2006-07-29  Rob Buis  <buis@kde.org>
2
3         Reviewed by Geoff.
4
5         http://bugzilla.opendarwin.org/show_bug.cgi?id=10151
6         ghostmap XHTML + SVG fails due to javascript undefined exception
7
8         Make sure document.URL works when called from a non-HTML document.
9
10         * bindings/js/kjs_html.cpp:
11         (KJS::JSHTMLDocument::getValueProperty):
12         * bindings/js/kjs_html.h:
13         (KJS::JSHTMLDocument::):
14         * dom/Document.idl:
15
16 2006-07-29  Mike Emmel  <mike.emmel@gmail.com>
17
18         Reviewed and tweaked by Darin.
19
20         - fixes for Linux build
21           (still might not compile, since Darin tweaked but was unable to test).
22
23         * WebCoreSources.bkl: Added some new sources, removed some obsolete ones.
24         * Projects/gdk/webcore-gdk.bkl: Added RenderPopupMenuGdk.cpp
25
26         * html/HTMLPlugInElement.h: Removed incorrect syntax with class name
27         before ::.
28
29         * platform/gdk/FrameGdk.h:
30         * platform/gdk/FrameGdk.cpp: Updated parameters of constructor. Moved a couple stubs
31         out of this file.
32         * platform/gdk/RenderPopupMenuGdk.h: Added.
33         * platform/gdk/RenderPopupMenuGdk.cpp: Added. Just a file full of empty stubs.
34         * platform/gdk/RenderThemeGdk.h:
35         * platform/gdk/RenderThemeGdk.cpp: (WebCore::RenderThemeGdk::createPopupMenu): Added.
36
37         * platform/gdk/TemporaryLinkStubs.cpp: Add some new stubs.
38
39 2006-07-29  Mark Rowe  <opendarwin.org@bdash.net.nz>
40
41         Reviewed by Darin.
42
43         http://bugzilla.opendarwin.org/show_bug.cgi?id=10022
44         Bug 10022: REGRESSION: Crash in WebCore::XMLTokenizer::characters
45
46         * dom/XMLTokenizer.cpp:
47         (WebCore::XMLTokenizer::resumeParsing): If the write() call resulted in new callbacks being
48         added, don't call through to end() just yet.
49
50 2006-07-29  Mitz Pettel  <opendarwin.org@mitzpettel.com>
51
52         Reviewed by John Sullivan.
53
54         - manual test for http://bugzilla.opendarwin.org/show_bug.cgi?id=9984
55           ASSERTION FAILURE: _private->mouseDownEvent != nil
56           (WebKit/WebView/WebHTMLView.m:4863 -[WebHTMLView(WebInternal) _delegateDragSourceActionMask])
57
58         * manual-tests/subview-click-assertion.html: Added.
59
60 2006-07-29  Andrew Wellington  <proton@wiretapped.net>
61
62         Reviewed by Darin.
63
64         Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8587 / <rdar://problem/4631844>
65         REGRESSION: {display:list-item} items outside an ol or ul element don't number correctly
66
67         * rendering/RenderListItem.cpp:
68         (WebCore::enclosingList): If no real list element is found, use parent instead.
69         (WebCore::previousListItem): Check list elements to see if they are list items -- the
70         old code assumed that a list would never be a list item but this is entirely possible
71         with CSS and especially with the new rule that means any DOM element could act as a list.
72
73 2006-07-29  Alexey Proskuryakov  <ap@nypop.com>
74
75         Reviewed by Darin.
76
77         Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=10147
78         REGRESSION: custom attribute values set via javascript are not persistent
79
80         Test: fast/dom/Element/setAttribute-case-insensitivity.html
81
82         * dom/Element.cpp:
83         (WebCore::Element::setAttribute): Use the lowercased localName for retrieving the old value, too.
84
85 2006-07-28  Timothy Hatcher  <timothy@apple.com>
86
87         Suggested by Darin.
88
89         Moving the implementation of isContentEditable to the
90         the WebPrivate category.
91
92         * bindings/objc/DOM.mm:
93         (-[DOMNode isContentEditable]):
94
95 2006-07-28  Justin Garcia  <justin.garcia@apple.com>
96
97         Reviewed by levi
98         
99         First part of:
100         <rdar://problem/4515463>
101         REGRESSION: Blot and Mail both do a very poor job of pasting the main www.apple.com page
102         
103         Migrate to isBlock and enclosingBlock.
104         Changed RendereringInfo::isBlock and ReplacementFragment::isBlock
105         to wasBlock so that they don't conflict with isBlock and because
106         it's more descriptive.
107
108         * editing/ReplaceSelectionCommand.cpp:
109         (WebCore::ReplacementFragment::mergeStartNode):
110         (WebCore::ReplacementFragment::wasBlock):
111         (WebCore::ReplacementFragment::saveRenderingInfo):
112         (WebCore::ReplacementFragment::renderedBlocks):
113         (WebCore::RenderingInfo::RenderingInfo):
114         (WebCore::ReplaceSelectionCommand::shouldMergeStart):
115         (WebCore::ReplaceSelectionCommand::doApply):
116         * editing/ReplaceSelectionCommand.h:
117         (WebCore::RenderingInfo::wasBlock):
118
119 2006-07-27  Justin Garcia  <justin.garcia@apple.com>
120
121         Reviewed by levi
122         
123         More changes for:
124         <rdar://problem/4242293>
125         Poor paste fidelity of http://www.google.com/
126
127         * editing/markup.cpp:
128         (WebCore::needInterchangeNewlineAfter): Added.
129         (WebCore::createMarkup): 
130         Only add an interchangeNewline if we're annotating for interchange.  Can't test 
131         this until we expose createMarkup in non-annotate mode (I'd expose Range::toHTML).
132         Remove the FIXME about prepending the interchangeNewline before creating the rest 
133         of the markup.  Its correct to surround the interchangeNewline in ancestors of the
134         adjusted startNode.
135         Fixed the check to see if an interchangeNewline is needed (!inSameBlock).  This would
136         add an interchangeNewline for a selection that started before a table.
137         Removed the workaround for the bug where markup for a table was not included when 
138         selecting the contents of a table, since this change fixes the general problem of 
139         markup for ancestors of the startNode being left out.
140         Don't leave out ancestors of the startNode as we leave their subtrees.  Execute the
141         code to include them even if we closed ancestors in the ancestorsToClose list.
142
143 2006-07-28  Timothy Hatcher  <timothy@apple.com>
144
145         Reviewed by John.
146
147         Adding isContentEditable to DOMNode's private category. 
148
149         * bindings/objc/DOMPrivate.h:
150
151 2006-07-28  Alexey Proskuryakov  <ap@nypop.com>
152
153         Rolling out http://bugzilla.opendarwin.org/show_bug.cgi?id=6010 because of failing layout tests.
154         Add better SVGLoad event support.
155
156         * dom/EventTargetNode.cpp:
157         (WebCore::EventTargetNode::dispatchGenericEvent):
158         * html/HTMLImageLoader.cpp:
159         (WebCore::HTMLImageLoader::dispatchLoadEvent):
160         * html/HTMLImageLoader.h:
161         * ksvg2/misc/SVGImageLoader.cpp:
162         (WebCore::SVGImageLoader::SVGImageLoader):
163         * ksvg2/misc/SVGImageLoader.h:
164         * ksvg2/svg/SVGAElement.cpp:
165         (WebCore::SVGAElement::parseMappedAttribute):
166         * ksvg2/svg/SVGAnimatedBoolean.h:
167         * ksvg2/svg/SVGElement.cpp:
168         (WebCore::SVGElement::SVGElement):
169         (WebCore::SVGElement::parseMappedAttribute):
170         * ksvg2/svg/SVGElement.h:
171         (WebCore::SVGElement::adjustViewportClipping):
172         (WebCore::SVGElement::closeRenderer):
173         (WebCore::SVGElement::rendererIsNeeded):
174         (WebCore::SVGElement::isClosed):
175         (WebCore::svg_dynamic_cast):
176         * ksvg2/svg/SVGExternalResourcesRequired.h:
177         * ksvg2/svg/SVGImageElement.cpp:
178         (SVGImageElement::SVGImageElement):
179         * ksvg2/svg/SVGImageElement.h:
180         * ksvg2/svg/SVGSVGElement.cpp:
181         (WebCore::SVGSVGElement::parseMappedAttribute):
182         * ksvg2/svg/SVGScriptElement.cpp:
183         (SVGScriptElement::SVGScriptElement):
184         (SVGScriptElement::parseMappedAttribute):
185         (SVGScriptElement::executeScript):
186         * xml/xmlhttprequest.cpp:
187         (WebCore::XMLHttpRequest::callReadyStateChangeListener):
188
189 2006-07-28  Adele Peterson  <adele@apple.com>
190
191         Rolling out http://bugzilla.opendarwin.org/show_bug.cgi?id=9753 because of failing layout tests.
192         SVG with width and height 100% leaves room for scrollbar on the right.
193
194         * kcanvas/RenderPath.cpp:
195         * kcanvas/RenderPath.h:
196         * kcanvas/RenderSVGContainer.cpp:
197         (WebCore::RenderSVGContainer::layout):
198         * ksvg2/svg/SVGCircleElement.cpp:
199         * ksvg2/svg/SVGCircleElement.h:
200         * ksvg2/svg/SVGEllipseElement.cpp:
201         * ksvg2/svg/SVGEllipseElement.h:
202         * ksvg2/svg/SVGLineElement.cpp:
203         * ksvg2/svg/SVGLineElement.h:
204         * ksvg2/svg/SVGRectElement.cpp:
205         * ksvg2/svg/SVGRectElement.h:
206         * ksvg2/svg/SVGStyledElement.h:
207
208 2006-07-27  Eric Seidel  <eric@eseidel.com>
209
210         Reviewed by darin.
211         
212         Add better SVGLoad event support.
213         http://bugzilla.opendarwin.org/show_bug.cgi?id=6010
214         There will still need to be additional support added for <link> and <script> elements.
215         Not all of the error -> loaded -> error transition cases work yet.
216
217         * dom/EventTargetNode.cpp:
218         (WebCore::EventTargetNode::dispatchGenericEvent):
219         * html/HTMLImageLoader.cpp:
220         (WebCore::HTMLImageLoader::dispatchLoadEvent):
221         * html/HTMLImageLoader.h:
222         (WebCore::HTMLImageLoader::haveFiredLoadEvent):
223         (WebCore::HTMLImageLoader::setHaveFiredLoadEvent):
224         * ksvg2/misc/SVGImageLoader.cpp:
225         (WebCore::SVGImageLoader::SVGImageLoader):
226         (WebCore::SVGImageLoader::dispatchLoadEvent):
227         * ksvg2/misc/SVGImageLoader.h:
228         * ksvg2/svg/SVGAElement.cpp:
229         (WebCore::SVGAElement::parseMappedAttribute):
230         * ksvg2/svg/SVGAnimatedBoolean.h:
231         * ksvg2/svg/SVGElement.cpp:
232         (WebCore::SVGElement::SVGElement):
233         (WebCore::SVGElement::parseMappedAttribute):
234         (WebCore::SVGElement::haveLoadedRequiredResources):
235         (WebCore::SVGElement::sendSVGLoadEventIfPossible):
236         (WebCore::SVGElement::closeRenderer):
237         * ksvg2/svg/SVGElement.h:
238         (WebCore::SVGElement::rendererIsNeeded):
239         (WebCore::svg_dynamic_cast):
240         * ksvg2/svg/SVGExternalResourcesRequired.h:
241         * ksvg2/svg/SVGImageElement.cpp:
242         (SVGImageElement::SVGImageElement):
243         (SVGImageElement::haveLoadedRequiredResources):
244         * ksvg2/svg/SVGImageElement.h:
245         * ksvg2/svg/SVGSVGElement.cpp:
246         (WebCore::SVGSVGElement::parseMappedAttribute):
247         * ksvg2/svg/SVGScriptElement.cpp:
248         (WebCore::SVGScriptElement::SVGScriptElement):
249         (WebCore::SVGScriptElement::parseMappedAttribute):
250         (WebCore::SVGScriptElement::executeScript):
251         * xml/xmlhttprequest.cpp:
252         (WebCore::XMLHttpRequest::callReadyStateChangeListener): use new Event() instead of createEvent
253
254 2006-07-27  Mitz Pettel  <opendarwin.org@mitzpettel.com>
255
256         Reviewed by Anders.
257
258         - http://bugzilla.opendarwin.org/show_bug.cgi?id=10135
259           Cleanup: remove useless parameters from RenderObject::position()
260
261         No test possible (no functionality change)
262
263         * rendering/RenderBox.cpp:
264         (WebCore::RenderBox::position):
265         * rendering/RenderBox.h:
266         * rendering/RenderObject.h:
267         (WebCore::RenderObject::position):
268         * rendering/RenderTableRow.h:
269         (WebCore::RenderTableRow::position):
270         * rendering/RenderTableSection.h:
271         (WebCore::RenderTableSection::position):
272         * rendering/RenderText.cpp:
273         (WebCore::RenderText::position):
274         * rendering/RenderText.h:
275         * rendering/bidi.cpp:
276         (WebCore::RenderBlock::constructLine):
277         (WebCore::RenderBlock::computeVerticalPositionsForLine):
278
279 2006-07-27  Rob Buis  <buis@kde.org>
280
281         Reviewed by Maciej.
282
283         http://bugzilla.opendarwin.org/show_bug.cgi?id=9753
284         SVG with width and height 100% leaves room for scrollbar on the right.
285
286         Relayout children of svg containers, except svg shapes that do not depend on percentages.
287
288         * kcanvas/RenderPath.cpp: (WebCore::RenderPath::hasPercentageValues):
289         * kcanvas/RenderPath.h:
290         * kcanvas/RenderSVGContainer.cpp: (WebCore::RenderSVGContainer::layout):
291         * ksvg2/svg/SVGCircleElement.cpp: (SVGCircleElement::hasPercentageValues):
292         * ksvg2/svg/SVGCircleElement.h:
293         * ksvg2/svg/SVGEllipseElement.cpp: (WebCore::SVGEllipseElement::hasPercentageValues):
294         * ksvg2/svg/SVGEllipseElement.h:
295         * ksvg2/svg/SVGLineElement.cpp: (SVGLineElement::hasPercentageValues):
296         * ksvg2/svg/SVGLineElement.h:
297         * ksvg2/svg/SVGRectElement.cpp: (WebCore::SVGRectElement::hasPercentageValues):
298         * ksvg2/svg/SVGRectElement.h:
299         * ksvg2/svg/SVGStyledElement.h: (WebCore::SVGStyledElement::hasPercentageValues):
300
301 2006-07-27  Justin Garcia  <justin.garcia@apple.com>
302
303         Reviewed by levi
304         
305         <rdar://problem/4242293>
306         Poor paste fidelity of http://www.google.com/
307
308         * editing/ApplyStyleCommand.cpp:
309         (WebCore::ApplyStyleCommand::applyInlineStyle):  Fixed crasher with nil-check.
310         * editing/markup.cpp:
311         (WebCore::startMarkup): Style information wasn't added to an element if it had
312         attributes but no style attribute.
313
314 2006-07-27  Alexander Kellett  <lypanov@kde.org>
315
316         Reviewed by Darin.
317
318         - fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=9867
319           REGRESSION: code that modifies form element in Firefox modifies form attribute in WebKit
320
321         * bindings/scripts/CodeGeneratorJS.pm: add new attribute - HasOverridingNameGetter
322         * html/HTMLFormElement.idl:
323
324 2006-07-27  Rob Buis  <buis@kde.org>
325
326         Reviewed by Anders.
327
328         http://bugzilla.opendarwin.org/show_bug.cgi?id=8992
329         Some HTML DOM attributes have incorrect types
330
331         Adjust idl and dom source code for HTMLImageElement and
332         HTMLBaseFontElement to choose correct type for
333         HTMLImageElement::border and HTMLBaseFontElement::size
334         attributes.
335
336         * html/HTMLBaseFontElement.cpp:
337         (WebCore::HTMLBaseFontElement::size):
338         (WebCore::HTMLBaseFontElement::setSize):
339         * html/HTMLBaseFontElement.h:
340         * html/HTMLBaseFontElement.idl:
341         * html/HTMLImageElement.cpp:
342         (WebCore::HTMLImageElement::border):
343         (WebCore::HTMLImageElement::setBorder):
344         * html/HTMLImageElement.h:
345         * html/HTMLImageElement.idl:
346
347 2006-07-27  Justin Garcia  <justin.garcia@apple.com>
348
349         Reviewed by levi
350         
351         <rdar://problem/4628409>
352         Safari crashes in CompositeEditCommand::removeBlockPlaceholder entering text in a web page form
353
354         * editing/CompositeEditCommand.cpp:
355         (WebCore::CompositeEditCommand::removeBlockPlaceholder): 
356         A script on the page shrinks the textarea down to zero rows just
357         before insertion.  That gives the shadow div a zero height, removing
358         [div, 0] as a candidate for a VisiblePosition.  Then 
359         InsertTextCommand::input() tries to create a VisiblePosition from 
360         [div, 0] and fails.  A nil check is a quick fix.  Another might
361         be to make positions where there is a caret selection candidates.
362         Another might be to make any [div, 0] where div is a shadow div inside
363         a form element a candidate.
364
365 2006-07-27  Graham Dennis  <graham.dennis@gmail.com>
366
367         Reviewed by Darin.
368
369         - fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=10094
370           Japanese characters improperly rendering in TOT
371           
372         Test: fast/encoding/denormalised-voiced-japanese-chars.html
373
374         * platform/Font.cpp:
375         (WebCore::WidthIterator::advance): pass currentCharacter to normalizeVoicingMarks
376         (WebCore::WidthIterator::normalizeVoicingMarks): turn the currentCharacter variable
377         into an argument as WidthIterator::advance doesn't update m_currentCharacter while
378         looping
379
380 2006-07-27  Eric Seidel  <eric@eseidel.com>
381
382         Reviewed by ap.
383
384         Complex entities seem to fail on TOT
385         http://bugzilla.opendarwin.org/show_bug.cgi?id=6390
386         Use an alternative work-around to an XML Entity parsing bug.
387
388         * dom/XMLTokenizer.cpp:
389         (WebCore::XMLTokenizer::write):
390         (WebCore::hackAroundLibXMLEntityBug): added.
391         (WebCore::startElementNsHandler):
392         (WebCore::endElementNsHandler):
393         (WebCore::charactersHandler):
394         (WebCore::processingInstructionHandler):
395         (WebCore::cdataBlockHandler):
396         (WebCore::commentHandler):
397         (WebCore::getEntityHandler):
398
399 2006-07-27  Rob Buis  <buis@kde.org>
400
401         Reviewed by Darin.
402
403         http://bugzilla.opendarwin.org/show_bug.cgi?id=9938
404         Fix viewBox issues in Hixie's test
405
406         Do a more accurate and quicker job of parsing the viewBox
407         attribute. Handle properly on negative width/height and
408         invalid syntax in general.
409
410         * ksvg2/svg/SVGFitToViewBox.cpp:
411         (SVGFitToViewBox::parseViewBox):
412
413 2006-07-27  Eric Seidel  <eric@eseidel.com>
414
415         Reviewed by ap.
416
417         Enables getSVGDocument() support for HTMLObjectElement and HTMLEmbedElement
418         http://bugzilla.opendarwin.org/show_bug.cgi?id=9237
419         This patch does not try to autogenerate anything, but enables the SVG functionality.
420         Also fix HTMLObjectElement vspace and hspace to be numbers instead of strings to match IE & Firefox.
421
422         * bindings/js/kjs_dom.cpp:
423         (KJS::toJS):
424         * bindings/js/kjs_html.cpp:
425         (KJS::JSHTMLElement::objectGetter):
426         (KJS::HTMLElementFunction::callAsFunction):
427         (KJS::JSHTMLElement::objectSetter):
428         * bindings/js/kjs_html.h:
429         (KJS::JSHTMLElement::):
430         * dom/Document.h:
431         (WebCore::Document::isSVGDocument):
432         * html/HTMLEmbedElement.cpp:
433         (WebCore::HTMLEmbedElement::contentDocument):
434         (WebCore::HTMLEmbedElement::getSVGDocument):
435         * html/HTMLEmbedElement.h:
436         * html/HTMLObjectElement.cpp:
437         (WebCore::HTMLObjectElement::HTMLObjectElement):
438         (WebCore::HTMLObjectElement::getInstance):
439         (WebCore::HTMLObjectElement::parseMappedAttribute):
440         (WebCore::HTMLObjectElement::contentDocument):
441         (WebCore::HTMLObjectElement::rendererIsNeeded):
442         (WebCore::HTMLObjectElement::createRenderer):
443         (WebCore::HTMLObjectElement::setCode):
444         (WebCore::HTMLObjectElement::setArchive):
445         (WebCore::HTMLObjectElement::setBorder):
446         (WebCore::HTMLObjectElement::setCodeBase):
447         (WebCore::HTMLObjectElement::setCodeType):
448         (WebCore::HTMLObjectElement::setData):
449         (WebCore::HTMLObjectElement::hspace):
450         (WebCore::HTMLObjectElement::setHspace):
451         (WebCore::HTMLObjectElement::setStandby):
452         (WebCore::HTMLObjectElement::setType):
453         (WebCore::HTMLObjectElement::setUseMap):
454         (WebCore::HTMLObjectElement::vspace):
455         (WebCore::HTMLObjectElement::setVspace):
456         (WebCore::HTMLObjectElement::getSVGDocument):
457         * html/HTMLObjectElement.h:
458         * ksvg2/svg/SVGDocument.h:
459         (WebCore::SVGDocument::isSVGDocument):
460         * rendering/RenderWidget.h:
461         (WebCore::RenderWidget::frameView):
462
463 2006-07-26  Alexey Proskuryakov  <ap@nypop.com>
464
465         Reviewed by Darin.
466
467         Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9901
468         XSLTProcessor cannot parse text nodes for INPUT ELEMENTS in an XSLT stylesheet
469
470         Test: fast/js/xhtml-serialize.html
471
472         * editing/markup.cpp:
473         (WebCore::endMarkup): If the element has child nodes, write a closing tag even if it 
474         is not permitted in HTML, to make it valid XML.
475
476 2006-07-26  Alice Liu  <alice.liu@apple.com>
477
478         Reviewed by John Sullivan (and Kevin and Timo).
479
480         landing this patch for John et al.  
481         Fixed <rdar://problem/4651380> REGRESSION (9A232->9A234): existing web clips don't render if you restart Dashboard
482
483         * page/FrameView.cpp:
484         (WebCore::FrameView::layout):
485         moved the call to didFirstLayout to above the check for needsLayout
486         because we need to call didFirstLayout for every webview, not just
487         ones we think need layout.  
488
489 2006-07-26  Justin Garcia  <justin.garcia@apple.com>
490
491         Reviewed by darin
492         
493         <rdar://problem/4652788>
494         REGRESSION: Can't change size or style of any text in message body
495
496         * dom/Node.cpp:
497         (WebCore::Node::isContentRichlyEditable): Mimic Node::isContentEditable.
498         * html/HTMLElement.cpp:
499         (WebCore::HTMLElement::isContentRichlyEditable): First check
500         the frame for editability, then userModify, like what
501         HTMLElement::isContentEditable() does.
502         * html/HTMLElement.h:
503
504 2006-07-26  Mitz Pettel  <opendarwin.org@mitzpettel.com>
505
506         Reviewed by ap.
507
508         - fix debug-only information() string for table cells
509
510         * rendering/RenderObject.cpp:
511         (WebCore::RenderObject::information):
512
513 2006-07-25  David Harrison  <harrison@apple.com>
514
515         Reviewed by timo and Darin.
516
517         <rdar://problem/4618584> "Paste and Match Style" is not working in Mail (add SPI)
518         
519         * WebCore.xcodeproj/project.pbxproj:
520         * bridge/mac/WebCoreFrameBridge.h:
521         * bridge/mac/WebCoreFrameBridge.mm:
522         (-[WebCoreFrameBridge replaceSelectionWithNode:selectReplacement:smartReplace:matchStyle:]):
523         Add matchStyle parameter for use by WebKit.
524
525 2006-07-25  Justin Garcia  <justin.garcia@apple.com>
526
527         Reviewed by adele
528         
529         <rdar://problem/4649560>
530         REGRESSION: Can't Select All when the body is contentEditable="true"
531
532         * editing/VisiblePosition.cpp:
533         (WebCore::VisiblePosition::canonicalPosition): Allow descent from a non-editable html
534         element into an editable body as a convenience.
535
536 2006-07-25  Justin Garcia  <justin.garcia@apple.com>
537
538         Reviewed by darin
539         
540         <rdar://problem/4468458> Incoming HTML message is editable <body contenteditable="true">
541
542         * dom/Document.cpp:
543         (WebCore::Document::inDesignMode): Removed some spaces.
544         * page/Frame.cpp:
545         (WebCore::Frame::applyEditingStyleToElement): Just add CSS properties needed for editing.
546         (WebCore::Frame::removeEditingStyleFromElement): Made this a no-op, we'll remove
547         it eventually.
548
549 2006-07-25  David Kilzer  <ddkilzer@kilzer.net>
550
551         Reviewed by Darin.
552
553         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9717
554           Replace IDL ConvertUndefinedToTrue parameter attribute with Optional attribute
555
556         No test added because there is no change in functionality.
557
558         * bindings/js/kjs_binding.cpp: Removed valueToBooleanTreatUndefinedAsTrue() method.
559         * bindings/js/kjs_binding.h: Ditto.
560         * bindings/scripts/CodeGeneratorJS.pm: Removed support for ConvertUndefinedToTrue parameter attribute.
561         * dom/Element.h: Set default value to true for scrollIntoView() and scrollIntoViewIfNeeded() arguments.
562         * dom/Element.idl: Replaced ConvertUndefinedToTrue attribute with Optional attribute.
563           Fixed name of scrollIntoViewIfNeeded() argument to match implementation.
564         * page/DOMWindow.idl: Replaced ConvertUndefinedToTrue attribute with Optional attribute.
565
566 2006-07-24  Dan Waylonis  <waylonis@google.com>
567
568         Reviewed and tweaked a bunch by Darin.
569
570         Test: plugins/bindings-test.html
571
572         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9902
573           jsNull and NSNull not properly converted between JS and ObjC
574
575         * bindings/objc/WebScriptObject.mm:
576         (+[WebScriptObject _convertValueToObjcValue:originExecutionContext:executionContext:]):
577         Added case that converts jsNull to NSNull.
578
579 2006-07-24  Darin Adler  <darin@apple.com>
580
581         Reviewed by Adele and Justin.
582
583         - fix <rdar://problem/4613616> REGRESSION: some spaces typed in <textarea> are posted as non-breaking spaces (9630)
584           http://bugzilla.opendarwin.org/show_bug.cgi?id=9630
585         - also fixes http://bugzilla.opendarwin.org/show_bug.cgi?id=9939
586           REGRESSION: Pasting text into native text area with newline at end does not preserve newline
587         - removed some uses of DeprecatedPtrList in the markup code
588
589         Test: fast/forms/textarea-type-spaces.html
590         Test: fast/forms/textarea-paste-newline.html
591
592         * bindings/objc/DOMHTML.mm: (-[DOMHTMLDocument createDocumentFragmentWithText:]):
593         Updated call to pass a range -- in this case it is the range of the entire document,
594         so this will not handle the whitespace properly.
595
596         * bridge/mac/WebCoreFrameBridge.h: Added range context parameter to the
597         documentFragmentWithText: method, so we can handle whitespace properly.
598         * bridge/mac/WebCoreFrameBridge.mm:
599         (-[WebCoreFrameBridge nodesFromList:]): Changed from DeprecatedPtrList to Vector.
600         (-[WebCoreFrameBridge markupStringFromNode:nodes:]): Ditto.
601         (-[WebCoreFrameBridge markupStringFromRange:nodes:]): Ditto.
602         (-[WebCoreFrameBridge documentFragmentWithText:inContext:]): Added range context
603         parameter -- pass it on to createFragmentFromText.
604         (-[WebCoreFrameBridge documentFragmentWithNodesAsParagraphs:]): Changed from
605         DeprecatedPtrList to Vector.
606         (-[WebCoreFrameBridge replaceSelectionWithText:selectReplacement:smartReplace:]):
607         Pass the range of the current selection as context when creating the fragment.
608
609         * dom/Position.cpp: (WebCore::Position::inRenderedText): Replace range check with
610         a call to the new containsCaretOffset function -- helps make the caret work right when
611         it is past the end of the last line in a textarea.
612
613         * editing/CompositeEditCommand.cpp:
614         (WebCore::CompositeEditCommand::rebalanceWhitespaceAt): Don't do anything if the
615         style does not call for collapsing whitespace.
616         (WebCore::CompositeEditCommand::rebalanceWhitespace): Call replaceWhitespaceAt
617         to share code, including the new logic mentioned above.
618
619         * editing/InsertLineBreakCommand.cpp: (WebCore::InsertLineBreakCommand::doApply):
620         Use a text node instead of a break element when inserting and the style is preserveNewline.
621
622         * editing/JSEditor.cpp: (WebCore::execRemoveFormat): Pass the selection range
623         to createFragmentFromText.
624
625         * editing/RebalanceWhitespaceCommand.cpp: (WebCore::RebalanceWhitespaceCommand::doApply):
626         Assert that we're in a style that collapses whitespace. It's the caller's responsibility
627         not to call otherwise.
628
629         * editing/ReplaceSelectionCommand.h: Removed unused destructor, type, isSingleTextNode,
630         isTreeFragment, m_type, and added a context parameter to inertFragmentForTestRendering.
631         Also changed the constructor to take a selection rather than a pointer to the root
632         editable element, replaced removeEndBRIfNeeded with shouldRemoveEndBR and removed an
633         unused parameter from shouldMergeEnd.
634         * editing/ReplaceSelectionCommand.cpp:
635         (WebCore::ReplacementFragment::ReplacementFragment): Removed code to set up m_type.
636         Compute root editable element from passed-in selection. Used the start of the selection
637         as a base node for style purposes for the test rendering. Removed the special case
638         "single text node" alternative to createFragmentFromText in the plain text case, since
639         createFragmentFromText now handles that correctly.
640         (WebCore::ReplacementFragment::insertFragmentForTestRendering): Copy the whitespace
641         property from the source location when creating a temporary element for test rendering.
642         (WebCore::ReplacementFragment::shouldMergeEnd): Removed unneeded boolean
643         parameter fragmentHadInterchangeNewlineAtEnd, which is always false.
644         (WebCore::ReplaceSelectionCommand::doApply): Update for ReplacementFragment changes,
645         change code to not remove end BR when it can be re-used instead, don't call the
646         paragraph separator insertion when the position is at the start of a paragraph already,
647         removed redundant computation of identical "next" value, removed unneeded boolean
648         parameter to shouldMergeEnd, add case for merging when all we need to do is to delete
649         a newline character, removed unneeded code to set insertionPos after all code that uses
650         it, and  use spaces instead of non-breaking spaces when doing smart paste if the
651         context is one where we do not collapse white space.
652         (WebCore::ReplaceSelectionCommand::shouldRemoveEndBR): Renamed and changed to return
653         a boolean instead of doing the removal.
654
655         * editing/markup.h: Use Vector instead of DeprecatedPtrList. Change the
656         createFragmentFromText function to take a range for context instead of a document.
657         * editing/markup.cpp:
658         (WebCore::markup): Use Vector instead of DeprecatedPtrList.
659         (WebCore::createMarkup): Ditto.
660         (WebCore::createParagraphContentsFromString): Remove unneeded document parameter
661         and changed a couple places to use isEmpty instead of comparing with "".
662         (WebCore::createFragmentFromText): Given the new context parameter, if the context
663         is one that preserves newlines, then use "\n" instead of <br> elements.
664         (WebCore::createFragmentFromNodes): Use Vector instead of DeprecatedPtrList.
665
666         * html/HTMLElement.cpp: (WebCore::HTMLElement::setInnerText): Do not use <br>
667         elements if the context of this node is one where we preserve newlines.
668
669         * rendering/InlineTextBox.h:
670         * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::containsCaretOffset):
671         Added. Implements the appropriate rule for determining if a caret position is
672         in this line or not. Returns true for both one line and the next in cases where
673         affinity must be considered to determine which line the caret is on.
674
675         * rendering/RenderText.h: Make atLineWrap no longer be a member function.
676         * rendering/RenderText.cpp:
677         (WebCore::atLineWrap): Remove special rule about preserveNewline and isLineBreak,
678         which will no longer apply due to the new containsCaretOffset function logic.
679         (WebCore::RenderText::caretRect): Use containsCaretOffset.
680         (WebCore::RenderText::inlineBox): Ditto.
681
682         * rendering/RenderTextControl.cpp:
683         (WebCore::RenderTextControl::updateFromElement): Make a placeholder <br> element
684         after calling setInnerText so that the last newline in the string has the effect
685         we expect outside the HTML world (an additional line).
686         (WebCore::RenderTextControl::setSelectionRange): Set granularity of the selection
687         too. The layout tests caught this problem, which needs a better solution long term.
688         (WebCore::RenderTextControl::text): Call textContent with the parameter false
689         so it will not include newlines for <br> elements. Now the only <br> element
690         that will ever be in the shadow DOM tree is the one to prevent collapsing, and
691         that one should not show up in the text value.
692
693         * rendering/bidi.cpp: (WebCore::RenderBlock::findNextLineBreak): Took a rule
694         that specifically called out the pre whitespace mode and made it work for all
695         the modes that preserve newlines. This makes sure we get a last line box for
696         text after the last "\n" even in cases where there is no <br> afterward.
697
698         * editing/DeleteSelectionCommand.cpp:
699         (WebCore::DeleteSelectionCommand::fixupWhitespace):
700         * editing/InsertParagraphSeparatorCommand.cpp:
701         (WebCore::InsertParagraphSeparatorCommand::doApply):
702         Added assertions to make sure we don't do anything when we're not collapsing
703         whitespace.
704
705         * html/HTMLTextAreaElement.cpp: (WebCore::HTMLTextAreaElement::setDefaultValue):
706         Changed to use Vector instead of DeprecatedPtrList.
707
708         * editing/HTMLInterchange.cpp: Removed obsolete comment.
709
710         * loader/Cache.h: Removed a stray include.
711
712 2006-07-24  Adele Peterson  <adele@apple.com>
713
714         Reviewed by Justin.
715
716         - Fix for <rdar://problem/4632132> Changing style of content with mixed editability fails
717
718         Test: * editing/style/apple-style-editable-mix.html
719
720         * dom/Node.cpp: (WebCore::Node::isContentRichlyEditable): Doesn't need to check the editable root.  It now just
721           checks the user modify property of its own renderer, since that is inherited.
722         * editing/ApplyStyleCommand.cpp: (WebCore::ApplyStyleCommand::applyInlineStyle): If the end position is in a table,
723         Adjust the end node to the last descendant of the table, so we don't skip over any runs.
724
725 2006-07-24  Darin Adler  <darin@apple.com>
726
727         Reviewed by Hyatt.
728
729         - implement String::createCFString
730
731         * WebCore.xcodeproj/project.pbxproj: Added StringImplMac.mm and StringMac.mm.
732
733         * bindings/objc/DOMInternal.mm: Moved NSString conversion functions out of here.
734
735         * platform/mac/StringImplMac.mm: Added. Moved NSString conversion members here
736         and added the CFStringRef ones.
737         * platform/mac/StringMac.mm: Added. Ditto.
738
739 2006-07-24  David Hyatt  <hyatt@apple.com>
740
741         Two bug fixes.
742
743         (1) Make sure to mark positioned objects that depend on line position to
744         mark themselves as needing layout when their line box placeholder gets
745         repositioned.
746
747         * rendering/RenderBox.cpp:
748         (WebCore::RenderBox::position):
749        
750         (2) Improve highlighting to factor the inflation into overflow so that
751         invalidation and repainting will work properly.
752
753         * rendering/RootInlineBox.cpp:
754         (WebCore::RootInlineBox::addHighlightOverflow):
755         * rendering/RootInlineBox.h:
756         * rendering/bidi.cpp:
757         (WebCore::RenderBlock::layoutInlineChildren):
758
759 2006-07-24  Anders Carlsson  <acarlsson@apple.com>
760
761         Reviewed by Adele.
762
763         <rdar://problem/4641824> REGRESSION: Wikipedia widget fails to complete a search after pressing return key
764         
765         * html/HTMLInputElement.cpp:
766         (WebCore::HTMLInputElement::defaultEventHandler):
767         Don't eat enter events for search fields that have no enclosing form; they need to be passed to AppKit so
768         that onsearch can be invoked.
769         
770         * manual-tests/onsearch-enter.html: Added.
771
772 2006-07-24  Dave MacLachlan  <dmaclach@mac.com>
773
774         Reviewed by Darin and Alexey.
775         
776         Fix for: <http://bugzilla.opendarwin.org/show_bug.cgi?id=8425> 
777         and <http://bugzilla.opendarwin.org/show_bug.cgi?id=6947>
778
779         Test: svg/custom/non-opaque-filters.svg
780
781         * kcanvas/device/quartz/KCanvasFilterQuartz.mm:
782         (WebCore::KCanvasFilterQuartz::prepareFilter):
783         We create an autorelease pool so we can control the deallocation of the
784         CIContext that we're creating. The CIContext retains the CGContext that 
785         you pass it internally so when the CIContext is released, the 
786         CGContext is released as well.
787         This is all fine and dandy unless you wrap the creation of the CIFilter
788         with a pair of CGBegin/EndTransparencyLayer calls which swap the context
789         out from underneath you. So if you start with context A, 
790         CGBeginTransparencyLayer swaps it out and gives you B. You create a CIFilter
791         with it and add a reference to B. CGEndTransparencyLayer swaps out B and
792         gives you back A. Autorelease pool comes and cleans up the Filter, and calls
793         release on A, but A never got the refcount in the first place. B did. BOOM!
794         So we create a pool, then do a retain, then release the pool so that we 
795         don't have to worry about the pool releasing it at a later time.
796         See <rdar://problem/4647735> for reduction of CGEndTransparencyLayer case
797
798 2006-07-24  Mitz Pettel  <opendarwin.org@mitzpettel.com>
799
800         Reviewed by Hyatt.
801
802         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9669
803           Incomplete repaint when changing an inline's border
804
805         Test: fast/repaint/line-overflow.html
806
807         * rendering/RenderBlock.h:
808         * rendering/bidi.cpp:
809         (WebCore::RenderBlock::layoutInlineChildren): Added repaintTop and repaintBottom
810         variables to track the vertical edges of the area that changed, accounting for
811         lines that were deleted, inserted or moved. Removed unnecessary updating of
812         m_overflowHeight.
813         (WebCore::RenderBlock::determineStartPosition): Removed unnecessary updating of
814         m_overflowHeight.
815         (WebCore::RenderBlock::determineEndPosition):
816         (WebCore::RenderBlock::matchedEndLine): Added repaintTop and repaintBottom
817         arguments, which this method updates to account for deleted lines.
818         (WebCore::RenderBlock::checkLinesForOverflow): Removed outdated FIXME.
819
820 2006-07-24  Mitz Pettel  <opendarwin.org@mitzpettel.com>
821
822         Reviewed by Darin.
823
824         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=10075
825           REGRESSION: Reversed pop-up text in visually-ordered Hebrew pages
826
827         Test: fast/forms/select-visual-hebrew.html
828
829         * css/html4.css: Set "-webkit-rtl-ordering: logical" on select elements.
830
831 2006-07-24  Alexey Proskuryakov  <ap@nypop.com>
832
833         Reviewed by Darin.
834
835         Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=10009
836         REGRESSION: Schubert-IT PDF Plug-in not working for full page (works in frames)
837
838         * page/Frame.cpp:
839         (WebCore::Frame::begin): Give PDF plugins a chance to handle frame content, before ImageDocument
840         claims it.
841
842 2006-07-24  Mitz Pettel  <opendarwin.org@mitzpettel.com>
843
844         Reviewed by Darin.
845
846         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=10083
847           REGRESSION (r15584): editing/selection/select-from-textfield-outwards failing
848
849         * rendering/RenderBlock.cpp:
850         (WebCore::RenderBlock::positionForCoordinates): Added back change from the fix
851         for bug 9312: For coordinates outside a replaced object, return the position
852         just before (after) the element if the coordinates are above or to the left (below
853         or to the right).
854
855 2006-07-23  Mark Rowe  <opendarwin.org@bdash.net.nz>
856
857         Reviewed by maciej.
858
859         Bug 9686: [Drosera] Need the ability to break into Drosera on Javascript exceptions
860         http://bugzilla.opendarwin.org/show_bug.cgi?id=9686
861
862         WebCore portion of the fix.
863
864         * bridge/mac/WebCoreScriptDebugger.h:
865         (-[WebScriptDebugger exceptionRaised:sourceId:line::]): Add delegate method.
866         * bridge/mac/WebCoreScriptDebugger.mm:
867         (WebCoreScriptDebuggerImp::exception): Call delegate method when an exception is raised.
868
869 2006-07-23  Alice Liu  <alice.liu@apple.com>
870
871         Reviewed by Adele.
872         Actually Adele figured out how to fix the layout test failures.  Landing this patch for her.  Layout test failures exposed but not caused by  r15584 (my patch earlier today).
873
874         * editing/visible_units.cpp:
875         (WebCore::previousLinePosition):
876         When setting selection endpoints, don't traverse down into nodes where editing would ignore its contents. Use the parent node instead.  
877         (WebCore::nextLinePosition):
878         same as above
879
880 2006-07-23  David Harrison  <harrison@apple.com>
881
882         Reviewed by timo.
883
884         <rdar://problem/4646759> Mail crash editing To Do - WebCore::InsertTextCommand::prepareForTextInsertion
885         
886         * Test: editing/deleting/delete-mixed-editable-content-001.html
887
888         * editing/visible_units.cpp:
889         (WebCore::startOfParagraph):
890         Respect editable boundary the same way endOfParagraph does.
891
892 2006-07-23  Beth Dakin  <bdakin@apple.com>
893
894         Reviewed by Maciej. (Patch by me, Maciej, and Harrison.)
895
896         Fix for <rdar://problem/4529398> WebCore crashes when pasting rich 
897         text - WebCore::InlineBox::root()
898
899         The initial rendering crash was due to a render object having a 
900         stale reference to an inline box that had already been deleted and 
901         then recreated in the exact same location in memory. (Crazy, I 
902         know.) The situation seemed pretty specific to list markers 
903         according to Hyatt according to Maciej, so that is what I patched 
904         specifically. Fixing this crash unearthed a separate editing crash 
905         where we were trying to insert a block into itself. I worked on 
906         that with Maciej and Harrison, and Harrison came up with a fix.
907
908         * editing/CompositeEditCommand.cpp:
909         (WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): This is the fix for the editing crash. If paragraphStart is an atomic 
910         node, insert the new block into the parent instead.
911         * rendering/InlineBox.cpp:
912         (WebCore::InlineBox::isChildOfParent): This function is for 
913         posterity. It will help keep the linebox tree in check.
914         * rendering/InlineBox.h:
915         * rendering/InlineFlowBox.cpp:
916         (WebCore::InlineFlowBox::addToLine): Added assert.
917         (WebCore::InlineFlowBox::deleteLine): Added assert.
918         * rendering/ListMarkerBox.cpp:
919         (WebCore::ListMarkerBox::destroy): If this has a parent, call 
920         removeChild on this.
921         (WebCore::ListMarkerBox::operator delete):
922         * rendering/ListMarkerBox.h:
923
924 2006-07-23  Alice Liu  <alice.liu@apple.com>
925
926         Reviewed by Darin.
927
928         fixed <rdar://problem/4617841> REGRESSION (NativeTextField): You can move keyboard focus to a field without getting insertion point
929
930         * rendering/RenderBlock.cpp:
931         (WebCore::RenderBlock::positionForCoordinates):
932         removed some unnecessary vertical position checks and added a fudge factor to be more forgiving for clicks near lines.
933         * rendering/RenderTextControl.cpp:
934         (WebCore::RenderTextControl::nodeAtPoint):
935         added implementation
936         * rendering/RenderTextControl.h:
937         added function protocol
938
939 2006-07-23  Adele Peterson  <adele@apple.com>
940
941         Reviewed by Darin.
942
943         Updating fix from last checkin.
944
945         * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::layoutVerticalBox):
946         Only tell the view about this flexbox if there isn't another flexbox already cached.
947
948 2006-07-23  Adele Peterson  <adele@apple.com>
949
950         Reviewed by Maciej.
951
952         - Fix for <rdar://problem/4644614> REGRESSION: Typing, pasting or dragging in new text areas causes unnecessary scrolling
953
954         * rendering/RenderBlock.cpp: (WebCore::RenderBlock::layoutBlock): Don't updateScrollInfoAfterLayout if an ancestor flexible box is just on
955         its first layout.
956         * rendering/RenderFlexibleBox.cpp:
957         (WebCore::RenderFlexibleBox::layoutBlock): ditto.
958         (WebCore::RenderFlexibleBox::layoutVerticalBox): Let the view know if this flex box is doing its first pass at layout.
959
960         * rendering/RenderView.cpp: (WebCore::RenderView::RenderView): Caches a flexible box that's doing its first layout.
961         * rendering/RenderView.h:
962         (WebCore::RenderView::setFlexBoxInFirstLayout):
963         (WebCore::RenderView::flexBoxInFirstLayout):
964
965 2006-07-22  Alexey Proskuryakov  <ap@nypop.com>
966
967         Reviewed by Darin.
968
969         Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=10038
970         REGRESSION: Length of navigator.mimeTypes collection returns number of installed plugins, not number 
971         of registered mime types
972
973         * bindings/js/kjs_navigator.cpp:
974         (KJS::MimeTypes::getValueProperty): Return the length of the mime types vector, not the plugins one.
975         (KJS::MimeTypes::getOwnPropertySlot): Fixed another typo, which prevented MimeTypes::getValueProperty()
976         from even being called.
977
978 2006-07-21  Maciej Stachowiak  <mjs@apple.com>
979
980         Reviewed by Adele and Tim Omernick.
981
982         <rdar://problem/4641004> 9A224: Safari crashes in WebCore::RenderMenuList::showPopup when changing a input select field to input text field
983
984         Couldn't figure out how to make layout test, here's a manual test:
985         * manual-tests/remove-select-onchange.html: Added.
986         
987         * rendering/RenderMenuList.cpp:
988         (WebCore::RenderMenuList::showPopup): Don't add the RenderPopupMenu to the render
989         tree so it doesn't get destroyed if we do.
990         
991         The remaining changes are to let the RenderPopupMenu know its menu list w/o having
992         to be in the render tree:
993         
994         * rendering/RenderPopupMenu.cpp:
995         (WebCore::RenderPopupMenu::RenderPopupMenu):
996         * rendering/RenderPopupMenu.h:
997         (WebCore::RenderPopupMenu::menuList):
998         * rendering/RenderPopupMenuMac.h:
999         * rendering/RenderPopupMenuMac.mm:
1000         (WebCore::RenderPopupMenuMac::RenderPopupMenuMac):
1001         * rendering/RenderPopupMenuWin.h:
1002         (WebCore::RenderPopupMenuWin::RenderPopupMenuWin):
1003         * rendering/RenderTheme.h:
1004         * rendering/RenderThemeMac.h:
1005         * rendering/RenderThemeMac.mm:
1006         (WebCore::RenderThemeMac::createPopupMenu):
1007         * rendering/RenderThemeWin.cpp:
1008         (WebCore::RenderThemeWin::createPopupMenu):
1009         * rendering/RenderThemeWin.h:
1010
1011 2006-07-21  Adele Peterson  <adele@apple.com>
1012
1013         Reviewed by Darin.
1014
1015         Fix for: <rdar://problem/4643238> REGRESSION: Can't set insertion point at the end of a line of text
1016
1017         Test: fast/forms/textarea-scrolled-endline-caret.html
1018
1019         * rendering/RenderBlock.cpp: (WebCore::RenderBlock::positionForCoordinates):
1020         When looking for the closest line box, take the scroll offset into account.
1021
1022 2006-07-21  Tim Omernick  <timo@apple.com>
1023
1024         Reviewed by Geoff & Maciej.
1025
1026         <rdar://problem/4632505> REGRESSION: Crash at WebCore::Widget::getView() const + 6
1027
1028         Geoff is working on a layout test for this.
1029
1030         * bridge/mac/FrameMac.mm:
1031         (WebCore::FrameMac::focusWindow):
1032         (WebCore::FrameMac::unfocusWindow):
1033         Check for a NULL view.  The view can be NULL if the frame has not yet loaded any data.  This fixes the crash, but the behavior is still
1034         wrong -- we should focus the frame once it gets a view.  I've filed <rdar://problem/4645685> to track that.  It's not as urgent as this
1035         crasher.
1036         
1037 2006-07-21  Maciej Stachowiak  <mjs@apple.com>
1038
1039         Reviewed by Darin.
1040
1041         <rdar://problem/4523976> REGRESSION (NativeTextField): Crash occurs when choosing "Undo Typing" after typing and setting the value
1042
1043         * rendering/RenderTextControl.cpp:
1044         (WebCore::RenderTextControl::updateFromElement): Clear the undo
1045         chain when the text control contents have been set
1046         programmatically.
1047         * bridge/mac/FrameMac.mm:
1048         (WebCore::FrameMac::clearUndoRedoOperations): Before clearing undo
1049         stack, close all open undo groups and then open an equal number,
1050         since otherwise NSUndoManager ends up in an inconsistent state
1051         leading to uncaught ObjC exceptions.
1052
1053 2006-07-21  Beth Dakin  <bdakin@apple.com>
1054         
1055         Reviewed by Darin.
1056
1057         Just moving this assertion down a couple of lines. It was hitting 
1058         every time you try to print a page because we put it too early in 
1059         the function.
1060
1061         * bridge/mac/WebCoreFrameBridge.mm:
1062         (-[WebCoreFrameBridge drawRect:]):
1063
1064 2006-07-21  Justin Garcia  <justin.garcia@apple.com>
1065
1066         Reviewed by levi
1067         
1068         <rdar://problem/4548238>
1069         REGRESSION: Can't remove the first OL/UL list item in a Mail's compose window
1070
1071         * editing/CompositeEditCommand.cpp:
1072         (WebCore::CompositeEditCommand::breakOutOfEmptyListItem): 
1073         Moved from InsertParagraphSeparator.  Does its own typing style restoration.
1074         * editing/CompositeEditCommand.h:
1075         * editing/InsertParagraphSeparatorCommand.cpp:
1076         (WebCore::InsertParagraphSeparatorCommand::doApply): Call breakOutOfEmptyListItem.
1077         * editing/TypingCommand.cpp:
1078         (WebCore::TypingCommand::deleteKeyPressed): Call breakOutOfEmptyListItem if
1079         the endingSelection is at the start of an editable region.
1080         * editing/htmlediting.cpp:
1081         (WebCore::embeddedSublist): Moved from InsertParagraphSeparator.
1082         (WebCore::appendedSublist): Ditto.
1083         (WebCore::enclosingEmptyListItem): Ditto.
1084         * editing/htmlediting.h:
1085
1086 === Safari-521.20 ===
1087
1088 2006-07-21  Tim Omernick  <timo@apple.com>
1089
1090         Reviewed by Beth Dakin & John Sullivan.
1091
1092         <rdar://problem/4633717> 9A218: Reproducible crash in -[NSScroller mouseDown:]
1093
1094         Beth is in the middle of making a layout test for this; she will land it soon.
1095
1096         * platform/mac/ScrollBarMac.mm:
1097         (ScrollBar::~ScrollBar):
1098         Call Widget::removeFromSuperview() rather than -removeFromSuperview directly on the scroll bar view.
1099         Widget::removeFromSuperview() obeys the "mustStayInWindow" flag, which is set while tracking the mouse
1100         in view-based widgets to prevent their destruction while the tracking is in progress.
1101         I searched around WebCore and this is the only Widget subclass that directly removes its view rather
1102         than using removeFromSuperview().
1103
1104 2006-07-21  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1105
1106         Reviewed by Darin.
1107
1108         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9312
1109           REGRESSION: Selection bug in new text fields when selecting past the first letter
1110
1111         Test: editing/selection/select-from-textfield-outwards.html
1112
1113         * editing/Selection.cpp:
1114         (WebCore::Selection::adjustForEditableContent): Added code to handle the case
1115         where the selection starts (resp. ends) in the last (resp. first) visual position
1116         inside an editable root.
1117         * editing/htmlediting.cpp:
1118         (WebCore::comparePositions): Fixed the case of comparing a position inside a shadow
1119         tree with a position in the shadow ancestor.
1120         * rendering/RenderBlock.cpp:
1121         (WebCore::RenderBlock::positionForCoordinates): For coordinates outside a replaced
1122         object, return the position just before (after) the element if the coordinates are above or
1123         to the left (below or to the right).
1124         * rendering/RenderObject.cpp:
1125         (WebCore::RenderObject::caretMaxOffset): Changed to return 1 for replaced objects.
1126         * rendering/RenderText.cpp:
1127         (WebCore::RenderText::positionForCoordinates): Changed to return the last position
1128         in the lowest text box if the y coordinate is below all text boxes.
1129
1130 2006-07-21  Geoffrey Garen  <ggaren@apple.com>
1131
1132         Reviewed by Darin.
1133         
1134         - Fixed <rdar://problem/4507265> REGRESSION: overlays don't work on 
1135         HousingMaps.com (Google Maps-based site)
1136         
1137         - Made style.filter undetectable, like document.all.
1138         
1139         Unfortunately, the SVG spec-makers invented a CSS attribute named 'filter',
1140         which conflicts with IE's custom CSS attribute by the same name. Web programs 
1141         like the Google maps API test for style.filter, and assume it's the IE 
1142         style.filter if they find it, so we need to make style.filter undetectable 
1143         to avoid breaking them.
1144         
1145         An alternative solution would be to hotwire a delorean, go back in time,
1146         and beg the web standards makers to make standards that work on the web.
1147
1148         * bindings/js/kjs_css.cpp:
1149         (KJS::DOMCSSStyleDeclaration::cssPropertyGetter):
1150
1151 2006-07-20  Justin Garcia  <justin.garcia@apple.com>
1152
1153         Reviewed by john
1154         
1155         <rdar://problem/4641033>
1156         REGRESSION: Pasting from web pages into Mail (or Blot) often loses most of the content
1157         
1158         * editing/markup.cpp:
1159         (WebCore::createMarkup): We surround the currently accumulated markup with markup 
1160         for ancestors of the startNode when the pre-order traversal leaves the trees rooted 
1161         at those ancestors.  We assumed that any ancestors of the current node not in the 
1162         ancestorsToClose list were those kind of ancestors.  But we don't add renderer-less 
1163         containers to the ancestorsToClose list.  So, we were incorrectly surrounding the 
1164         currently accumulated markup with markup for render-less containers.  Most of the
1165         content at apple.com was being put inside an <optgroup> inside a <select> element.  
1166         Then on Paste createContextualFragment would drop it.
1167
1168 2006-07-21  Anders Carlsson  <acarlsson@apple.com>
1169
1170         Reviewed by Geoff.
1171
1172         * dom/Document.h:
1173         (WebCore::Document::):
1174         * dom/EventTargetNode.cpp:
1175         (WebCore::EventTargetNode::addEventListener):
1176         * page/FrameView.cpp:
1177         (WebCore::FrameView::layout):
1178         * rendering/RenderLayer.cpp:
1179         (WebCore::RenderLayer::updateScrollInfoAfterLayout):
1180         Only dispatch overflowchanged events if overflowchanged event listeners have been registered on the document.
1181
1182 2006-07-20  Anders Carlsson  <acarlsson@apple.com>
1183
1184         Reviewed by Geoff.
1185
1186         <rdar://problem/4637807> REGRESSION: "Features & Options" page at volvocars.us fails
1187
1188         * xml/XSLTProcessor.cpp:
1189         (WebCore::xsltParamArrayFromParameterMap):
1190         Turns out parameters never worked. String parameters need to be escaped so we create a transform context,
1191         add the parameters to it quoted and then use xsltApplyStylesheetUser which lets us pass the transform context to it.
1192         This also works around a bug in libxslt where a hash table isn't allocated.
1193
1194 2006-07-20  Alice Liu  <alice.liu@apple.com>
1195
1196         Reviewed by Tim Omernick.
1197
1198         Fixed <rdar://problem/4621649> repro crash: Upload link causes crash on pages.google.com in Frame::nodeForWidget
1199         added manual test because there is no way to change the value of an <input type=file> via the DOM.  It's not supported because it's a security risk. 
1200
1201         * manual-tests/remove-input-file-onchange.html: Added.
1202         * platform/mac/FileButtonMac.mm:
1203         (-[WebFileChooserButton chooseFilename:]):
1204         swapped the calls to changeFilename and bridgeForWidget because changeFilename will destroy the widget that is accessed in bridgeForWidget 
1205
1206 2006-07-20  Alice Liu  <alice.liu@apple.com>
1207
1208         Reviewed by Adele.
1209
1210         Fixed <rdar://problem/4532113> REGRESSION (NativeTextField): Crash occurs after modifying field then reloading page -[FormDelegate frameLayoutHasChanged:]
1211         added a manual test because of the need to use AutoFill.
1212
1213         * dom/Node.h:
1214         (WebCore::Node::aboutToUnload):
1215         added virtual function prototype
1216         * html/HTMLInputElement.cpp:
1217         (WebCore::HTMLInputElement::aboutToUnload):
1218         added implementation that sends textFieldDidEndEditing notification
1219         * html/HTMLInputElement.h:
1220         added virtual function prototype
1221         * manual-tests/input-type-file-autocomplete-frame-1.html: Added.
1222         * manual-tests/input-type-file-autocomplete-frame-2.html: Added.
1223         * manual-tests/input-type-file-autocomplete-refresh.html: Added.
1224         * page/Frame.cpp:
1225         (WebCore::Frame::stopLoading):
1226         before unloading, call aboutToUnload on the current focused node
1227
1228 2006-07-20  Brady Eidson  <beidson@apple.com>
1229
1230         Reviewed by Maciej
1231
1232         fixed <rdar://problem/4611303> REGRESSION: repro crash in WebCore::EventTargetNode::dispatchWindowEvent at aeropostale.com
1233         There was an attempt to deref an EventListener that got cleaned up in GC.  Changing Document's EventListener list from 
1234         vanilla ptrs to refptrs to prevent GC, following EventTargetNode's proven example.
1235
1236         * dom/Document.cpp:
1237         (WebCore::Document::Document):
1238         (WebCore::Document::clear):
1239         (WebCore::Document::handleWindowEvent):
1240         (WebCore::Document::getHTMLWindowEventListener):
1241         (WebCore::Document::removeHTMLWindowEventListener):
1242         (WebCore::Document::removeWindowEventListener):
1243         (WebCore::Document::hasWindowEventListener):
1244         Changed all of the list iterators to work with RefPtrs instead of vanilla ptrs
1245
1246         * dom/Document.h:
1247         Changed the EventListener list to be a vanilla pointer list to a refptr list
1248
1249 2006-07-20  John Sullivan  <sullivan@apple.com>
1250
1251         Reviewed by Maciej
1252
1253         - WebCore part of fix for:
1254         <rdar://problem/4557386> REGRESSION (419.3-521.19): repro Safari world leak involving 
1255         closing tabs after clicking in a web page
1256         
1257         * bridge/mac/WebCoreFrameBridge.h:
1258         (-[WebCoreFrameBridge textViewWasFirstResponderAtMouseDownTime:])
1259         renamed to be more specific (formerly wasFirstResponderAtMouseDownTime:)
1260         * bridge/mac/FrameMac.mm:
1261         (WebCore::FrameMac::passMouseDownEventToWidget):
1262         updated for name change
1263
1264 2006-07-19  Alexey Proskuryakov  <ap@nypop.com>
1265
1266         Reviewed by Darin.
1267
1268         Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8272
1269         Use of window.open & window.close can cause crash
1270
1271         * platform/PlatformMouseEvent.h:
1272         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
1273         * platform/mac/PlatformMouseEventMac.mm:
1274         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
1275         The default constructor now creates a "zero" event, and a new one was added to create the "current" one.
1276
1277         * bridge/mac/FrameMac.mm:
1278         (WebCore::FrameMac::handleMouseMoveEvent):
1279         * rendering/RenderFormElement.cpp:
1280         (WebCore::RenderFormElement::clicked): 
1281         Updated for the above changes.
1282
1283         * platform/gdk/MouseEventGdk.cpp:
1284         * platform/gdk/TemporaryLinkStubs.cpp:
1285         (PlatformMouseEvent::PlatformMouseEvent):
1286         * platform/win/MouseEventWin.cpp:
1287         * platform/win/TemporaryLinkStubs.cpp:
1288         (PlatformMouseEvent::PlatformMouseEvent):
1289         Trying not to break other platforms.
1290
1291         * manual-tests/invalid-mouse-event.html: Added.
1292
1293 2006-07-20  Maciej Stachowiak  <mjs@apple.com>
1294         
1295         Reviewed by Anders.
1296
1297         - delete line that I only commented in the last patch - meant to do this before landing
1298
1299         * html/HTMLFrameElement.cpp:
1300         (WebCore::HTMLFrameElement::close): 
1301
1302 2006-07-19  Maciej Stachowiak  <mjs@apple.com>
1303
1304         Reviewed by Geoff.
1305
1306         - fixed <rdar://problem/4634484> REGRESSION: Project Change Request form should have vertical scroll bar, but doesn't
1307         
1308         I couldn't figure out how to make an automated test case for this,
1309         or even a manual one. It seems to be timing-related in some way.
1310
1311         * html/HTMLFrameElement.cpp:
1312         (WebCore::HTMLFrameElement::close): detach the child frame from
1313         its element, not the frame containing this element.
1314
1315 2006-07-20  Anders Carlsson  <acarlsson@apple.com>
1316
1317         Reviewed by Darin.
1318
1319         * bridge/mac/FrameMac.mm:
1320         (WebCore::FrameMac::nextKeyViewInFrame):
1321         Hold a ref to the node in case it gets destroyed by an event handler.
1322
1323 2006-07-19  Mark Rowe  <opendarwin.org@bdash.net.nz>
1324
1325         Reviewed by Darin.
1326
1327         http://bugzilla.opendarwin.org/show_bug.cgi?id=10021
1328         Bug 10021: REGRESSION: Stack overflow due to infinite recursion in 
1329         Image::checkForSolidColor
1330
1331         * platform/Image.cpp:
1332         (WebCore::Image::cacheFrame): Don't call checkForSolidColor unless 
1333         the frame was decoded successfully.
1334
1335 2006-07-19  Adele Peterson  <adele@apple.com>
1336
1337         Reviewed by Maciej.
1338
1339         - Fix for: 
1340         <rdar://problem/4422657> REGRESSION: member name field or password field should have focus after loading webmail.mac.com (7405)
1341         http://bugzilla.opendarwin.org/show_bug.cgi?id=7405
1342
1343         <rdar://problem/4614181> REGRESSION: Crash in WebCore::RenderTextField::text() when quoting post at the Ars Technica forum (9707)
1344         http://bugzilla.opendarwin.org/show_bug.cgi?id=9707
1345
1346         Needs an http test. (http://bugzilla.opendarwin.org/show_bug.cgi?id=10020)
1347
1348         These bugs were both cases where focus() was called on an element which didn't have a renderer yet because stylesheets hadn't finished loading yet.
1349         Now, we detect this case and let setFocusNode be called.  And when the stylesheet finishes loading, and the element attaches, a timer will fire, 
1350         which will cause the correct selection & scrolling behavior to occur. 
1351
1352         This fix removes selection and scrolling behavior from the focus method.  This code is now in a new method, updateFocusAppearance.
1353         updateFocusAppearance can now be called directly from focus(), but it can also be called when a timer fires.  This timer gets set
1354         up when an element attaches, and its already been focused by the focus method.  We have to use a timer, because updateFocusAppearance can cause
1355         a layout to happen, and we don't want that to happen in the middle of attach().
1356
1357         * bindings/objc/DOM.mm: (-[DOMElement isFocused]): Added SPI for autofill.
1358         * bindings/objc/DOMPrivate.h:
1359
1360         * dom/Element.cpp:
1361         (WebCore::Element::Element): Initializes timer and needFocusAppearanceUpdate bool.
1362         (WebCore::Element::attach): Checks needsFocusAppearanceUpdate, and if the node is focused, then starts the timer.
1363         (WebCore::Element::focus): Updated to check supportsFocus before calling setFocusNode, 
1364         and only requiring the element to be focusable now before updating focus appearance.
1365         (WebCore::Element::updateFocusAppearance): Added. Separates the selection, and the scrolling from focusing the node.
1366         (WebCore::Element::updateFocusAppearanceTimerFired): Stops the timer, and if the element is focusable, calls updateFocusAppearance.
1367         (WebCore::Element::stopUpdateFocusAppearanceTimer):  Cancels timer, and setsNeedsFocusAppearanceUpdate(false).
1368         (WebCore::Element::detach): Calls stopUpdateFocusAppearanceTimer.
1369         (WebCore::Element::blur): ditto.
1370         * dom/Element.h:
1371         (WebCore::Element::needsFocusAppearanceUpdate): Added so the timer only fires when focus() methods have caused an element to be focused.
1372         (WebCore::Element::setNeedsFocusAppearanceUpdate): Added so focus methods can set this flag.
1373
1374         * dom/Node.h: (WebCore::Node::supportsFocus): Added.  Base class just calls isFocusable.
1375         * html/HTMLAnchorElement.h: Added supportsFocus.
1376         * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::supportsFocus): Added. Checks for the case where stylesheets haven't loaded yet,
1377         so we can still focus the node without a renderer, and when it gets a renderer, we'll update the focus appearance.
1378         * html/HTMLGenericFormElement.h: (WebCore::HTMLGenericFormElement::supportsFocus): ditto.
1379         * html/HTMLGenericFormElement.cpp: Removed include of Document.h since this is now in the header.
1380
1381         * html/HTMLInputElement.cpp:
1382         (WebCore::HTMLInputElement::focus): Updated to check supportsFocus before calling setFocusNode, 
1383         and only requiring the element to be focusable now before updating focus appearance.
1384         (WebCore::HTMLInputElement::updateFocusAppearance): Added. Separates the selection, and the scrolling from focusing the node.
1385         * html/HTMLInputElement.h:
1386
1387         * html/HTMLTextAreaElement.cpp:
1388         (WebCore::HTMLTextAreaElement::focus): Updated to check supportsFocus before calling setFocusNode, 
1389         and only requiring the element to be focusable now before updating focus appearance.
1390         (WebCore::HTMLTextAreaElement::updateFocusAppearance): Added. Separates the selection, and the scrolling from focusing the node.
1391         * html/HTMLTextAreaElement.h:
1392
1393 2006-07-19  Justin Garcia  <justin.garcia@apple.com>
1394
1395         Reviewed by levi
1396         
1397         <rdar://problem/4631972>
1398         REGRESSION: Mail crashes when pasting entire contents of http://www.apple.com/support/ into a new mail message
1399
1400         * dom/Position.cpp:
1401         (WebCore::Position::upstream): Deployed isBlock and enclosingBlock.
1402         (WebCore::Position::downstream): Ditto.
1403         * editing/CompositeEditCommand.cpp:
1404         (WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): Ditto.
1405         * editing/htmlediting.cpp:
1406         (WebCore::canHaveChildrenForEditing): Added !iframe.
1407         (WebCore::isBlock): Added, returns !node->renderer()->isInline()
1408         (WebCore::enclosingBlock): Added.
1409         * editing/htmlediting.h:
1410
1411 2006-07-19  Anders Carlsson  <acarlsson@apple.com>
1412
1413         Reviewed by Adele.
1414
1415         <rdar://problem/4631272> REGRESSION: Crash tabbing out of hostname field at autorestore.apple.com
1416         
1417         * bridge/mac/FrameMac.mm:
1418         (WebCore::FrameMac::nextKeyViewInFrame):
1419         Take into account that focus handlers can cause a node's renderer to be destroyed.
1420         
1421 2006-07-19  David Hyatt  <hyatt@apple.com>
1422
1423         Fix for 4638376.  The 1x1 solid color image optimization was broken when
1424         I re-architected image.  This patch restores the optimization for CG.  Cairo
1425         will still need the optimization.
1426
1427         Reviewed by darin
1428
1429         WARNING: NO TEST CASES ADDED OR CHANGED (need test cases still)
1430
1431         * platform/Image.cpp:
1432         (WebCore::Image::Image):
1433         (WebCore::Image::invalidateData):
1434         (WebCore::Image::cacheFrame):
1435         * platform/Image.h:
1436         (WebCore::Image::setIsPDF):
1437         * platform/cairo/ImageCairo.cpp:
1438         (WebCore::Image::checkForSolidColor):
1439         * platform/mac/ImageMac.mm:
1440         (WebCore::Image::initNativeData):
1441         (WebCore::Image::invalidateNativeData):
1442         (WebCore::Image::checkForSolidColor):
1443         (WebCore::Image::draw):
1444         (WebCore::Image::drawTiled):
1445
1446 2006-07-19  Justin Garcia  <justin.garcia@apple.com>
1447
1448         Reviewed by levi
1449         
1450         <rdar://problem/4613519>
1451         REGRESSION: Pasting text in native text area inserts text one character before it should (9527)
1452
1453         * editing/InsertParagraphSeparatorCommand.cpp:
1454         (WebCore::InsertParagraphSeparatorCommand::doApply): Turn into an InsertLineBreakCommand instead of bailing
1455         if the enclosingBlockFlowElement doesn't have a parent.
1456
1457 2006-07-19  David Harrison  <harrison@apple.com>
1458
1459         Reviewed by Tim Hatcher.
1460
1461         <rdar://problem/4629307> -[DOMRange markupString] does not include the initial table element if it is at the beginning of the range
1462         <rdar://problem/4062218> pasting in contents of web.apple.com strips off the <table> element from the first table
1463         
1464         Better patch than previous checkin.
1465
1466         * test: editing/pasteboard/paste-table-003.html
1467         
1468         * editing/markup.cpp:
1469         (WebCore::createMarkup):
1470         Make sure to include the table when including a tbody.
1471
1472 === Safari-521.19 ===
1473
1474 2006-07-19  David Harrison  <harrison@apple.com>
1475
1476         Reviewed by Tim Hatcher.
1477
1478         <rdar://problem/4629307> -[DOMRange markupString] does not include the initial table element if it is at the beginning of the range
1479
1480         No test case as this can only be reproduced through ObjC APIs.
1481
1482         * editing/markup.cpp:
1483         (WebCore::createMarkup):
1484         Adjust the range for ancestor markup handling when main loop skips first node.
1485
1486 2006-07-18  David Hyatt  <hyatt@apple.com>
1487
1488         Fix for radar 4611287, make resizable text fields opt-in rather than
1489         opt-out.  Open source users will need to write the pref into their defaults
1490         to see the resizers on textareas now.
1491
1492         Reviewed by mjs and adele
1493
1494         * WebCore.xcodeproj/project.pbxproj:
1495         * bridge/mac/WebCoreSettings.mm:
1496         (-[WebCoreSettings setTextAreasAreResizable:]):
1497         * css/cssparser.cpp:
1498         (WebCore::CSSParser::parseValue):
1499         * css/cssstyleselector.cpp:
1500         (WebCore::CSSStyleSelector::applyProperty):
1501         * css/html4.css:
1502
1503 2006-07-18  Anders Carlsson  <acarlsson@apple.com>
1504
1505         Reviewed by Darin.
1506
1507         http://bugzilla.opendarwin.org/show_bug.cgi?id=9959
1508         REGRESSION: iframes stop rendering after 200th one on successive reloads
1509         
1510         * html/HTMLFrameElement.cpp:
1511         (WebCore::HTMLFrameElement::attach):
1512         (WebCore::HTMLFrameElement::close):
1513         * html/HTMLIFrameElement.cpp:
1514         (WebCore::HTMLIFrameElement::insertedIntoDocument):
1515         (WebCore::HTMLIFrameElement::willRemove):
1516         Remove calls to incrementFrameCount and decrementFrameCount.
1517         
1518         * page/Frame.cpp:
1519         (WebCore::Frame::Frame):
1520         Call incrementFrameCount here.
1521         
1522         (WebCore::Frame::~Frame):
1523         Call disconnectOwnerElement.
1524         
1525         (WebCore::Frame::disconnectOwnerElement):
1526         Call decrementFrameCount here.
1527         
1528 2006-07-18  Alexey Proskuryakov  <ap@nypop.com>
1529
1530         Reviewed by Darin.
1531
1532         Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9013
1533         Let correct CSS custom cursor declarations parse
1534
1535         * css/cssparser.cpp:
1536         (WebCore::CSSParser::parseValue): Ignore any values following a custom CSS cursor URI, instead of
1537         requiring that it is the only one in the list (which is actually illegal, according to the spec). 
1538         This is only a temporary hack, with a real implementation to follow in bug 6001/6002.
1539
1540         * manual-tests/custom-cursors.html: Added a test for this issue.
1541         * manual-tests/resources/helpCursor.tiff: A cursor image used in the test.
1542
1543 2006-07-18  Timothy Hatcher  <timothy@apple.com>
1544
1545         Reviewed by Anders.
1546         
1547         <rdar://problem/4636216> NetNewsWire fails to launch on 9A224 - missing symbols
1548         
1549         WebCore needs to add -sub_library libobjc to maintain
1550         backwards compatibility with binaries linked with WebKit
1551         before JavaScriptCore moved out of WebKit.
1552
1553         * WebCore.xcodeproj/project.pbxproj:
1554
1555 2006-07-18  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1556
1557         Reviewed by Justin.
1558
1559         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9978
1560           REGRESSION (r12949-r12988): Clicking the first letter on a line places the caret at the end of the previous line
1561
1562         Test: editing/selection/click-start-of-line.html
1563
1564         * rendering/RenderText.cpp:
1565         (WebCore::RenderText::positionForCoordinates): Changed to return downstream
1566         affinity if the x coordinate is to the left of the middle of the first character
1567         in the text box.
1568
1569 2006-07-18  Anders Carlsson  <acarlsson@apple.com>
1570
1571         Reviewed by Darin.
1572
1573         http://bugzilla.opendarwin.org/show_bug.cgi?id=9695
1574         <rdar://problem/4614085> 
1575         TOT REGRESSION: NativeTextArea: Text area does not respond to Cmd-UpArrow/Cmd-DownArrow (9695)
1576         
1577         * editing/SelectionController.cpp:
1578         (WebCore::SelectionController::modifyExtendingRightForward):
1579         (WebCore::SelectionController::modifyMovingRightForward):
1580         (WebCore::SelectionController::modifyExtendingLeftBackward):
1581         (WebCore::SelectionController::modifyMovingLeftBackward):
1582         If the caret is inside an editable region, the beginning/end of the document should actually be the
1583         beginning/end of the editable region.
1584
1585 2006-07-17  Tim Omernick  <timo@apple.com>
1586
1587         Reviewed by Maciej.
1588
1589         <rdar://problem/4612079> need a way to prevent pages from scrolling to reveal elements that are focused
1590         by script
1591
1592         * bridge/mac/WebCoreFrameBridge.h:
1593         * bridge/mac/WebCoreFrameBridge.mm:
1594         (-[WebCoreFrameBridge setProhibitsScrolling:]):
1595         * page/Frame.cpp:
1596         (WebCore::Frame::prohibitsScrolling):
1597         (WebCore::Frame::setProhibitsScrolling):
1598         * page/Frame.h:
1599         * page/FramePrivate.h:
1600         (WebCore::FramePrivate::FramePrivate):
1601         * page/FrameView.cpp:
1602         (WebCore::FrameView::scrollPointRecursively):
1603         (WebCore::FrameView::setContentsPos):
1604         * page/FrameView.h:
1605         * platform/ScrollView.h:
1606
1607 2006-07-17  Maciej Stachowiak  <mjs@apple.com>
1608
1609         Reviewed by Dave Harrison.
1610         
1611         - fixed <rdar://problem/4618089> Blot crashes when I paste in all the contents of http://www.apple.com/startpage/
1612
1613         * editing/htmlediting.cpp:
1614         (WebCore::editingIgnoresContent):
1615
1616 2006-07-17  Justin Garcia  <justin.garcia@apple.com>
1617
1618         Reviewed by levi
1619         
1620         <rdar://problem/4621728>
1621         REGRESSION: Selecting by dragging down creates selection in wrong direction, with certain steps
1622         <rdar://problem/4604932>
1623         REGRESSION: Dragging too far left on a line will select all lines above it.
1624  
1625         No layout test because of 9980.
1626
1627         * rendering/RenderBlock.cpp:
1628         (WebCore::RenderBlock::positionForCoordinates): Don't return positions inside editable roots
1629         for coordinates outside those roots, except for coordinates outside a document that is entirely 
1630         editable.
1631
1632 2006-07-17  Timothy Hatcher  <timothy@apple.com>
1633
1634         Reviewed by Darin.
1635
1636         <rdar://problem/4635281> JSCanvasRenderingContext2D::drawImage needs to initialize the exception code to zero
1637
1638         * bindings/js/JSCanvasRenderingContext2DCustom.cpp:
1639         (WebCore::JSCanvasRenderingContext2D::drawImage): initialize ec to zero
1640         * html/CanvasRenderingContext2D.cpp:
1641         (WebCore::CanvasRenderingContext2D::drawImage): initialize ec before earlier return
1642
1643 2006-07-17  Timothy Hatcher  <timothy@apple.com>
1644
1645         Reviewed by Maciej.
1646
1647         <rdar://problem/4634874> WebScriptObject and WebUndefined are no longer defined by WebKit
1648
1649         Moves WebScriptObject and WebUndefined to WebCore.
1650
1651         * WebCore.exp:
1652         * WebCore.xcodeproj/project.pbxproj:
1653         * bindings/objc/DOM.mm:
1654         * bindings/objc/DOMCore.h:
1655         * bindings/objc/DOMInternal.mm:
1656         * bindings/objc/DOMUtility.mm:
1657         * bindings/objc/WebScriptObject.mm: Added.
1658         (+[WebUndefined allocWithZone:]):
1659         (-[WebUndefined initWithCoder:]):
1660         (-[WebUndefined encodeWithCoder:]):
1661         (-[WebUndefined copyWithZone:]):
1662         * bindings/objc/WebScriptObjectPrivate.h: Added.
1663         * bridge/mac/FrameMac.mm:
1664         * bridge/mac/WebCoreScriptDebugger.mm:
1665
1666 2006-07-17  David Hyatt  <hyatt@apple.com>
1667
1668         Back out the fix for 5564, since it turns out font:x-small; is a pretty
1669         prominent IE-specific CSS hack.  Because Web sites rely on IE's incorrect
1670         font parsing as a means of also correcting IE's incorrect font size rules.
1671
1672         This fixes Yahoo.com.
1673
1674         Reviewed by darin
1675
1676         * css/cssparser.cpp:
1677         (WebCore::CSSParser::parseFont):
1678
1679 2006-07-17  Justin Garcia  <justin.garcia@apple.com>
1680
1681         Reviewed by levi
1682         
1683         <rdar://problem/4618389> REGRESSION: After applying a link to the last word of a sentence, a new selection is created at the start of the sentence
1684         
1685         * dom/Document.cpp:
1686         (WebCore::Document::updateSelection):
1687
1688 2006-07-17  Maciej Stachowiak  <mjs@apple.com>
1689
1690         Reviewed by Beth.
1691         
1692         <rdar://problem/4604946> REGRESSION: 'checkboxRef.checked = true' fires onchange event in Leopard
1693
1694         * html/HTMLInputElement.cpp:
1695         (WebCore::HTMLInputElement::setChecked):
1696         (WebCore::HTMLInputElement::preDispatchEventHandler):
1697         * html/HTMLInputElement.h:
1698
1699 2006-07-16  David Kilzer  <ddkilzer@kilzer.net>
1700
1701         Reviewed by Darin.
1702
1703         - fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=9954
1704           REGRESSION: document.dir should return empty string in <head>
1705
1706         Test: fast/dom/document-dir-property.html
1707
1708         * bindings/js/kjs_html.cpp:
1709         (KJS::JSHTMLDocument::getValueProperty): Return an empty string instead of an
1710         undefined value for an unset document.dir property.
1711
1712 2006-07-16  David Kilzer  <ddkilzer@kilzer.net>
1713
1714         Reviewed by Darin.
1715
1716         * dom/NodeFilter.idl:
1717         Removed "No newline at end of file" that snuck in as part of the "apply patch" process.
1718         * manual-tests/input-empty-on-focus.html:
1719         Removed "Property changes" that snuck in as part of the "apply patch" process.
1720
1721 2006-07-16  Darin Adler  <darin@apple.com>
1722
1723         Reviewed by John Sullivan.
1724
1725         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9943
1726           <rdar://problem/4590613>
1727           REGRESSION (Tiger-TOT): menus are offset to the right at http://movies.aol.com/movie-photo-bts/superman-returns
1728
1729         The problem turns out to be the fact that body.offsetLeft is returning a non-zero value.
1730         I have no idea why the menus worked in Tiger Safari, because body.offsetLeft behavior has not changed.
1731         Presumably some other bug that we fixed had been compensating.
1732
1733         Test: fast/html/body-offset-properties.html
1734
1735         * rendering/RenderObject.cpp:
1736         (WebCore::RenderObject::offsetLeft): Always return 0 for any object without an offsetParent.
1737         (WebCore::RenderObject::offsetTop): Ditto.
1738         (WebCore::RenderObject::offsetParent): Return 0 for the body (treat as a special case).
1739
1740 2006-07-16  Beth Dakin  <bdakin@apple.com>
1741
1742         Reviewed by Maciej.
1743
1744         Fix for <rdar://problem/4616595> REGRESSION: Problems with world 
1745         clock widget clock hand motion on 9A211 + 4604574
1746
1747         The second hand on the widget was jiggling because the rotation was 
1748         messing up the use of the affine transformation matrix while 
1749         rounding to pixel boundaries in device space. We are mainly 
1750         concerned with rounding to pixel boundaries with the scale in mind, 
1751         so this patch extracts the scale to device space from the matrix, 
1752         and rounds to pixel boundaries using only the scale. This doesn't 
1753         seem like it is a perfect solution, but it definitely solves the 
1754         immediate problem. We will probably need to re-address what should 
1755         happen to avoid pixel cracks with rotations at non-integral scale 
1756         factors. 
1757
1758         * platform/cg/GraphicsContextCG.cpp:
1759         (WebCore::GraphicsContext::roundToDevicePixels):
1760
1761 2006-07-15  Darin Adler  <darin@apple.com>
1762
1763         - fix mistake from fix for 8952 that was breaking layout tests
1764
1765         * editing/SelectionController.cpp: (WebCore::SelectionController::nodeWillBeRemoved):
1766         Justin was right! I changed the behavior of the function by accident. Changed it
1767         back so that it doesn't blow away the selection on the DOM side in the case where
1768         it didn't before.
1769
1770         I will write 100 times on the blackboard: "When Justin says something about editing,
1771         assume he is right."
1772
1773 2006-07-15  Darin Adler  <darin@apple.com>
1774
1775         - try to fix Windows build
1776
1777         * WebCore.vcproj/WebCore/WebCore.vcproj: Added StreamingTextDecoderICU.cpp/h.
1778
1779 2006-07-15  Darin Adler  <darin@apple.com>
1780
1781         Reviewed by John Sullivan.
1782
1783         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8952
1784           <rdar://problem/4575185>
1785           REGRESSION: crash on drag of highlighted Google custom home page modules
1786
1787         Test: fast/dynamic/move-node-with-selection.html
1788
1789         * editing/SelectionController.cpp: (WebCore::SelectionController::nodeWillBeRemoved):
1790         Call updateRendering before calling clearSelection(), since it's important to do any
1791         work beforehand, and there are calls inside clearSelection that will indirectly do an
1792         updateRendering. Also change code to make fewer assumptions about object lifetime.
1793
1794 2006-07-15  Darin Adler  <darin@apple.com>
1795
1796         Reviewed by John Sullivan.
1797
1798         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8587
1799           <rdar://problem/4631844>
1800           REGRESSION: {display:list-item} on items outside an ol or ul element no longer causes incremental numbering
1801
1802         Test: fast/lists/numeric-markers-outside-list.html
1803
1804         * rendering/RenderListItem.cpp: (WebCore::previousListItem):
1805         Look for list items, even when we're outside any list.
1806
1807 2006-07-15  Adele Peterson  <adele@apple.com>
1808
1809         Reviewed by John.
1810
1811         - Fix for <rdar://problem/4593970> REGRESSION (NativeTextField): autofill menu disappears after typing a 2nd character
1812
1813         This was caused by composite editing commands, (like typing or pasting) that include a DeleteCommand, being
1814         interpreted by the form delegate as an actual delete.  This fix doesn't notify the form delegate if the deletion is
1815         part of an editing command to replace the selected text.
1816
1817         * editing/DeleteSelectionCommand.h: Added m_replace to keep track of whether this deletion is 
1818           part of a composite command to replace the text being deleted.
1819         * editing/DeleteSelectionCommand.cpp:
1820         (WebCore::DeleteSelectionCommand::DeleteSelectionCommand): Initialize m_replace.
1821         (WebCore::DeleteSelectionCommand::doApply): Only notify the form delegate of the deletion if the text is not being replaced.
1822         * editing/CompositeEditCommand.h:
1823         * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::deleteSelection): 
1824           Added replace argument to construct DeleteSelectionCommand.
1825           
1826         * editing/InsertTextCommand.cpp: (WebCore::InsertTextCommand::input): Call deleteSelection with replace argument.
1827         * editing/ReplaceSelectionCommand.cpp: (WebCore::ReplaceSelectionCommand::doApply): ditto.
1828
1829 2006-07-15  Geoffrey Garen  <ggaren@apple.com>
1830
1831         Reviewed by Maciej, tweaked to match Darin's patch.
1832         
1833         - Fixed <rdar://problem/4631837> REGRESSION: Reproducible crash on 
1834         FCKeditor demo (9911)
1835         
1836         * WebCore.xcodeproj/project.pbxproj:
1837         * bindings/js/kjs_html.cpp:
1838         (KJS::JSHTMLDocument::putValueProperty): Check for a null body element before
1839         forwarding the put request to it. I confirmed that no other parts of the 
1840         file use 'body' or 'bodyElement' without checking for null. 
1841         
1842         Also, use 'body' rather than 'bodyElement' because dir can bet set on 
1843         any element, not just HTMLBodyElement.
1844
1845 2006-07-15  Darin Adler  <darin@apple.com>
1846
1847         Reviewed by Adele.
1848
1849         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8871
1850           <rdar://problem/4575417>
1851           REGRESSION: Pressing Enter/Return in a text input removes the selected text
1852
1853         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9743
1854           <rdar://problem/4614228>
1855           REGRESSION: crash dispatching JavaScript-created keyboard event to input element
1856
1857         * bridge/mac/FrameMac.mm: (WebCore::FrameMac::doTextFieldCommandFromEvent):
1858         Add a null check to fix the crash, and a FIXME explaining why this is not necessarily
1859         enough for the future.
1860
1861         * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::defaultEventHandler):
1862         Consume Enter key keypress events even if the element is not in a form.
1863
1864         * platform/mac/KeyEventMac.mm: (WebCore::keyIdentifierForKeyEvent): Added \n to the
1865         characters that turn into "Enter". Actual keyboard events always are \r or \003 on
1866         the Macintosh, but in layout tests we can use \n, and everything other than the
1867         code path here works, so worth fixing.
1868
1869 2006-07-15  Darin Adler  <darin@apple.com>
1870
1871         Reviewed by John Sullivan.
1872
1873         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9883
1874           <rdar://problem/4631821>
1875           REGRESSION: NativePopups don't work correctly in some forum software
1876
1877         Test: fast/forms/select-selected.html
1878
1879         * rendering/RenderMenuList.h:
1880         * rendering/RenderMenuList.cpp:
1881         (WebCore::RenderMenuList::updateFromElement): Added code to map the selected option
1882         index to a list index before using it to index into the list.
1883         (WebCore::RenderMenuList::showPopup): Added code to map the selection option index
1884         to a list index before passing it to the menu renderer.
1885         (WebCore::RenderMenuList::valueChanged): Added code to map the list index back to a
1886         option index before calling setSelectedIndex (that function takes an option index).
1887
1888 2006-07-15  Darin Adler  <darin@apple.com>
1889
1890         Reviewed by John Sullivan.
1891
1892         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9928
1893           REGRESSION: Text Encoding menu inoperative (after gcc protocol build fix)
1894
1895         * bindings/objc/DOM.mm:
1896         (-[DOMNode addEventListener:::]): Moved into DOMEventTarget category.
1897         (-[DOMNode removeEventListener:::]): Ditto.
1898         (-[DOMNode dispatchEvent:]): Ditto.
1899
1900         * WebCore.xcodeproj/project.pbxproj: Allow Xcode to do its thing.
1901
1902 2006-07-15  Maciej Stachowiak  <mjs@apple.com>
1903
1904         Reviewed by Anders.
1905
1906         <rdar://problem/4632144> REGRESSION: table column tests failing as a result of very recent fix
1907
1908         * rendering/RenderTable.cpp:
1909         (WebCore::RenderTable::addChild): columns and colgroups are valid children of a table too, not
1910         just table sections!
1911
1912 2006-07-15  Anders Carlsson  <acarlsson@apple.com>
1913
1914         Reviewed by Darin.
1915
1916         http://bugzilla.opendarwin.org/show_bug.cgi?id=9866
1917         <rdar://problem/4631561>
1918         REGRESSION: Repro crash from mangleme using iframe, only from server.
1919         
1920         * html/HTMLIFrameElement.cpp:
1921         (WebCore::HTMLIFrameElement::attach):
1922         Add null check for contentFrame() since content frames won't be created for invalid URLs.        
1923
1924 2006-07-14  Alexey Proskuryakov  <ap@nypop.com>
1925
1926         Reviewed by Darin.
1927
1928         Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=4195
1929         REGRESSION: KOI8-U encoding no longer supported.
1930
1931         Tests:
1932         * http/tests/misc/BOM-override.pl
1933         * http/tests/misc/BOM-override-script.html
1934         * fast/encoding/charset-koi8-u.html
1935         * fast/encoding/charset-x-nextstep.html
1936
1937         Restored a TEC code path for encodings that are not supported by ICU (but which currently
1938         passes all layout tests even by itself with ICU disabled). A lot of refactoring is 
1939         still needed - most importantly, round-tripping encoding names via CFStringEncoding 
1940         makes little sense now.
1941
1942         * WebCore.exp:
1943         * bridge/mac/WebCoreTextDecoder.h: Removed.
1944         * bridge/mac/WebCoreTextDecoder.mm: Removed.
1945         WebCoreTextDecoder was not used anywhere since WebTextView was moved into WebCore.
1946
1947         * loader/Decoder.cpp:
1948         (Decoder::Decoder):
1949         (Decoder::setEncodingName):
1950         (Decoder::decode):
1951         Use StreamingTextDecoder::create().
1952
1953         * platform/StreamingTextDecoder.cpp:
1954         (WebCore::StreamingTextDecoder::create):
1955         (WebCore::StreamingTextDecoder::~StreamingTextDecoder):
1956         * platform/StreamingTextDecoder.h:
1957         StreamingTextDecoder is just an abstract interface to implementations now.
1958
1959         * platform/StreamingTextDecoderICU.cpp: Added.
1960         (WebCore::StreamingTextDecoderICU::StreamingTextDecoderICU):
1961         (WebCore::StreamingTextDecoderICU::~StreamingTextDecoderICU):
1962         (WebCore::StreamingTextDecoderICU::releaseICUConverter):
1963         (WebCore::StreamingTextDecoderICU::textEncodingSupported):
1964         (WebCore::StreamingTextDecoderICU::convertUTF16):
1965         (WebCore::StreamingTextDecoderICU::convertIfASCII):
1966         (WebCore::StreamingTextDecoderICU::createICUConverter):
1967         (WebCore::StreamingTextDecoderICU::appendOmittingBOM):
1968         (WebCore::StreamingTextDecoderICU::convertUsingICU):
1969         (WebCore::StreamingTextDecoderICU::convert):
1970         (WebCore::StreamingTextDecoderICU::toUnicode):
1971         (WebCore::StreamingTextDecoderICU::fromUnicode):
1972         * platform/StreamingTextDecoderICU.h: Added.
1973         Renamed from StreamingTextDecoder; added a way to tell whether the encoding is actually
1974         supported by the decoder; minor cleanup.
1975
1976         * platform/TextEncoding.cpp:
1977         (WebCore::TextEncoding::effectiveEncoding): Moved from StreamingTextDecoder.
1978         (WebCore::TextEncoding::toUnicode): Use StreamingTextDecoder::create().
1979         (WebCore::TextEncoding::fromUnicode): Moved to StreamingTextDecoderICU.
1980         
1981         * platform/TextEncoding.h: Changed __APPLE__ to PLATFORM(MAC); added effectiveEncoding().
1982
1983         * platform/mac/StreamingTextDecoderMac.cpp: Added.
1984         (WebCore::StreamingTextDecoderMac::StreamingTextDecoderMac):
1985         (WebCore::StreamingTextDecoderMac::~StreamingTextDecoderMac):
1986         (WebCore::StreamingTextDecoderMac::releaseTECConverter):
1987         (WebCore::StreamingTextDecoderMac::textEncodingSupported):
1988         (WebCore::StreamingTextDecoderMac::convertUTF16):
1989         (WebCore::StreamingTextDecoderMac::convertIfASCII):
1990         (WebCore::StreamingTextDecoderMac::createTECConverter):
1991         (WebCore::StreamingTextDecoderMac::appendOmittingBOM):
1992         (WebCore::StreamingTextDecoderMac::convertOneChunkUsingTEC):
1993         (WebCore::StreamingTextDecoderMac::convertUsingTEC):
1994         (WebCore::StreamingTextDecoderMac::convert):
1995         (WebCore::StreamingTextDecoderMac::toUnicode):
1996         (WebCore::StreamingTextDecoderMac::fromUnicode):
1997         * platform/mac/StreamingTextDecoderMac.h: Added.
1998         (WebCore::StreamingTextDecoderMac::convert):
1999         This is a TEC+CFString code path for decoding, basically restored from a year-old revision.
2000
2001         * platform/mac/TextEncodingMac.cpp: Removed. Code moved to StreamingTextDecoderMac.
2002
2003         * WebCore.xcodeproj/project.pbxproj:
2004
2005 === Safari-521.17 ===
2006
2007 2006-07-14  Timothy Hatcher  <timothy@apple.com>
2008
2009         <rdar://problem/4623957> SWB: gcc-5412 (new?) objc warning causes WebCore project failure
2010
2011         Made a DOMNode category in DOMEvents.h that lets DOMNode conform to the
2012         DOMEventTarget protocol that works with GCC 5412.
2013
2014         Removed forward declarations of WebCoreWidgetHolder and imported WebCoreWidgetHolder.h.
2015
2016         Removed all <Cocoa/Cocoa.h> and <Foundation/Foundation.h> imports in other headers,
2017         we import <Cocoa/Cocoa.h> in the prefix header for ObjC.
2018
2019         * WebCore.xcodeproj/project.pbxproj:
2020         * bindings/objc/DOMCore.h:
2021         * bindings/objc/DOMEvents.h:
2022         * bridge/mac/FormDataMac.h:
2023         * bridge/mac/WebCoreAXObject.h:
2024         * bridge/mac/WebCoreCache.h:
2025         * bridge/mac/WebCoreEncodings.h:
2026         * bridge/mac/WebCoreFrameBridge.h:
2027         * bridge/mac/WebCoreFrameNamespaces.h:
2028         * bridge/mac/WebCoreJavaScript.h:
2029         * bridge/mac/WebCorePageBridge.h:
2030         * bridge/mac/WebCorePageState.h:
2031         * bridge/mac/WebCoreResourceLoader.h:
2032         * bridge/mac/WebCoreScriptDebugger.h:
2033         * bridge/mac/WebCoreSettings.h:
2034         * bridge/mac/WebCoreStringTruncator.h:
2035         * bridge/mac/WebCoreStringTruncator.mm:
2036         * bridge/mac/WebCoreTextDecoder.h:
2037         * bridge/mac/WebDashboardRegion.h:
2038         * kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
2039         * platform/mac/CookieJar.mm:
2040         * platform/mac/DeprecatedStringMac.mm:
2041         * platform/mac/FontDataMac.mm:
2042         * platform/mac/FoundationExtras.h:
2043         * platform/mac/TextBoundaries.mm:
2044         * platform/mac/WebCoreHistory.h:
2045         * platform/mac/WebCoreHistory.m:
2046         * platform/mac/WebCoreKeyGenerator.h:
2047         * platform/mac/WebCoreTextArea.h:
2048         * platform/mac/WebCoreTextField.h:
2049         * platform/mac/WebCoreTextRenderer.h:
2050         * platform/mac/WebCoreView.h:
2051         * platform/mac/WebCoreWidgetHolder.h:
2052
2053 2006-07-14  Geoffrey Garen  <ggaren@apple.com>
2054
2055         Reviewed by Maciej.
2056
2057         - Updated ScriptInterpreter to work with Interpreter ref-counting in 
2058         JavaScriptCore.
2059
2060         (KJS::ScriptInterpreter::~ScriptInterpreter): Now protected to catch
2061         manual delete.
2062
2063 2006-07-14  Anders Carlsson  <acarlsson@apple.com>
2064
2065         Reviewed by Adele and Justin.
2066
2067         http://bugzilla.opendarwin.org/show_bug.cgi?id=9658
2068         <rdar://problem/4613948>
2069         REGRESSION: Check Spelling does not work in textarea elements
2070         
2071         * bridge/mac/FrameMac.mm:
2072         (WebCore::FrameMac::advanceToNextMisspelling):
2073         Don't use setStartBefore or setEndAfter on the search range because for shadow trees, there
2074         is no notion of before and after. Instead, use setStart and setEnd and pass in the start and end
2075         indices respectively.
2076         
2077         * dom/Range.cpp:
2078         (WebCore::Range::checkNodeBA):
2079         Allow range operations on shadow trees.
2080
2081         * manual-tests/form-element-spelling.html: Added.
2082
2083 2006-07-14  Beth Dakin  <bdakin@apple.com>
2084
2085         Reviewed by Hyatt.
2086
2087         Fix for <rdar://problem/4621660> REGRESSION: Safari crashing in 
2088         WebCore::FrameView::updateOverflowStatus
2089
2090         m_viewportRenderer is never initialized for framesets, and it 
2091         shouldn't be. So we just need to nil-check for it in 
2092         updateOverflowStatus() and return early.
2093
2094         * page/FrameView.cpp:
2095         (WebCore::FrameView::updateOverflowStatus): Nil check.
2096
2097 2006-07-14  Adele Peterson  <adele@apple.com>
2098
2099         RS by Darin.
2100
2101         Backing out fix for <rdar://problem/4604703> 
2102         REGRESSION (NativeTextField): Focus is not removed from password field after I ctrl-click into a different field
2103
2104         Darin had a better fix in WebKit for this.
2105
2106         * bridge/mac/FrameMac.mm: (WebCore::FrameMac::sendContextMenuEvent):
2107
2108 2006-07-14  Adele Peterson  <adele@apple.com>
2109
2110         Reviewed by Darin.
2111
2112         - Fix for <rdar://problem/4614054> REGRESSION: Safari submits forms when the Return key is hit to complete inline inputs
2113
2114         * page/Frame.h: (WebCore::Frame::inputManagerHasMarkedText): Added.
2115         * bridge/mac/FrameMac.h: ditto.
2116         * bridge/mac/FrameMac.mm: (WebCore::FrameMac::inputManagerHasMarkedText): Added. Asks the input manager if there's marked text.
2117         * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::defaultEventHandler): For text fields, don't submit the form on Enter
2118         if the input manager says there's marked text.  I added this code for all text field paths.  For widgets, WebCoreTextField.mm
2119         has code to deal with this case.  But as we convert search, password, and isindex, they will need to do this check too.
2120
2121 2006-07-14  Mitz Pettel  <opendarwin.org@mitzpettel.com>
2122
2123         Reviewed by Darin.
2124
2125         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9907
2126           REGRESSION (r15418): editing/pasteboard/paste-table-001 fails in pixel  mode
2127
2128         * rendering/RenderText.cpp:
2129         (WebCore::RenderText::caretRect): Fixed the calculation of the max/min allowed caret
2130         position.
2131
2132 2006-07-14  Mitz Pettel  <opendarwin.org@mitzpettel.com>
2133
2134         Reviewed by Darin.
2135
2136         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9905
2137           REGRESSION (r15404-r15415): Repro crash when pressing delete in an empty editable div
2138
2139         Test: editing/deleting/delete-at-start-or-end.html
2140
2141         * editing/TypingCommand.cpp:
2142         (WebCore::TypingCommand::deleteKeyPressed): Added null check.
2143         (WebCore::TypingCommand::forwardDeleteKeyPressed): Ditto.
2144
2145 2006-07-14  David Kilzer  <ddkilzer@kilzer.net>
2146
2147         Reviewed by Geoffrey.
2148
2149         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9903
2150           Simplify logic in JSHTMLOptionsCollection::setLength() by using no-arg getNumber()
2151
2152         No test cases since there is no change in functionality.
2153
2154         * bindings/js/JSHTMLOptionsCollectionCustom.cpp:
2155         (WebCore::JSHTMLOptionsCollection::setLength):  Simplified logic by using the
2156         no-argument getNumber() method.
2157
2158 2006-07-14  Geoffrey Garen  <ggaren@apple.com>
2159
2160         Reviewed by Adele.
2161
2162         - Build fix: don't need BLOCK_OBJC_EXCEPTIONS because we already have
2163         one surrounding this function, and the nested one makes the compiler
2164         think our local variable is volatile (seems like a compiler bug to me).
2165         
2166         * bridge/mac/FrameMac.mm:
2167         (WebCore::FrameMac::sendContextMenuEvent):
2168
2169 2006-07-14  Timothy Hatcher  <timothy@apple.com>
2170
2171         Reviewed by Maciej.
2172
2173         Make JavaScriptCore a public framework. Adjusted the paths.
2174
2175         * WebCore.xcodeproj/project.pbxproj:
2176
2177 2006-07-14  Maciej Stachowiak  <mjs@apple.com>
2178
2179         Reviewed by Hyatt.
2180
2181         - fixed <rdar://problem/4567031> REGRESSION: Crash at WebCore::RenderBlock::createLineBoxes (seems to be a security hole?)
2182         
2183         I also fixed all the similar crash / assertion failure cases I could think of.
2184
2185         * dom/Node.cpp:
2186         (WebCore::Node::nextRendererWithSameParent): Helper function for some of the above.
2187         * dom/Node.h:
2188         * rendering/RenderTable.cpp:
2189         (WebCore::RenderTable::addChild): Don't allow inserting forms when not in
2190         an HTML document, since we don't need that quirk and because parsing won't
2191         do certain render tree fixups. Also watch out for case when inserting before
2192         the renderer of a misnested child.
2193         * rendering/RenderTableRow.cpp:
2194         (WebCore::RenderTableRow::addChild): ditto
2195         * rendering/RenderTableSection.cpp:
2196         (WebCore::RenderTableSection::addChild): ditto
2197
2198 2006-07-13  Adele Peterson  <adele@apple.com>
2199
2200         Reviewed by Maciej.
2201
2202         - Fix for <rdar://problem/4604703> 
2203         REGRESSION (NativeTextField): Focus is not removed from password field after I ctrl-click into a different field
2204
2205         Test:
2206         * manual-tests/password-ctrl-click-lose-focus.html: Added.
2207
2208         * bridge/mac/FrameMac.mm: (WebCore::FrameMac::sendContextMenuEvent):
2209         If we're about to set a selection in the current view, make sure its the first responder.
2210         In this case, this will cause the password field to resign first responder at the right time.
2211
2212 2006-07-13  Mitz Pettel  <opendarwin.org@mitzpettel.com>
2213
2214         Reviewed by Hyatt.
2215
2216         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9670
2217           REGRESSION: RTL white-space:pre-wrap text is offset to the right
2218
2219         Test: fast/text/international/rtl-white-space-pre-wrap.html
2220
2221         * rendering/RenderText.cpp:
2222         (WebCore::RenderText::caretRect): Fixed LTR case and added the RTL case
2223         of clipping the caret position to the text box when the caret is after
2224         the trailing space of an autowrapped line.
2225         * rendering/bidi.cpp:
2226         (WebCore::RenderBlock::computeHorizontalPositionsForLine): Changed to truncate-
2227         to-fit the logically last text box if it contains the trailing spaces of an
2228         autowrapped line. 
2229         (WebCore::RenderBlock::bidiReorderLine): Remember the logically last text run.
2230         In the case of autowrapped text with white space that overflows beyond the line,
2231         the last text run is the one containing the overflowing white space.
2232         (WebCore::RenderBlock::findNextLineBreak): Split overflowing white space on a
2233         line that autowraps only after white space into a separate text run.
2234
2235 2006-07-13  David Harrison  <harrison@apple.com>
2236
2237         Reviewed by Dave Hyatt.
2238
2239         <rdar://problem/4624203> -webkit-highlight should be behind images
2240
2241         * rendering/RenderImage.cpp:
2242         (WebCore::RenderImage::paint):
2243         * rendering/RenderListMarker.cpp:
2244         (WebCore::RenderListMarker::paint):
2245         * rendering/RenderWidget.cpp:
2246         (WebCore::RenderWidget::paint):
2247         Call custom highlighter before painting the image, marker, or widget.
2248
2249 2006-07-13  David Harrison  <harrison@apple.com>
2250
2251         Reviewed by Justin and Levi.
2252
2253         <rdar://problem/4620743> REGRESSION: Option-Delete doesn't delete words during typing
2254
2255         * Tests:
2256         editing/deleting/delete-by-word-001.html
2257         editing/deleting/delete-by-word-002.html
2258
2259         * editing/TypingCommand.cpp:
2260         (WebCore::TypingCommand::deleteKeyPressed):
2261         (WebCore::TypingCommand::forwardDeleteKeyPressed):
2262         (WebCore::TypingCommand::doApply):
2263         * editing/TypingCommand.h:
2264         Delete and forward delete to use specified granularity.
2265         Undo of delete and forward delete to select what had been deleted (non-char granularity only).
2266         
2267         * page/Frame.cpp:
2268         (WebCore::Frame::setSelection):
2269         Close typing and end style even if selection is not changing.
2270         * page/Frame.h:
2271         Remove unused setSelection parameter keepTypingStyle.
2272
2273 2006-07-12  Levi Weintraub  <lweintraub@apple.com>
2274
2275         Reviewed by justin
2276
2277         <rdar://problem/4622763> Deleting from beginning of paragraph following a table deletes rather than selects the table
2278
2279         * editing/DeleteSelectionCommand.cpp:
2280         (WebCore::DeleteSelectionCommand::initializeStartEnd): Added selection expansion for HRs.
2281         (WebCore::DeleteSelectionCommand::initializePositionData): Now uses enclosingBlockFlowOrTableElement
2282         instead of enclosingBlockFlowElement.
2283         (WebCore::DeleteSelectionCommand::removeNode): Use to identify that we need a placeholder
2284         when the start or end block is removed.
2285         (WebCore::DeleteSelectionCommand::handleGeneralDelete): Added check for canHaveChildrenForEditing
2286         to keep things like HRs from being given children.
2287         (WebCore::DeleteSelectionCommand::doApply): Switched to use member variable for needPlaceholder.
2288         * editing/DeleteSelectionCommand.h: Made needPlaceholder a member variable.
2289         * editing/TypingCommand.cpp:
2290         (WebCore::TypingCommand::deleteKeyPressed): Fixed selection bug for tables and open typing commands.
2291         (WebCore::TypingCommand::forwardDeleteKeyPressed): Ditto.
2292         * editing/htmlediting.cpp:
2293         (WebCore::editingIgnoresContent): Added check for HRs, since it's not considered a widget.
2294         * editing/visible_units.cpp:
2295         (WebCore::startOfParagraph): Fix for HRs and tables.
2296         (WebCore::endOfParagraph): Ditto.
2297
2298 2006-07-13  Alexey Proskuryakov  <ap@nypop.com>
2299
2300         Reviewed by Darin.
2301
2302         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9880
2303           Memory leaks running DOM-Hanoi
2304
2305         No change in behavior, thus no test included.
2306
2307         * bridge/mac/FrameMac.mm:
2308         (WebCore::FrameMac::setStatusBarText): Use a local autorelease pool to release the temporaries - 
2309         the test runs non-stop, and the enclosing pool doesn't get a chance to be drained.
2310
2311 2006-07-12  Mitz Pettel  <opendarwin.org@mitzpettel.com>
2312
2313         Reviewed by Adele.
2314
2315         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9862
2316           REGRESSION: GMail: Crash in RenderView::repaintViewRectangle when spoofing as FF
2317         - see also <rdar://problem/4622407>
2318
2319         Test: fast/frames/repaint-display-none-crash.html
2320
2321         * rendering/RenderView.cpp:
2322         (WebCore::RenderView::repaintViewRectangle): Added null checking of the owner element's
2323         renderer, which can be null if the iframe is set to display:none.
2324
2325 2006-07-12  Justin Garcia  <justin.garcia@apple.com>
2326
2327         Reviewed by levi
2328         
2329         <rdar://problem/4509393>
2330         selected DOM range starts with <object>, 0 offset but selection should include the <object>
2331
2332         * editing/ReplaceSelectionCommand.cpp:
2333         (WebCore::ReplaceSelectionCommand::shouldMergeStart): 
2334         Don't pull content out of a table cell.
2335         * editing/htmlediting.cpp:
2336         (WebCore::editingIgnoresContent): Added <select> nodes.
2337         (WebCore::rangeCompliantEquivalent): Convert [node, 0] positions to positionBeforeNode(node)
2338         for more types of nodes.
2339         * rendering/RenderContainer.cpp:
2340         (WebCore::RenderContainer::positionForCoordinates): 
2341         Fix a crasher when right clicking on an anonymous table.
2342
2343 2006-07-12  John Sullivan  <sullivan@apple.com>
2344
2345         Reviewed by Brady Eidson
2346         
2347         - fixed <rdar://problem/4611164> REGRESSION: Crash occurs when undoing a series of 
2348         misspelled words (WebCore::RenderObject::repaint(bool)
2349
2350         * dom/Document.cpp:
2351         (WebCore::Document::removeMarkers):
2352         put (it - markers.begin()) in a local variable before altering markers, in every case where this was
2353         happening. One of the cases like this was fixed a while back, but other cases were
2354         either missed at that time or crept in since. 
2355
2356 2006-07-13  Anders Carlsson  <acarlsson@apple.com>
2357
2358         Reviewed by Justin.
2359
2360         http://bugzilla.opendarwin.org/show_bug.cgi?id=9663
2361         REGRESSION (r14948-r14956): Selection in text field remains highlighted when the text field loses focus
2362         
2363         * dom/Document.cpp:
2364         (WebCore::Document::updateSelection):
2365         Don't return early if the selection is empty.
2366
2367 2006-07-12  Anders Carlsson  <acarlsson@apple.com>
2368
2369         Reviewed by Adele.
2370
2371         <rdar://problem/4614656> REGRESSION: onpaste() handlers don't run for textarea elements
2372         
2373         * bridge/mac/FrameMac.mm:
2374         (WebCore::FrameMac::dispatchCPPEvent):
2375         If the element is a shadow node, dispatch the event to its real parent.
2376
2377         * manual-tests/textarea-onpaste.html: Added.
2378
2379 2006-07-12  Beth Dakin  <bdakin@apple.com>
2380
2381         Reviewed by Anders.
2382
2383         Fix for layout test regressions after my check-in last night. Just 
2384         a silly mistake where I should have asked if we were NOT printing 
2385         instead of if we were in the listbox code.
2386
2387         * WebCore.xcodeproj/project.pbxproj: Project file wars. Back to 
2388         XCode 2.3
2389         * platform/mac/ListBoxMac.mm:
2390         (itemTextRenderer): Inverted check.
2391         (groupLabelTextRenderer): Inverted check.
2392
2393 2006-07-12  Darin Adler  <darin@apple.com>
2394
2395         Reviewed by Maciej.
2396
2397         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9806
2398           <rdar://problem/4622622>
2399           REGRESSION: Large rowspan causes WebKit to call abort()
2400
2401         Test: fast/table/large-rowspan-crash.html
2402
2403         * rendering/RenderTableSection.cpp:
2404         (WebCore::RenderTableSection::ensureRows):
2405         Use sizeof(RowStruct) instead of sizeof(int).
2406         Clearly we'll need something better to solve this completely.
2407         I expect another smaller, but still huge, value will still cause a problem.
2408
2409 2006-07-12  Anders Carlsson  <acarlsson@apple.com>
2410
2411         Reviewed by Maciej.
2412
2413         <rdar://problem/4586665> REGRESSION: autorestore.apple.com: Crashes Safari in WebCore::Widget::client() const
2414
2415         * bridge/mac/FrameMac.h:
2416         Add focusCallResultedInViewBeingCreated argument. 
2417         
2418         * bridge/mac/FrameMac.mm:
2419         (WebCore::FrameMac::nextKeyViewInFrame):
2420         If the call to focus() caused the node to get a native widget, set focusCallResultedInViewBeingCreated to true.
2421         
2422         (WebCore::FrameMac::nextKeyViewInFrameHierarchy):
2423         Don't reset the focus node if focusCallResultedInViewBeingCreated is true. Also, add magic to prevent setting
2424         a text field as the first responder if its field editor already is the current first responder.
2425         
2426         * page/FrameView.cpp:
2427         (WebCore::FrameView::handleMousePressEvent):
2428         In some cases, get the event target node again after dispatching the mouse event.
2429
2430 2006-07-12  Beth Dakin  <bdakin@apple.com>
2431
2432         Reviewed by Adele.
2433
2434         Fix for <rdar://problem/4615765> Input[type='search' fields 
2435         initially render too large in Widgets
2436
2437         Fundamentally, the problem here is that we were miscalculating 
2438         things because [NSGraphicsContext currentContextDrawingToScreen] 
2439         was evaluating to false when widgets first load. We only ever used 
2440         this check, however, to determine if we were printing or not, so it 
2441         should not have evaluated to false for loading in Dashbaord. 
2442         Instead, if we query the RenderView about whether or not we are 
2443         printing, we will get the right answer.
2444
2445         No test case added since this appears only to affect Dashboard.
2446
2447         * bridge/mac/WebCoreFrameBridge.mm:
2448         (-[WebCoreFrameBridge drawRect:]): Ask the RenderView if we are 
2449         printing instead. This is not part of the actual bug fix, but it 
2450         seems wise to get rid of all calls to [NSGraphicsContext 
2451         currentContextDrawingToScreen] when we are just trying to determine 
2452         if we are printing or not.
2453         * platform/mac/ListBoxMac.mm:
2454         (itemTextRenderer):This function now takes a boolean, isPrinting.
2455         (groupLabelTextRenderer): Same as above.
2456         (ListBox::sizeForNumberOfLines): Ask the RenderView if we are 
2457         printing.
2458         (-[WebCoreTableView drawRow:clipRect:]): Same as above.
2459         * platform/mac/PopUpButtonMac.mm:
2460         (PopUpButton::sizeHint): Same as above.
2461         * platform/mac/TextFieldMac.mm:
2462         (-[NSSearchFieldCell _addStringToRecentSearches:]):
2463         * rendering/RenderLineEdit.cpp: Same as above.
2464
2465 2006-07-12  Adele Peterson  <adele@apple.com>
2466
2467         Reviewed by Maciej.
2468
2469         Fix for: http://bugzilla.opendarwin.org/show_bug.cgi?id=9813
2470         OPTION text can paint over select element's scrollbar
2471
2472         Test: fast/forms/option-text-clip.html
2473
2474         * rendering/RenderMenuList.cpp: (WebCore::RenderMenuList::paintObject):
2475         When calculating the clip to apply to the button text, also consider padding.
2476         In the future, we may have separate renderers for the text part, and the arrow part
2477         of the control, and then the separation should be natural.  For now, we use padding.
2478
2479 2006-07-11  David Kilzer  <ddkilzer@kilzer.net>
2480
2481         Windows build fix.  Reviewed by NOBODY.
2482
2483         * WebCore.vcproj/WebCore/WebCore.vcproj:  Added JSHTMLOptionsCollection.cpp/h
2484         and JSHTMLOptionsCollectionCuston.cpp.  VC++ Express realphabetized the file list.
2485
2486 2006-07-11  Darin Adler  <darin@apple.com>
2487
2488         Reviewed by Adele.
2489
2490         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9809
2491           <rdar://problem/4619515>
2492           focus ring fails to appear on select element after choosing item from popup
2493
2494         - includes http://bugzilla.opendarwin.org/show_bug.cgi?id=9853
2495           improvements to select element, including some storage leak fixes
2496
2497         * html/HTMLOptionElement.cpp: (WebCore::HTMLOptionElement::index): Use a const
2498         reference for the list items, so we don't have to copy a vector.
2499         * html/HTMLSelectElement.cpp:
2500         (WebCore::HTMLSelectElement::selectedIndex): Ditto.
2501         (WebCore::HTMLSelectElement::setSelectedIndex): Ditto.
2502         (WebCore::HTMLSelectElement::length): Ditto.
2503         (WebCore::HTMLSelectElement::remove): Ditto.
2504         (WebCore::HTMLSelectElement::value): Ditto.
2505         (WebCore::HTMLSelectElement::setValue): Ditto.
2506         (WebCore::HTMLSelectElement::stateValue): Ditto.
2507         (WebCore::HTMLSelectElement::restoreState): Ditto.
2508         (WebCore::HTMLSelectElement::appendFormData): Ditto.
2509         (WebCore::HTMLSelectElement::optionToListIndex): Ditto.
2510         (WebCore::HTMLSelectElement::listToOptionIndex): Ditto.
2511         (WebCore::HTMLSelectElement::recalcListItems): Made const, with the appropriate
2512         fields mutable.
2513         (WebCore::HTMLSelectElement::reset): Use a const reference for
2514         the list items, so we don't have to copy the vector. Remove the call to
2515         setSelectionChanged for the RenderMenuList case.
2516         (WebCore::HTMLSelectElement::notifyOptionSelected): Ditto, on both counts.
2517         (WebCore::HTMLSelectElement::defaultEventHandler): Call focus() before showing
2518         the pop-up.
2519         * html/HTMLSelectElement.h: The RenderMenuList class is no longer a friend.
2520         Changed the listItems function to return a const reference to the vector so
2521         it no longer copies the vector. Removed the const_cast to the call to
2522         recalcListItems and changed it to a const member function. Made m_recalcListItems
2523         mutable.
2524         * rendering/DeprecatedRenderSelect.cpp:
2525         (WebCore::DeprecatedRenderSelect::updateFromElement): Removed an unnecessary call
2526         to recalcListItems, which is called automatically. Use a const reference for the
2527         list items so we don't have to copy a vector.
2528         (WebCore::DeprecatedRenderSelect::layout): Ditto.
2529         (WebCore::DeprecatedRenderSelect::selectionChanged): Ditto.
2530         (WebCore::DeprecatedRenderSelect::updateSelection): Ditto.
2531         * rendering/RenderMenuList.cpp:
2532         (WebCore::RenderMenuList::RenderMenuList): Updated for renamed data members.
2533         (WebCore::RenderMenuList::createInnerBlock): Ditto.
2534         (WebCore::RenderMenuList::addChild): Ditto.
2535         (WebCore::RenderMenuList::removeChild): Ditto.
2536         (WebCore::RenderMenuList::setStyle): Ditto. Also removed code to set the style
2537         on the pop-up menu, because it's created with the correct style and destroyed
2538         before it a style change could occur.
2539         (WebCore::RenderMenuList::updateFromElement): Rearranged code to compute the
2540         maximum width in a simpler fashion, and to not bother trying to maintain
2541         the "selected" flags on the elements, since the HTMLSelectElement class
2542         takes care of that. Store the width as an int. Call setText to set the text
2543         based on the selected element's option text.
2544         (WebCore::RenderMenuList::paintObject): Don't check m_inner when setting
2545         up the clip -- always set up the clip.
2546         (WebCore::RenderMenuList::calcMinMaxWidth): Use m_optionsWidth directly
2547         instead of calling ceilf on m_longestWidth.
2548         (WebCore::RenderMenuList::showPopup): Don't use m_popupMenu to store the
2549         menu -- instead keep the pointer in a local variable. Get the selected
2550         index from the HTMLSelectElement.
2551         (WebCore::RenderMenuList::valueChanged): Call HTMLSelectElement::setSelectedIndex
2552         to do most of the work.
2553         * rendering/RenderMenuList.h: Renamed m_inner to m_innerBlock. Removed
2554         m_popupMenu, m_size, m_selectionChanged, and m_selectedIndex. Renamed
2555         m_longestWidth to m_optionsWidth and changed it to be an int. Removed
2556         unneeded override of removeLeftoverAnonymousBoxes function. Removed
2557         unneeded selectionChanged, setSelectionChanged, updateSelection, and
2558         hasPopupMenu functions. Removed extra includes.
2559         * rendering/RenderPopupMenu.cpp: (WebCore::RenderPopupMenu::populate):
2560         Change to iterate the list items instead of iterating all children
2561         of the select node.
2562         * rendering/RenderPopupMenu.h: Renamed getRenderMenuList to menuList.
2563         * rendering/RenderPopupMenuMac.mm:
2564         (WebCore::RenderPopupMenuMac::populate): Moved code to clear and create
2565         the pop-up here from the caller. Removed an extra retain that would cause
2566         the NSPopUpButtonCell to leak.
2567         (WebCore::RenderPopupMenuMac::showPopup): Removed unnecessary code to
2568         create the pop-up, which is now in populate, and also the call to the
2569         clear function, for the same reason. Reorganized code to make it a bit
2570         more readable. Removed an unnecessary if to check if frame is nil.
2571         Used a RefPtr to make sure we don't make a call on a frame after it's
2572         deleted. As part of the reorganization fixed a problem where we'd retain
2573         the event and then return early without releasing it in one case.
2574         (WebCore::RenderPopupMenuMac::addSeparator): Tweaked a little.
2575         (WebCore::RenderPopupMenuMac::addGroupLabel): Grouped all the code to
2576         manage the NSMenu at the bottom of the function.
2577         (WebCore::RenderPopupMenuMac::addOption): Ditto.
2578
2579 2006-07-11  Justin Garcia  <justin.garcia@apple.com>
2580
2581         Reviewed by levi
2582         
2583         <rdar://problem/4620686>
2584         REGRESSION: Mispelling markers are still displayed when using the delete key to place caret into a misspelled word
2585
2586         * bridge/mac/FrameMac.mm:
2587         (WebCore::FrameMac::respondToChangedSelection): Remove markers from newAdjacentWords 
2588         even if oldAdjacentWords is equal to newAdjacentWords.  This happens during a deletion.
2589         
2590
2591 2006-07-11  Tim Omernick  <timo@apple.com>
2592
2593         Reviewed by NOBODY (build fix)
2594
2595         * bindings/objc/DOMPrivate.h:
2596         Don't @class NPObject; that breaks files that actually #import <JavaScriptCore/npruntime.h>, since the NPObject
2597         there is of a different type.
2598         Also clarified a highly misleading comment from my last commit.  I meant to clarify the comment
2599         before landing.
2600
2601 2006-07-12  Anders Carlsson  <acarlsson@apple.com>
2602
2603         Reviewed by Geoff.
2604
2605         http://bugzilla.opendarwin.org/show_bug.cgi?id=9635
2606         REGRESSION: Crash when adding to cart at <http://www.yemeksepeti.com/>
2607         
2608         * html/HTMLTokenizer.cpp:
2609         (WebCore::HTMLTokenizer::scriptHandler):
2610         Don't load external scripts if the parser is stopped.
2611         
2612         * manual-tests/open-close-tokenizer-crash.html: Added.
2613         * manual-tests/resources/empty-file.js: Added.
2614         * manual-tests/resources/open-close-tokenizer-crash.html: Added.
2615         Add manual test.
2616
2617 2006-07-11  John Sullivan  <sullivan@apple.com>
2618
2619         Reviewed by Kevin, Timo O, Brady, Darin, and Hyatt (whee!)
2620
2621         - added support for creating a selection image with white text
2622
2623         * rendering/RenderObject.h:
2624         (WebCore::):
2625         add PaintRestriction enum
2626         (WebCore::RenderObject::PaintInfo::PaintInfo):
2627         add forceWhiteText boolean to PaintInfo struct
2628
2629         * page/FramePrivate.h:
2630         (WebCore::FramePrivate::FramePrivate):
2631         replaced m_selectionOnly bool with m_paintRestriction, which also handles forcing the
2632         text to white
2633
2634         * page/Frame.cpp:
2635         (WebCore::Frame::paint):
2636         updated to use & pass m_paintRestriction where it used to use & pass just m_selectionOnly
2637
2638         * bridge/mac/FrameMac.h:
2639         * bridge/mac/FrameMac.mm:
2640         (WebCore::FrameMac::selectionImage):
2641         now takes forceWhiteText parameter, stored in FramePrivate as part of PaintRestriction
2642
2643         * bridge/mac/WebCoreFrameBridge.h:
2644         * bridge/mac/WebCoreFrameBridge.mm:
2645         (-[WebCoreFrameBridge selectionImageForcingWhiteText:]):
2646         renamed from selectionImage, now takes forceWhiteText parameter, which is passed
2647         down into Frame
2648
2649         * rendering/RenderLayer.h:
2650         * rendering/RenderLayer.cpp:
2651         (WebCore::RenderLayer::paint):
2652         use a PaintRestriction value where we used to use a selectionOnly bool
2653         (WebCore::RenderLayer::paintLayer):
2654         ditto; also stores forceWhiteText in PaintInfo struct
2655
2656         * kcanvas/KCanvasResources.cpp:
2657         (WebCore::KCanvasMarker::draw):
2658         updated for changed signature of PaintInfo constructor
2659
2660         * ksvg2/svg/SVGMaskElement.cpp:
2661         (WebCore::SVGMaskElement::drawMaskerContent):
2662         ditto
2663
2664         * ksvg2/svg/SVGPatternElement.cpp:
2665         (WebCore::SVGPatternElement::drawPatternContentIntoTile):
2666         ditto
2667
2668         * rendering/InlineTextBox.cpp:
2669         (WebCore::InlineTextBox::paint):
2670         paint with white text color if forceWhiteText is set in PaintInfo struct
2671
2672 2006-07-11  Tim Omernick  <timo@apple.com>
2673
2674         Reviewed by Anders.
2675
2676         <http://bugzilla.opendarwin.org/show_bug.cgi?id=9843>:
2677         Give Netscape plug-ins access to their own DOM element
2678
2679         * html/HTMLPlugInElement.h:
2680         Just import JSC headers on Mac.  The NPObject and Bindings::Instance stuff is only used on Mac anyway.
2681         Changed __APPLE__ to PLATFORM(MAC).
2682         Added m_NPObject ivar.
2683         * html/HTMLPlugInElement.cpp:
2684         (WebCore::HTMLPlugInElement::HTMLPlugInElement):
2685         Initialize the NPObject.
2686         (WebCore::HTMLPlugInElement::~HTMLPlugInElement):
2687         Release the NPObject when the element is destroyed.
2688         (WebCore::HTMLPlugInElement::createNPObject):
2689         Creates an NPObject for the element.
2690         (WebCore::HTMLPlugInElement::getNPObject):
2691         Returns the NPObject for the element, creating and caching it if necessary.
2692
2693         * html/HTMLAppletElement.h:
2694         Changed __APPLE__ to PLATFORM(MAC).
2695         * html/HTMLAppletElement.cpp:
2696         ditto
2697         * html/HTMLEmbedElement.h:
2698         ditto
2699         * html/HTMLEmbedElement.cpp:
2700         ditto
2701         * html/HTMLObjectElement.h:
2702         ditto
2703         * html/HTMLObjectElement.cpp:
2704         ditto
2705
2706         * bindings/objc/DOMPrivate.h:
2707         Added -[DOMElement _NPObject].
2708
2709         * bindings/objc/DOM.mm:
2710         (-[DOMElement _NPObject]):
2711         Returns the NPObject for the element.  Since this is only needed by the Netscape plug-in API, you can only get 
2712         the NPObject for applet, embed, and object elements.
2713         
2714 2006-07-11  Adele Peterson  <adele@apple.com>
2715
2716         Reviewed by Hyatt.
2717
2718         - Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=9861
2719         REGRESSION: Can't dynamically change list box to popup
2720         
2721         and updated fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=9859
2722         REGRESSION: Can't dynamically change popup to list box
2723
2724         The original fix for 9859 was in the renderer, and I think we can catch the change
2725         earlier in the element to detach and reattach.
2726
2727         I also did some cleanup to remove the PopupButton code path from DeprecatedRenderSelect
2728
2729         Test: fast/forms/select-change-listbox-to-popup.html
2730
2731         * html/HTMLSelectElement.cpp:
2732         (WebCore::HTMLSelectElement::parseMappedAttribute): If the new attribute value is going to require us to change from listbox to popup or vice versa,
2733         and we're already attached, then detach and reattach to create the correct renderer.  If we're not attached, then we'll create the correct renderer
2734         when we attach.
2735         (WebCore::HTMLSelectElement::recalcStyle): Updated shouldUseMenuList since it no longer takes a RenderStyle.
2736         (WebCore::HTMLSelectElement::isKeyboardFocusable): ditto.
2737         (WebCore::HTMLSelectElement::isMouseFocusable): ditto.
2738         (WebCore::HTMLSelectElement::createRenderer): ditto.
2739         (WebCore::HTMLSelectElement::setRecalcListItems): ditto.
2740         (WebCore::HTMLSelectElement::reset): ditto.
2741         (WebCore::HTMLSelectElement::notifyOptionSelected): ditto.
2742         (WebCore::HTMLSelectElement::defaultEventHandler): ditto.
2743
2744         * html/HTMLSelectElement.h: (WebCore::HTMLSelectElement::shouldUseMenuList):
2745         This method no longer takes a RenderStyle.  That was leftover from when we used to use the appearance
2746         to determine whether or not to use the new menu list implementation.
2747
2748         * rendering/DeprecatedRenderSelect.h: Removed PopupButton code path.
2749         * rendering/DeprecatedRenderSelect.cpp:
2750         (WebCore::DeprecatedRenderSelect::DeprecatedRenderSelect):
2751         (WebCore::DeprecatedRenderSelect::setWidgetWritingDirection):
2752         (WebCore::DeprecatedRenderSelect::updateFromElement):
2753         (WebCore::DeprecatedRenderSelect::baselinePosition):
2754         (WebCore::DeprecatedRenderSelect::layout):
2755         (WebCore::DeprecatedRenderSelect::updateSelection):
2756
2757         * rendering/RenderMenuList.cpp: (WebCore::RenderMenuList::updateFromElement):
2758         Backed out previous fix since this is now done in HTMLSelectElement.
2759
2760 2006-07-11  Adele Peterson  <adele@apple.com>
2761
2762         Reviewed by Hyatt.
2763
2764         Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=9859
2765         REGRESSION: Can't dynamically change popup to list box
2766
2767         Test: fast/forms/select-change-popup-to-listbox.html
2768
2769         * rendering/RenderMenuList.cpp: (WebCore::RenderMenuList::updateFromElement):
2770         If the select element has the multiple property set, or has a size > 1, then it
2771         really should be a list box, so we detach and attach the element so it creates the
2772         correct type of renderer.
2773
2774 2006-07-11  John Sullivan  <sullivan@apple.com>
2775
2776         Reviewed by Beth Dakin and Tim Omernick
2777
2778         - fixed <rdar://problem/4622794> HiDPI: dragging the selection in Safari can show pixel cracks 
2779         at non-integral scale factors
2780
2781         * bridge/mac/FrameMac.mm:
2782         (WebCore::FrameMac::imageFromRect):
2783         round image rect in window coordinate space
2784
2785 2006-07-10  Darin Adler  <darin@apple.com>
2786
2787         Reviewed by Geoff.
2788
2789         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9811
2790           rdar://problem/4619572
2791           OPTION text contained in OPTGROUP appears at the wrong size
2792
2793         * dom/Node.h:
2794         * dom/Node.cpp: (WebCore::Node::renderStyle): Made a const member function.
2795         The derived classes were overriding with const member functions, and I could
2796         change either this or the derived -- decided to do this.
2797
2798 2006-07-10  Darin Adler  <darin@apple.com>
2799
2800         Reviewed by Geoff.
2801
2802         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9810
2803           rdar://problem/4619534
2804           OPTGROUP label text is using the default font instead of Lucida Grande
2805
2806         * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::setFontFromControlSize):
2807         Code wants the family name, but was calling fontName, which is not the same thing.
2808         Also removed the unneeded conversion to DeprecatedString.
2809
2810 === Safari-521.16 ===
2811
2812 2006-07-10  David Kilzer  <ddkilzer@kilzer.net>
2813
2814         Reviewed by Darin.
2815
2816         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9179
2817           Implement select.options.add() method
2818
2819         Tests:
2820         - fast/dom/select-selectedIndex-multiple.html
2821         - fast/dom/select-selectedIndex.html
2822         - fast/js/select-options-add.html
2823
2824         * DerivedSources.make: Added JSHTMLOptionsCollection.h.
2825         * ForwardingHeaders/kjs/operations.h: Added.
2826         * WebCore.xcodeproj/project.pbxproj: Added new source files.
2827         * bindings/js/JSHTMLOptionsCollectionCustom.cpp: Added.
2828         (WebCore::JSHTMLOptionsCollection::length):
2829         (WebCore::JSHTMLOptionsCollection::setLength):
2830         (WebCore::JSHTMLOptionsCollection::indexSetter):
2831         * bindings/js/kjs_html.cpp: Removed JSHTMLOptionsCollection implementation.
2832         Renamed classes and methods for consistency.
2833         (KJS::JSHTMLElement::selectGetter):
2834         (KJS::JSHTMLElement::put):
2835         (KJS::JSHTMLElement::selectSetter):
2836         (KJS::JSHTMLCollection::JSHTMLCollection):
2837         (KJS::JSHTMLCollectionProtoFunc::callAsFunction):
2838         (KJS::getHTMLOptionsCollection):
2839         * bindings/js/kjs_html.h: Ditto.
2840         * bindings/scripts/CodeGeneratorJS.pm: Added support for HasCustomIndexSetter class attribute.
2841         Added support for Optional parameter attribute, which makes generated code assume overloaded
2842         implementation methods are available for a JavaScript function with optional arguments.  Changed
2843         local 'impl' variables to 'imp' so that impl() methods could be called without class designation.
2844         * html/HTMLOptionElement.idl: Added GenerateNativeConverter attribute.
2845         * html/HTMLOptionsCollection.cpp: Added methods used by generated JSHTMLOptionsCollection class.
2846         (WebCore::HTMLOptionsCollection::HTMLOptionsCollection):
2847         (WebCore::HTMLOptionsCollection::add):
2848         (WebCore::HTMLOptionsCollection::selectedIndex):
2849         (WebCore::HTMLOptionsCollection::setSelectedIndex):
2850         (WebCore::HTMLOptionsCollection::setLength):
2851         * html/HTMLOptionsCollection.h: Ditto.
2852         * html/HTMLOptionsCollection.idl: Added.
2853
2854 2006-07-10  David Harrison  <harrison@apple.com>
2855
2856         Reviewed by Dave Hyatt.
2857
2858         <rdar://problem/4602408> -webkit-highlight needs to support images and elements other than text
2859
2860         * rendering/RenderBox.cpp:
2861         (WebCore::RenderBox::paintCustomHighlight):
2862         * rendering/RenderBox.h:
2863         Utility for subclasses.
2864         
2865         * rendering/RenderImage.cpp:
2866         (WebCore::RenderImage::paint):
2867         Custom highlight in front of images.
2868         
2869         * rendering/RenderListMarker.cpp:
2870         (WebCore::RenderListMarker::paint):
2871         Custom highlight in front of list markers.
2872
2873         * rendering/RenderWidget.cpp:
2874         (WebCore::RenderWidget::paint):
2875         Custom highlight in front of objects.
2876
2877 2006-07-10  David Hyatt  <hyatt@apple.com>
2878
2879         <rdar://problem/4620557> REGRESSION: In a mail message, text isn't painted
2880         correctly after choosing Redo Typing
2881
2882         Better fix for repainting issue with positioned objects when height
2883         changes.  Optimize when only a positioned child changes so that we don't
2884         incorrectly do normal flow layout.
2885
2886         Reviewed by darin
2887
2888         * WebCore.xcodeproj/project.pbxproj:
2889         * rendering/RenderBlock.cpp:
2890         (WebCore::RenderBlock::layoutBlock):
2891         * rendering/RenderFlexibleBox.cpp:
2892         (WebCore::RenderFlexibleBox::layoutBlock):
2893         * rendering/RenderTable.cpp:
2894         (WebCore::RenderTable::layout):
2895         * rendering/RenderView.cpp:
2896         (WebCore::RenderView::layout):
2897         * rendering/bidi.cpp:
2898         (WebCore::RenderBlock::layoutInlineChildren):
2899
2900 2006-07-10  Adele Peterson  <adele@apple.com>
2901
2902         Reviewed by Beth.
2903
2904         - Fix for <rdar://problem/4621442> REGRESSION (NativePopup) : Popup menus aren't drawn correctly on page at orbitz.com; cheaptickets.com
2905
2906         Test: fast/forms/select-style.html
2907
2908         * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::isControlStyled):
2909         Don't let popups be style-able for now.  We'll allow it later, when we
2910         have a good way to handle border & backgrounds and still having it look like a control.
2911
2912 2006-07-10  Justin Garcia  <justin.garcia@apple.com>
2913
2914         Reviewed by harrison
2915         
2916         <rdar://problem/4619260>
2917         9A213 + Safari 521.15.1 Crash with To Do's alarm icon (WebCore::maxDeepOffset(WebCore::Node const*) )
2918         <rdar://problem/4619841>
2919         REGRESSION: Dragging selection over input field results in a crash (WebCore::maxDeepOffset(WebCore::Node const*)
2920
2921         * WebCore.xcodeproj/project.pbxproj:
2922         * editing/Selection.cpp:
2923         (WebCore::Selection::adjustForEditableContent): Iterate using next/previousVisuallyDistinctCandidate 
2924         instead of traverseNext/Previous node because we were skipping positions.  Jump out of shadow trees.  
2925         Migrate to isEditablePosition instead of isContentEditable.
2926         
2927
2928 2006-07-10  Beth Dakin  <bdakin@apple.com>
2929
2930         Reviewed by Adele.
2931
2932         Shuffling comments around from my last check-in to make things read 
2933         more clearly.
2934
2935         * page/DOMWindow.h:
2936         * page/DOMWindow.idl:
2937
2938 2006-07-10  Beth Dakin  <bdakin@apple.com>
2939
2940         Reviewed by Darin.
2941
2942         Fix for <rdar://problem/4621095> The should be a way to 
2943         access the user interface scale factor through the DOM
2944
2945         window.devicePixelRatio returns the user interface scale factor.
2946
2947         * page/DOMWindow.cpp:
2948         (WebCore::DOMWindow::devicePixelRatio):
2949         * page/DOMWindow.h:
2950         * page/DOMWindow.idl:
2951
2952 2006-07-10  Brady Eidson  <beidson@apple.com>
2953
2954         Reviewed by Alexey
2955
2956         Resolved the console error messages people got from the new DB even if they didn't have it enabled
2957
2958         * icon/IconDatabase.cpp:
2959         (WebCore::IconDatabase::pruneUnreferencedIcons):
2960         (WebCore::IconDatabase::pruneUnretainedIcons):
2961         Added quick check to bail if the DB isn't open
2962
2963 2006-07-10  David Harrison  <harrison@apple.com>
2964
2965         Reviewed by Tim Hatcher
2966
2967         Partial fix for...
2968         <rdar://problem/4619260> 9A213 + Safari 521.15.1 Crash with To Do's alarm icon (WebCore::maxDeepOffset(WebCore::Node const*) )
2969         
2970         * editing/Selection.cpp:
2971         (WebCore::Selection::adjustForEditableContent):
2972         Allow for node being 0.  This is a bandaid fix to prevent the crash.  It will still assert in a debug build.  See bug for more info.
2973
2974 2006-07-10  Mitz Pettel  <opendarwin.org@mitzpettel.com>
2975
2976         Reviewed by Darin.
2977
2978         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9808
2979           REGRESSION: Incorrect layout (and ERROR) when forcing ATSU For All Text
2980
2981         * manual-tests/ATSU-bad-layout.html: Added.
2982         * platform/mac/FontMac.mm:
2983         (WebCore::Font::floatWidthForComplexText): Return 0 immediately for empty runs.
2984
2985 2006-07-10  Darin Adler  <darin@apple.com>
2986
2987         - try to fix the no-SVG build
2988
2989         * ksvg2/misc/SVGImageLoader.cpp: Move namespace brace inside the #if.
2990
2991 2006-07-10  Darin Adler  <darin@apple.com>
2992
2993         Reviewed by Anders.
2994
2995         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9833
2996           REGRESSION: Reproducible crash: RenderMenuList.cpp:58: failed assertion `!m_first'
2997
2998         * manual-tests/empty-title-popup.html: Added.
2999
3000         * rendering/RenderMenuList.h: Add createInnerBlock.
3001         * rendering/RenderMenuList.cpp:
3002         (WebCore::RenderMenuList::createInnerBlock): Factored out of addChild.
3003         (WebCore::RenderMenuList::addChild): Call createInnerBlock.
3004         (WebCore::RenderMenuList::setText): Changed parameter type.
3005         (WebCore::RenderMenuList::showPopup): Call createInnerBlock before calling
3006         the parent class's addChild.
3007
3008 2006-07-10  Rob Buis  <buis@kde.org>
3009
3010         Reviewed by Maciej via IRC.
3011
3012         Make sure the attributes are calculated against viewport width value,
3013         as defined in the spec.  http://paste.lisp.org/display/22342
3014
3015         * ksvg2/svg/SVGEllipseElement.cpp:
3016         (WebCore::SVGEllipseElement::rx): Changed LM_HEIGHT to LM_WIDTH.
3017         * ksvg2/svg/SVGLineElement.cpp:
3018         (SVGLineElement::x2): Ditto.
3019
3020 2006-07-10  Beth Dakin  <bdakin@apple.com>
3021
3022         Reviewed by Maciej.
3023
3024         Fix for <rdar://problem/4610314> Support the CSS3 content property 
3025         for images
3026
3027         This patch provides initial support for the CSS3 content property. 
3028         It lacks support for any content other than images, and only allows 
3029         content for elements that seemed safe for now.
3030
3031         * css/cssstyleselector.cpp:
3032         (WebCore::CSSStyleSelector::applyProperty): Remove restrictions for 
3033         just :before and :after
3034         * html/HTMLBRElement.cpp:
3035         (WebCore::HTMLBRElement::createRenderer):
3036         * html/HTMLFrameSetElement.cpp:
3037         (WebCore::HTMLFrameSetElement::createRenderer):
3038         * html/HTMLImageElement.cpp:
3039         (WebCore::HTMLImageElement::createRenderer):
3040         * html/HTMLLegendElement.cpp:
3041         (WebCore::HTMLLegendElement::createRenderer):
3042         * rendering/RenderImage.cpp:
3043         (WebCore::RenderImage::RenderImage):
3044         (WebCore::RenderImage::setCachedImage): Don't allow the image to be 
3045         set this way if it was already set with the content property.
3046         * rendering/RenderImage.h:
3047         (WebCore::RenderImage::setIsAnonymousImage): Anonymous images are 
3048         those set through the content property.
3049         (WebCore::RenderImage::isAnonymousImage):
3050         * rendering/RenderObject.cpp:
3051         (WebCore::RenderObject::createObject): If there is content 
3052         specified, create a RenderImage with the content and initialize the 
3053         cached image to whatever was specified in the CSS.
3054
3055 2006-07-10  Brady Eidson  <beidson@apple.com>
3056
3057         Reviewed by NOBODY (Build Fix!)
3058
3059         * icon/SiteIcon.cpp:
3060         (SiteIcon::getImage):
3061         Release build made an "unused variable" warning, which is, of course, an error.  fixed that.
3062
3063 2006-07-10  Brady Eidson  <beidson@apple.com>
3064
3065         Reviewed by Maciej
3066
3067         SQLite Icon DB now fully replicates functionality of the old DB, including pruning to keep unused
3068         information out to keep down disk usage.  For now, it is still off by default, as the critical
3069         feature of importing old icons into the new DB is still unrealized.
3070         If you'd like to test, add #define ICONDEBUG to your WebKitPrefix.h
3071
3072         * icon/IconDatabase.cpp:
3073         (WebCore::IconDatabase::IconDatabase):
3074         (WebCore::IconDatabase::open):
3075           -Sets up a timer for initial pruning
3076         (WebCore::IconDatabase::iconForPageURL):
3077           -Switched away from "dirty blob hack" as the problem is provisionally solved
3078         (WebCore::IconDatabase::retainIconForURL):
3079         (WebCore::IconDatabase::releaseIconForURL):
3080           -Same as found in WebKit
3081         (WebCore::IconDatabase::totalRetainCountForIconURL):
3082           -Adds up all retainers of icon
3083         (WebCore::IconDatabase::forgetIconForIconURLFromDatabase):
3084           -Wipes an Icon table entry out
3085         (WebCore::IconDatabase::establishTemporaryIconIDForIconURL):
3086         (WebCore::IconDatabase::establishTemporaryIconIDForEscapedIconURL):
3087         (WebCore::IconDatabase::establishIconIDForIconURL):
3088         (WebCore::IconDatabase::establishIconIDForEscapedIconURL):
3089           -Added ability to get an iconID without creating a new one if a lookup is all
3090            that is genuinely wanted
3091         (WebCore::IconDatabase::pruneUnreferencedIcons):
3092         (WebCore::IconDatabase::pruneUnretainedIcons):
3093           -Called on a timer on DB startup to clean it out
3094         * icon/IconDatabase.h:
3095         * icon/SiteIcon.cpp:
3096         (SiteIcon::SiteIcon):
3097         (SiteIcon::~SiteIcon):
3098           -Deletes the image on deletion
3099         (SiteIcon::getImage):
3100           -Cut down on no-longer-necessary debug info
3101
3102 2006-07-10  Anders Carlsson  <acarlsson@apple.com>
3103
3104         Reviewed by Adele.
3105
3106         http://bugzilla.opendarwin.org/show_bug.cgi?id=9245
3107         Quirksmode: Incorrect handling of disabled BUTTON elements
3108
3109         * html/HTMLButtonElement.cpp:
3110         (WebCore::HTMLButtonElement::defaultEventHandler):
3111         Don't call prepareSubmit if the element is disabled.
3112
3113         * html/HTMLInputElement.cpp:
3114         (WebCore::HTMLInputElement::defaultEventHandler):
3115         Don't call prepareSubmit if the element is disabled.
3116
3117 2006-07-10  Darin Adler  <darin@apple.com>
3118
3119         - try to fix Windows build
3120
3121         * platform/win/TemporaryLinkStubs.cpp: Put a few functions in the WebCore namespace.
3122         * platform/gdk/TemporaryLinkStubs.cpp: Ditto.
3123
3124 2006-07-10  Darin Adler  <darin@apple.com>
3125
3126         Reviewed by Geoff.
3127
3128         - fix failures seen in layout tests
3129
3130         * bindings/js/kjs_dom.cpp: (KJS::toJS): Restore one of the few WebCore:: prefixes
3131         that really needed to be there -- because we have two classes named JSHTMLDocument
3132         at the moment! (One in KJS and one in WebCore namespace.)
3133
3134 2006-07-10  Darin Adler  <darin@apple.com>
3135
3136         - try to fix Windows build
3137
3138         * rendering/RenderLayer.h: Correct a forward declaration of ScrollBar.
3139
3140 2006-07-09  Adele Peterson  <adele@apple.com>
3141
3142         Reviewed by Maciej.
3143
3144         Fix for <rdar://problem/4463835> Switch to use new popup menu implementation for <select>
3145
3146         * css/html4.css: Added style for new selects, and for list boxes.
3147         * html/HTMLSelectElement.h: (WebCore::HTMLSelectElement::shouldUseMenuList): Removed check for appearance so new popups can be styled.
3148    
3149         * rendering/RenderMenuList.cpp:
3150         (WebCore::RenderMenuList::setStyle): Removed padding.  This is now set by the theme.
3151         (WebCore::RenderMenuList::calcMinMaxWidth): Now takes minimum text size into account.
3152         * rendering/RenderMenuList.h: Removed baselinePosition since we're letting the theme calculate that.
3153
3154         * rendering/RenderTheme.cpp: (WebCore::RenderTheme::isControlContainer): Added menuList as a ControlContainer, 
3155         so RenderThemeMac will compute its baseline.
3156         * rendering/RenderTheme.h: (WebCore::RenderTheme::minimumTextSize): Added.
3157         * rendering/RenderThemeMac.h: Added minimumTextSize, setPopupPaddingFromControlSize, popupButtonSizes, popupButtonMargins, popupButtonPadding.
3158         Removed sizeOfArrowControl. 
3159         * rendering/RenderThemeMac.mm:
3160         (WebCore::): Added enum for padding.
3161         (WebCore::RenderThemeMac::adjustRepaintRect): Now inflates rect to account for control shadow.
3162         (WebCore::RenderThemeMac::baselinePosition): Now calculates baseline for menulist.
3163         (WebCore::RenderThemeMac::popupButtonMargins): Tweaked values.
3164         (WebCore::RenderThemeMac::popupButtonSizes): Added.
3165         (WebCore::RenderThemeMac::popupButtonPadding): Added, so different padding can be set for different control sizes.
3166         (WebCore::RenderThemeMac::setPopupPaddingFromControlSize): Added.
3167         (WebCore::RenderThemeMac::paintMenuList): Now inflates rect to account for control shadow.
3168         (WebCore::RenderThemeMac::adjustMenuListStyle): Resets border, sets padding, sets control size.
3169         (WebCore::RenderThemeMac::setPopupButtonCellState): Removed unnecessary class name.
3170         (WebCore::RenderThemeMac::minimumTextSize): Added.
3171
3172 2006-07-09  Darin Adler  <darin@apple.com>
3173
3174         - add back "unused code" for plain text fields, still used by <isindex>!
3175
3176         * platform/TextField.h:
3177         * platform/mac/TextFieldMac.mm:
3178         * platform/mac/WebCoreTextField.h:
3179         * platform/mac/WebCoreTextField.mm:
3180         * rendering/RenderLineEdit.cpp:
3181
3182 2006-07-09  Darin Adler  <darin@apple.com>
3183
3184         Reviewed by Tim Hatcher.
3185
3186         - put more into the WebCore namespace
3187         - removed unused code for plain text fields
3188
3189         Put more classes, class templates, enums, functions, and constants into
3190         the WebCore namespace, including all the headers in the platform directory.
3191
3192         Removed lots of unneeded "WebCore::" qualifiers and "using" directives.
3193
3194         Added some "WebCore::" qualifiers in a few places.
3195
3196         Removed "uses WebCore::" in headers that we said we'd remove "when
3197         everything is in the WebCore namespace".
3198
3199         * bindings/js/JSDOMParser.cpp:
3200         * bindings/js/JSHTMLElementWrapperFactory.cpp:
3201         * bindings/js/JSXSLTProcessor.cpp:
3202         * bindings/js/kjs_binding.cpp:
3203         * bindings/js/kjs_css.cpp:
3204         * bindings/js/kjs_dom.cpp:
3205         * bindings/js/kjs_dom.h:
3206         * bindings/js/kjs_events.cpp:
3207         * bindings/js/kjs_proxy.h:
3208         * bindings/js/kjs_window.h:
3209         * bindings/objc/DOM.mm:
3210         * bridge/History.h:
3211         * bridge/JavaAppletWidget.h:
3212         * bridge/mac/FormDataMac.h:
3213         * bridge/mac/FormDataMac.mm:
3214         * bridge/mac/WebCoreAXObject.mm:
3215         * bridge/mac/WebCoreEncodings.mm:
3216         * bridge/mac/WebCoreFrameBridge.h:
3217         * bridge/mac/WebCoreIconDatabaseBridge.mm:
3218         * bridge/mac/WebCorePageState.h:
3219         * bridge/mac/WebCoreScriptDebugger.mm:
3220         * bridge/mac/WebCoreSettings.h:
3221         * css/CSSGrammar.y:
3222         * css/CSSPageRule.cpp:
3223         * css/CSSPageRule.h:
3224         * css/MediaList.cpp:
3225         * css/cssstyleselector.h:
3226         * dom/Clipboard.h:
3227         * dom/Document.cpp:
3228         * dom/Document.h:
3229         * dom/EventTargetNode.h:
3230         * dom/Node.cpp:
3231         * dom/Node.h:
3232         * dom/Position.h:
3233         * dom/Range.cpp:
3234         * dom/XMLTokenizer.cpp:
3235         * editing/AppendNodeCommand.h:
3236         * editing/ApplyStyleCommand.cpp:
3237         * editing/BreakBlockquoteCommand.cpp:
3238         * editing/BreakBlockquoteCommand.h:
3239         * editing/CompositeEditCommand.cpp:
3240         * editing/CompositeEditCommand.h:
3241         * editing/CreateLinkCommand.h:
3242         * editing/DeleteFromTextNodeCommand.h:
3243         * editing/DeleteSelectionCommand.h:
3244         * editing/FormatBlockCommand.h:
3245         * editing/HTMLInterchange.cpp:
3246         * editing/HTMLInterchange.h:
3247         * editing/IndentOutdentCommand.h:
3248         * editing/InsertIntoTextNodeCommand.h:
3249         * editing/InsertLineBreakCommand.h:
3250         * editing/InsertListCommand.h:
3251         * editing/InsertNodeBeforeCommand.h:
3252         * editing/InsertTextCommand.cpp:
3253         * editing/InsertTextCommand.h:
3254         * editing/JSEditor.cpp:
3255         * editing/JSEditor.h:
3256         * editing/JoinTextNodesCommand.h:
3257         * editing/MergeIdenticalElementsCommand.cpp:
3258         * editing/MergeIdenticalElementsCommand.h:
3259         * editing/ModifySelectionListLevel.h:
3260         * editing/MoveSelectionCommand.h:
3261         * editing/RebalanceWhitespaceCommand.h:
3262         * editing/RemoveNodeAttributeCommand.h:
3263         * editing/RemoveNodeCommand.h:
3264         * editing/RemoveNodePreservingChildrenCommand.h:
3265         * editing/ReplaceSelectionCommand.h:
3266         * editing/SetNodeAttributeCommand.h:
3267         * editing/SplitElementCommand.cpp:
3268         * editing/SplitElementCommand.h:
3269         * editing/SplitTextNodeCommand.cpp:
3270         * editing/SplitTextNodeCommand.h:
3271         * editing/SplitTextNodeContainingElementCommand.h:
3272         * editing/TypingCommand.cpp:
3273         * editing/TypingCommand.h:
3274         * editing/UnlinkCommand.h:
3275         * editing/VisiblePosition.cpp:
3276         * editing/WrapContentsInDummySpanCommand.cpp:
3277         * editing/WrapContentsInDummySpanCommand.h:
3278         * editing/markup.cpp:
3279         * editing/markup.h:
3280         * html/HTMLAnchorElement.cpp:
3281         * html/HTMLBodyElement.cpp:
3282         * html/HTMLButtonElement.h:
3283         * html/HTMLCollection.h:
3284         * html/HTMLDocument.h:
3285         * html/HTMLEmbedElement.cpp:
3286         * html/HTMLFormElement.cpp:
3287         * html/HTMLFormElement.h:
3288         * html/HTMLFrameElement.cpp:
3289         * html/HTMLFrameSetElement.cpp:
3290         * html/HTMLKeygenElement.cpp:
3291         * html/HTMLLabelElement.cpp:
3292         * html/HTMLObjectElement.cpp:
3293         * html/HTMLObjectElement.h:
3294         * html/HTMLTableElement.cpp:
3295         * html/HTMLTablePartElement.cpp:
3296         * icon/IconDatabase.h:
3297         * kcanvas/KCanvasPath.h:
3298         * kcanvas/KCanvasResources.cpp:
3299         * kcanvas/KCanvasResources.h:
3300         * kcanvas/KCanvasTreeDebug.cpp:
3301         * kcanvas/KCanvasTreeDebug.h:
3302         * kcanvas/RenderSVGContainer.cpp:
3303         * kcanvas/RenderSVGText.h:
3304         * kcanvas/device/KRenderingPaintServer.h:
3305         * kcanvas/device/KRenderingPaintServerGradient.h:
3306         * kcanvas/device/KRenderingPaintServerSolid.cpp:
3307         * ksvg2/misc/SVGImageLoader.cpp:
3308         * ksvg2/svg/SVGElement.cpp:
3309         * ksvg2/svg/SVGElement.h:
3310         * ksvg2/svg/SVGForeignObjectElement.cpp:
3311         * ksvg2/svg/SVGForeignObjectElement.h:
3312         * ksvg2/svg/SVGImageElement.cpp:
3313         * ksvg2/svg/SVGPoint.h:
3314         * ksvg2/svg/SVGStylable.h:
3315         * ksvg2/svg/SVGTRefElement.cpp:
3316         * ksvg2/svg/SVGTRefElement.h:
3317         * ksvg2/svg/SVGTSpanElement.cpp:
3318         * ksvg2/svg/SVGTSpanElement.h:
3319         * ksvg2/svg/SVGTextElement.h:
3320         * ksvg2/svg/svgpathparser.cpp:
3321         * ksvg2/svg/svgpathparser.h:
3322         * loader/Cache.h:
3323         * loader/DocLoader.h:
3324         * loader/LoaderFunctions.h:
3325         * loader/mac/LoaderFunctionsMac.mm:
3326         * page/Frame.h:
3327         * page/FrameView.h:
3328         * page/Page.h:
3329         * page/Settings.h:
3330         * platform/AffineTransform.cpp:
3331         * platform/AffineTransform.h:
3332         * platform/Arena.cpp:
3333         * platform/Arena.h:
3334         * platform/CookieJar.h:
3335         * platform/DeprecatedCString.cpp:
3336         * platform/DeprecatedCString.h:
3337         * platform/DeprecatedPtrList.h:
3338         * platform/DeprecatedPtrListImpl.cpp:
3339         * platform/DeprecatedPtrListImpl.h:
3340         * platform/DeprecatedPtrQueue.h:
3341         * platform/DeprecatedString.cpp:
3342         * platform/DeprecatedString.h:
3343         * platform/DeprecatedStringList.cpp:
3344         * platform/DeprecatedStringList.h:
3345         * platform/DeprecatedValueList.h:
3346         * platform/DeprecatedValueListImpl.cpp:
3347         * platform/DeprecatedValueListImpl.h:
3348         * platform/FileButton.h:
3349         * platform/FloatPoint.h:
3350         * platform/FloatRect.h:
3351         * platform/FloatSize.h:
3352         * platform/FontData.h:
3353         * platform/FontFallbackList.h:
3354         * platform/GraphicsContext.h:
3355         * platform/IntPoint.h:
3356         * platform/IntRect.h:
3357         * platform/IntSize.h:
3358         * platform/KURL.cpp:
3359         * platform/KURL.h:
3360         * platform/ListBox.h:
3361         * platform/Logging.cpp:
3362         * platform/Logging.h:
3363         * platform/Pen.h:
3364         * platform/PopUpButton.h:
3365         * platform/RegularExpression.cpp:
3366         * platform/RegularExpression.h:
3367         * platform/SSLKeyGenerator.h:
3368         * platform/ScrollBar.h:
3369         * platform/SegmentedString.h:
3370         * platform/Shared.h:
3371         * platform/Slider.h:
3372         * platform/StringImpl.h:
3373         * platform/TextBox.h:
3374         * platform/TextField.h:
3375         * platform/TextStream.cpp:
3376         * platform/TextStream.h:
3377         * platform/TransferJob.h:
3378         * platform/TransferJobClient.h:
3379         * platform/Widget.h:
3380         * platform/cg/AffineTransformCG.cpp:
3381         * platform/mac/ClipboardMac.h:
3382         * platform/mac/ClipboardMac.mm:
3383         * platform/mac/DeprecatedStringListMac.mm:
3384         * platform/mac/FontCacheMac.mm:
3385         * platform/mac/KURLMac.mm:
3386         * platform/mac/ListBoxMac.mm:
3387         * platform/mac/PopUpButtonMac.mm:
3388         * platform/mac/SSLKeyGeneratorMac.mm:
3389         * platform/mac/TextBoxMac.mm:
3390         * platform/mac/TextFieldMac.mm:
3391         * platform/mac/WebCoreTextArea.h:
3392         * platform/mac/WebCoreTextArea.mm:
3393         * platform/mac/WebCoreTextField.h:
3394         * platform/mac/WebCoreTextField.mm:
3395         * rendering/DeprecatedRenderSelect.h:
3396         * rendering/RenderArena.cpp:
3397         * rendering/RenderArena.h:
3398         * rendering/RenderBlock.cpp:
3399         * rendering/RenderBox.cpp:
3400         * rendering/RenderContainer.cpp:
3401         * rendering/RenderFlexibleBox.cpp:
3402         * rendering/RenderFlow.cpp:
3403         * rendering/RenderLayer.cpp:
3404         * rendering/RenderLineEdit.cpp:
3405         * rendering/RenderObject.h:
3406         * rendering/RenderStyle.cpp:
3407         * rendering/RenderStyle.h:
3408         * rendering/RenderText.cpp:
3409         * rendering/RenderTextFragment.cpp:
3410         * rendering/RenderTheme.h:
3411         * rendering/RenderTreeAsText.cpp:
3412         * rendering/RenderTreeAsText.h:
3413         * rendering/RenderView.h:
3414         * rendering/bidi.h:
3415         * xml/XSLStyleSheet.cpp:
3416         * xml/XSLTProcessor.cpp:
3417
3418 2006-07-09  Geoffrey Garen  <ggaren@apple.com>
3419
3420         Reviewed by Beth.
3421
3422         * bindings/js/kjs_window.cpp:
3423         (KJS::Window::clear): Garbage collect after reinitalizing the global
3424         object, not before, since the reinitialization tends to create garbage.
3425
3426 2006-07-09  Timothy Hatcher  <timothy@apple.com>
3427
3428         Reviewed by Darin.
3429
3430         Bug 9820: Move new DOM API that has been through API review to public headers
3431         http://bugzilla.opendarwin.org/show_bug.cgi?id=9820
3432
3433         * bindings/objc/DOM.mm:
3434         (-[DOMElement focus]):
3435         (-[DOMElement blur]):
3436         (-[DOMRange text]):
3437         (-[DOMRange _text]):
3438         * bindings/objc/DOMCSS.mm:
3439         (-[DOMRGBColor color]):
3440         (-[DOMRGBColor _color]):
3441         * bindings/objc/DOMCore.h:
3442         * bindings/objc/DOMEvents.h:
3443         * bindings/objc/DOMExtensions.h:
3444         * bindings/objc/DOMHTML.mm:
3445         (-[DOMHTMLElement titleDisplayString]):
3446         (-[DOMHTMLDocument createDocumentFragmentWithMarkupString:baseURL:]):
3447         (-[DOMHTMLDocument createDocumentFragmentWithText:]):
3448         (-[DOMHTMLDocument _createDocumentFragmentWithMarkupString:baseURLString:]):
3449         (-[DOMHTMLDocument _createDocumentFragmentWithText:]):
3450         * bindings/objc/DOMPrivate.h:
3451         * bindings/objc/DOMXPath.h:
3452         * bindings/objc/DOMXPath.mm:
3453
3454 2006-07-09  Beth Dakin  <bdakin@apple.com>
3455
3456         Reviewed by Maciej.
3457
3458         Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=9749 A 
3459         nested content editable div causes unnecessary screen redraws.
3460         
3461         We were repainting too much because we were deciding that we needed 
3462         a full layout because we didn't have a first line box. Our code 
3463         used to hold a lot of assumptions that positioned elements would 
3464         always have line boxes, but I fixed a few bugs a while back that 
3465         appeared because this assumption isn't true. This assumption was 
3466         also causing the extra redraws because the check meant that we 
3467         would decide to do a full layout for any positioned element that 
3468         did not have any line boxes in the first place. Maciej and I talked 
3469         about this, and we couldn't figure out why the check for line boxes 
3470         was part of determining if we need a full layout in the first 
3471         place. After hunting around the code, we decided to assume that 
3472         this check is antiquated. Removing it fixes the bug and doesn't 
3473         seem to break any layout tests. So, fingers crossed!
3474
3475         Will add layout test so soon.
3476
3477         * rendering/bidi.cpp:
3478         (WebCore::RenderBlock::layoutInlineChildren): Remove firstLineBox 
3479         check.
3480
3481 2006-07-09  David Harrison  <harrison@apple.com>
3482
3483         Reviewed by John Sullivan.
3484
3485         <rdar://problem/4598149> Deleting the contents of a DOMRange and then inserting a node into it crashes in WebCore::Font::canUseGlyphCache
3486
3487         Test: fast/dom/delete-contents.html
3488         
3489         * dom/Range.cpp:
3490         (WebCore::Range::processContents):
3491
3492 2006-07-09  Darin Adler  <darin@apple.com>
3493
3494         - another round of renaming; and KWQ is dead
3495
3496         * WebCore.vcproj/WebCore/WebCore.vcproj: Remove paths for kwq and khtml directories.
3497         Move files to their new locations. Did rename.
3498         * WebCore.xcodeproj/project.pbxproj: Move files to their new locations. Did rename.
3499         * WebCoreSources.bkl: Did rename.
3500         * webcore-base.bkl: Removed kwq.
3501
3502         * kwq/AccessibilityObjectCache.h: Removed.
3503         * kwq/AccessibilityObjectCache.mm: Removed.
3504         * kwq/FormDataMac.h: Removed.
3505         * kwq/FormDataMac.mm: Removed.
3506         * kwq/WebCoreAXObject.h: Removed.
3507         * kwq/WebCoreAXObject.mm: Removed.
3508         * kwq/WebCoreEditCommand.h: Removed.