- Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6289
[WebKit-https.git] / WebCore / ChangeLog
1 2005-12-30  Alexey Proskuryakov  <ap@nypop.com>
2
3         - Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6289
4         REGRESSION: firstCharacterForRange(0, 0) returns a 0x0 rect
5
6         * khtml/editing/visible_text.cpp:
7         (khtml::TextIterator::rangeFromLocationAndLength):
8         Only special-case (0, 0) ranges for empty documents.
9
10 2005-12-29  Geoffrey Garen  <ggaren@apple.com>
11
12         Added test case for <rdar://problem/4268278> Submitting a form in onUnload event
13         handler causes crash in -[WebDataSource(WebPrivate) _commitIfReady:]
14
15         * manual-tests/onunload-form-submit-crash.html: Added.
16
17 2005-12-30  Anders Carlsson  <andersca@mac.com>
18
19         Reviewed by Eric.
20
21                 - Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6297
22                 XMLSerializer should use createMarkup.
23                                 
24         * khtml/ecma/xmlserializer.cpp:
25         (KJS::XMLSerializerProtoFunc::callAsFunction):
26                 Use createMarkup instead of NodeImpl::toString.
27                 
28         * khtml/editing/markup.cpp:
29         (khtml::startMarkup):
30                 escape attribute values and ignore document fragment nodes.
31
32 2005-12-30  Eric Seidel  <eseidel@apple.com>
33
34         Reviewed by mjs.
35
36         No functional changes, thus no layout test.
37
38         Just removes debug NSLog() calls from ksvg2/kcanvas.
39         http://bugzilla.opendarwin.org/show_bug.cgi?id=6299
40
41         * kcanvas/device/quartz/KCanvasFilterQuartz.mm:
42         (KCanvasFilterQuartz::prepareFilter):
43         (KCanvasFilterQuartz::applyFilter):
44         (KCanvasFilterQuartz::getCIFilterStack):
45         (KCanvasFilterQuartz::imageForName):
46         (KCanvasFEBlendQuartz::getCIFilter):
47         (KCanvasFEColorMatrixQuartz::getCIFilter):
48         (KCanvasFEGaussianBlurQuartz::getCIFilter):
49         * kcanvas/device/quartz/KCanvasResourcesQuartz.mm:
50         (KCanvasClipperQuartz::applyClip):
51         * kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
52         (KRenderingDeviceContextQuartz::mapFromVisual):
53         (KRenderingDeviceContextQuartz::mapToVisual):
54         (KRenderingDeviceQuartz::createResource):
55         (KRenderingDeviceQuartz::createFilterEffect):
56         * kcanvas/device/quartz/KRenderingPaintServerGradientQuartz.mm:
57         (drawShadingWithStyle):
58         (KRenderingPaintServerGradientQuartz::updateQuartzGradientCache):
59         * kcanvas/device/quartz/KRenderingPaintServerQuartz.mm:
60         (KRenderingPaintServerPatternQuartz::draw):
61         * ksvg2/svg/svgpathparser.cpp:
62         (SVGPathParser::parseSVG):
63
64 2005-12-29  Graham Dennis  <Graham.Dennis@gmail.com>
65
66         Reviewed by Hyatt.
67
68         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=3579
69           In-place style-switching is leaving junk behind, messing up styles
70
71         * khtml/rendering/render_block.h: (khtml::RenderBlock::initMaxMarginValues):
72         Set all margin values in all cases.
73
74 2005-12-29  Eric Seidel  <eseidel@apple.com>
75
76         Reviewed by mjs.
77
78         XML documents with "html" in dtd name use XHTML entities when they shouldn't
79         http://bugzilla.opendarwin.org/show_bug.cgi?id=6290
80
81         * khtml/xml/xml_tokenizer.cpp:
82         (khtml::externalSubsetHandler): check for exact xhtml types
83
84 2005-12-29  Eric Seidel  <eseidel@apple.com>
85
86         Reviewed by mjs.
87
88         Close leak in CollectionInfo due to HashMap migration
89         http://bugzilla.opendarwin.org/show_bug.cgi?id=6295
90
91         * khtml/html/html_miscimpl.cpp:
92         (DOM::HTMLCollectionImpl::CollectionInfo::~CollectionInfo):
93         * khtml/html/html_miscimpl.h:
94
95 2005-12-29  Maciej Stachowiak  <mjs@apple.com>
96
97         Reviewed by Eric.
98
99         - finished frame traversal cleanup
100         http://bugzilla.opendarwin.org/show_bug.cgi?id=6293
101         
102         * kwq/WebCoreBridge.h: Removed childFrames method from WebCoreBridge protocol
103         since it is not actually used.
104
105 2005-12-29  Eric Seidel  <eseidel@apple.com>
106
107         Reviewed by mjs.
108
109         Leaks in XSLTProcessorImpl due to early exit in failure case
110         http://bugzilla.opendarwin.org/show_bug.cgi?id=6101
111
112         * khtml/xsl/xslt_processorimpl.cpp:
113         (DOM::xmlDocPtrFromNode): add "shouldDelete" argument
114         (DOM::XSLTProcessorImpl::transformToString): delete new'd xmlDoc
115
116 2005-12-29  Eric Seidel  <eseidel@apple.com>
117
118         File accidentally omitted from previous commit.
119
120         Remove QDict from khtml/html
121         http://bugzilla.opendarwin.org/show_bug.cgi?id=6230
122
123         * khtml/ecma/kjs_html.cpp:
124         (KJS::KJS::HTMLCollection::getNamedItems):
125
126 2005-12-29  Eric Seidel  <eseidel@apple.com>
127
128         Reviewed by mjs.
129
130         Remove QDict from khtml/html
131         http://bugzilla.opendarwin.org/show_bug.cgi?id=6230
132         Uses HashMap instead.
133
134         * khtml/html/html_miscimpl.cpp:
135         (DOM::HTMLCollectionImpl::CollectionInfo::CollectionInfo):
136         (DOM::HTMLCollectionImpl::CollectionInfo::reset):
137         (DOM::HTMLCollectionImpl::namedItem):
138         (DOM::HTMLCollectionImpl::updateNameCache):
139         (DOM::HTMLCollectionImpl::namedItems):
140         (DOM::HTMLCollectionImpl::nextNamedItem):
141         (DOM::HTMLFormCollectionImpl::nextNamedItemInternal):
142         (DOM::HTMLFormCollectionImpl::updateNameCache):
143         * khtml/html/html_miscimpl.h:
144
145 2005-12-29  Eric Seidel  <eseidel@apple.com>
146
147         Reviewed by mjs.
148
149         DOMString/DOMStringImpl/AtomicString need enhancements before replacing QString
150         http://bugzilla.opendarwin.org/show_bug.cgi?id=6228
151         Added find(), contains(), startsWith() and endsWith() to DOMString
152         Uses the above functions throughout the code.
153         Small performance boost.
154
155         * khtml/css/css_base.cpp:
156         (CSSSelector::print):
157         * khtml/css/css_ruleimpl.cpp:
158         (DOM::CSSImportRuleImpl::init):
159         * khtml/css/css_valueimpl.cpp:
160         (DOM::CSSStyleDeclarationImpl::setProperty):
161         * khtml/css/cssparser.cpp:
162         (CSSParser::parseValue):
163         (CSSParser::parseDeclaration):
164         (CSSParser::parseContent):
165         * khtml/css/cssstyleselector.cpp:
166         (khtml::CSSStyleSelector::CSSStyleSelector):
167         (khtml::CSSStyleSelector::setEncodedURL):
168         (khtml::parseUASheet):
169         (khtml::cleanpath):
170         (khtml::CSSStyleSelector::checkSelector):
171         (khtml::CSSStyleSelector::checkOneSelector):
172         (khtml::CSSRuleSet::addRulesFromSheet):
173         (khtml::CSSStyleSelector::applyProperty):
174         * khtml/dom/dom_string.cpp:
175         * khtml/dom/dom_string.h:
176         (DOM::DOMString::contains):
177         (DOM::DOMString::find):
178         (DOM::DOMString::startsWith):
179         (DOM::DOMString::endsWith):
180         * khtml/html/html_formimpl.cpp:
181         (DOM::HTMLFormElementImpl::parseEnctype):
182         * khtml/khtml_part.cpp:
183         (KHTMLPart::requestFrame):
184         (KHTMLPart::submitForm):
185         * khtml/misc/decoder.cpp:
186         (Decoder::decode):
187         * khtml/xml/dom_atomicstring.h:
188         (DOM::AtomicString::length):
189         (DOM::AtomicString::operator []):
190         (DOM::AtomicString::contains):
191         (DOM::AtomicString::find):
192         (DOM::AtomicString::startsWith):
193         (DOM::AtomicString::endsWith):
194         * khtml/xml/dom_docimpl.cpp:
195         (DocumentImpl::processHttpEquiv):
196         * khtml/xml/dom_stringimpl.cpp:
197         (DOM::equal):
198         (DOM::equalCaseInsensitive):
199         (DOM::DOMStringImpl::find):
200         (DOM::DOMStringImpl::endsWith):
201         * khtml/xml/dom_stringimpl.h:
202         (DOM::DOMStringImpl::startsWith):
203
204 2005-12-29  Rob Buis  <rwlbuis@xs4all.nl>
205
206         Reviewed by eseidel.
207
208         WebCore+SVG has some problems with rounded rectangles
209         http://bugzilla.opendarwin.org/show_bug.cgi?id=6157
210
211         * ksvg2/svg/SVGRectElementImpl.cpp:
212         (SVGRectElementImpl::toPathData): fixed round rect calculations
213
214 2005-12-29  Mark Rowe  <opendarwin.org@bdash.net.nz>
215
216         Reviewed by eseidel, ggaren, darin.
217         
218         - http://bugzilla.opendarwin.org/show_bug.cgi?id=4301
219         Support HTML entities on pages parsed as XHTML
220
221         Added layout tests:
222         * fast/parser/entities-in-xhtml.xhtml
223
224         * khtml/xml/xml_tokenizer.cpp:
225         (khtml::XMLTokenizer::setIsXHTMLDocument): Track whether the XML document is XHTML.
226         (khtml::XMLTokenizer::isXHTMLDocument): Ditto.
227         (khtml::externalSubsetHandler): Ditto.
228         (khtml::XMLTokenizer::finish): Ditto.
229         (khtml::getXHTMLEntity): Look up the HTML entity.
230         (khtml::getEntityHandler): Look up the HTML entity if this is an XHTML document.
231         * khtml/html/kentities.h: Added.
232         * khtml/html/kentities.gperf: changed entity to Entity
233
234 2005-12-29  Mitz Pettel  <opendarwin.org@mitzpettel.com>
235
236         Reviewed by darin
237
238         - WebCore part of fix for
239           http://bugzilla.opendarwin.org/show_bug.cgi?id=3922
240           Variable word/letter spacing and full justification not supported for
241           ATSUI-rendered text
242
243         * khtml/rendering/font.h:
244         (khtml::Font::checkSelectionPoint): Make sure the complete run, used for
245         counting spaces and determining padding per space does not go beyond the
246         text box.
247
248 2005-12-28  Geoffrey Garen  <ggaren@apple.com>
249
250         Reviewed by mjs.
251
252         - Fixed <rdar://problem/4325722> crash in KJS::Bindings::dispatchJNICall
253         due to liveconnect call from Java after Java PlugInView has been 
254         deallocated @ www.binarybet.com
255         AKA
256         http://bugzilla.opendarwin.org/show_bug.cgi?id=5518
257
258         We had code that checked for whether a call came from a live PlugIn,
259         but the live PlugIn dictionary would only get cleared when the 
260         KWQKHTMLPart was destroyed. Since a single part can service multiple
261         loads, the dictionary needs to clear after each one.
262
263         No layout test because this bug is difficult to reproduce.
264
265         * kwq/KWQKHTMLPart.mm:
266         (KWQKHTMLPart::~KWQKHTMLPart):
267         (1) Unrelated cleanup: Removed manual clearing of form values,
268         replaced with call to clearRecordedFormValues().
269         (2) Replaced PlugIn dictionary cleanup code and view deref call
270         with call to setView(0), since much of this code was duplicated in
271         setView, and the stuff that wasn't duplicated needed to be.
272
273         (KWQKHTMLPart::setView):
274         (1) Removed some unnecessary braces.
275         (2) Added PlugIn dictionary cleanup code.
276         (3) New behavior: clear _bindingRoot and _windowScriptObject after
277         each view change. This is needed because after a call to
278         clenaupPluginRootObjects(), both objects have stale references.
279         (4) Changed a NULL to a 0.
280
281         (KWQKHTMLPart::cleanupPluginRootObjects): Removed extra space.
282
283 2005-12-28  Anders Carlsson  <andersca@mac.com>
284
285         Reviewed by Maciej.
286
287         - Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6268
288         Add undetectable document.all
289         
290         * khtml/ecma/kjs_html.cpp:
291         (KJS::HTMLDocument::getValueProperty):
292         If "all" has been set to a new value, return the new value.
293         
294         (KJS::KJS::HTMLDocument::putValueProperty):
295         Allow "all" to be set to a new value.
296         
297         (KJS::HTMLAllCollection::toPrimitive):
298         Return jsNull() if the preferred type is NullType.
299         
300         (KJS::getAllHTMLCollection):
301         * khtml/ecma/kjs_html.h:
302         (KJS::HTMLAllCollection::HTMLAllCollection):
303         Add HTMLAllCollection, a subclass of HTMLCollection which should
304         be undetectable.
305         
306         (KJS::HTMLAllCollection::toBoolean):
307         Return false.
308
309 2005-12-28  Mitz Pettel  <opendarwin.org@mitzpettel.com>
310
311         Reviewed by Eric, landed by ap.
312         
313         Test: fast/block/basic/text-indent-rtl.html
314
315         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6214
316           text-indent in RTL block does the opposite
317
318         * khtml/rendering/render_block.cpp:
319         (khtml::RenderBlock::rightRelOffset): Subtract the indent instead of adding it.
320
321 2005-12-28  Mitz Pettel  <opendarwin.org@mitzpettel.com>
322
323         Reviewed by Darin, landed by ap.
324
325         Test: fast/dom/HTMLScriptElement/script-load-events.html
326
327         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5812
328           Generate load events for <script> elements
329
330         * khtml/html/html_headimpl.cpp:
331         (HTMLScriptElementImpl::parseMappedAttribute): Parse the onload and onerror attributes.
332         (HTMLScriptElementImpl::closeRenderer): Call base class's implementation.
333         (HTMLScriptElementImpl::notifyFinished): Dispatch load and error events.
334         * khtml/html/htmlparser.h:
335         * khtml/html/htmlparser.cpp:
336         (HTMLParser::parseToken): Return the node that was inserted.
337         * khtml/html/htmltokenizer.h: Added scriptNode, a RefPtr to the node corresponding
338         to the current load request.
339         * khtml/html/htmltokenizer.cpp:
340         (HTMLTokenizer::scriptHandler): Reset scriptNode if a load request was not made.
341         (HTMLTokenizer::parseTag): Set scriptNode to the node created from the script tag.
342         (HTMLTokenizer::processToken): Return the node that was inserted.
343         (HTMLTokenizer::notifyFinished): Reset scriptNode and dispatch load and error events.
344         * khtml/misc/loader.h:
345         (CachedScript::errorOccurred): Added.
346         * khtml/misc/loader.cpp:
347         (CachedScript::CachedScript):
348         (CachedScript::error):
349
350 2005-12-28  Alexey Proskuryakov  <ap@nypop.com>
351
352         Reviewed by Maciej.
353
354         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6246
355           TextIterator::rangeFromLocationAndLength() returns nil range for an 
356           empty document
357
358         Test: editing/input/range-for-empty-document.html
359
360         * khtml/editing/visible_text.cpp:
361         (khtml::TextIterator::rangeFromLocationAndLength):
362         Handle the case of an empty document and (0, 0) requested range.
363
364 2005-12-28  Anders Carlsson  <andersca@mac.com>
365
366         Reviewed and landed by Geoff.
367
368         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6269
369         ToT memory corruption
370         
371         * khtml/rendering/render_text.cpp:
372         (khtml::RenderText::setText):
373         Remove deref().
374         
375 2005-12-27  Mitz Pettel  <opendarwin.org@mitzpettel.com>
376
377         Reviewed by Hyatt, landed by Darin.
378         
379         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5699
380           REGRESSION: incomplete repaint
381
382         * khtml/rendering/render_object.cpp:
383         (RenderObject::repaintAfterLayoutIfNeeded): Return false if only the
384         size changed and not everything was repainted.
385         * manual-tests/bugzilla-5699.html: Added.
386
387 2005-12-27  Sam Weinig  <sam.weinig@gmail.com>
388
389         Reviewed by Maciej, landed by Darin.
390
391         - fixed <http://bugzilla.opendarwin.org/show_bug.cgi?id=4101>
392         CSS Fibonacci spiral using 4 images doesn't render correctly
393
394         Added layout tests:
395         * fast/replaced/absolute-image-sizing.html
396
397         * khtml/rendering/render_box.cpp:
398         (RenderBox::calcAbsoluteHorizontalValues): Use calcReplacedWidth() instead of intrinsicWidth()
399         for replaced elements.
400         (RenderBox::calcAbsoluteVerticalValues): Same thing for height.
401
402 2005-12-27  Darin Adler  <darin@apple.com>
403
404         Reviewed by Geoff and Eric.
405
406         - http://bugzilla.opendarwin.org/show_bug.cgi?id=6198
407           use RefPtr a few places in RenderText and related classes
408
409         * khtml/html/htmltokenizer.h: Use RefPtr for some data members in Token.
410         Also removed use of bitfields in Token, since there's no need to optimize storage here.
411         * khtml/html/htmlparser.cpp:
412         (HTMLParser::parseToken): Update for use of RefPtr in Token.
413         (HTMLParser::textCreateErrorCheck): Ditto.
414         (HTMLParser::commentCreateErrorCheck): Ditto.
415         (HTMLParser::handleIsindex): Ditto.
416         * khtml/html/htmltokenizer.cpp:
417         (khtml::Token::addAttribute): Ditto.
418         (khtml::HTMLTokenizer::processToken): Ditto.
419
420         * khtml/rendering/render_text.h: Reduce the number of includes, change
421         SOFT_HYPHEN from a macro into a constant. Change originalString function
422         to return a PassRefPtr instead of a RefPtr. Make str and m_generatedContentStr
423         member be a RefPtr.
424         * khtml/rendering/render_text.cpp:
425         (khtml::RenderText::previousOffset): Update for use of RefPtr for str.
426         (khtml::RenderText::nextOffset): Ditto.
427         (khtml::RenderText::RenderText): Ditto.
428         (khtml::RenderText::originalString): Change to return PassRefPtr, even though
429         it's not necessary at this level (since it's a virtual function).
430         (khtml::RenderText::posOfChar): Update for use of RefPtr for str.
431         (khtml::RenderText::setText): Ditto.
432         (khtml::RenderTextFragment::RenderTextFragment): Ditto.
433         (khtml::RenderTextFragment::originalString): Change to return PassRefPtr.
434
435         * khtml/html/html_inlineimpl.cpp: Re-sorted list of includes, added newly-needed ones.
436         * kwq/KWQRenderTreeDebug.cpp: Added new include needed since QPtrVector is no longer
437         included by render_text.h.
438
439 2005-12-27  Darin Adler  <darin@apple.com>
440
441         Fix suggested by Mitz.
442
443         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6240
444           REGRESSION: scrollbars in overflows don't work
445
446         * khtml/xml/dom2_eventsimpl.cpp: (DOM::MouseRelatedEventImpl::computePositions):
447         Remove the code to compute pageX/Y from clientX/Y, because clientX/Y are not passed
448         in correctly (in fact, what's passed in is pageX/Y)! I accidentally included part
449         of my fix for clientX/Y in the original patch.
450
451 2005-12-27  Maks Orlovich <maksim@kde.org>
452
453         Reviewed and landed by Maciej.
454
455         - fixed 4405: <button> not listed in form collections.
456         http://bugzilla.opendarwin.org/show_bug.cgi?id=4405
457
458         Test: fast/forms/button-in-forms-collection.html
459         
460         * khtml/html/html_formimpl.h:
461         (DOM::HTMLButtonElementImpl::isEnumeratable): override to return true
462
463 2005-12-25  Maciej Stachowiak  <mjs@apple.com>
464
465         Reviewed by Geoff.
466
467         - Remove WebFrame's parent frame pointer, instead rely on WebCore's parent concept
468         http://bugzilla.opendarwin.org/show_bug.cgi?id=6241
469
470         * kwq/WebCoreBridge.h:
471         * kwq/WebCoreBridge.mm:
472         (-[WebCoreBridge parent]): New method, relies on the KHTMLPart's
473         parent pointer.
474
475 2005-12-24  Mitz Pettel  <opendarwin.org@mitzpettel.com>
476
477         Reviewed by eseidel.
478         
479         Test: fast/forms/domstring-replace-crash.html
480
481         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6236
482           REGRESSION: Crash in DOMString::replace() in ToT (12/24/05)
483
484         * khtml/dom/dom_string.h:
485         (DOMString::replace): Added check for null m_impl.
486
487 2005-12-24  Maciej Stachowiak  <mjs@apple.com>
488
489         Reviewed by Eric.
490
491         - replaced QPtrDict for Accessors structs with HashMap (also renamed some
492         stray getSetInfo methods)
493         http://bugzilla.opendarwin.org/show_bug.cgi?id=6223
494
495         * khtml/ecma/kjs_html.cpp:
496         (KJS::HTMLElement::accessors):
497         (KJS::HTMLElement::getValueProperty):
498         (KJS::HTMLElement::putValueProperty):
499         * khtml/ecma/kjs_html.h:
500
501 2005-12-24  Geoffrey Garen  <ggaren@apple.com>
502
503         Reviewed by eric.
504
505         http://bugzilla.opendarwin.org/show_bug.cgi?id=6231
506
507         - Fixed assertion failure in QString::mid caused by my last checkin. 
508         parseWindowFeatures() sometimes called QString::mid() with a start 
509         index past the end of the string but a length of 0. There were two 
510         problems there. (1) parseWindowFeatures() shouldn't have gotten past 
511         the end of the string. (2) QString had range truncating code that was 
512         borked. So I fixed both.
513
514         * khtml/ecma/kjs_window.cpp:
515         (KJS::parseWindowFeatures): One of the "past the end" tests was > 
516         instead of >=.
517         * kwq/KWQString.mm:
518         (QString::mid): Truncate length *before* deciding whether to return 
519         early. Also, compare start and data._length before computing 
520         data._length - start, because the error case we're trying to catch 
521         will almost certainly cause unsigned overflow.
522         * manual-tests/window-open-features-parsing.html: Added trailing ',' 
523         to uber-test to catch this failure, too.
524
525 2005-12-24  Mitz Pettel  <opendarwin.org@mitzpettel.com>
526
527         Reviewed by Maciej.
528
529         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6221
530           REGRESSION: Password field is blank error for secure websites using
531           password field (ToT, 12/24/05)
532
533         * khtml/kwq/KWQSlot.mm:
534         (KWQSlot::KWQSlot): Changed the parameter type of slotTextChanged to const DOMString &
535         * khtml/rendering/render_form.h:
536         * khtml/rendering/render_form.cpp:
537         (RenderLineEdit::RenderLineEdit): ditto.
538         (RenderLineEdit::slotTextChanged): ditto.
539         (RenderFileButton::RenderFileButton): ditto.
540         (RenderFileButton::slotTextChanged): ditto.
541
542 2005-12-22  Geoffrey Garen  <ggaren@apple.com>
543     
544         Reviewed by vicki (yay!), eric.
545
546         - Fixed: <rdar://problem/4377597> parsing of window.open features strings needs to be more forgiving
547
548         Manual test case: WebCore/manual-tests/window-open-features-parsing.html
549         Also fixed: WebCore/manual-tests/window-open-features.html, which had an incorrect URL in it.
550
551         This patch is long. Luckily, it's also complicated.
552
553         The main thing I've done is to change our parsing of the window.open 'features' argument to match Win IE.
554         This is important because we now implement the correct defaults for window.open, and resizing and
555         scrolling are turned off by default. So, if we parse the 'features' string incorrectly, we'll end
556         up with an annoying, incorrectly sized window that can't resize or scroll.
557
558         To honor a long-standing request by Eric, I factored out the parsing into two new functions:
559         parseWindowFeatures and constrainToScreen. I also added support for "innerWidth" and "innerHeight,"
560         since they're just synonyms for "width" and "height."
561
562         * khtml/ecma/kjs_window.cpp: removed "emit" statements, since emit is #defined as ""
563         (KJS::parseDialogFeatures): renamed from parseFeatures, since we now have a 'parseWindowFeatures'.
564         (KJS::showModalDialog): ditto on parseFeatures. Also added some missing initializations for WindowArgs data members.
565         (KJS::parseWindowFeatures): new function, all new functionality.
566         (KJS::constrainToScreen): new function, no new functionality -- just cut and pasted code that used to run as
567         part of our parsing routine.
568         (KJS::WindowFunc::callAsFunction):
569         (1) Factored out previous parsing code.
570         (2) Factored 17 lines of custom popup-blocking code into 3 lines that use pre-existing 'allowPopUp' function.
571             Gratuitous, but it cried out to me.
572         (3) Changed URL parsing to substitute "" for undefined *and* null values (we already did this for undefined),
573             to avoid trying to navigate to 'http://null'.
574         (4) Factore a multiline if () { if () {}} into an if ( && )
575         (4) Removed the main body of code from a giant 'else' block by inserting early returns for the exceptional cases.
576             This caused some things to show up in the diff even though they're just whitespace changes.
577             I didn't actually change any code past the line "if (!str.isEmpty() && activePart)"
578         * kwq/KWQKHTMLPartBrowserExtension.mm:
579         (KHTMLPartBrowserExtension::createNewWindow): Added code to set toolbars to visible if toolBarVisible is true *or*
580         locationBarVisible is true. The parser used to do this for us, but it's really the browser that's responsible for
581         saying that the toolbar and the locationbar are the same thing. Hopefully, we can add a setLocationBarVisible delegate
582         in the future so that other webkit clients can make their own UI decisions.
583         * kwq/KWQKPartsBrowserExtension.h: Added locationBarVisible data member to WindowArgs structure and renamed
584         toolBarsVisible to toolBarVisible (see above). Removed initialization code from WindowArgs structure because
585         this file is for platform-specific code, and what defaults to use for window arguments is purely engine stuff.
586
587 2005-12-23  Eric Seidel  <eseidel@apple.com>
588
589         Reviewed by mjs.
590
591         Remove many use of .qstring()
592         Convert several instances of QStrings to DOMStrings
593         Add DOMString::replace(QChar, QChar)
594         Remove (unused) KWQLabel, KWQKGlobal
595         Slight performance improvement.
596         Also fixed ChangeLog line endings from previous commit.
597         http://bugzilla.opendarwin.org/show_bug.cgi?id=6138
598
599         No tests needed, no functionality changes.
600
601         * ChangeLog: Fixed line endings
602         * ForwardingHeaders/kglobal.h: Removed.
603         * ForwardingHeaders/qlabel.h: Removed.
604         * WebCore.xcodeproj/project.pbxproj: removed KWQLabel
605         * khtml/css/css_base.cpp:
606         (CSSSelector::selectorText):
607         * khtml/css/css_stylesheetimpl.cpp:
608         (MediaListImpl::setMediaText):
609         * khtml/css/cssstyleselector.cpp:
610         (khtml::checkPseudoState):
611         * khtml/dom/dom_string.h:
612         (DOM::DOMString::replace):
613         * khtml/ecma/kjs_css.cpp:
614         (KJS::DOMCSSStyleDeclaration::put):
615         * khtml/ecma/kjs_dom.cpp:
616         (KJS::DOMNode::put):
617         (KJS::DOMAttr::put):
618         (KJS::DOMDocument::put):
619         * khtml/ecma/kjs_events.cpp:
620         (KJS::JSAbstractEventListener::handleEvent):
621         * khtml/ecma/kjs_html.cpp:
622         (KJS::KJS::HTMLDocument::put):
623         (KJS::KJS::HTMLElementFunction::callAsFunction):
624         (KJS::KJS::HTMLElement::put):
625         (KJS::KJS::Context2DFunction::callAsFunction):
626         (KJS::Context2D::putValueProperty):
627         * khtml/ecma/kjs_proxy.cpp:
628         (KJSProxyImpl::evaluate):
629         * khtml/ecma/kjs_window.cpp:
630         (KJS::Window::isSafeScript):
631         (KJS::WindowFunc::callAsFunction):
632         (KJS::ScheduledAction::execute):
633         * khtml/ecma/xmlhttprequest.cpp:
634         (KJS::XMLHttpRequest::send):
635         (KJS::XMLHttpRequestProtoFunc::callAsFunction):
636         * khtml/ecma/xmlhttprequest.h:
637         * khtml/editing/jsediting.cpp:
638         (DOM::JSEditor::queryCommandSupported):
639         * khtml/editing/markup.cpp:
640         (khtml::stringValueForRange):
641         (khtml::startMarkup):
642         * khtml/html/html_baseimpl.cpp:
643         (HTMLBodyElementImpl::parseMappedAttribute):
644         * khtml/html/html_elementimpl.cpp:
645         (HTMLElementImpl::addHTMLAlignment):
646         * khtml/html/html_formimpl.cpp:
647         (DOM::HTMLFormElementImpl::formData):
648         (DOM::HTMLInputElementImpl::appendFormData):
649         (DOM::HTMLTextAreaElementImpl::updateValue):
650         * khtml/html/html_headimpl.cpp:
651         (HTMLLinkElementImpl::parseMappedAttribute):
652         * khtml/html/html_imageimpl.cpp:
653         (DOM::HTMLImageElementImpl::parseMappedAttribute):
654         * khtml/html/html_objectimpl.cpp:
655         (DOM::HTMLObjectElementImpl::parseMappedAttribute):
656         (DOM::HTMLParamElementImpl::isURLAttribute):
657         * khtml/html/html_objectimpl.h:
658         * khtml/html/html_tableimpl.cpp:
659         (DOM::HTMLTableElementImpl::addChild):
660         (DOM::HTMLTableElementImpl::parseMappedAttribute):
661         (DOM::HTMLTablePartElementImpl::parseMappedAttribute):
662         (DOM::HTMLTableSectionElementImpl::addChild):
663         (DOM::HTMLTableRowElementImpl::addChild):
664         * khtml/html/htmltokenizer.cpp:
665         (khtml::HTMLTokenizer::parseTag):
666         * khtml/khtml_part.cpp:
667         (KHTMLPart::executeScript):
668         (KHTMLPart::checkEmitLoadEvent):
669         * khtml/misc/loader.cpp:
670         (CachedObject::finish):
671         (CachedCSSStyleSheet::checkNotify):
672         (CachedXSLStyleSheet::checkNotify):
673         (CachedXBLDocument::checkNotify):
674         (DocLoader::requestImage):
675         (DocLoader::requestStyleSheet):
676         (DocLoader::requestScript):
677         (Loader::servePendingRequests):
678         (Loader::cancelRequests):
679         * khtml/rendering/render_applet.cpp:
680         * khtml/rendering/render_block.cpp:
681         (khtml::RenderBlock::updateFirstLetter):
682         * khtml/rendering/render_box.cpp:
683         (RenderBox::~RenderBox):
684         * khtml/rendering/render_form.cpp:
685         (RenderFormElement::slotTextChanged):
686         (RenderLineEdit::updateFromElement):
687         (RenderTextArea::updateFromElement):
688         (RenderTextArea::text):
689         * khtml/rendering/render_form.h:
690         * khtml/rendering/render_frames.cpp:
691         (RenderPartObject::updateWidget):
692         * khtml/rendering/render_line.cpp:
693         (khtml::EllipsisBox::paint):
694         * khtml/rendering/render_list.cpp:
695         (RenderListItem::paint):
696         (RenderListMarker::paint):
697         * khtml/rendering/render_text.cpp:
698         (khtml::RenderText::RenderText):
699         (khtml::RenderText::position):
700         * khtml/xml/dom_docimpl.cpp:
701         (DOMImplementationImpl::hasFeature):
702         (DocumentImpl::getElementByAccessKey):
703         (DocumentImpl::recalcStyleSelector):
704         (DocumentImpl::defaultEventHandler):
705         * khtml/xml/dom_elementimpl.cpp:
706         (ElementImpl::recalcStyle):
707         * khtml/xml/dom_nodeimpl.cpp:
708         (DOM::NodeImpl::dump):
709         (DOM::appendAttributeDesc):
710         (DOM::NodeImpl::showNode):
711         * khtml/xml/dom_stringimpl.cpp:
712         (DOM::DOMStringImpl::lower):
713         * khtml/xml/xml_tokenizer.cpp:
714         (khtml::XMLTokenizer::executeScripts):
715         * khtml/xsl/xsl_stylesheetimpl.cpp:
716         (DOM::XSLStyleSheetImpl::loadChildSheets):
717         * kwq/KWQKHTMLPart.h:
718         * kwq/KWQKHTMLPart.mm:
719         (KWQKHTMLPart::documentViewForNode):
720         (KWQKHTMLPart::runJavaScriptAlert):
721         (KWQKHTMLPart::runJavaScriptConfirm):
722         (KWQKHTMLPart::runJavaScriptPrompt):
723         (KWQKHTMLPart::addMessageToConsole):
724         (KWQKHTMLPart::passWheelEventToChildWidget):
725         (KWQKHTMLPart::shouldDragAutoNode):
726         (KWQKHTMLPart::snapshotDragImage):
727         (convertAttributesToUnderlines):
728         (KWQKHTMLPart::setMarkedTextRange):
729         (KWQKHTMLPart::mousePressNode):
730         * kwq/KWQKGlobal.h: Removed.
731         * kwq/KWQKGlobal.mm: Removed.
732         * kwq/KWQLabel.h: Removed.
733         * kwq/KWQLabel.mm: Removed.
734         * kwq/KWQLineEdit.h:
735         * kwq/KWQLineEdit.mm:
736         (QLineEdit::setText):
737         (QLineEdit::text):
738         (QLineEdit::setAutoSaveName):
739         (QLineEdit::setPlaceholderString):
740         * kwq/KWQPainter.mm:
741         (QPainter::compositeOperatorFromString):
742         * kwq/KWQSignal.h:
743         * kwq/KWQSignal.mm:
744         (KWQSignal::call):
745         * kwq/KWQSlot.h:
746         * kwq/KWQSlot.mm:
747         (KWQSlot::call):
748         * kwq/KWQString.h:
749         * kwq/KWQString.mm:
750         * kwq/KWQTextEdit.h:
751         * kwq/KWQTextEdit.mm:
752         (QTextEdit::setText):
753         (QTextEdit::text):
754         (QTextEdit::textWithHardLineBreaks):
755         * ksvg2/scripts/cssmakeprops: removed kglobal.h
756         * ksvg2/scripts/cssmakevalues: removed kglobal.h
757
758 2005-12-23  Alexey Proskuryakov  <ap@nypop.com>
759
760         Reviewed by Eric Seidel.
761
762         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5924
763           Zero-length responses to XMLHTTPRequest mishandled
764
765         * khtml/ecma/xmlhttprequest.cpp (KJS::XMLHttpRequest::slotFinished):
766           Make sure to fetch response headers and set the state to Loaded, if
767           this hasn't been done already.
768
769 2005-12-23  Alexey Proskuryakov  <ap@nypop.com>
770
771         Reviewed by Eric Seidel.
772
773         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=3565
774           Posting data via XML HTTP Request doesnt work
775
776         * khtml/ecma/xmlhttprequest.cpp:
777         (KJS::XMLHttpRequest::send): Set application/xml as a default Content-Type;
778           use a proper codec for request body if a charset is specified.
779         (KJS::XMLHttpRequest::getRequestHeader): Use getSpecificHeader.
780         (KJS::XMLHttpRequest::getResponseHeader): Ditto.
781         (KJS::XMLHttpRequest::getSpecificHeader): Factored out code from getResponseHeader.
782         (KJS::XMLHttpRequestProtoFunc::callAsFunction): Removed a FIXME (this is done in send() now).
783         * khtml/ecma/xmlhttprequest.h:
784
785 2005-12-22  Alexey Proskuryakov  <ap@nypop.com>
786
787         Reviewed by Darin Adler.
788
789         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6118
790         Investigate not using the frameset charset as a default for frames
791
792         * khtml/khtml_part.cpp (KHTMLPart::write):
793         Do not use the parent frame encoding as a default for sub-frames (revert
794         rdar://3100151). 
795
796 2005-12-22  Maciej Stachowiak  <mjs@apple.com>
797
798         Reviewed by Eric.
799
800         - made RefPtr<DOMStringImpl> usable as a hashtable key/value
801         - changed XSLTProcessorImpl to make use of this instead of a QDict.
802         - partially fixed broken param handling for xslt
803
804         See LayoutTests for updated test case.
805
806         * khtml/xml/dom_stringimpl.cpp:
807         * khtml/xml/dom_stringimpl.h:
808         (KXMLCore::): Set things up so you can use RefPtr<DOMStringImpl> as
809         a hashtable key (should already be usable as a value).
810         * khtml/xsl/xslt_processorimpl.cpp:
811         (DOM::xsltParamArrayFromParameterMap): Updated to use a HashMap of RefPtrs instead
812         of QDict. Also, fixed bugs that would have kept this from ever working at all.
813         (DOM::XSLTProcessorImpl::transformToString): ditto
814         (DOM::XSLTProcessorImpl::setParameter): ditto
815         (DOM::XSLTProcessorImpl::getParameter): ditto
816         (DOM::XSLTProcessorImpl::removeParameter): ditto
817         * khtml/xsl/xslt_processorimpl.h:
818
819 2005-12-21  Maciej Stachowiak  <mjs@apple.com>
820
821         Reviewed by Darin.
822
823         - update for new HashTranslator stuff
824
825         * khtml/xml/dom_atomicstring.cpp:
826         (DOM::CStringTranslator::hash):
827         (DOM::CStringTranslator::equal):
828         (DOM::CStringTranslator::translate):
829         (DOM::AtomicString::equal):
830         (DOM::AtomicString::add):
831         (DOM::QCharBufferTranslator::hash):
832         (DOM::QCharBufferTranslator::equal):
833         (DOM::QCharBufferTranslator::translate):
834         * khtml/xml/dom_qname.cpp:
835         (DOM::QNameComponentsTranslator::hash):
836         (DOM::QNameComponentsTranslator::equal):
837         (DOM::QNameComponentsTranslator::translate):
838         (DOM::QualifiedName::QualifiedName):
839
840 2005-12-22  Adele Peterson  <adele@apple.com>
841
842         Reviewed by Darin.
843
844         Cleaned up a previous checkin by defining global const defaultForm.
845
846         * khtml/xml/dom_docimpl.cpp:
847         (DocumentImpl::radioButtonChecked):
848         (DocumentImpl::checkedRadioButtonForGroup):
849         (DocumentImpl::removeRadioButtonGroup):
850
851 2005-12-22  Adele Peterson  <adele@apple.com>
852
853         Reviewed by Tim Hatcher.
854
855         Fixed <rdar://problem/4387433> Seed: Radio buttons behave incorrectly in Gmail settings
856
857         * khtml/html/html_formimpl.cpp:
858         (DOM::HTMLFormElementImpl::registerFormElement): update radio button hash map when moving form elements around.
859         (DOM::HTMLGenericFormElementImpl::insertedIntoTree): ditto.
860         * khtml/html/html_formimpl.h:
861         (DOM::HTMLGenericFormElementImpl::isRadioButton): Added.
862         (DOM::HTMLInputElementImpl::isRadioButton): Added.
863         * khtml/xml/dom_docimpl.cpp:
864         (DocumentImpl::radioButtonChecked): 
865         Added comment explaining that we use 1 for the default form.  We can't use a null pointer as a key for the hash map.
866         (DocumentImpl::checkedRadioButtonForGroup): Added conversion of null form pointer to 1.
867         (DocumentImpl::removeRadioButtonGroup): ditto.
868
869 2005-12-22  Anders Carlsson  <andersca@mac.com>
870
871         Reviewed by Eric.
872
873         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6196
874         Would like to be able to define prototypes in headers
875
876         * khtml/ecma/XSLTProcessor.cpp:
877         * khtml/ecma/domparser.cpp:
878         * khtml/ecma/kjs_css.cpp:
879         * khtml/ecma/kjs_dom.cpp:
880         * khtml/ecma/kjs_events.cpp:
881         * khtml/ecma/kjs_html.cpp:
882         * khtml/ecma/kjs_range.cpp:
883         * khtml/ecma/kjs_traversal.cpp:
884         * khtml/ecma/kjs_views.cpp:
885         * khtml/ecma/xmlhttprequest.cpp:
886         * khtml/ecma/xmlserializer.cpp:
887         Update for changes to JSC.
888
889 2005-12-22  Darin Adler  <darin@apple.com>
890
891         Reviewed by NOBODY (OOPS!).
892
893         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6198
894           use RefPtr a few places in RenderText and related classes
895
896         * khtml/html/htmlparser.cpp:
897         (HTMLParser::parseToken): Use get since text pointer is RefPtr now.
898         (HTMLParser::textCreateErrorCheck): Ditto.
899         (HTMLParser::commentCreateErrorCheck): Ditto.
900         (HTMLParser::handleIsindex): Get rid of explicit deref, no longer needed.
901
902         * khtml/html/htmltokenizer.h: Make attrs and text fields of Token use
903         RefPtr. Also stop using bit fields for the flags in Token -- there's no
904         evidence this makes things faster.
905         * khtml/html/htmltokenizer.cpp:
906         (khtml::Token::addAttribute): Get rid of explicit ref, no longer needed.
907         (khtml::HTMLTokenizer::processToken): Ditto.
908
909         * khtml/rendering/render_block.cpp: (khtml::RenderBlock::updateFirstLetter):
910         Use a PassRefPtr.
911
912         * khtml/rendering/render_text.cpp:
913         (khtml::RenderText::previousOffset): Use get since str pointer is RefPtr now.
914         (khtml::RenderText::nextOffset): Ditto.
915         (khtml::RenderText::RenderText): Get rid of explicit ref, no longer needed.
916         Change to use initializer syntax instead of assignment.
917         (khtml::RenderText::setStyle): Use PassRefPtr.
918         (khtml::RenderText::originalString): Ditto.
919         (khtml::RenderText::setText): Get rid of explicit ref, no longer needed.
920         (khtml::RenderTextFragment::RenderTextFragment): Get rid of explicit ref,
921         no longer needed.
922         (khtml::RenderTextFragment::originalString): Use PassRefPtr.
923
924         * khtml/rendering/render_text.h: Change SOFT_HYPEN to be a constant rather than
925         a preprocessor macro. Used PassRefPtr in a couple places. Made RenderText's str
926         and RenderTextFragment's m_generatedContentStr be RefPtr.
927
928         * khtml/html/html_inlineimpl.cpp: Add a newly-needed include, sort them.
929         * kwq/KWQRenderTreeDebug.cpp: Add a newly-needed include.
930
931 2005-12-22  Darin Adler  <darin@apple.com>
932
933         Reviewed by Eric.
934
935         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6193
936           remove some unused KWQ code
937
938         * kcanvas/KCanvasCreator.cpp: (KCanvasCreator::self): Don't use static deleter for
939         two reasons: (1) We don't want any globals with constructors in any of our frameworks
940         because they slow down framework load time. (2) There's no need to destroy this object at
941         process termination time -- it's extra work with no benefit. Because of both these
942         reasons, our KStaticDeleter implementation was basically a no-op.
943         * ksvg2/svg/SVGDOMImplementationImpl.cpp: (SVGDOMImplementationImpl::self): Ditto.
944         * khtml/xml/dom_docimpl.cpp: (DocumentImpl::setDocumentChanged): Ditto.
945
946         * khtml/html/html_canvasimpl.cpp: Removed include of kstringhandler.h.
947         * khtml/html/html_imageimpl.cpp: Ditto.
948
949         * khtml/khtmlpart_p.h: Removed something that was in an "APPLE_CANGES" ifdef.
950
951         * ForwardingHeaders/kstaticdeleter.h: Removed.
952         * ForwardingHeaders/kstringhandler.h: Removed.
953         * kwq/KWQKStaticDeleter.h: Removed.
954         * kwq/KWQKStringHandler.h: Removed.
955         * kwq/KWQKStringHandler.mm: Removed.
956
957         * WebCore.xcodeproj/project.pbxproj: Removed files.
958
959 2005-12-22  Darin Adler  <darin@apple.com>
960
961         Reviewed by Eric.
962
963         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6192
964           add support for non-standard &nsup; entity (implemented in other browsers)
965
966         * khtml/html/kentities.gperf: Add "nsup" to table.
967         * khtml/html/htmltokenizer.cpp: Removed old workaround for inlining issue that no
968         longer seems to be necessary; also touches the file which is important because
969         Xcode doesn't seem to understand the dependency on kentities.gperf and the need
970         to recompile.
971
972 2005-12-22  Darin Adler  <darin@apple.com>
973
974         Reviewed by Eric.
975
976         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6167
977           RenderStyle default constructor should initialize its members for speed
978
979         * khtml/rendering/DataRef.h: (khtml::DataRef::operator=): Eliminate an extra
980         branch by doing ref before deref instead of == check.
981
982         * khtml/rendering/render_style.cpp:
983         (khtml::initDefaultStyle): Added. Function to initialize the default style
984         for use in constructor.
985         (khtml::RenderStyle::RenderStyle): Changed constructor to initalize all the
986         members with constructor syntax instead of using assignment on all of them.
987         * khtml/rendering/render_style.h: Removed static data member _default --
988         it's now a file scope global instead.
989
990 2005-12-21  Darin Adler  <darin@apple.com>
991
992         Reviewed by Justin.
993
994         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6142
995           intermittent failures in some paste tests
996
997         * khtml/editing/apply_style_command.cpp:
998         (khtml::ApplyStyleCommand::applyBlockStyle): Call new updateLayout member function.
999         (khtml::ApplyStyleCommand::applyInlineStyle): Ditto.
1000         (khtml::ApplyStyleCommand::pushDownTextDecorationStyleAtBoundaries): Ditto.
1001         * khtml/editing/composite_edit_command.cpp:
1002         (khtml::CompositeEditCommand::addBlockPlaceholderIfNeeded): Ditto.
1003         (khtml::CompositeEditCommand::findBlockPlaceholder): Ditto.
1004         (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): Ditto.
1005         * khtml/editing/delete_selection_command.cpp:
1006         (khtml::DeleteSelectionCommand::fixupWhitespace): Ditto.
1007         (khtml::DeleteSelectionCommand::moveNodesAfterNode): Ditto.
1008         * khtml/editing/edit_command.cpp:
1009         (khtml::EditCommand::apply): Ditto.
1010         (khtml::EditCommand::unapply): Ditto.
1011         (khtml::EditCommand::reapply): Ditto.
1012         (khtml::EditCommand::updateLayout): Added. Calls updateLayoutIgnorePendingStylesheets
1013         on the document.
1014         * khtml/editing/edit_command.h: Added updateLayout member function.
1015         * khtml/editing/insert_line_break_command.cpp:
1016         (khtml::InsertLineBreakCommand::doApply): Call new updateLayout member function.
1017         * khtml/editing/insert_paragraph_separator_command.cpp:
1018         (khtml::InsertParagraphSeparatorCommand::doApply): Ditto.
1019         * khtml/editing/jsediting.cpp:
1020         (DOM::JSEditor::execCommand): Call updateLayoutIgnorePendingStylesheets instead of updateLayout.
1021         (DOM::JSEditor::queryCommandEnabled): Ditto.
1022         (DOM::JSEditor::queryCommandIndeterm): Ditto.
1023         (DOM::JSEditor::queryCommandState): Ditto.
1024         (DOM::JSEditor::queryCommandValue): Ditto.
1025         * khtml/editing/markup.cpp: (khtml::createMarkup): Ditto.
1026         * khtml/editing/replace_selection_command.cpp:
1027         (khtml::ReplacementFragment::insertFragmentForTestRendering): Ditto.
1028         (khtml::ReplaceSelectionCommand::fixupNodeStyles): Call new updateLayout member function.
1029         (khtml::ReplacementFragment::computeStylesUsingTestRendering): Call
1030         updateLayoutIgnorePendingStylesheets instead of updateLayout.
1031         (khtml::ReplaceSelectionCommand::doApply): Call new updateLayout member function.
1032         (khtml::ReplaceSelectionCommand::removeLinePlaceholderIfNeeded): Ditto.
1033         (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Ditto.
1034         * khtml/editing/visible_units.cpp:
1035         (khtml::previousLinePosition): Call updateLayoutIgnorePendingStylesheets instead of updateLayout.
1036         (khtml::nextLinePosition): Ditto.
1037         * khtml/html/html_elementimpl.cpp:
1038         (HTMLElementImpl::innerText): Ditto.
1039         * kwq/WebCoreBridge.mm:
1040         (-[WebCoreBridge setSelectedDOMRange:affinity:closeTyping:]): Ditto.
1041         (-[WebCoreBridge smartDeleteRangeForProposedRange:]): Ditto.
1042
1043 2005-12-21  Darin Adler  <darin@apple.com>
1044
1045         Reviewed by Geoff.
1046
1047         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6177
1048           move event code from JavaScript binding into DOM implementation
1049
1050         * khtml/ecma/kjs_events.cpp:
1051         (KJS::DOMMouseEvent::getValueProperty): Change everything to just call through instead of doing
1052         the work here.
1053         (KJS::DOMWheelEvent::getValueProperty): Ditto.
1054
1055         * khtml/xml/dom2_eventsimpl.h:
1056         (DOM::MouseRelatedEventImpl::offsetX):
1057         (DOM::MouseRelatedEventImpl::offsetY):
1058         * khtml/xml/dom2_eventsimpl.cpp:
1059         (DOM::MouseRelatedEventImpl::MouseRelatedEventImpl): Initialize new m_pageX, m_pageY, m_layerX,
1060         m_layerY, m_offsetX, and m_offsetY.
1061         (DOM::MouseRelatedEventImpl::computePositions): Renamed from computeLayerPos since it handles
1062         page position andoffset position too now.
1063         (DOM::MouseRelatedEventImpl::pageX): Added. Not in header since it's virtual.
1064         (DOM::MouseRelatedEventImpl::pageY): Ditto.
1065         (DOM::MouseRelatedEventImpl::x): Added, with FIXME since it should change eventually.
1066         (DOM::MouseRelatedEventImpl::y): Ditto.
1067         (DOM::MouseEventImpl::initMouseEvent): Call computePositions instead of computeLayerPos.
1068         (DOM::MouseEventImpl::toElement): Added.
1069         (DOM::MouseEventImpl::fromElement): Added.
1070
1071 2005-12-21  Timothy Hatcher  <timothy@apple.com>
1072
1073         * WebCore.xcodeproj/project.pbxproj:
1074           Set tab width to 8, indent width to 4 and uses tabs to false per file.
1075
1076 2005-12-21  John Sullivan  <sullivan@apple.com>
1077
1078         Reviewed by Tim Omernick and Darin Adler.
1079         
1080         - fixed HiDPI problem with forms auto-fill menu width
1081
1082         No test cases added; this code is used for "chrome" only.
1083
1084         * kwq/DOMHTML.mm:
1085         (-[DOMHTMLInputElement _rectOnScreen]):
1086         convert entire rect to window coordinates, not just origin
1087
1088 2005-12-21  David Harrison  <harrison@apple.com>
1089
1090         Reviewed by Justin.
1091
1092         <rdar://problem/4039777> Pasting particular snippet of HTML containing list items and a link creates too many list items
1093         - Fixed paste crash by making calling RenderBox::deleteLineBoxWrapper() from RenderObject::remove(),
1094         so that the connection is broken before the InlineBox's parent gets deleted.
1095         - Fixed overzealous style changes when setting the style on a specific range of elements.  These specific
1096         ranges are derived programmatically, e.g. as a part of pasting, so they must be respected exactly rather
1097         than modified by converting the endpoints to VisiblePositions.
1098         
1099         Test cases coming soon.
1100
1101         * khtml/editing/apply_style_command.cpp:
1102         (khtml::ApplyStyleCommand::ApplyStyleCommand):
1103         (khtml::ApplyStyleCommand::updateStartEnd):
1104         (khtml::ApplyStyleCommand::startPosition):
1105         (khtml::ApplyStyleCommand::endPosition):
1106         (khtml::ApplyStyleCommand::applyBlockStyle):
1107         (khtml::ApplyStyleCommand::applyRelativeFontStyleChange):
1108         (khtml::ApplyStyleCommand::applyInlineStyle):
1109         (khtml::ApplyStyleCommand::removeInlineStyle):
1110         (khtml::ApplyStyleCommand::splitTextAtStartIfNeeded):
1111         (khtml::ApplyStyleCommand::splitTextAtEndIfNeeded):
1112         (khtml::ApplyStyleCommand::splitTextElementAtStartIfNeeded):
1113         (khtml::ApplyStyleCommand::splitTextElementAtEndIfNeeded):
1114         (khtml::ApplyStyleCommand::mergeStartWithPreviousIfIdentical):
1115         (khtml::ApplyStyleCommand::mergeEndWithNextIfIdentical):
1116         (khtml::ApplyStyleCommand::joinChildTextNodes):
1117         * khtml/editing/apply_style_command.h:
1118         * khtml/editing/composite_edit_command.cpp:
1119         (khtml::CompositeEditCommand::applyStyle):
1120         * khtml/editing/composite_edit_command.h:
1121         * khtml/editing/insert_line_break_command.cpp:
1122         (khtml::InsertLineBreakCommand::doApply):
1123         * khtml/editing/replace_selection_command.cpp:
1124         (khtml::ReplaceSelectionCommand::fixupNodeStyles):
1125         (khtml::ReplaceSelectionCommand::completeHTMLReplacement):
1126         * khtml/rendering/render_box.cpp:
1127         (RenderBox::destroy):
1128         (RenderBox::deleteLineBoxWrapper):
1129         * khtml/rendering/render_box.h:
1130         * khtml/rendering/render_list.cpp:
1131         (RenderListMarker::~RenderListMarker):
1132         (RenderListMarker::setStyle):
1133         * khtml/rendering/render_object.cpp:
1134         (RenderObject::remove):
1135         * khtml/rendering/render_object.h:
1136         * khtml/rendering/render_replaced.cpp:
1137         (RenderWidget::destroy):
1138
1139 2005-12-20  Adele Peterson  <adele@apple.com>
1140
1141         Reviewed by Darin.
1142
1143         Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=5911
1144         REGRESSION: Page scroll position jumps when clicking on word in editable div
1145
1146         I moved the scrolling code out of setFocusNode, and consolidated some of the focus code to scroll when necessary.
1147
1148         * khtml/html/html_formimpl.cpp: Removed HTMLButtonElementImpl::blur, HTMLButtonElementImpl::focus, HTMLInputElementImpl::blur, HTMLInputElementImpl::focus.  
1149         New code in ElementImpl::focus will now handle these cases.  This allows tabbing through the elements to go through the same code path as calling focus() on an element.  
1150         Before, focus() would scroll to reveal for any form elements that had a RenderWidget, but wouldn't scroll for anchor elements, or any of the new form elements.  
1151         Now the behavior will be more consistent.
1152         (DOM::HTMLLabelElementImpl::focus): calls ElementImpl::focus.
1153         (DOM::HTMLLegendElementImpl::focus): ditto.
1154         * khtml/html/html_formimpl.h:
1155         * khtml/khtml_part.cpp:
1156         (KHTMLPart::selectAll): calls new function selectContentsOfNode
1157         (KHTMLPart::selectContentsOfNode): factored out code to selectAll for a particular node- which is useful for contenteditable elements.
1158         * khtml/khtml_part.h: added selectContentsOfNode
1159         * khtml/xml/dom_docimpl.cpp:
1160         (DocumentImpl::setFocusNode): removed scrolling code.
1161         * khtml/xml/dom_elementimpl.cpp:
1162         (ElementImpl::focus): Calls updateLayout in case focus() is called before there's a renderer.
1163         Makes a selection for editable elements (right now we select all, but this will change).
1164         Doesn't scroll if the renderer is a RenderWidget, since that is handled when the view becomes first responder.  This will go away when we convert the rest of our form elements.
1165         * kwq/KWQKHTMLPart.mm:
1166         (KWQKHTMLPart::revealSelection): Made this more like centerSelectionInVisibleArea  where we get the right rectangle if the selection is a caret.
1167         (KWQKHTMLPart::nextKeyViewInFrame): call ElementImpl::focus() for the node.  This will set the selection too, which used to be done here.
1168
1169 2005-12-20  Alexey Proskuryakov  <ap@nypop.com>
1170
1171         Reviewed by justin
1172         
1173         <http://bugzilla.opendarwin.org/show_bug.cgi?id=4682>
1174         -[WebHTMLView firstRectForCharacterRange:] is using _selectedRange instead of the given range if no marked text
1175
1176         Added layout tests:
1177         * editing/input/firstrectforcharacterrange-styled
1178         * editing/input/firstrectforcharacterrange-plain
1179
1180         * khtml/editing/visible_text.cpp:
1181         (khtml::TextIterator::rangeFromLocationAndLength): 
1182         Return null if the range isn't found, instead of a startless/endless 
1183         range.  Set the end if the requested location+length is out of bounds.
1184         * kwq/WebCoreBridge.mm:
1185         (-[WebCoreBridge convertToDOMRange:]): Handle larged unsigned values 
1186         before calling rangeWithLocationAndLength, which expects signed ints.
1187
1188 2005-12-20  Adele Peterson  <adele@apple.com>
1189
1190         Reviewed by Darin.
1191
1192         Fix for <rdar://problem/4387630> REGRESSION: <select> element's onClick event doesn't fire @ bugweb.apple.com
1193
1194         * kwq/KWQKHTMLPart.mm:
1195         (KWQKHTMLPart::passSubframeEventToSubframe): only pass mouse down for khtmlviews.
1196
1197 2005-12-20  Justin Garcia  <justin.garcia@apple.com>
1198
1199         Reviewed by eric, thatcher
1200         
1201         <rdar://problem/4172984> KWQExceptions needs to use @try/@catch instead of relying on NSException.h internals
1202         
1203         Needed to undef try/catch because of 4333439.  Moved the 
1204         declarations of variables that are returned from within a @try 
1205         block outside the @try block (because of "might be clobbered by 
1206         a longjmp or vfork" warnings).  Moved some return statements
1207         inside the @try block to fix volatilization errors with gcc4.
1208
1209         * WebCore.xcodeproj/project.pbxproj:
1210         * WebCorePrefix.h:
1211         * kcanvas/device/quartz/KCanvasFilterQuartz.mm:
1212         (KCanvasFEBlendQuartz::getCIFilter):
1213         (KCanvasFEColorMatrixQuartz::getCIFilter):
1214         (KCanvasFECompositeQuartz::getCIFilter):
1215         (getPointLightVectors):
1216         (getLightVectors):
1217         (getNormalMap):
1218         (KCanvasFEDiffuseLightingQuartz::getCIFilter):
1219         (KCanvasFEFloodQuartz::getCIFilter):
1220         (KCanvasFEImageQuartz::getCIFilter):
1221         (KCanvasFEMergeQuartz::getCIFilter):
1222         (KCanvasFESpecularLightingQuartz::getCIFilter):
1223         * kwq/KWQExceptions.h:
1224         * kwq/KWQExceptions.mm:
1225         (KWQReportBlockedException):
1226         * kwq/KWQFileButton.mm:
1227         (KWQFileButton::sizeForCharacterWidth):
1228         (KWQFileButton::frameGeometry):
1229         * kwq/KWQKCursor.mm:
1230         (+[NSCursor _WebCore_cursorWithName:hotSpot:_WebCore_cursorWithName:hotSpot:]):
1231         * kwq/KWQKHTMLPart.mm:
1232         (KWQKHTMLPart::createPart):
1233         (KWQKHTMLPart::nextKeyView):
1234         (KWQKHTMLPart::runJavaScriptPrompt):
1235         (KWQKHTMLPart::keyEvent):
1236         (KWQKHTMLPart::sendContextMenuEvent):
1237         (KWQKHTMLPart::fileWrapperForElement):
1238         (KWQKHTMLPart::attributedString):
1239         (KWQKHTMLPart::imageFromRect):
1240         * kwq/KWQKHTMLPartBrowserExtension.mm:
1241         * kwq/KWQLineEdit.mm:
1242         (QLineEdit::sizeForCharacterWidth):
1243         * kwq/KWQListBox.mm:
1244         (QListBox::sizeForNumberOfLines):
1245         * kwq/KWQLoader.mm:
1246         (KWQCheckCacheObjectStatus):
1247         * kwq/KWQWidget.mm:
1248         (QWidget::frameGeometry):
1249         (QWidget::mapFromGlobal):
1250
1251 2005-12-20  David Harrison  <harrison@apple.com>
1252
1253         <rdar://problem/4294417> Cannot un-italicize some text after triple clicking it
1254
1255         Reviewed by Justin.
1256
1257         * khtml/editing/apply_style_command.cpp:
1258         (khtml::ApplyStyleCommand::addInlineStyleIfNeeded):
1259         Removed check for tab span because ApplyStyleCommand::removeCSSStyle() already makes the same check.
1260
1261 2005-12-20  Justin Garcia  <justin.garcia@apple.com>
1262
1263         <rdar://problem/4387270> editing/deleting/delete-3800834-fix failing
1264         <http://bugzilla.opendarwin.org/show_bug.cgi?id=6160> REGRESSION: Crash when running editing/deleting/delete-3800834-fix.html
1265         <http://bugzilla.opendarwin.org/show_bug.cgi?id=6161> REGRESSION: crash when pressing tab in editable WebHTMLView
1266
1267         Reviewed by darin
1268     
1269         Some callers call setAttribute on a floating element.  So, using 
1270         a RefPtr for the element inside addAttribute can destroy
1271         it.
1272
1273         * khtml/xml/dom_elementimpl.cpp:
1274         (NamedAttrMapImpl::addAttribute):
1275
1276 2005-12-20  Maciej Stachowiak  <mjs@apple.com>
1277
1278         Reviewed by Darin.
1279
1280         - fixed leak in createAttributeMap
1281         http://bugzilla.opendarwin.org/show_bug.cgi?id=6162
1282         
1283         * khtml/xml/dom_elementimpl.cpp:
1284         (StyledElementImpl::createAttributeMap): the new attribute map
1285         is going in a RefPtr, don't also ref it manually.
1286
1287 2005-12-20  Maciej Stachowiak  <mjs@apple.com>
1288
1289         Reviewed by Darin.
1290
1291         - change an assignment to a contructor declaration to build with PassRefPtr
1292         leak fix changes
1293
1294         * ksvg2/svg/SVGTransformableImpl.cpp:
1295         (SVGTransformableImpl::parseTransformAttribute):
1296
1297 2005-12-20  Geoffrey Garen  <ggaren@apple.com>
1298
1299         Reviewed by John.
1300
1301         Fixed <rdar://problem/4310363> JavaScript window.open: Height is 1 
1302         pixel short, and related bugs.
1303
1304         There were a few bugs here.
1305         (1) Our code took size arguments and applied them to the window's
1306             content rect. That's incorrect. The Rhino book says the arguments 
1307             should apply to the WebView. Other things that occupy the content 
1308             rect include the tab bar, the status bar, and the 1 pixel border 
1309             between brushed metal and document. All of these used to impinge 
1310             on the web page's display area.
1311
1312             The fix is to calculate sizing based on the WebView instead of
1313             the content rect. This means that the webViewContentRect and 
1314             setContentRect delegate methods are obsolete and no longer called
1315             by any of our code. (setContentRect was never called in the 
1316             first place.)
1317
1318         (2) None of our sizing accounted for scaled resolutions.
1319
1320             The fix is to ask the WebView to scale all coordintes for us.
1321
1322         (3) Our code assumed that all window accoutrements were on by default.
1323             Safari works that way, but other WebKit clients might not.
1324
1325             The fix is always to explicitly set an on/off state.
1326         
1327         (a) To facilitate scaling, I added a new bridge method, webView, to 
1328         access the webView.
1329
1330         (b) For internal consistency, I changed ___Bars to ___bars in bridge 
1331         methods, and ___bars to ___Bars in WinArgs data members. (Interestingly,
1332         the different classes in our code are evenly divided on which format to 
1333         use.)
1334         
1335         Added manual test:
1336         * manual-tests/window-open-features.html: Added.
1337         * manual-tests/resources/200x200.png: Added.
1338         * manual-tests/resources/popup200x200.html: Added.
1339
1340         * khtml/ecma/kjs_window.cpp:
1341         (KJS::showModalDialog): see (b)
1342         (KJS::WindowFunc::callAsFunction): see (b)
1343         * kwq/KWQKHTMLPart.mm:
1344         (KWQKHTMLPart::statusbarVisible): see (b)
1345         * kwq/KWQKHTMLPartBrowserExtension.mm:
1346         (KHTMLPartBrowserExtension::createNewWindow):
1347         At the top of this method, I just did some formatting cleanup and
1348         moved the 'referrer' variable closer to where it's used.
1349         The changes in the middle of the method are (3), the bottom, (2).
1350         * kwq/KWQKPartsBrowserExtension.h:
1351         (KParts::WindowArgs::WindowArgs): see (b)
1352         * kwq/WebCoreBridge.h: see (a)
1353
1354 2005-12-20  Eric Seidel  <eseidel@apple.com>
1355
1356         Reviewed by mjs.
1357
1358         Leaks when running SVG tests
1359         http://bugzilla.opendarwin.org/show_bug.cgi?id=6156
1360         No additional tests necessary, leaks already caught by other tests.
1361
1362         * kcanvas/KCanvasFilters.cpp:
1363         (KCanvasFEDiffuseLighting::setLightSource): takes ownership
1364         (KCanvasFESpecularLighting::setLightSource): takes ownership
1365         * kcanvas/KCanvasFilters.h:
1366         (KCanvasFEDiffuseLighting::KCanvasFEDiffuseLighting): added
1367         (KCanvasFEDiffuseLighting::~KCanvasFEDiffuseLighting): added
1368         (KCanvasFEDiffuseLighting::lightSource): fixed spacing
1369         (KCanvasFESpecularLighting::KCanvasFESpecularLighting): added
1370         (KCanvasFESpecularLighting::~KCanvasFESpecularLighting): added
1371         (KCanvasFESpecularLighting::lightSource): fixed spacing
1372         * kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
1373         (KRenderingDeviceQuartz::stringForPath): added missing CFRelease
1374
1375 2005-12-20  Eric Seidel  <eseidel@apple.com>
1376
1377         Reviewed by darin.
1378
1379         Remove additional bit-rotted DEBUG* ifdefs from WebCore.
1380         This removes PARSER_DEBUG, FORMS_DEBUG and CSS_STYLESHEET_DEBUG.
1381         http://bugzilla.opendarwin.org/show_bug.cgi?id=5931
1382         No tests possible, only removing dead code.
1383
1384         * khtml/css/css_stylesheetimpl.cpp:
1385         (CSSStyleSheetImpl::parseString):
1386         (CSSStyleSheetImpl::isLoading):
1387         * khtml/html/html_formimpl.cpp:
1388         (DOM::HTMLFormElementImpl::formData):
1389         (DOM::HTMLFormElementImpl::submit):
1390         (DOM::HTMLFormElementImpl::reset):
1391         (DOM::HTMLGenericFormElementImpl::getForm):
1392         * khtml/html/htmlparser.cpp:
1393         (HTMLParser::processCloseTag):
1394         (HTMLParser::createHead):
1395
1396 2005-12-20  Eric Seidel  <eseidel@apple.com>
1397
1398         Reviewed by darin.
1399
1400         Move Decoder onto Shared<T> and clients onto RefPtr.
1401         http://bugzilla.opendarwin.org/show_bug.cgi?id=6107
1402         No test cases possible, no functional changes.
1403
1404         * khtml/ecma/XSLTProcessor.cpp:
1405         (KJS::XSLTProcessorProtoFunc::callAsFunction):
1406         * khtml/ecma/xmlhttprequest.cpp:
1407         (KJS::XMLHttpRequest::XMLHttpRequest):
1408         (KJS::XMLHttpRequest::~XMLHttpRequest):
1409         (KJS::XMLHttpRequest::changeState):
1410         (KJS::XMLHttpRequest::abort):
1411         (KJS::XMLHttpRequest::slotFinished):
1412         (KJS::XMLHttpRequest::slotData):
1413         * khtml/ecma/xmlhttprequest.h:
1414         * khtml/khtml_part.cpp:
1415         (KHTMLPart::clear):
1416         (KHTMLPart::begin):
1417         (KHTMLPart::write):
1418         * khtml/khtmlpart_p.h:
1419         (KHTMLPartPrivate::KHTMLPartPrivate):
1420         * khtml/misc/decoder.cpp:
1421         (Decoder::Decoder):
1422         (Decoder::~Decoder):
1423         * khtml/misc/decoder.h:
1424         * khtml/misc/loader.h:
1425         * khtml/xml/dom_docimpl.cpp:
1426         (DocumentImpl::DocumentImpl):
1427         (DocumentImpl::~DocumentImpl):
1428         (DocumentImpl::prepareMouseEvent):
1429         (DocumentImpl::setDecoder):
1430         * khtml/xml/dom_docimpl.h:
1431         (DOM::DocumentImpl::decoder):
1432         * khtml/xsl/xslt_processorimpl.cpp:
1433         (DOM::XSLTProcessorImpl::createDocumentFromSource):
1434
1435 2005-12-19  Darin Adler  <darin@apple.com>
1436
1437         Reviewed by Maciej.
1438
1439         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6143
1440           DOM::ElementImpl should use a RefPtr for the attribute map
1441
1442         * khtml/xml/dom_elementimpl.cpp:
1443         (ElementImpl::ElementImpl): Remove code to initialize the pointer; not needed since
1444         RefPtr gets initialized to 0.
1445         (ElementImpl::~ElementImpl): Remove code to deref the pointer; RefPtr handles that.
1446         (ElementImpl::attributes): Add get() call to get raw pointer.
1447         (ElementImpl::setAttributeMap): Remove code to deref the old map and set the new map.
1448         But added code to clear the element pointer from the old map (missing in the old
1449         version). Also added a FIXME.
1450         (ElementImpl::createAttributeMap): Remove ref(); RefPtr handles that.
1451         (NamedAttrMapImpl::addAttribute): Use a RefPtr to guarantee the element does not go
1452         away in the middle of dispatching DOM events.
1453         (StyledElementImpl::attributeChanged): Clean up code by using the inline function
1454         mappedAttributes() instead of doing type casts.
1455         (StyledElementImpl::parseMappedAttribute): Ditto.
1456         (StyledElementImpl::getClassList): Ditto.
1457
1458         * khtml/xml/dom_elementimpl.h: Make ElementImpl::namedAttrMap be a RefPtr instead
1459         of raw pointer. Added an overload of StyledElementImpl::mappedAttributes for both
1460         const and non-const.
1461
1462         * khtml/xml/dom_nodeimpl.cpp: (DOM::NodeImpl::addChild): Use a RefPtr to ref/deref
1463         the child so that it doesn't leak.
1464
1465         * khtml/html/htmlparser.h: Changed isindex to use a RefPtr.
1466         * khtml/html/htmlparser.cpp:
1467         (HTMLParser::~HTMLParser): Removed now-unneeded ref.
1468         (HTMLParser::isindexCreateErrorCheck): Remove now-unneeded deref/ref.
1469         (HTMLParser::handleIsindex): Put isindex element into a RefPtr. This prevents a
1470         crash that was otherwise happening during layout tests (caused indirectly by
1471         the changes above).
1472         (HTMLParser::startBody): Added call to get().
1473
1474 2005-12-19  Darin Adler  <darin@apple.com>
1475
1476         Reviewed by Geoff Garen and Eric Seidel.
1477
1478         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=4923
1479           stop using <ostream> in WebCore, eliminating the <cmath> troubles it causes
1480
1481         * ForwardingHeaders/kxmlcore/AlwaysInline.h: Added.
1482         * WebCorePrefix.h: Removed the use of <ostream>.
1483
1484         * kwq/KWQDef.h: Removed now-unused Q_INT64, Q_INT16, Q_UINT16, qRound, and _KWQ_IOSTREAM_.
1485
1486         * kwq/KWQKHTMLPart.h: Removed some unneeded headers and added forward-declarations of classes
1487         instead. Corrected some incorrect member function declarations.
1488         * kwq/KWQKHTMLPart.mm: Added a now-needed header.
1489
1490         * khtml/ecma/kjs_window.cpp: Removed the <cmath> workaround.
1491         * khtml/rendering/bidi.cpp: Added include of AlwaysInline.h and removed a
1492         lot of unnecessary includes.
1493         * khtml/rendering/render_canvasimage.cpp: Removed the <cmath> workaround.
1494         * khtml/rendering/render_image.cpp: Removed the <cmath> workaround.
1495         * khtml/rendering/render_text.cpp: Added include of AlwaysInline.h and removed a
1496         lot of unnecessary includes.
1497
1498         * ksvg2/css/SVGCSSStyleSelector.cpp: (KDOM::CSSStyleSelector::applySVGProperty):
1499         * ksvg2/svg/SVGAnimateColorElementImpl.cpp: (SVGAnimateColorElementImpl::calculateColor):
1500         * ksvg2/svg/SVGAnimateTransformElementImpl.cpp: (SVGAnimateTransformElementImpl::handleTimerEvent):
1501         * ksvg2/svg/SVGAnimationElementImpl.cpp: (SVGAnimationElementImpl::closeRenderer):
1502         * ksvg2/svg/SVGLinearGradientElementImpl.cpp: (SVGLinearGradientElementImpl::buildGradient):
1503         * ksvg2/svg/SVGPatternElementImpl.cpp: (SVGPatternElementImpl::notifyAttributeChange):
1504         * ksvg2/svg/SVGRadialGradientElementImpl.cpp: (SVGRadialGradientElementImpl::buildGradient):
1505         Replaced use of qRound with use of lroundf or lround as appropriate.
1506
1507         * kwq/KWQCString.h:
1508         * kwq/KWQCString.mm:
1509         * kwq/KWQDateTime.h:
1510         * kwq/KWQDateTime.mm:
1511         * kwq/KWQMap.h:
1512         * kwq/KWQMemArray.h:
1513         * kwq/KWQPoint.mm:
1514         * kwq/KWQPointArray.h:
1515         * kwq/KWQPtrList.h:
1516         * kwq/KWQPtrStack.h:
1517         * kwq/KWQPtrVector.h:
1518         * kwq/KWQRect.h:
1519         * kwq/KWQRect.mm:
1520         * kwq/KWQSize.h:
1521         * kwq/KWQSize.mm:
1522         * kwq/KWQValueList.h:
1523         Removed _KWQ_IOSTREAM_ code that was used at one time for unit tests, but is now unneeded,
1524         and requires <ostream>.
1525
1526 2005-12-19  Darin Adler  <darin@apple.com>
1527
1528         Reviewed by Geoff Garen and John Sullivan.
1529
1530         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=4312
1531           XMLHttpRequest headers that have two CRLF sequences lead to Obj-C exception
1532
1533         I found this by code inspection after examining a security report about
1534         vulnerabilities in other browsers' XMLHttpRequest implementations.
1535
1536         * kwq/KWQLoader.mm:
1537         (+[NSDictionary _webcore_dictionaryWithHeaderString:_webcore_dictionaryWithHeaderString:]):
1538         Check length of string before calling characterAtIndex:0 since it will fail for an empty string.
1539
1540 2005-12-19  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1541
1542         Reviewed by Beth
1543
1544         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6149
1545           REGRESSION (WebCore-417.5): horizontal scrollbar in overflow with top
1546           border doesn't receive mouse events
1547
1548         * khtml/rendering/render_block.cpp:
1549         (khtml::RenderBlock::isPointInScrollbar):
1550         Removed borderTop() from horizontal scrollbar rect computation.
1551         * manual-tests/scrollbar-hittest2.html: Added.
1552
1553 2005-12-19  Alexey Proskuryakov  <ap@nypop.com>
1554
1555         Reviewed by Darin, committed by Adele.
1556
1557         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5744
1558           XMLHttpRequest does not apply page encoding after assigning via innerHtml
1559
1560         * khtml/ecma/xmlhttprequest.cpp:
1561         (getMIMEType): A helper function to get MIME type from a Content-Type string.
1562         (getCharset): A helper function to get charset from a Content-Type string.
1563         (KJS::XMLHttpRequest::getValueProperty): Factored out responseIsXML().
1564         (KJS::XMLHttpRequest::getResponseHeader): Return QString instead of JSValue
1565           (to get rid of unnecessary JSLocks).
1566         (KJS::XMLHttpRequest::responseIsXML): A new method that analyses Content-Type.
1567         (KJS::XMLHttpRequest::slotData): Use a correct charset for responses, see bug for details.
1568         (KJS::XMLHttpRequestProtoFunc::callAsFunction): Update for getResponseHeader() changes
1569         * khtml/ecma/xmlhttprequest.h:
1570
1571 == Rolled over to ChangeLog-2005-12-19 ==