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