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