Changes in trunk [40086:40124] in webkit


Ignore:
Location:
trunk
Files:
16 added
4 deleted
174 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r40086 r40124  
     12009-01-22  Dmitry Titov  <dimich@chromium.org>
     2
     3        Reviewed by Alexey Proskuryakov.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=23373
     6
     7        Implement ThreadCondition::timedWait().
     8        Since we borrow the code for condition variables from other sources,
     9        I did the same for timedWait(). See comments in ThreadingWin.cpp for
     10        rationale and more info.
     11
     12        * wtf/CONTRIBUTORS.pthreads-win32:
     13        Added. A list of Pthreads-win32 contributors mentioned in their license. The license itself
     14        is included into wtf/ThreadingWin32.cpp.
     15
     16        * wtf/Threading.h:
     17        * wtf/ThreadingWin.cpp:
     18        Additional info and Pthreads-win32 license at the beginning.
     19        (WTF::PlatformCondition::timedWait): new method, derived from Pthreads-win32.
     20        (WTF::PlatformCondition::signal): same
     21        (WTF::ThreadCondition::ThreadCondition):
     22        (WTF::ThreadCondition::~ThreadCondition):
     23        (WTF::ThreadCondition::wait): this now calls PlatformCondition::timedWait.
     24        (WTF::ThreadCondition::timedWait): same
     25        (WTF::ThreadCondition::signal): this now calls PlatformCondition::signal.
     26        (WTF::ThreadCondition::broadcast): same
     27
     282009-01-21  Gavin Barraclough  <barraclough@apple.com>
     29
     30        Reviewed by Oliver Hunt.
     31
     32        Fix for https://bugs.webkit.org/show_bug.cgi?id=23469.
     33
     34        We need to check all numbers in integer switches, not just those
     35        represented as integer JSImmediates.
     36
     37        * interpreter/Interpreter.cpp:
     38        (JSC::Interpreter::privateExecute):
     39        (JSC::Interpreter::cti_op_switch_imm):
     40
     412009-01-21  Gavin Barraclough  <barraclough@apple.com>
     42
     43        Reviewed by Geoff Garen.
     44
     45        Fix for https://bugs.webkit.org/show_bug.cgi?id=23468.
     46
     47        * interpreter/Interpreter.cpp:
     48        (JSC::Interpreter::privateExecute):
     49
    1502009-01-21  Alexey Proskuryakov  <ap@webkit.org>
    251
  • trunk/JavaScriptCore/interpreter/Interpreter.cpp

    r40086 r40124  
    25522552                RefPtr<Structure>* end = it + count;
    25532553
    2554                 JSObject* baseObject = asObject(baseCell);
    2555                 while (1) {
    2556                     baseObject = asObject(baseObject->structure()->prototypeForLookup(callFrame));
     2554                while (true) {
     2555                    JSObject* baseObject = asObject(baseCell->structure()->prototypeForLookup(callFrame));
     2556
    25572557                    if (UNLIKELY(baseObject->structure() != (*it).get()))
    25582558                        break;
     
    25682568                        NEXT_INSTRUCTION();
    25692569                    }
     2570
     2571                    // Update baseCell, so that next time around the loop we'll pick up the prototype's prototype.
     2572                    baseCell = baseObject;
    25702573                }
    25712574            }
     
    31413144        if (scrutinee.isInt32Fast())
    31423145            vPC += callFrame->codeBlock()->immediateSwitchJumpTable(tableIndex).offsetForValue(scrutinee.getInt32Fast(), defaultOffset);
    3143         else
    3144             vPC += defaultOffset;
     3146        else {
     3147            int32_t value;
     3148            if (scrutinee.numberToInt32(value))
     3149                vPC += callFrame->codeBlock()->immediateSwitchJumpTable(tableIndex).offsetForValue(value, defaultOffset);
     3150            else
     3151                vPC += defaultOffset;
     3152        }
    31453153        NEXT_INSTRUCTION();
    31463154    }
     
    59665974    if (scrutinee.isInt32Fast())
    59675975        return codeBlock->immediateSwitchJumpTable(tableIndex).ctiForValue(scrutinee.getInt32Fast());
    5968 
    5969     return codeBlock->immediateSwitchJumpTable(tableIndex).ctiDefault;
     5976    else {
     5977        int32_t value;
     5978        if (scrutinee.numberToInt32(value))
     5979            return codeBlock->immediateSwitchJumpTable(tableIndex).ctiForValue(value);
     5980        else
     5981            return codeBlock->immediateSwitchJumpTable(tableIndex).ctiDefault;
     5982    }
    59705983}
    59715984
  • trunk/JavaScriptCore/wtf/Threading.h

    r40086 r40124  
    133133};
    134134struct PlatformCondition {
    135     size_t m_timedOut;
    136     size_t m_blocked;
    137     size_t m_waitingForRemoval;
    138     HANDLE m_gate;
    139     HANDLE m_queue;
    140     HANDLE m_mutex;
     135    size_t m_waitersGone;
     136    size_t m_waitersBlocked;
     137    size_t m_waitersToUnblock;
     138    HANDLE m_blockLock;
     139    HANDLE m_blockQueue;
     140    HANDLE m_unblockLock;
     141
     142    bool timedWait(PlatformMutex&, DWORD durationMilliseconds);
     143    void signal(bool unblockAll);
    141144};
    142145#else
  • trunk/JavaScriptCore/wtf/ThreadingWin.cpp

    r40086 r40124  
    11/*
    22 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
     3 * Copyright (C) 2009 Google Inc. All rights reserved.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    2526 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
    2627 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    27  *
    28  * =============================================================================
    29  * Note:  The implementation of condition variables under the Windows
    30  * plaform was based on that of the excellent BOOST C++ library.  It
    31  * has been rewritten to fit in with the WebKit architecture and to
    32  * use its coding conventions.
    33  * =============================================================================
    34  *
    35  * The Boost license is virtually identical to the Apple variation at the
    36  * top of this file, but is included here for completeness:
    37  *
    38  * Boost Software License - Version 1.0 - August 17th, 2003
    39  *
    40  * Permission is hereby granted, free of charge, to any person or organization
    41  * obtaining a copy of the software and accompanying documentation covered by
    42  * this license (the "Software") to use, reproduce, display, distribute,
    43  * execute, and transmit the Software, and to prepare derivative works of the
    44  * Software, and to permit third-parties to whom the Software is furnished to
    45  * do so, all subject to the following:
    46  *
    47  * The copyright notices in the Software and this entire statement, including
    48  * the above license grant, this restriction and the following disclaimer,
    49  * must be included in all copies of the Software, in whole or in part, and
    50  * all derivative works of the Software, unless such copies or derivative
    51  * works are solely in the form of machine-executable object code generated by
    52  * a source language processor.
    53  *
    54  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    55  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    56  * FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
    57  * SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
    58  * FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
    59  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
    60  * DEALINGS IN THE SOFTWARE.
     28 */
     29
     30/*
     31 * There are numerous academic and practical works on how to implement pthread_cond_wait/pthread_cond_signal/pthread_cond_broadcast
     32 * functions on Win32. Here is one example: http://www.cs.wustl.edu/~schmidt/win32-cv-1.html which is widely credited as a 'starting point'
     33 * of modern attempts. There are several more or less proven implementations, one in Boost C++ library (http://www.boost.org) and another
     34 * in pthreads-win32 (http://sourceware.org/pthreads-win32/).
     35 *
     36 * The number of articles and discussions is the evidence of significant difficulties in implementing these primitives correctly.
     37 * The brief search of revisions, ChangeLog entries, discussions in comp.programming.threads and other places clearly documents
     38 * numerous pitfalls and performance problems the authors had to overcome to arrive to the suitable implementations.
     39 * Optimally, WebKit would use one of those supported/tested libraries directly. To roll out our own implementation is impractical,
     40 * if even for the lack of sufficient testing. However, a faithful reproduction of the code from one of the popular supported
     41 * libraries seems to be a good compromise.
     42 *
     43 * The early Boost implementation (http://www.boxbackup.org/trac/browser/box/nick/win/lib/win32/boost_1_32_0/libs/thread/src/condition.cpp?rev=30)
     44 * is identical to pthreads-win32 (http://sourceware.org/cgi-bin/cvsweb.cgi/pthreads/pthread_cond_wait.c?rev=1.10&content-type=text/x-cvsweb-markup&cvsroot=pthreads-win32).
     45 * Current Boost uses yet another (although seemingly equivalent) algorithm which came from their 'thread rewrite' effort.
     46 *
     47 * This file includes timedWait/signal/broadcast implementations translated to WebKit coding style from the latest algorithm by
     48 * Alexander Terekhov and Louis Thomas, as captured here: http://sourceware.org/cgi-bin/cvsweb.cgi/pthreads/pthread_cond_wait.c?rev=1.10&content-type=text/x-cvsweb-markup&cvsroot=pthreads-win32
     49 * It replaces the implementation of their previous algorithm, also documented in the same source above.
     50 * The naming and comments are left very close to original to enable easy cross-check.
     51 *
     52 * The corresponding Pthreads-win32 License is included below, and CONTRIBUTORS file which it refers to is added to
     53 * source directory (as CONTRIBUTORS.pthreads-win32).
     54 */
     55
     56/*
     57 *      Pthreads-win32 - POSIX Threads Library for Win32
     58 *      Copyright(C) 1998 John E. Bossom
     59 *      Copyright(C) 1999,2005 Pthreads-win32 contributors
     60 *
     61 *      Contact Email: rpj@callisto.canberra.edu.au
     62 *
     63 *      The current list of contributors is contained
     64 *      in the file CONTRIBUTORS included with the source
     65 *      code distribution. The list can also be seen at the
     66 *      following World Wide Web location:
     67 *      http://sources.redhat.com/pthreads-win32/contributors.html
     68 *
     69 *      This library is free software; you can redistribute it and/or
     70 *      modify it under the terms of the GNU Lesser General Public
     71 *      License as published by the Free Software Foundation; either
     72 *      version 2 of the License, or (at your option) any later version.
     73 *
     74 *      This library is distributed in the hope that it will be useful,
     75 *      but WITHOUT ANY WARRANTY; without even the implied warranty of
     76 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     77 *      Lesser General Public License for more details.
     78 *
     79 *      You should have received a copy of the GNU Lesser General Public
     80 *      License along with this library in the file COPYING.LIB;
     81 *      if not, write to the Free Software Foundation, Inc.,
     82 *      59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
    6183 */
    6284
     
    7092#include <process.h>
    7193#include <windows.h>
     94#include <wtf/CurrentTime.h>
    7295#include <wtf/HashMap.h>
    7396#include <wtf/MathExtras.h>
     
    215238        LOG_ERROR("ThreadIdentifier %u did not correspond to an active thread when trying to quit", threadID);
    216239 
    217     DWORD joinResult = ::WaitForSingleObject(threadHandle, INFINITE);
     240    DWORD joinResult = WaitForSingleObject(threadHandle, INFINITE);
    218241    if (joinResult == WAIT_FAILED)
    219242        LOG_ERROR("ThreadIdentifier %u was found to be deadlocked trying to quit", threadID);
    220243
    221     ::CloseHandle(threadHandle);
     244    CloseHandle(threadHandle);
    222245    clearThreadHandleForIdentifier(threadID);
    223246
     
    231254    HANDLE threadHandle = threadHandleForIdentifier(threadID);
    232255    if (threadHandle)
    233         ::CloseHandle(threadHandle);
     256        CloseHandle(threadHandle);
    234257    clearThreadHandleForIdentifier(threadID);
    235258}
     
    237260ThreadIdentifier currentThread()
    238261{
    239     return static_cast<ThreadIdentifier>(::GetCurrentThreadId());
     262    return static_cast<ThreadIdentifier>(GetCurrentThreadId());
    240263}
    241264
     
    248271{
    249272    m_mutex.m_recursionCount = 0;
    250     ::InitializeCriticalSection(&m_mutex.m_internalMutex);
     273    InitializeCriticalSection(&m_mutex.m_internalMutex);
    251274}
    252275
    253276Mutex::~Mutex()
    254277{
    255     ::DeleteCriticalSection(&m_mutex.m_internalMutex);
     278    DeleteCriticalSection(&m_mutex.m_internalMutex);
    256279}
    257280
    258281void Mutex::lock()
    259282{
    260     ::EnterCriticalSection(&m_mutex.m_internalMutex);
     283    EnterCriticalSection(&m_mutex.m_internalMutex);
    261284    ++m_mutex.m_recursionCount;
    262285}
     
    270293    // tests in WebKit that check to see if the current thread already
    271294    // owned this mutex (see e.g., IconDatabase::getOrCreateIconRecord)
    272     DWORD result = ::TryEnterCriticalSection(&m_mutex.m_internalMutex);
     295    DWORD result = TryEnterCriticalSection(&m_mutex.m_internalMutex);
    273296   
    274297    if (result != 0) {       // We got the lock
     
    277300        // pthread_mutex_trylock:
    278301        if (m_mutex.m_recursionCount > 0) {
    279             ::LeaveCriticalSection(&m_mutex.m_internalMutex);
     302            LeaveCriticalSection(&m_mutex.m_internalMutex);
    280303            return false;
    281304        }
     
    291314{
    292315    --m_mutex.m_recursionCount;
    293     ::LeaveCriticalSection(&m_mutex.m_internalMutex);
    294 }
    295 
    296 static const long MaxSemaphoreCount = static_cast<long>(~0UL >> 1);
    297 
    298 ThreadCondition::ThreadCondition()
    299 {
    300     m_condition.m_timedOut = 0;
    301     m_condition.m_blocked = 0;
    302     m_condition.m_waitingForRemoval = 0;
    303     m_condition.m_gate = ::CreateSemaphore(0, 1, 1, 0);
    304     m_condition.m_queue = ::CreateSemaphore(0, 0, MaxSemaphoreCount, 0);
    305     m_condition.m_mutex = ::CreateMutex(0, 0, 0);
    306 
    307     if (!m_condition.m_gate || !m_condition.m_queue || !m_condition.m_mutex) {
    308         if (m_condition.m_gate)
    309             ::CloseHandle(m_condition.m_gate);
    310         if (m_condition.m_queue)
    311             ::CloseHandle(m_condition.m_queue);
    312         if (m_condition.m_mutex)
    313             ::CloseHandle(m_condition.m_mutex);
    314     }
    315 }
    316 
    317 ThreadCondition::~ThreadCondition()
    318 {
    319     ::CloseHandle(m_condition.m_gate);
    320     ::CloseHandle(m_condition.m_queue);
    321     ::CloseHandle(m_condition.m_mutex);
    322 }
    323    
    324 void ThreadCondition::wait(Mutex& mutex)
    325 {
    326     PlatformMutex& cs = mutex.impl();
    327 
     316    LeaveCriticalSection(&m_mutex.m_internalMutex);
     317}
     318
     319bool PlatformCondition::timedWait(PlatformMutex& mutex, DWORD durationMilliseconds)
     320{
    328321    // Enter the wait state.
    329     DWORD res = ::WaitForSingleObject(m_condition.m_gate, INFINITE);
     322    DWORD res = WaitForSingleObject(m_blockLock, INFINITE);
    330323    ASSERT(res == WAIT_OBJECT_0);
    331     ++m_condition.m_blocked;
    332     res = ::ReleaseSemaphore(m_condition.m_gate, 1, 0);
     324    ++m_waitersBlocked;
     325    res = ReleaseSemaphore(m_blockLock, 1, 0);
    333326    ASSERT(res);
    334327
    335     ::LeaveCriticalSection(&cs.m_internalMutex);
    336 
    337     res = ::WaitForSingleObject(m_condition.m_queue, INFINITE);
     328    LeaveCriticalSection(&mutex.m_internalMutex);
     329
     330    // Main wait - use timeout.
     331    bool timedOut = (WaitForSingleObject(m_blockQueue, durationMilliseconds) == WAIT_TIMEOUT);
     332
     333    res = WaitForSingleObject(m_unblockLock, INFINITE);
    338334    ASSERT(res == WAIT_OBJECT_0);
    339335
    340     res = ::WaitForSingleObject(m_condition.m_mutex, INFINITE);
    341     ASSERT(res == WAIT_OBJECT_0);
    342     size_t wasWaiting = m_condition.m_waitingForRemoval;
    343     size_t wasTimedOut = m_condition.m_timedOut;
    344     if (wasWaiting != 0) {
    345         if (--m_condition.m_waitingForRemoval == 0) {
    346             if (m_condition.m_blocked != 0) {
    347                 res = ::ReleaseSemaphore(m_condition.m_gate, 1, 0);  // open m_gate
    348                 ASSERT(res);
    349                 wasWaiting = 0;
    350             }
    351             else if (m_condition.m_timedOut != 0)
    352                 m_condition.m_timedOut = 0;
    353         }
    354     } else if (++m_condition.m_timedOut == ((std::numeric_limits<unsigned>::max)() / 2)) {
    355         // timeout occured, normalize the m_condition.m_timedOut count
     336    int signalsLeft = m_waitersToUnblock;
     337
     338    if (m_waitersToUnblock)
     339        --m_waitersToUnblock;
     340    else if (++m_waitersGone == (INT_MAX / 2)) { // timeout/canceled or spurious semaphore
     341        // timeout or spurious wakeup occured, normalize the m_waitersGone count
    356342        // this may occur if many calls to wait with a timeout are made and
    357343        // no call to notify_* is made
    358         res = ::WaitForSingleObject(m_condition.m_gate, INFINITE);
     344        res = WaitForSingleObject(m_blockLock, INFINITE);
    359345        ASSERT(res == WAIT_OBJECT_0);
    360         m_condition.m_blocked -= m_condition.m_timedOut;
    361         res = ::ReleaseSemaphore(m_condition.m_gate, 1, 0);
     346        m_waitersBlocked -= m_waitersGone;
     347        res = ReleaseSemaphore(m_blockLock, 1, 0);
    362348        ASSERT(res);
    363         m_condition.m_timedOut = 0;
    364     }
    365     res = ::ReleaseMutex(m_condition.m_mutex);
     349        m_waitersGone = 0;
     350    }
     351
     352    res = ReleaseMutex(m_unblockLock);
    366353    ASSERT(res);
    367354
    368     if (wasWaiting == 1) {
    369         for (/**/ ; wasTimedOut; --wasTimedOut) {
    370             // better now than spurious later
    371             res = ::WaitForSingleObject(m_condition.m_queue, INFINITE);
    372             ASSERT(res == WAIT_OBJECT_0);
    373         }
    374         res = ::ReleaseSemaphore(m_condition.m_gate, 1, 0);
     355    if (signalsLeft == 1) {
     356        res = ReleaseSemaphore(m_blockLock, 1, 0); // Open the gate.
    375357        ASSERT(res);
    376358    }
    377359
    378     ::EnterCriticalSection (&cs.m_internalMutex);
    379 }
    380 
    381 bool ThreadCondition::timedWait(Mutex& mutex, double absoluteTime)
    382 {
    383     // FIXME: Implement.
    384     ASSERT(false);
    385     return false;
    386 }
    387 
    388 void ThreadCondition::signal()
    389 {
    390     unsigned signals = 0;
    391 
    392     DWORD res = ::WaitForSingleObject(m_condition.m_mutex, INFINITE);
     360    EnterCriticalSection (&mutex.m_internalMutex);
     361
     362    return !timedOut;
     363}
     364
     365void PlatformCondition::signal(bool unblockAll)
     366{
     367    unsigned signalsToIssue = 0;
     368
     369    DWORD res = WaitForSingleObject(m_unblockLock, INFINITE);
    393370    ASSERT(res == WAIT_OBJECT_0);
    394371
    395     if (m_condition.m_waitingForRemoval != 0) { // the m_gate is already closed
    396         if (m_condition.m_blocked == 0) {
    397             res = ::ReleaseMutex(m_condition.m_mutex);
     372    if (m_waitersToUnblock) { // the gate is already closed
     373        if (!m_waitersBlocked) { // no-op
     374            res = ReleaseMutex(m_unblockLock);
    398375            ASSERT(res);
    399376            return;
    400377        }
    401378
    402         ++m_condition.m_waitingForRemoval;
    403         --m_condition.m_blocked;
    404 
    405         signals = 1;
    406     } else {
    407         res = ::WaitForSingleObject(m_condition.m_gate, INFINITE);
     379        if (unblockAll) {
     380            signalsToIssue = m_waitersBlocked;
     381            m_waitersToUnblock += m_waitersBlocked;
     382            m_waitersBlocked = 0;
     383        } else {
     384            signalsToIssue = 1;
     385            ++m_waitersToUnblock;
     386            --m_waitersBlocked;
     387        }
     388    } else if (m_waitersBlocked > m_waitersGone) {
     389        res = WaitForSingleObject(m_blockLock, INFINITE); // Close the gate.
    408390        ASSERT(res == WAIT_OBJECT_0);
    409         if (m_condition.m_blocked > m_condition.m_timedOut) {
    410             if (m_condition.m_timedOut != 0) {
    411                 m_condition.m_blocked -= m_condition.m_timedOut;
    412                 m_condition.m_timedOut = 0;
    413             }
    414             signals = m_condition.m_waitingForRemoval = 1;
    415             --m_condition.m_blocked;
     391        if (m_waitersGone != 0) {
     392            m_waitersBlocked -= m_waitersGone;
     393            m_waitersGone = 0;
     394        }
     395        if (unblockAll) {
     396            signalsToIssue = m_waitersBlocked;
     397            m_waitersToUnblock = m_waitersBlocked;
     398            m_waitersBlocked = 0;
    416399        } else {
    417             res = ::ReleaseSemaphore(m_condition.m_gate, 1, 0);
    418             ASSERT(res);
     400            signalsToIssue = 1;
     401            m_waitersToUnblock = 1;
     402            --m_waitersBlocked;
    419403        }
    420     }
    421 
    422     res =::ReleaseMutex(m_condition.m_mutex);
     404    } else { // No-op.
     405        res = ReleaseMutex(m_unblockLock);
     406        ASSERT(res);
     407        return;
     408    }
     409
     410    res = ReleaseMutex(m_unblockLock);
    423411    ASSERT(res);
    424412
    425     if (signals) {
    426         res = ::ReleaseSemaphore(m_condition.m_queue, signals, 0);
     413    if (signalsToIssue) {
     414        res = ReleaseSemaphore(m_blockQueue, signalsToIssue, 0);
    427415        ASSERT(res);
    428416    }
    429417}
    430418
     419static const long MaxSemaphoreCount = static_cast<long>(~0UL >> 1);
     420
     421ThreadCondition::ThreadCondition()
     422{
     423    m_condition.m_waitersGone = 0;
     424    m_condition.m_waitersBlocked = 0;
     425    m_condition.m_waitersToUnblock = 0;
     426    m_condition.m_blockLock = CreateSemaphore(0, 1, 1, 0);
     427    m_condition.m_blockQueue = CreateSemaphore(0, 0, MaxSemaphoreCount, 0);
     428    m_condition.m_unblockLock = CreateMutex(0, 0, 0);
     429
     430    if (!m_condition.m_blockLock || !m_condition.m_blockQueue || !m_condition.m_unblockLock) {
     431        if (m_condition.m_blockLock)
     432            CloseHandle(m_condition.m_blockLock);
     433        if (m_condition.m_blockQueue)
     434            CloseHandle(m_condition.m_blockQueue);
     435        if (m_condition.m_unblockLock)
     436            CloseHandle(m_condition.m_unblockLock);
     437    }
     438}
     439
     440ThreadCondition::~ThreadCondition()
     441{
     442    CloseHandle(m_condition.m_blockLock);
     443    CloseHandle(m_condition.m_blockQueue);
     444    CloseHandle(m_condition.m_unblockLock);
     445}
     446
     447void ThreadCondition::wait(Mutex& mutex)
     448{
     449    m_condition.timedWait(mutex.impl(), INFINITE);
     450}
     451
     452bool ThreadCondition::timedWait(Mutex& mutex, double absoluteTime)
     453{
     454    double currentTime = WTF::currentTime();
     455
     456    // Time is in the past - return immediately.
     457    if (absoluteTime < currentTime)
     458        return false;
     459
     460    double intervalMilliseconds = (absoluteTime - currentTime) * 1000.0;
     461    if (intervalMilliseconds >= INT_MAX)
     462        intervalMilliseconds = INT_MAX;
     463
     464    return m_condition.timedWait(mutex.impl(), static_cast<unsigned long>(intervalMilliseconds));
     465}
     466
     467void ThreadCondition::signal()
     468{
     469    m_condition.signal(false); // Unblock only 1 thread.
     470}
     471
    431472void ThreadCondition::broadcast()
    432473{
    433     unsigned signals = 0;
    434 
    435     DWORD res = ::WaitForSingleObject(m_condition.m_mutex, INFINITE);
    436     ASSERT(res == WAIT_OBJECT_0);
    437 
    438     if (m_condition.m_waitingForRemoval != 0) { // the m_gate is already closed
    439         if (m_condition.m_blocked == 0) {
    440             res = ::ReleaseMutex(m_condition.m_mutex);
    441             ASSERT(res);
    442             return;
    443         }
    444 
    445         m_condition.m_waitingForRemoval += (signals = m_condition.m_blocked);
    446         m_condition.m_blocked = 0;
    447     } else {
    448         res = ::WaitForSingleObject(m_condition.m_gate, INFINITE);
    449         ASSERT(res == WAIT_OBJECT_0);
    450         if (m_condition.m_blocked > m_condition.m_timedOut) {
    451             if (m_condition.m_timedOut != 0) {
    452                 m_condition.m_blocked -= m_condition.m_timedOut;
    453                 m_condition.m_timedOut = 0;
    454             }
    455             signals = m_condition.m_waitingForRemoval = m_condition.m_blocked;
    456             m_condition.m_blocked = 0;
    457         } else {
    458             res = ::ReleaseSemaphore(m_condition.m_gate, 1, 0);
    459             ASSERT(res);
    460         }
    461     }
    462 
    463     res = ::ReleaseMutex(m_condition.m_mutex);
    464     ASSERT(res);
    465 
    466     if (signals) {
    467         res = ::ReleaseSemaphore(m_condition.m_queue, signals, 0);
    468         ASSERT(res);
    469     }
     474    m_condition.signal(true); // Unblock all threads.
    470475}
    471476
  • trunk/LayoutTests/ChangeLog

    r40086 r40124  
     12009-01-21  Gavin Barraclough  <barraclough@apple.com>
     2
     3        Rubber stamped by Geoff "Cameron Zwarich" Garen.
     4
     5        Add pre & post standalone driver scripts to assist running the javascript layout tests
     6        on jsc, rather than a full webkit build.
     7
     8        * fast/js/resources/standalone-post.js: Copied from fast/js/resources/js-test-post.js.
     9        * fast/js/resources/standalone-pre.js: Copied from fast/js/resources/js-test-pre.js.
     10        (description):
     11        (debug):
     12        (escapeString):
     13        (testPassed):
     14        (testFailed):
     15
     162009-01-21  Gavin Barraclough  <barraclough@apple.com>
     17
     18        Reviewed by Oliver Hunt.
     19
     20        Add layout test for switch (-0).
     21
     22        * fast/js/resources/switch-behaviour.js:
     23        * fast/js/switch-behaviour-expected.txt:
     24
     252009-01-19  Chris Marrin  <cmarrin@apple.com>
     26
     27        Reviewed by David Hyatt
     28
     29        Fix for https://bugs.webkit.org/show_bug.cgi?id=23317
     30
     31        * transitions/repeated-firing-background-color-expected.txt: Added.
     32        * transitions/repeated-firing-background-color.html: Added.
     33
     342009-01-21  Eric Seidel  <eric@webkit.org>
     35
     36        Reviewed by Justin Garcia.
     37
     38        Remove the style='' turds left by some editing commands
     39        https://bugs.webkit.org/show_bug.cgi?id=23463
     40
     41        * editing/execCommand/toggle-styles-expected.txt: updated results
     42
     432009-01-21  Chris Fleizach  <cfleizach@apple.com>
     44
     45        Reviewed by Beth Dakin.
     46
     47        Test to make sure accessibility doesn't crash when a table is modified through JavaScript
     48
     49        * accessibility/table-modification-crash-expected.txt: Added.
     50        * accessibility/table-modification-crash.html: Added.
     51
     522009-01-16  Eric Seidel  <eric@webkit.org>
     53
     54        Reviewed by Justin Garcia.
     55       
     56        Updated results for execCommand() 'sub' and 'super' toggle fixes.
     57        https://bugs.webkit.org/show_bug.cgi?id=17733
     58
     59        * editing/execCommand/toggle-styles-expected.txt:
     60
    1612009-01-20  Nikolas Zimmermann  <nikolas.zimmermann@torchmobile.com>
    262
  • trunk/LayoutTests/editing/execCommand/resources/toggle-styles.js

    r40086 r40124  
    8989runTests("italic", "i", "font-style", "italic");
    9090testTagRemovalOnToggle("em", "italic"); // IE adds "em" tags for italic, so we should remove them (even though FF doesn't)
    91 runTests("subscript", "sub", "vertical-align", "subscript");
    92 runTests("superscript", "sup", "vertical-align", "superscript");
     91runTests("subscript", "sub", "vertical-align", "sub");
     92runTests("superscript", "sup", "vertical-align", "super");
    9393runTests("strikethrough", "strike", "text-decoration", "line-through");
    9494testTagRemovalOnToggle("s", "strikethrough");
  • trunk/LayoutTests/editing/execCommand/toggle-styles-expected.txt

    r40086 r40124  
    77PASS bold toggle
    88PASS bold removing b
    9 FAIL bold removing font-weight: bold -- <span style="">test</span>
     9FAIL bold removing font-weight: bold -- <span>test</span>
    1010FAIL bold removing strong -- <strong><span class="Apple-style-span" style="font-weight: normal;">test</span></strong>
    1111PASS italic toggle
    1212PASS italic removing i
    13 FAIL italic removing font-style: italic -- <span style="">test</span>
     13FAIL italic removing font-style: italic -- <span>test</span>
    1414FAIL italic removing em -- <em><span class="Apple-style-span" style="font-style: normal;">test</span></em>
    15 FAIL subscript toggle: <span class="Apple-style-span" style="vertical-align: sub;">test</span>
    16 FAIL subscript removing sub -- <sub>test</sub>
    17 FAIL subscript removing vertical-align: subscript -- <span><span class="Apple-style-span" style="vertical-align: sub;">test</span></span>
    18 FAIL superscript toggle: <span class="Apple-style-span" style="vertical-align: super;">test</span>
    19 FAIL superscript removing sup -- <sup>test</sup>
    20 FAIL superscript removing vertical-align: superscript -- <span><span class="Apple-style-span" style="vertical-align: super;">test</span></span>
     15PASS subscript toggle
     16PASS subscript removing sub
     17FAIL subscript removing vertical-align: sub -- <span>test</span>
     18PASS superscript toggle
     19PASS superscript removing sup
     20FAIL superscript removing vertical-align: super -- <span>test</span>
    2121PASS strikethrough toggle
    22 FAIL strikethrough removing strike -- <strike style=""><span class="Apple-style-span" style="text-decoration: none;">test</span></strike>
    23 FAIL strikethrough removing text-decoration: line-through -- <span style="">test</span>
    24 FAIL strikethrough removing s -- <s style=""><span class="Apple-style-span" style="text-decoration: none;">test</span></s>
     22FAIL strikethrough removing strike -- <strike><span class="Apple-style-span" style="text-decoration: none;">test</span></strike>
     23FAIL strikethrough removing text-decoration: line-through -- <span>test</span>
     24FAIL strikethrough removing s -- <s><span class="Apple-style-span" style="text-decoration: none;">test</span></s>
    2525PASS underline toggle
    26 FAIL underline removing u -- <u style=""><span class="Apple-style-span" style="text-decoration: none;">test</span></u>
    27 FAIL underline removing text-decoration: underline -- <span style="">test</span>
     26FAIL underline removing u -- <u><span class="Apple-style-span" style="text-decoration: none;">test</span></u>
     27FAIL underline removing text-decoration: underline -- <span>test</span>
    2828PASS successfullyParsed is true
    2929
  • trunk/LayoutTests/fast/js/resources/switch-behaviour.js

    r40086 r40124  
    241241shouldBe("characterSwitch({toString: function(){return 'B'}})", '"default"');
    242242shouldBe("characterSwitch(0)", '"default"');
     243shouldBe("characterSwitch(-0)", '"default"');
    243244shouldBe("characterSwitch(1)", '"default"');
    244245shouldBe("characterSwitch(-1)", '"default"');
     
    257258shouldBe("sparseCharacterSwitch({toString: function(){return 'B'}})", '"default"');
    258259shouldBe("sparseCharacterSwitch(0)", '"default"');
     260shouldBe("sparseCharacterSwitch(-0)", '"default"');
    259261shouldBe("sparseCharacterSwitch(1)", '"default"');
    260262shouldBe("sparseCharacterSwitch(-1)", '"default"');
     
    275277shouldBe("stringSwitch('s')", '"default"');
    276278shouldBe("stringSwitch(0)", '"default"');
     279shouldBe("stringSwitch(-0)", '"default"');
    277280shouldBe("stringSwitch(1)", '"default"');
    278281shouldBe("stringSwitch(-1)", '"default"');
     
    293296shouldBe("numberSwitch('s')", '"default"');
    294297shouldBe("numberSwitch(0)", '0');
     298shouldBe("numberSwitch(-0)", '0');
    295299shouldBe("numberSwitch(1)", '1');
    296300shouldBe("numberSwitch(-1)", '-1');
     
    311315shouldBe("sparseNumberSwitch('s')", '"default"');
    312316shouldBe("sparseNumberSwitch(0)", '0');
     317shouldBe("sparseNumberSwitch(-0)", '0');
    313318shouldBe("sparseNumberSwitch(1)", '1');
    314319shouldBe("sparseNumberSwitch(-1)", '-1');
     
    329334shouldBe("generalSwitch('s')", '"default"');
    330335shouldBe("generalSwitch(0)", '0');
     336shouldBe("generalSwitch(-0)", '0');
    331337shouldBe("generalSwitch(1)", '1');
    332338shouldBe("generalSwitch(-1)", '-1');
  • trunk/LayoutTests/fast/js/switch-behaviour-expected.txt

    r40086 r40124  
    1313PASS characterSwitch({toString: function(){return 'B'}}) is "default"
    1414PASS characterSwitch(0) is "default"
     15PASS characterSwitch(-0) is "default"
    1516PASS characterSwitch(1) is "default"
    1617PASS characterSwitch(-1) is "default"
     
    2728PASS sparseCharacterSwitch({toString: function(){return 'B'}}) is "default"
    2829PASS sparseCharacterSwitch(0) is "default"
     30PASS sparseCharacterSwitch(-0) is "default"
    2931PASS sparseCharacterSwitch(1) is "default"
    3032PASS sparseCharacterSwitch(-1) is "default"
     
    4345PASS stringSwitch('s') is "default"
    4446PASS stringSwitch(0) is "default"
     47PASS stringSwitch(-0) is "default"
    4548PASS stringSwitch(1) is "default"
    4649PASS stringSwitch(-1) is "default"
     
    5962PASS numberSwitch('s') is "default"
    6063PASS numberSwitch(0) is 0
     64PASS numberSwitch(-0) is 0
    6165PASS numberSwitch(1) is 1
    6266PASS numberSwitch(-1) is -1
     
    7579PASS sparseNumberSwitch('s') is "default"
    7680PASS sparseNumberSwitch(0) is 0
     81PASS sparseNumberSwitch(-0) is 0
    7782PASS sparseNumberSwitch(1) is 1
    7883PASS sparseNumberSwitch(-1) is -1
     
    9196PASS generalSwitch('s') is "default"
    9297PASS generalSwitch(0) is 0
     98PASS generalSwitch(-0) is 0
    9399PASS generalSwitch(1) is 1
    94100PASS generalSwitch(-1) is -1
  • trunk/WebCore/ChangeLog

    r40086 r40124  
     12009-01-22  David Hyatt  <hyatt@apple.com>
     2
     3        Fix regressions in list box selection on Mac.  The wrong color was being used for the list box
     4        background, and list box colors actually weren't even being properly fetched because of a bug in
     5        the RenderTheme base class.  Existing pixel tests cover the bug fix.
     6
     7        Reviewed by Jon Honeycutt
     8
     9        * rendering/RenderTheme.cpp:
     10        (WebCore::RenderTheme::activeListBoxSelectionBackgroundColor):
     11        (WebCore::RenderTheme::inactiveListBoxSelectionBackgroundColor):
     12        (WebCore::RenderTheme::activeListBoxSelectionForegroundColor):
     13        (WebCore::RenderTheme::inactiveListBoxSelectionForegroundColor):
     14        * rendering/RenderThemeMac.mm:
     15        (WebCore::RenderThemeMac::platformInactiveListBoxSelectionBackgroundColor):
     16
     172009-01-22  David Levin  <levin@chromium.org>
     18
     19        Reviewed by Alexey Proskuryakov.
     20
     21        Bug 22720: Make XMLHttpRequest work in Workers
     22        <https://bugs.webkit.org/show_bug.cgi?id=22720>
     23
     24        Add copy/adopt for HTTPHeaderMap to allow the data to be passed across threads.
     25
     26        No observable change in behavior, so no test.
     27
     28        * GNUmakefile.am:
     29        * WebCore.pro:
     30        * WebCore.scons:
     31        * WebCore.vcproj/WebCore.vcproj:
     32        * WebCore.xcodeproj/project.pbxproj:
     33        * WebCoreSources.bkl:
     34        * platform/network/HTTPHeaderMap.cpp: Added.
     35        (WebCore::HTTPHeaderMap::copyData):
     36        (WebCore::HTTPHeaderMap::adopt):
     37        * platform/network/HTTPHeaderMap.h:
     38
     392009-01-21  David Hyatt  <hyatt@apple.com>
     40
     41        Back out a portion of my patch that I did not mean to land.  Revert paintOutline back to the way it
     42        was before my landing.  Fixes failing SVG focus ring tests.
     43
     44        * rendering/RenderObject.cpp:
     45        (WebCore::RenderObject::paintOutline):
     46        * rendering/RenderObject.h:
     47        * rendering/RenderPath.cpp:
     48        (WebCore::RenderPath::paint):
     49        * rendering/RenderSVGContainer.cpp:
     50        (WebCore::RenderSVGContainer::paint):
     51
     522009-01-21  David Hyatt  <hyatt@apple.com>
     53
     54        Fix Node's renderBox() method on Windows.
     55
     56        * dom/Node.cpp:
     57        (WebCore::Node::renderBox):
     58
     592009-01-21  David Hyatt  <hyatt@apple.com>
     60
     61        Fix RenderThemeSafari bustage on Win32.
     62
     63        * rendering/RenderThemeSafari.cpp:
     64        (WebCore::RenderThemeSafari::baselinePosition):
     65
     662009-01-21  David Hyatt  <hyatt@apple.com>
     67
     68        Fix bustage in RenderThemeWin. It's actually terrible that RenderThemeWin is using absoluteContentBox,
     69        but that's a problem for another day.
     70
     71        * rendering/RenderThemeWin.cpp:
     72        (WebCore::RenderThemeWin::paintSearchFieldCancelButton):
     73        (WebCore::RenderThemeWin::paintSearchFieldResultsDecoration):
     74        (WebCore::RenderThemeWin::paintSearchFieldResultsButton):
     75
     762009-01-21  Oliver Hunt  <oliver@apple.com>
     77
     78        Reviewed by Dave Hyatt.
     79
     80        Bug 23470: Crash when page load occurs while processing scroll event with MallocScribble enabled
     81        <https://bugs.webkit.org/show_bug.cgi?id=23470>
     82
     83        Add a RefPtr protector to handleWheelEvent to guard against destruction
     84        while processing the scroll event.  Alas the absurd set of circumstances
     85        required to trigger this do not appear to be reproducible in DRT.
     86
     87        * page/EventHandler.cpp:
     88        (WebCore::EventHandler::handleWheelEvent):
     89
     902009-01-21  David Hyatt  <hyatt@apple.com>
     91
     92        Fix for https://bugs.webkit.org/show_bug.cgi?id=23453
     93
     94        Devirtualize the width/height/x/y methods of the render tree.  The methods are now non-virtual on RenderBox.
     95        Many functions that were previously in RenderObject.cpp are now in RenderBox.cpp.
     96
     97        Reviewed by Eric Seidel and Darin Adler
     98
     99        * WebCore.base.exp:
     100        * css/CSSComputedStyleDeclaration.cpp:
     101        (WebCore::sizingBox):
     102        * dom/ContainerNode.cpp:
     103        (WebCore::ContainerNode::getUpperLeftCorner):
     104        (WebCore::ContainerNode::getLowerRightCorner):
     105        * dom/Element.cpp:
     106        (WebCore::Element::offsetLeft):
     107        (WebCore::Element::offsetTop):
     108        (WebCore::Element::offsetWidth):
     109        (WebCore::Element::offsetHeight):
     110        (WebCore::Element::offsetParent):
     111        (WebCore::Element::clientLeft):
     112        (WebCore::Element::clientTop):
     113        (WebCore::Element::clientWidth):
     114        (WebCore::Element::clientHeight):
     115        (WebCore::Element::scrollLeft):
     116        (WebCore::Element::scrollTop):
     117        (WebCore::Element::setScrollLeft):
     118        (WebCore::Element::setScrollTop):
     119        (WebCore::Element::scrollWidth):
     120        (WebCore::Element::scrollHeight):
     121        * dom/Node.cpp:
     122        (WebCore::Node::renderBox):
     123        (WebCore::Node::getRect):
     124        * dom/Node.h:
     125        * dom/Position.cpp:
     126        (WebCore::endsOfNodeAreVisuallyDistinctPositions):
     127        (WebCore::Position::hasRenderedNonAnonymousDescendantsWithHeight):
     128        (WebCore::Position::isCandidate):
     129        * dom/PositionIterator.cpp:
     130        (WebCore::PositionIterator::isCandidate):
     131        * editing/CompositeEditCommand.cpp:
     132        (WebCore::CompositeEditCommand::addBlockPlaceholderIfNeeded):
     133        * editing/DeleteButtonController.cpp:
     134        (WebCore::isDeletableElement):
     135        * editing/DeleteSelectionCommand.cpp:
     136        (WebCore::DeleteSelectionCommand::removeNode):
     137        * editing/Editor.cpp:
     138        (WebCore::Editor::insideVisibleArea):
     139        * editing/EditorCommand.cpp:
     140        (WebCore::verticalScrollDistance):
     141        * html/HTMLAnchorElement.cpp:
     142        (WebCore::HTMLAnchorElement::isKeyboardFocusable):
     143        * html/HTMLCanvasElement.cpp:
     144        (WebCore::HTMLCanvasElement::willDraw):
     145        * html/HTMLFormControlElement.cpp:
     146        (WebCore::HTMLFormControlElement::isFocusable):
     147        * html/HTMLFrameElementBase.cpp:
     148        (WebCore::HTMLFrameElementBase::width):
     149        (WebCore::HTMLFrameElementBase::height):
     150        * html/HTMLImageElement.cpp:
     151        (WebCore::HTMLImageElement::width):
     152        (WebCore::HTMLImageElement::height):
     153        * inspector/InspectorController.cpp:
     154        (WebCore::InspectorController::drawNodeHighlight):
     155        * page/AccessibilityRenderObject.cpp:
     156        (WebCore::AccessibilityRenderObject::accessibilityIsIgnored):
     157        * page/FrameView.cpp:
     158        (WebCore::FrameView::createScrollbar):
     159        (WebCore::FrameView::updateDashboardRegions):
     160        * page/animation/AnimationBase.cpp:
     161        (WebCore::blendFunc):
     162        * rendering/HitTestResult.cpp:
     163        (WebCore::HitTestResult::imageRect):
     164        * rendering/InlineBox.cpp:
     165        (WebCore::InlineBox::renderBox):
     166        (WebCore::InlineBox::adjustPosition):
     167        * rendering/InlineBox.h:
     168        * rendering/InlineFlowBox.cpp:
     169        (WebCore::InlineFlowBox::placeBoxesHorizontally):
     170        (WebCore::InlineFlowBox::verticallyAlignBoxes):
     171        (WebCore::InlineFlowBox::placeBoxesVertically):
     172        * rendering/InlineFlowBox.h:
     173        * rendering/RenderApplet.cpp:
     174        (WebCore::RenderApplet::createWidgetIfNecessary):
     175        * rendering/RenderBlock.cpp:
     176        (WebCore::RenderBlock::overflowHeight):
     177        (WebCore::RenderBlock::overflowWidth):
     178        (WebCore::RenderBlock::overflowRect):
     179        (WebCore::RenderBlock::isSelfCollapsingBlock):
     180        (WebCore::RenderBlock::layout):
     181        (WebCore::RenderBlock::layoutBlock):
     182        (WebCore::RenderBlock::adjustPositionedBlock):
     183        (WebCore::RenderBlock::adjustFloatingBlock):
     184        (WebCore::RenderBlock::handleSpecialChild):
     185        (WebCore::RenderBlock::handlePositionedChild):
     186        (WebCore::RenderBlock::handleFloatingChild):
     187        (WebCore::RenderBlock::handleCompactChild):
     188        (WebCore::RenderBlock::insertCompactIfNeeded):
     189        (WebCore::RenderBlock::handleRunInChild):
     190        (WebCore::RenderBlock::collapseMargins):
     191        (WebCore::RenderBlock::clearFloatsIfNeeded):
     192        (WebCore::RenderBlock::estimateVerticalPosition):
     193        (WebCore::RenderBlock::determineHorizontalPosition):
     194        (WebCore::RenderBlock::handleBottomOfBlock):
     195        (WebCore::RenderBlock::layoutBlockChildren):
     196        (WebCore::RenderBlock::layoutOnlyPositionedObjects):
     197        (WebCore::RenderBlock::layoutPositionedObjects):
     198        (WebCore::RenderBlock::markPositionedObjectsForLayout):
     199        (WebCore::RenderBlock::repaintOverhangingFloats):
     200        (WebCore::RenderBlock::paint):
     201        (WebCore::RenderBlock::paintChildren):
     202        (WebCore::RenderBlock::paintObject):
     203        (WebCore::RenderBlock::paintFloats):
     204        (WebCore::RenderBlock::paintContinuationOutlines):
     205        (WebCore::clipOutPositionedObjects):
     206        (WebCore::RenderBlock::fillSelectionGaps):
     207        (WebCore::RenderBlock::fillBlockSelectionGaps):
     208        (WebCore::RenderBlock::leftSelectionOffset):
     209        (WebCore::RenderBlock::rightSelectionOffset):
     210        (WebCore::RenderBlock::insertPositionedObject):
     211        (WebCore::RenderBlock::removePositionedObject):
     212        (WebCore::RenderBlock::removePositionedObjects):
     213        (WebCore::RenderBlock::insertFloatingObject):
     214        (WebCore::RenderBlock::removeFloatingObject):
     215        (WebCore::RenderBlock::positionNewFloats):
     216        (WebCore::RenderBlock::newLine):
     217        (WebCore::RenderBlock::lowestPosition):
     218        (WebCore::RenderBlock::rightmostPosition):
     219        (WebCore::RenderBlock::leftmostPosition):
     220        (WebCore::RenderBlock::clearFloats):
     221        (WebCore::RenderBlock::addOverhangingFloats):
     222        (WebCore::RenderBlock::markAllDescendantsWithFloatsForLayout):
     223        (WebCore::RenderBlock::getClearDelta):
     224        (WebCore::RenderBlock::nodeAtPoint):
     225        (WebCore::RenderBlock::positionForCoordinates):
     226        (WebCore::RenderBlock::layoutColumns):
     227        (WebCore::RenderBlock::getBaselineOfFirstLineBox):
     228        (WebCore::RenderBlock::getBaselineOfLastLineBox):
     229        (WebCore::getHeightForLineCount):
     230        (WebCore::RenderBlock::adjustForBorderFit):
     231        * rendering/RenderBlock.h:
     232        (WebCore::RenderBlock::FloatWithRect::FloatWithRect):
     233        (WebCore::RenderBlock::hasOverhangingFloats):
     234        (WebCore::RenderBlock::CompactInfo::compact):
     235        (WebCore::RenderBlock::CompactInfo::set):
     236        * rendering/RenderBox.cpp:
     237        (WebCore::RenderBox::RenderBox):
     238        (WebCore::RenderBox::offsetLeft):
     239        (WebCore::RenderBox::offsetTop):
     240        (WebCore::RenderBox::offsetParent):
     241        (WebCore::RenderBox::clientWidth):
     242        (WebCore::RenderBox::clientHeight):
     243        (WebCore::RenderBox::scrollWidth):
     244        (WebCore::RenderBox::scrollHeight):
     245        (WebCore::RenderBox::scrollLeft):
     246        (WebCore::RenderBox::scrollTop):
     247        (WebCore::RenderBox::setScrollLeft):
     248        (WebCore::RenderBox::setScrollTop):
     249        (WebCore::RenderBox::absoluteRects):
     250        (WebCore::RenderBox::absoluteQuads):
     251        (WebCore::RenderBox::absoluteContentBox):
     252        (WebCore::RenderBox::absoluteContentQuad):
     253        (WebCore::RenderBox::absoluteOutlineBounds):
     254        (WebCore::RenderBox::addFocusRingRects):
     255        (WebCore::RenderBox::reflectionBox):
     256        (WebCore::RenderBox::reflectionOffset):
     257        (WebCore::RenderBox::reflectedRect):
     258        (WebCore::RenderBox::overrideWidth):
     259        (WebCore::RenderBox::overrideHeight):
     260        (WebCore::RenderBox::nodeAtPoint):
     261        (WebCore::RenderBox::paint):
     262        (WebCore::RenderBox::maskClipRect):
     263        (WebCore::RenderBox::repaintLayerRectsForImage):
     264        (WebCore::RenderBox::paintCustomHighlight):
     265        (WebCore::RenderBox::getOverflowClipRect):
     266        (WebCore::RenderBox::getClipRect):
     267        (WebCore::RenderBox::containingBlockWidth):
     268        (WebCore::RenderBox::localToAbsolute):
     269        (WebCore::RenderBox::offsetFromContainer):
     270        (WebCore::RenderBox::position):
     271        (WebCore::RenderBox::computeAbsoluteRepaintRect):
     272        (WebCore::RenderBox::repaintDuringLayoutIfMoved):
     273        (WebCore::RenderBox::calcWidth):
     274        (WebCore::RenderBox::calcWidthUsing):
     275        (WebCore::RenderBox::calcHorizontalMargins):
     276        (WebCore::RenderBox::calcHeight):
     277        (WebCore::RenderBox::calcPercentageHeight):
     278        (WebCore::RenderBox::calcReplacedHeightUsing):
     279        (WebCore::RenderBox::containingBlockWidthForPositioned):
     280        (WebCore::RenderBox::containingBlockHeightForPositioned):
     281        (WebCore::RenderBox::calcAbsoluteHorizontal):
     282        (WebCore::RenderBox::calcAbsoluteVertical):
     283        (WebCore::RenderBox::calcAbsoluteVerticalValues):
     284        (WebCore::RenderBox::calcAbsoluteHorizontalReplaced):
     285        (WebCore::RenderBox::calcAbsoluteVerticalReplaced):
     286        (WebCore::RenderBox::localCaretRect):
     287        (WebCore::RenderBox::lowestPosition):
     288        (WebCore::RenderBox::rightmostPosition):
     289        (WebCore::RenderBox::leftmostPosition):
     290        (WebCore::RenderBox::localTransform):
     291        * rendering/RenderBox.h:
     292        (WebCore::):
     293        (WebCore::RenderBox::x):
     294        (WebCore::RenderBox::y):
     295        (WebCore::RenderBox::width):
     296        (WebCore::RenderBox::height):
     297        (WebCore::RenderBox::setX):
     298        (WebCore::RenderBox::setY):
     299        (WebCore::RenderBox::setWidth):
     300        (WebCore::RenderBox::setHeight):
     301        (WebCore::RenderBox::location):
     302        (WebCore::RenderBox::size):
     303        (WebCore::RenderBox::setLocation):
     304        (WebCore::RenderBox::setSize):
     305        (WebCore::RenderBox::move):
     306        (WebCore::RenderBox::frameRect):
     307        (WebCore::RenderBox::setFrameRect):
     308        (WebCore::RenderBox::borderBoxRect):
     309        (WebCore::RenderBox::contentBoxRect):
     310        (WebCore::RenderBox::previousSiblingBox):
     311        (WebCore::RenderBox::nextSiblingBox):
     312        (WebCore::RenderBox::parentBox):
     313        (WebCore::RenderBox::overflowHeight):
     314        (WebCore::RenderBox::overflowWidth):
     315        (WebCore::RenderBox::setOverflowHeight):
     316        (WebCore::RenderBox::setOverflowWidth):
     317        (WebCore::RenderBox::overflowLeft):
     318        (WebCore::RenderBox::overflowTop):
     319        (WebCore::RenderBox::overflowRect):
     320        (WebCore::RenderBox::contentWidth):
     321        (WebCore::RenderBox::contentHeight):
     322        (WebCore::RenderBox::offsetWidth):
     323        (WebCore::RenderBox::offsetHeight):
     324        (WebCore::RenderBox::clientLeft):
     325        (WebCore::RenderBox::clientTop):
     326        (WebCore::RenderBox::availableWidth):
     327        (WebCore::RenderBox::tryLayoutDoingPositionedMovementOnly):
     328        * rendering/RenderButton.cpp:
     329        (WebCore::RenderButton::controlClipRect):
     330        * rendering/RenderContainer.cpp:
     331        (WebCore::RenderContainer::layout):
     332        (WebCore::RenderContainer::positionForCoordinates):
     333        * rendering/RenderContainer.h:
     334        (WebCore::RenderContainer::firstChildBox):
     335        (WebCore::RenderContainer::lastChildBox):
     336        * rendering/RenderFieldset.cpp:
     337        (WebCore::RenderFieldset::calcPrefWidths):
     338        (WebCore::RenderFieldset::layoutLegend):
     339        (WebCore::RenderFieldset::findLegend):
     340        (WebCore::RenderFieldset::paintBoxDecorations):
     341        (WebCore::RenderFieldset::paintMask):
     342        * rendering/RenderFieldset.h:
     343        * rendering/RenderFileUploadControl.cpp:
     344        (WebCore::RenderFileUploadControl::maxFilenameWidth):
     345        (WebCore::RenderFileUploadControl::paintObject):
     346        * rendering/RenderFlexibleBox.cpp:
     347        (WebCore::FlexBoxIterator::FlexBoxIterator):
     348        (WebCore::FlexBoxIterator::first):
     349        (WebCore::FlexBoxIterator::next):
     350        (WebCore::RenderFlexibleBox::calcHorizontalPrefWidths):
     351        (WebCore::RenderFlexibleBox::calcVerticalPrefWidths):
     352        (WebCore::RenderFlexibleBox::layoutBlock):
     353        (WebCore::RenderFlexibleBox::layoutHorizontalBox):
     354        (WebCore::RenderFlexibleBox::layoutVerticalBox):
     355        (WebCore::RenderFlexibleBox::placeChild):
     356        (WebCore::RenderFlexibleBox::allowedChildFlex):
     357        * rendering/RenderFlexibleBox.h:
     358        * rendering/RenderFlow.cpp:
     359        (WebCore::RenderFlow::absoluteClippedOverflowRect):
     360        (WebCore::RenderFlow::lowestPosition):
     361        (WebCore::RenderFlow::rightmostPosition):
     362        (WebCore::RenderFlow::leftmostPosition):
     363        (WebCore::RenderFlow::localCaretRect):
     364        (WebCore::RenderFlow::addFocusRingRects):
     365        * rendering/RenderFrameSet.cpp:
     366        (WebCore::RenderFrameSet::paint):
     367        (WebCore::RenderFrameSet::layout):
     368        (WebCore::RenderFrameSet::positionFrames):
     369        * rendering/RenderHTMLCanvas.cpp:
     370        (WebCore::RenderHTMLCanvas::paintReplaced):
     371        (WebCore::RenderHTMLCanvas::canvasSizeChanged):
     372        * rendering/RenderImage.cpp:
     373        (WebCore::RenderImage::imageChanged):
     374        (WebCore::RenderImage::paintReplaced):
     375        (WebCore::RenderImage::nodeAtPoint):
     376        (WebCore::RenderImage::calcReplacedWidth):
     377        * rendering/RenderInline.cpp:
     378        (WebCore::RenderInline::absoluteRects):
     379        (WebCore::RenderInline::boundingBoxWidth):
     380        (WebCore::RenderInline::boundingBoxHeight):
     381        (WebCore::RenderInline::positionForCoordinates):
     382        * rendering/RenderInline.h:
     383        (WebCore::RenderInline::offsetWidth):
     384        (WebCore::RenderInline::offsetHeight):
     385        * rendering/RenderLayer.cpp:
     386        (WebCore::RenderLayer::updateTransform):
     387        (WebCore::RenderLayer::updateLayerPosition):
     388        (WebCore::RenderLayer::scrollbarCornerPresent):
     389        (WebCore::RenderLayer::createScrollbar):
     390        (WebCore::RenderLayer::positionOverflowControls):
     391        (WebCore::RenderLayer::paintScrollCorner):
     392        (WebCore::RenderLayer::paintResizer):
     393        (WebCore::RenderLayer::paintLayer):
     394        (WebCore::RenderLayer::hitTestLayer):
     395        (WebCore::RenderLayer::calculateRects):
     396        (WebCore::RenderLayer::boundingBox):
     397        * rendering/RenderListBox.cpp:
     398        (WebCore::RenderListBox::calcHeight):
     399        (WebCore::RenderListBox::controlClipRect):
     400        * rendering/RenderListItem.cpp:
     401        (WebCore::RenderListItem::positionListMarker):
     402        (WebCore::RenderListItem::paint):
     403        * rendering/RenderListMarker.cpp:
     404        (WebCore::RenderListMarker::paint):
     405        (WebCore::RenderListMarker::layout):
     406        (WebCore::RenderListMarker::imageChanged):
     407        (WebCore::RenderListMarker::getRelativeMarkerRect):
     408        (WebCore::RenderListMarker::selectionRect):
     409        * rendering/RenderMarquee.cpp:
     410        (WebCore::RenderMarquee::computePosition):
     411        * rendering/RenderMedia.cpp:
     412        (WebCore::RenderMedia::layout):
     413        (WebCore::RenderMedia::lowestPosition):
     414        (WebCore::RenderMedia::rightmostPosition):
     415        (WebCore::RenderMedia::leftmostPosition):
     416        * rendering/RenderMenuList.cpp:
     417        (WebCore::RenderMenuList::controlClipRect):
     418        * rendering/RenderObject.cpp:
     419        (WebCore::RenderObject::RenderObject):
     420        (WebCore::RenderObject::markAllDescendantsWithFloatsForLayout):
     421        (WebCore::RenderObject::paintOutline):
     422        (WebCore::RenderObject::addLineBoxRects):
     423        (WebCore::RenderObject::absoluteBoundingBoxRect):
     424        (WebCore::RenderObject::addAbsoluteRectForLayer):
     425        (WebCore::RenderObject::paintingRootRect):
     426        (WebCore::RenderObject::container):
     427        (WebCore::RenderObject::removeFromObjectLists):
     428        (WebCore::RenderObject::updateHitTestResult):
     429        (WebCore::RenderObject::addDashboardRegions):
     430        (WebCore::RenderObject::localTransform):
     431        * rendering/RenderObject.h:
     432        (WebCore::RenderObject::isBox):
     433        (WebCore::RenderObject::hasMask):
     434        (WebCore::RenderObject::setIsText):
     435        (WebCore::RenderObject::setIsBox):
     436        (WebCore::RenderObject::borderTop):
     437        (WebCore::RenderObject::borderBottom):
     438        (WebCore::RenderObject::absoluteRects):
     439        (WebCore::RenderObject::collectAbsoluteLineBoxQuads):
     440        (WebCore::RenderObject::absoluteQuads):
     441        (WebCore::RenderObject::hasReflection):
     442        (WebCore::RenderObject::addFocusRingRects):
     443        (WebCore::RenderObject::absoluteOutlineBounds):
     444        * rendering/RenderPart.cpp:
     445        (WebCore::RenderPart::updateWidgetPosition):
     446        * rendering/RenderPath.cpp:
     447        (WebCore::RenderPath::layout):
     448        (WebCore::RenderPath::paint):
     449        (WebCore::RenderPath::absoluteOutlineBounds):
     450        * rendering/RenderPath.h:
     451        * rendering/RenderReplaced.cpp:
     452        (WebCore::RenderReplaced::layout):
     453        (WebCore::RenderReplaced::paint):
     454        (WebCore::RenderReplaced::shouldPaint):
     455        (WebCore::RenderReplaced::positionForCoordinates):
     456        (WebCore::RenderReplaced::localSelectionRect):
     457        (WebCore::RenderReplaced::adjustOverflowForBoxShadow):
     458        (WebCore::RenderReplaced::overflowRect):
     459        * rendering/RenderReplica.cpp:
     460        (WebCore::RenderReplica::layout):
     461        (WebCore::RenderReplica::calcPrefWidths):
     462        (WebCore::RenderReplica::paint):
     463        * rendering/RenderSVGContainer.cpp:
     464        (WebCore::RenderSVGContainer::paint):
     465        (WebCore::RenderSVGContainer::absoluteOutlineBounds):
     466        * rendering/RenderSVGContainer.h:
     467        (WebCore::RenderSVGContainer::width):
     468        (WebCore::RenderSVGContainer::height):
     469        * rendering/RenderSVGImage.cpp:
     470        (WebCore::RenderSVGImage::layout):
     471        * rendering/RenderSVGInlineText.cpp:
     472        (WebCore::RenderSVGInlineText::computeAbsoluteRectForRange):
     473        (WebCore::RenderSVGInlineText::positionForCoordinates):
     474        * rendering/RenderSVGRoot.cpp:
     475        (WebCore::RenderSVGRoot::layout):
     476        (WebCore::RenderSVGRoot::applyContentTransforms):
     477        (WebCore::RenderSVGRoot::paint):
     478        (WebCore::RenderSVGRoot::absoluteTransform):
     479        (WebCore::RenderSVGRoot::nodeAtPoint):
     480        * rendering/RenderSVGTSpan.cpp:
     481        (WebCore::RenderSVGTSpan::absoluteRects):
     482        (WebCore::RenderSVGTSpan::absoluteQuads):
     483        * rendering/RenderSVGText.cpp:
     484        (WebCore::RenderSVGText::layout):
     485        (WebCore::RenderSVGText::relativeBBox):
     486        * rendering/RenderSVGTextPath.cpp:
     487        (WebCore::RenderSVGTextPath::absoluteRects):
     488        (WebCore::RenderSVGTextPath::absoluteQuads):
     489        * rendering/RenderSVGViewportContainer.cpp:
     490        (WebCore::RenderSVGViewportContainer::nodeAtPoint):
     491        * rendering/RenderScrollbar.cpp:
     492        (WebCore::RenderScrollbar::createCustomScrollbar):
     493        (WebCore::RenderScrollbar::RenderScrollbar):
     494        (WebCore::RenderScrollbar::setParent):
     495        * rendering/RenderScrollbar.h:
     496        (WebCore::RenderScrollbar::owningRenderer):
     497        * rendering/RenderScrollbarPart.cpp:
     498        (WebCore::RenderScrollbarPart::layout):
     499        (WebCore::RenderScrollbarPart::layoutHorizontalPart):
     500        (WebCore::RenderScrollbarPart::layoutVerticalPart):
     501        (WebCore::RenderScrollbarPart::computeScrollbarWidth):
     502        (WebCore::RenderScrollbarPart::computeScrollbarHeight):
     503        (WebCore::RenderScrollbarPart::paintIntoRect):
     504        * rendering/RenderSlider.cpp:
     505        (WebCore::HTMLSliderThumbElement::defaultEventHandler):
     506        (WebCore::RenderSlider::layout):
     507        (WebCore::RenderSlider::mouseEventIsInThumb):
     508        (WebCore::RenderSlider::positionForOffset):
     509        (WebCore::RenderSlider::trackSize):
     510        * rendering/RenderTable.cpp:
     511        (WebCore::RenderTable::calcWidth):
     512        (WebCore::RenderTable::layout):
     513        (WebCore::RenderTable::paint):
     514        (WebCore::RenderTable::getBaselineOfFirstLineBox):
     515        * rendering/RenderTableCell.cpp:
     516        (WebCore::RenderTableCell::updateWidth):
     517        (WebCore::RenderTableCell::computeAbsoluteRepaintRect):
     518        (WebCore::RenderTableCell::localToAbsolute):
     519        (WebCore::RenderTableCell::absoluteToLocal):
     520        (WebCore::RenderTableCell::localToAbsoluteQuad):
     521        (WebCore::RenderTableCell::paint):
     522        (WebCore::RenderTableCell::paintBackgroundsBehindCell):
     523        * rendering/RenderTableCell.h:
     524        * rendering/RenderTableSection.cpp:
     525        (WebCore::RenderTableSection::addChild):
     526        (WebCore::RenderTableSection::addCell):
     527        (WebCore::RenderTableSection::setCellWidths):
     528        (WebCore::RenderTableSection::calcRowHeight):
     529        (WebCore::RenderTableSection::layoutRows):
     530        (WebCore::RenderTableSection::lowestPosition):
     531        (WebCore::RenderTableSection::rightmostPosition):
     532        (WebCore::RenderTableSection::leftmostPosition):
     533        (WebCore::RenderTableSection::getBaselineOfFirstLineBox):
     534        (WebCore::RenderTableSection::paint):
     535        (WebCore::RenderTableSection::recalcCells):
     536        (WebCore::RenderTableSection::nodeAtPoint):
     537        * rendering/RenderTableSection.h:
     538        (WebCore::RenderTableSection::overflowWidth):
     539        (WebCore::RenderTableSection::overflowHeight):
     540        * rendering/RenderText.cpp:
     541        (WebCore::RenderText::RenderText):
     542        (WebCore::RenderText::boundingBoxX):
     543        (WebCore::RenderText::boundingBoxY):
     544        (WebCore::RenderText::firstRunX):
     545        (WebCore::RenderText::firstRunY):
     546        (WebCore::RenderText::boundingBoxHeight):
     547        (WebCore::RenderText::boundingBoxWidth):
     548        * rendering/RenderText.h:
     549        * rendering/RenderTextControl.cpp:
     550        (WebCore::RenderTextControl::textBlockHeight):
     551        (WebCore::RenderTextControl::textBlockWidth):
     552        (WebCore::RenderTextControl::setSelectionRange):
     553        (WebCore::RenderTextControl::calcHeight):
     554        (WebCore::RenderTextControl::hitInnerTextBlock):
     555        (WebCore::RenderTextControl::controlClipRect):
     556        * rendering/RenderTextControlMultiLine.cpp:
     557        (WebCore::RenderTextControlMultiLine::layout):
     558        (WebCore::RenderTextControlMultiLine::adjustControlHeightBasedOnLineHeight):
     559        * rendering/RenderTextControlSingleLine.cpp:
     560        (WebCore::RenderTextControlSingleLine::paint):
     561        (WebCore::RenderTextControlSingleLine::layout):
     562        (WebCore::RenderTextControlSingleLine::nodeAtPoint):
     563        (WebCore::RenderTextControlSingleLine::forwardEvent):
     564        (WebCore::RenderTextControlSingleLine::textBlockWidth):
     565        (WebCore::RenderTextControlSingleLine::adjustControlHeightBasedOnLineHeight):
     566        (WebCore::RenderTextControlSingleLine::clientPaddingLeft):
     567        (WebCore::RenderTextControlSingleLine::clientPaddingRight):
     568        * rendering/RenderTheme.cpp:
     569        (WebCore::RenderTheme::hitTestMediaControlPart):
     570        (WebCore::RenderTheme::baselinePosition):
     571        * rendering/RenderThemeMac.mm:
     572        (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
     573        (WebCore::RenderThemeMac::paintSearchFieldResultsDecoration):
     574        (WebCore::RenderThemeMac::paintSearchFieldResultsButton):
     575        (WebCore::RenderThemeMac::hitTestMediaControlPart):
     576        * rendering/RenderTreeAsText.cpp:
     577        (WebCore::operator<<):
     578        * rendering/RenderVideo.cpp:
     579        (WebCore::RenderVideo::videoBox):
     580        * rendering/RenderView.cpp:
     581        (WebCore::RenderView::RenderView):
     582        (WebCore::RenderView::calcHeight):
     583        (WebCore::RenderView::calcWidth):
     584        (WebCore::RenderView::layout):
     585        (WebCore::RenderView::viewRect):
     586        (WebCore::RenderView::docHeight):
     587        (WebCore::RenderView::docWidth):
     588        (WebCore::RenderView::setBestTruncatedAt):
     589        * rendering/RenderView.h:
     590        * rendering/RenderWidget.cpp:
     591        (WebCore::RenderWidget::paint):
     592        (WebCore::RenderWidget::updateWidgetPosition):
     593        (WebCore::RenderWidget::nodeAtPoint):
     594        * rendering/RootInlineBox.h:
     595        (WebCore::RootInlineBox::floats):
     596        (WebCore::RootInlineBox::floatsPtr):
     597        * rendering/SVGInlineFlowBox.cpp:
     598        (WebCore::SVGInlineFlowBox::verticallyAlignBoxes):
     599        * rendering/SVGInlineFlowBox.h:
     600        * rendering/SVGRenderTreeAsText.cpp:
     601        (WebCore::operator<<):
     602        (WebCore::write):
     603        * rendering/SVGRootInlineBox.cpp:
     604        (WebCore::SVGRootInlineBox::verticallyAlignBoxes):
     605        (WebCore::SVGRootInlineBox::computePerCharacterLayoutInformation):
     606        (WebCore::SVGRootInlineBox::layoutInlineBoxes):
     607        * rendering/SVGRootInlineBox.h:
     608        * rendering/bidi.cpp:
     609        (WebCore::RenderBlock::computeHorizontalPositionsForLine):
     610        (WebCore::RenderBlock::computeVerticalPositionsForLine):
     611        (WebCore::RenderBlock::layoutInlineChildren):
     612        (WebCore::RenderBlock::determineStartPosition):
     613        (WebCore::RenderBlock::matchedEndLine):
     614        (WebCore::RenderBlock::skipTrailingWhitespace):
     615        (WebCore::RenderBlock::skipLeadingWhitespace):
     616        (WebCore::RenderBlock::fitBelowFloats):
     617        (WebCore::RenderBlock::findNextLineBreak):
     618        (WebCore::RenderBlock::checkLinesForOverflow):
     619        * svg/SVGLength.cpp:
     620        (WebCore::SVGLength::PercentageOfViewport):
     621
     6222009-01-21  Anders Carlsson  <andersca@apple.com>
     623
     624        Reviewed by Sam Weinig.
     625
     626        * WebCore.LP64.exp:
     627        Add some bridge related symbols.
     628       
     629        * WebCore.xcodeproj/project.pbxproj:
     630        Make runtime_object.h a private header.
     631
     6322009-01-20  David Levin  <levin@chromium.org>
     633
     634        Reviewed by Alexey Proskuryakov.
     635
     636        Bug 22720: Make XMLHttpRequest work in Workers
     637        <https://bugs.webkit.org/show_bug.cgi?id=22720>
     638
     639        More removal of document usage from XMLHttpRequest.
     640        * Abstracted away the sync and async requests behind the ThreadableLoader class, which
     641          will get an implementation for Workers.  ThreadableLoader follows the same model as
     642          SubresourceLoader because DocumentThreadableLoader is a thin wrapper around SubresourceLoader.
     643          Also, WorkerThreadableLoader (coming soon) will use DocumentThreadableLoader to get things done.
     644        * Consolidated dashboard compatibility checks into usesDashboardBackwardCompatibilityMode
     645          which handles workers.
     646
     647        No observable change in behavior, so no test.
     648
     649        * GNUmakefile.am:
     650        * WebCore.pro:
     651        * WebCore.scons:
     652        * WebCore.vcproj/WebCore.vcproj:
     653        * WebCore.xcodeproj/project.pbxproj:
     654        * WebCoreSources.bkl:
     655        * loader/DocumentThreadableLoader.cpp: Added.
     656        (WebCore::DocumentThreadableLoader::create):
     657        (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
     658        (WebCore::DocumentThreadableLoader::~DocumentThreadableLoader):
     659        (WebCore::DocumentThreadableLoader::cancel):
     660        (WebCore::DocumentThreadableLoader::willSendRequest):
     661        (WebCore::DocumentThreadableLoader::didSendData):
     662        (WebCore::DocumentThreadableLoader::didReceiveResponse):
     663        (WebCore::DocumentThreadableLoader::didReceiveData):
     664        (WebCore::DocumentThreadableLoader::didFinishLoading):
     665        (WebCore::DocumentThreadableLoader::didFail):
     666        (WebCore::DocumentThreadableLoader::receivedCancellation):
     667        * loader/DocumentThreadableLoader.h: Added.
     668        (WebCore::DocumentThreadableLoader::refThreadableLoader):
     669        (WebCore::DocumentThreadableLoader::derefThreadableLoader):
     670        * loader/SubresourceLoaderClient.h:
     671        (WebCore::SubresourceLoaderClient::didReceiveData):
     672        * loader/ThreadableLoader.cpp: Added.
     673        (WebCore::ThreadableLoader::create):
     674        (WebCore::ThreadableLoader::loadResourceSynchronously):
     675        * loader/ThreadableLoader.h: Added.
     676        (WebCore::):
     677        (WebCore::ThreadableLoader::ref):
     678        (WebCore::ThreadableLoader::deref):
     679        (WebCore::ThreadableLoader::~ThreadableLoader):
     680        * loader/ThreadableLoaderClient.h: Added.
     681        (WebCore::ThreadableLoaderClient::didSendData):
     682        (WebCore::ThreadableLoaderClient::didReceiveResponse):
     683        (WebCore::ThreadableLoaderClient::didReceiveData):
     684        (WebCore::ThreadableLoaderClient::didFinishLoading):
     685        (WebCore::ThreadableLoaderClient::didFail):
     686        (WebCore::ThreadableLoaderClient::didGetCancelled):
     687        (WebCore::ThreadableLoaderClient::didReceiveAuthenticationCancellation):
     688        (WebCore::ThreadableLoaderClient::~ThreadableLoaderClient):
     689        * xml/XMLHttpRequest.cpp:
     690        (WebCore::XMLHttpRequest::XMLHttpRequest):
     691        (WebCore::XMLHttpRequest::usesDashboardBackwardCompatibilityMode):
     692        (WebCore::XMLHttpRequest::send):
     693        (WebCore::XMLHttpRequest::loadRequestSynchronously):
     694        (WebCore::XMLHttpRequest::loadRequestAsynchronously):
     695        (WebCore::XMLHttpRequest::setRequestHeader):
     696        (WebCore::XMLHttpRequest::processSyncLoadResults):
     697        (WebCore::XMLHttpRequest::didFail):
     698        (WebCore::XMLHttpRequest::didGetCancelled):
     699        (WebCore::XMLHttpRequest::didFinishLoading):
     700        (WebCore::XMLHttpRequest::didFinishLoadingPreflight):
     701        (WebCore::XMLHttpRequest::didSendData):
     702        (WebCore::XMLHttpRequest::didReceiveResponse):
     703        (WebCore::XMLHttpRequest::didReceiveResponsePreflight):
     704        (WebCore::XMLHttpRequest::didReceiveAuthenticationCancellation):
     705        (WebCore::XMLHttpRequest::didReceiveData):
     706        * xml/XMLHttpRequest.h:
     707
     7082009-01-19  Chris Marrin  <cmarrin@apple.com>
     709
     710        Reviewed by David Hyatt.
     711
     712        Fix for https://bugs.webkit.org/show_bug.cgi?id=23317
     713
     714        The high CPU usage was really from repeatedly firing transitions caused
     715        by a bug in the way we handle background-color animations. If animating
     716        from a valid background color to no background color, we sometimes left
     717        (based on timing) the background color as transparent black, but valid
     718        rather than invalid, which it should be. Fixing that got rid of the
     719        repeated firing.
     720
     721        But we really were doing more expensive iteration of all objects with
     722        animations or transitions on them (running or not). So I added two
     723        optimizations to quickly short circuit when an object had no running
     724        animations or transitions. Things are now as zippy as ever.
     725
     726        Test: transitions/repeated-firing-background-color.html
     727
     728        * page/animation/AnimationBase.cpp:
     729        (WebCore::blendFunc):
     730        * page/animation/AnimationController.cpp:
     731        (WebCore::AnimationControllerPrivate::updateAnimationTimer):
     732        * page/animation/CompositeAnimation.cpp:
     733        (WebCore::CompositeAnimationPrivate::hasAnimations):
     734        (WebCore::CompositeAnimationPrivate::clearRenderer):
     735        (WebCore::CompositeAnimationPrivate::animate):
     736        (WebCore::CompositeAnimationPrivate::setAnimating):
     737        (WebCore::CompositeAnimationPrivate::willNeedService):
     738        (WebCore::CompositeAnimationPrivate::getAnimationForProperty):
     739        (WebCore::CompositeAnimationPrivate::cleanupFinishedAnimations):
     740        (WebCore::CompositeAnimationPrivate::setAnimationStartTime):
     741        (WebCore::CompositeAnimationPrivate::setTransitionStartTime):
     742        (WebCore::CompositeAnimationPrivate::suspendAnimations):
     743        (WebCore::CompositeAnimationPrivate::resumeAnimations):
     744        (WebCore::CompositeAnimationPrivate::overrideImplicitAnimations):
     745        (WebCore::CompositeAnimationPrivate::resumeOverriddenImplicitAnimations):
     746        (WebCore::CompositeAnimationPrivate::styleAvailable):
     747        (WebCore::CompositeAnimationPrivate::isAnimatingProperty):
     748        (WebCore::CompositeAnimationPrivate::numberOfActiveAnimations):
     749        (WebCore::CompositeAnimation::hasAnimations):
     750        * page/animation/CompositeAnimation.h:
     751
     7522009-01-21  Eric Seidel  <eric@webkit.org>
     753
     754        Reviewed by Justin Garcia.
     755
     756        Remove the style='' turds left by some editing commands
     757        https://bugs.webkit.org/show_bug.cgi?id=23463
     758
     759        Test: editing/execCommand/toggle-styles.html
     760
     761        * editing/ApplyStyleCommand.cpp:
     762        (WebCore::ApplyStyleCommand::removeCSSStyle): check if we just removed the last CSS property and remove the style attribute as well
     763        * editing/CompositeEditCommand.cpp:
     764        (WebCore::CompositeEditCommand::removeNodeAttribute): remove extra ;
     765
     7662009-01-21  Eric Seidel  <eric@webkit.org>
     767
     768        No review, build fix.
     769
     770        Fix release-only build failure (and do a tiny code-cleanup).
     771
     772        * editing/ApplyStyleCommand.cpp:
     773        (WebCore::createFontElement):
     774        (WebCore::createStyleSpanElement):
     775        (WebCore::ApplyStyleCommand::addInlineStyleIfNeeded):
     776
     7772009-01-21  Chris Fleizach  <cfleizach@apple.com>
     778
     779        Reviewed by Beth Dakin.
     780
     781        Bug 23443: Table accessibility should be re-enabled after fixing crash that occurs at WebCore::AccessibilityTable::isTableExposableThroughAccessibility()
     782        https://bugs.webkit.org/show_bug.cgi?id=23443
     783
     784        Test: accessibility/table-modification-crash.html
     785
     786        * page/AccessibilityObject.cpp:
     787        (WebCore::AccessibilityObject::updateBackingStore):
     788        * page/AccessibilityObject.h:
     789        * page/AccessibilityRenderObject.cpp:
     790        (WebCore::AccessibilityRenderObject::childrenChanged):
     791        (WebCore::AccessibilityRenderObject::children):
     792        (WebCore::AccessibilityRenderObject::updateBackingStore):
     793        * page/AccessibilityRenderObject.h:
     794        (WebCore::AccessibilityRenderObject::markChildrenDirty):
     795        * page/AccessibilityTable.cpp:
     796        (WebCore::AccessibilityTable::AccessibilityTable):
     797        * page/mac/AccessibilityObjectWrapper.mm:
     798        (-[AccessibilityObjectWrapper accessibilityActionNames]):
     799        (-[AccessibilityObjectWrapper accessibilityAttributeNames]):
     800        (-[AccessibilityObjectWrapper accessibilityAttributeValue:]):
     801        (-[AccessibilityObjectWrapper accessibilityFocusedUIElement]):
     802        (-[AccessibilityObjectWrapper accessibilityHitTest:]):
     803        (-[AccessibilityObjectWrapper accessibilityIsAttributeSettable:]):
     804        (-[AccessibilityObjectWrapper accessibilityIsIgnored]):
     805        (-[AccessibilityObjectWrapper accessibilityParameterizedAttributeNames]):
     806        (-[AccessibilityObjectWrapper accessibilityPerformPressAction]):
     807        (-[AccessibilityObjectWrapper accessibilityPerformAction:]):
     808        (-[AccessibilityObjectWrapper accessibilitySetValue:forAttribute:]):
     809        (-[AccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
     810        (-[AccessibilityObjectWrapper accessibilityIndexOfChild:]):
     811        (-[AccessibilityObjectWrapper accessibilityArrayAttributeCount:]):
     812        (-[AccessibilityObjectWrapper accessibilityArrayAttributeValues:index:maxCount:]):
     813        * rendering/RenderObject.cpp:
     814        (WebCore::RenderObject::destroy):
     815        * rendering/RenderWidget.cpp:
     816        (WebCore::RenderWidget::destroy):
     817
     8182009-01-16  Eric Seidel  <eric@webkit.org>
     819
     820        Reviewed by Justin Garcia.
     821
     822        Fix execCommand() 'super' and 'sub' commands to add <sup> and <sub> in quirks mode, and to toggle when called twice
     823        https://bugs.webkit.org/show_bug.cgi?id=17733
     824       
     825        Test changed: editing/execCommand/toggle-styles-expected.txt
     826
     827        * editing/ApplyStyleCommand.cpp:
     828        (WebCore::StyleChange::applySubscript):
     829        (WebCore::StyleChange::applySuperscript):
     830        (WebCore::StyleChange::StyleChange):
     831        (WebCore::StyleChange::init):
     832        (WebCore::StyleChange::checkForLegacyHTMLStyleChange):
     833        (WebCore::ApplyStyleCommand::isHTMLStyleNode):
     834        (WebCore::ApplyStyleCommand::addInlineStyleIfNeeded):
     835        * editing/EditorCommand.cpp:
     836        (WebCore::executeSubscript):
     837        (WebCore::executeSuperscript):
     838        * editing/htmlediting.cpp:
     839        (WebCore::createHTMLElement):
     840        * editing/htmlediting.h:
     841
     8422009-01-21  Anders Carlsson  <andersca@apple.com>
     843
     844        Fix 64-bit build.
     845
     846        * WebCore.LP64.exp:
     847
     8482009-01-21  Oliver Hunt  <oliver@apple.com>
     849
     850        Reviewed by Alexey Proskuryakov.
     851
     852        Bug 23458: Reintroduce CanvasPixelArray in ImageData.idl
     853        <https://bugs.webkit.org/show_bug.cgi?id=23458>
     854
     855        Return CanvasPixelArray, et al -- the only difference between this
     856        and the original CPA implementation is that it now uses a ByteArray
     857        rather than a vector.  JSC still uses a custom wrapper, but this allows
     858        ObjC, COM, and V8 bindings to be autogenerated again.
     859
     860        * GNUmakefile.am:
     861        * WebCore.pro:
     862        * WebCore.vcproj/WebCore.vcproj:
     863        * WebCore.xcodeproj/project.pbxproj:
     864        * WebCoreSources.bkl:
     865        * bindings/js/JSImageDataCustom.cpp:
     866        (WebCore::toJS):
     867        * html/CanvasPixelArray.cpp: Added.
     868        (WebCore::CanvasPixelArray::create):
     869        (WebCore::CanvasPixelArray::CanvasPixelArray):
     870        * html/CanvasPixelArray.h: Added.
     871        (WebCore::CanvasPixelArray::data):
     872        (WebCore::CanvasPixelArray::length):
     873        (WebCore::CanvasPixelArray::set):
     874        (WebCore::CanvasPixelArray::get):
     875        * html/CanvasPixelArray.idl: Added.
     876        * html/CanvasRenderingContext2D.cpp:
     877        (WebCore::createEmptyImageData):
     878        * html/ImageData.cpp:
     879        (WebCore::ImageData::ImageData):
     880        * html/ImageData.h:
     881        (WebCore::ImageData::data):
     882        * html/ImageData.idl:
     883        * platform/graphics/cairo/ImageBufferCairo.cpp:
     884        (WebCore::ImageBuffer::getImageData):
     885        (WebCore::ImageBuffer::putImageData):
     886        * platform/graphics/cg/ImageBufferCG.cpp:
     887        (WebCore::ImageBuffer::getImageData):
     888        (WebCore::ImageBuffer::putImageData):
     889
     8902009-01-21  Dirk Schulze  <krit@webkit.org>
     891
     892        Reviewed by Nikolas Zimmermann.
     893
     894        Remove last relics of platform dependent PaintServer in SVG.
     895        We draw everything with the help of GraphicsContext.
     896
     897        Remove SVGPaintServerPlatform's
     898        [https://bugs.webkit.org/show_bug.cgi?id=23439]
     899
     900        * GNUmakefile.am:
     901        * WebCore.pro:
     902        * WebCore.vcproj/WebCore.vcproj:
     903        * WebCore.xcodeproj/project.pbxproj:
     904        * svg/graphics/SVGPaintServer.cpp:
     905        (WebCore::SVGPaintServer::draw):
     906        (WebCore::SVGPaintServer::renderPath):
     907        (WebCore::SVGPaintServer::teardown):
     908        * svg/graphics/SVGPaintServer.h:
     909        * svg/graphics/SVGPaintServerGradient.cpp:
     910        * svg/graphics/SVGPaintServerGradient.h:
     911        * svg/graphics/SVGPaintServerPattern.cpp:
     912        * svg/graphics/SVGPaintServerPattern.h:
     913        * svg/graphics/SVGPaintServerSolid.cpp:
     914        * svg/graphics/SVGPaintServerSolid.h:
     915        * svg/graphics/cairo/SVGPaintServerCairo.cpp: Removed.
     916        * svg/graphics/cg/SVGPaintServerCg.cpp: Removed.
     917        * svg/graphics/qt/SVGPaintServerQt.cpp: Removed.
     918        * svg/graphics/skia/SVGPaintServerSkia.cpp: Removed.
     919
     9202009-01-21  Nikolas Zimmermann  <nikolas.zimmermann@torchmobile.com>
     921
     922        Reviewed by Alexey Proskuryakov.
     923
     924        Move "Element -> ScriptElement" casting functionality into ScriptElement.h
     925        to be consistent with FormControlElement/InputElement/OptionElement/OptionGroupElement.
     926
     927        It was living in XMLTokenizer before, which is not an obvious place for this.
     928        TODO: Rename 'formControlElementForElement' to 'toFormControlElement' (analogous changes for InputElement etc.)
     929              as suggested by Alexey, it really reads better this way.
     930
     931        * dom/ScriptElement.cpp:
     932        (WebCore::toScriptElement):
     933        * dom/ScriptElement.h:
     934        * dom/XMLTokenizer.cpp:
     935        (WebCore::XMLTokenizer::notifyFinished):
     936        * dom/XMLTokenizer.h:
     937        * dom/XMLTokenizerLibxml2.cpp:
     938        (WebCore::XMLTokenizer::startElementNs):
     939        (WebCore::XMLTokenizer::endElementNs):
     940        * dom/XMLTokenizerQt.cpp:
     941        (WebCore::XMLTokenizer::parseStartElement):
     942        (WebCore::XMLTokenizer::parseEndElement):
     943
    19442009-01-20  Nikolas Zimmermann  <nikolas.zimmermann@torchmobile.com>
    2945
  • trunk/WebCore/GNUmakefile.am

    r40086 r40124  
    809809        WebCore/html/CanvasPattern.cpp \
    810810        WebCore/html/CanvasPattern.h \
     811        WebCore/html/CanvasPixelArray.cpp \
     812        WebCore/html/CanvasPixelArray.h \
    811813        WebCore/html/CanvasRenderingContext2D.cpp \
    812814        WebCore/html/CanvasRenderingContext2D.h \
     
    10421044        WebCore/loader/DocumentLoader.cpp \
    10431045        WebCore/loader/DocumentLoader.h \
     1046        WebCore/loader/DocumentThreadableLoader.cpp \
     1047        WebCore/loader/DocumentThreadableLoader.h \
    10441048        WebCore/loader/EmptyClients.h \
    10451049        WebCore/loader/FTPDirectoryDocument.cpp \
     
    10831087        WebCore/loader/TextResourceDecoder.cpp \
    10841088        WebCore/loader/TextResourceDecoder.h \
     1089        WebCore/loader/ThreadableLoader.cpp \
     1090        WebCore/loader/ThreadableLoader.h \
     1091        WebCore/loader/ThreadableLoaderClient.h \
    10851092        WebCore/loader/archive/Archive.h \
    10861093        WebCore/loader/archive/ArchiveFactory.cpp \
     
    13801387        WebCore/platform/network/FormDataBuilder.h \
    13811388        WebCore/platform/network/HTTPHeaderMap.h \
     1389        WebCore/platform/network/HTTPHeaderMap.cpp \
    13821390        WebCore/platform/network/HTTPParsers.cpp \
    13831391        WebCore/platform/network/HTTPParsers.h \
     
    28442852
    28452853webcoregtk_sources += \
    2846         WebCore/svg/graphics/cairo/SVGPaintServerCairo.cpp \
    28472854        WebCore/svg/graphics/cairo/SVGResourceFilterCairo.cpp \
    28482855        WebCore/svg/graphics/cairo/SVGResourceMaskerCairo.cpp
  • trunk/WebCore/WebCore.LP64.exp

    r40086 r40124  
    11# This file gets appended to WebCore.exp, only for 64-bit architectures.
    22
     3__ZN3JSC16RuntimeObjectImp6s_infoE
     4__ZN3JSC8Bindings10RootObjectD1Ev
     5__ZN3JSC8Bindings8Instance19createRuntimeObjectEPNS_9ExecStateE
     6__ZN3JSC8Bindings8InstanceC2EN3WTF10PassRefPtrINS0_10RootObjectEEE
     7__ZN3JSC8Bindings8InstanceD2Ev
     8__ZN7WebCore16ScriptController9isEnabledEv
    39__ZN7WebCore6String8fromUTF8EPKcm
    4 __ZN7WebCore16ScriptController9isEnabledEv
  • trunk/WebCore/WebCore.base.exp

    r40086 r40124  
    735735__ZNK7WebCore12IconDatabase9isEnabledEv
    736736__ZNK7WebCore12RenderObject14enclosingLayerEv
     737__ZNK7WebCore10RenderText16boundingBoxWidthEv
     738__ZNK7WebCore10RenderText17boundingBoxHeightEv
     739__ZNK7WebCore10RenderText9firstRunXEv
     740__ZNK7WebCore10RenderText9firstRunYEv
    737741__ZNK7WebCore12SharedBuffer4dataEv
    738742__ZNK7WebCore12SharedBuffer4sizeEv
  • trunk/WebCore/WebCore.pro

    r40086 r40124  
    683683    html/CanvasGradient.cpp \
    684684    html/CanvasPattern.cpp \
     685    html/CanvasPixelArray.cpp \
    685686    html/CanvasRenderingContext2D.cpp \
    686687    html/CanvasStyle.cpp \
     
    786787    loader/DocLoader.cpp \
    787788    loader/DocumentLoader.cpp \
     789    loader/DocumentThreadableLoader.cpp \
    788790    loader/FormState.cpp \
    789791    loader/FrameLoader.cpp \
     
    806808    loader/TextDocument.cpp \
    807809    loader/TextResourceDecoder.cpp \
     810    loader/ThreadableLoader.cpp \
    808811    page/AccessibilityImageMapLink.cpp \
    809812    page/AccessibilityObject.cpp \   
     
    907910    platform/network/FormData.cpp \
    908911    platform/network/FormDataBuilder.cpp \
     912    platform/network/HTTPHeaderMap.cpp \
    909913    platform/network/HTTPParsers.cpp \
    910914    platform/network/NetworkStateNotifier.cpp \
     
    18021806
    18031807SOURCES += \
    1804         svg/graphics/qt/SVGPaintServerQt.cpp \
    18051808        svg/graphics/qt/SVGResourceFilterQt.cpp \
    18061809        svg/graphics/qt/SVGResourceMaskerQt.cpp
  • trunk/WebCore/WebCore.scons

    r40086 r40124  
    336336    'loader/DocLoader.cpp',
    337337    'loader/DocumentLoader.cpp',
     338    'loader/DocumentThreadableLoader.cpp',
    338339    'loader/FormState.cpp',
    339340    'loader/FrameLoader.cpp',
     
    354355    'loader/TextDocument.cpp',
    355356    'loader/TextResourceDecoder.cpp',
     357    'loader/ThreadableLoader.cpp',
    356358    'loader/UserStyleSheetLoader.cpp',
    357359]
     
    798800    'platform/network/FormData.cpp',
    799801    'platform/network/FormDataBuilder.cpp',
     802    'platform/network/HTTPHeaderMap.cpp',
    800803    'platform/network/HTTPParsers.cpp',
    801804    'platform/network/mac/NetworkStateNotifierMac.cpp',
  • trunk/WebCore/WebCore.vcproj/WebCore.vcproj

    r40086 r40124  
    27492749                        </File>
    27502750                        <File
     2751                                RelativePath="..\loader\DocumentThreadableLoader.cpp"
     2752                                >
     2753                        </File>
     2754                        <File
     2755                                RelativePath="..\loader\DocumentThreadableLoader.h"
     2756                                >
     2757                        </File>
     2758                        <File
    27512759                                RelativePath="..\loader\FormState.cpp"
    27522760                                >
     
    29142922                        <File
    29152923                                RelativePath="..\loader\TextResourceDecoder.h"
     2924                                >
     2925                        </File>
     2926                        <File
     2927                                RelativePath="..\loader\ThreadableLoader.cpp"
     2928                                >
     2929                        </File>
     2930                        <File
     2931                                RelativePath="..\loader\ThreadableLoader.h"
     2932                                >
     2933                        </File>
     2934                        <File
     2935                                RelativePath="..\loader\ThreadableLoaderClient.h"
    29162936                                >
    29172937                        </File>
     
    58065826                                </File>
    58075827                                <File
     5828                                        RelativePath="..\platform\network\HTTPHeaderMap.cpp"
     5829                                        >
     5830                                </File>
     5831                                <File
    58085832                                        RelativePath="..\platform\network\HTTPHeaderMap.h"
    58095833                                        >
     
    1259112615                        </File>
    1259212616                        <File
     12617                                RelativePath="..\html\CanvasPixelArray.cpp"
     12618                                >
     12619                                <FileConfiguration
     12620                                        Name="Release_PGO|Win32"
     12621                                        >
     12622                                        <Tool
     12623                                                Name="VCCLCompilerTool"
     12624                                                WholeProgramOptimization="true"
     12625                                        />
     12626                                </FileConfiguration>
     12627                        </File>
     12628                        <File
     12629                                RelativePath="..\html\CanvasPixelArray.h"
     12630                                >
     12631                        </File>
     12632                        <File
    1259312633                                RelativePath="..\html\CanvasRenderingContext2D.cpp"
    1259412634                                >
     
    1548915529                                        >
    1549015530                                        <File
    15491                                                 RelativePath="..\svg\graphics\cg\SVGPaintServerCg.cpp"
    15492                                                 >
    15493                                                 <FileConfiguration
    15494                                                         Name="Debug_Cairo|Win32"
    15495                                                         ExcludedFromBuild="true"
    15496                                                         >
    15497                                                         <Tool
    15498                                                                 Name="VCCLCompilerTool"
    15499                                                         />
    15500                                                 </FileConfiguration>
    15501                                                 <FileConfiguration
    15502                                                         Name="Release_Cairo|Win32"
    15503                                                         ExcludedFromBuild="true"
    15504                                                         >
    15505                                                         <Tool
    15506                                                                 Name="VCCLCompilerTool"
    15507                                                         />
    15508                                                 </FileConfiguration>
    15509                                         </File>
    15510                                         <File
    1551115531                                                RelativePath="..\svg\graphics\cg\SVGResourceFilterCg.cpp"
    1551215532                                                >
     
    1570815728                                        Name="cairo"
    1570915729                                        >
    15710                                         <File
    15711                                                 RelativePath="..\svg\graphics\cairo\SVGPaintServerCairo.cpp"
    15712                                                 >
    15713                                                 <FileConfiguration
    15714                                                         Name="Debug|Win32"
    15715                                                         ExcludedFromBuild="true"
    15716                                                         >
    15717                                                         <Tool
    15718                                                                 Name="VCCLCompilerTool"
    15719                                                         />
    15720                                                 </FileConfiguration>
    15721                                                 <FileConfiguration
    15722                                                         Name="Release|Win32"
    15723                                                         ExcludedFromBuild="true"
    15724                                                         >
    15725                                                         <Tool
    15726                                                                 Name="VCCLCompilerTool"
    15727                                                         />
    15728                                                 </FileConfiguration>
    15729                                                 <FileConfiguration
    15730                                                         Name="Debug_Internal|Win32"
    15731                                                         ExcludedFromBuild="true"
    15732                                                         >
    15733                                                         <Tool
    15734                                                                 Name="VCCLCompilerTool"
    15735                                                         />
    15736                                                 </FileConfiguration>
    15737                                                 <FileConfiguration
    15738                                                         Name="Release_PGO|Win32"
    15739                                                         ExcludedFromBuild="true"
    15740                                                         >
    15741                                                         <Tool
    15742                                                                 Name="VCCLCompilerTool"
    15743                                                         />
    15744                                                 </FileConfiguration>
    15745                                         </File>
    1574615730                                        <File
    1574715731                                                RelativePath="..\svg\graphics\cairo\SVGResourceFilterCairo.cpp"
  • trunk/WebCore/WebCore.xcodeproj/project.pbxproj

    r40086 r40124  
    125125                08E6E0F20EFF42BA00029FBF /* WMLFieldSetElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 08E6E0F00EFF42BA00029FBF /* WMLFieldSetElement.h */; };
    126126                0A4844990CA44CB200B7BD48 /* SoftLinking.h in Headers */ = {isa = PBXBuildFile; fileRef = 0A4844980CA44CB200B7BD48 /* SoftLinking.h */; settings = {ATTRIBUTES = (Private, ); }; };
     127                0B8C56D40F28627F000502E1 /* HTTPHeaderMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0B8C56D30F28627F000502E1 /* HTTPHeaderMap.cpp */; };
     128                0B9056190F2578BE0095FF6A /* DocumentThreadableLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0B9056150F2578BE0095FF6A /* DocumentThreadableLoader.cpp */; };
     129                0B90561A0F2578BF0095FF6A /* DocumentThreadableLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 0B9056160F2578BE0095FF6A /* DocumentThreadableLoader.h */; settings = {ATTRIBUTES = (); }; };
     130                0B90561B0F2578BF0095FF6A /* ThreadableLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 0B9056170F2578BE0095FF6A /* ThreadableLoader.h */; settings = {ATTRIBUTES = (); }; };
     131                0B90561C0F2578BF0095FF6A /* ThreadableLoaderClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 0B9056180F2578BE0095FF6A /* ThreadableLoaderClient.h */; settings = {ATTRIBUTES = (); }; };
     132                0B90561E0F257E930095FF6A /* ThreadableLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0B90561D0F257E930095FF6A /* ThreadableLoader.cpp */; };
    127133                0BA5D3860F240FB4009B870B /* GenericWorkerTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 0BA5D3850F240FB4009B870B /* GenericWorkerTask.h */; };
    128134                0F56028F0E4B76580065B038 /* RenderMarquee.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F56028D0E4B76580065B038 /* RenderMarquee.h */; };
     
    253259                1A569D210D7E2B82007C3983 /* runtime_method.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A569CF20D7E2B82007C3983 /* runtime_method.h */; };
    254260                1A569D220D7E2B82007C3983 /* runtime_object.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A569CF30D7E2B82007C3983 /* runtime_object.cpp */; };
    255                 1A569D230D7E2B82007C3983 /* runtime_object.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A569CF40D7E2B82007C3983 /* runtime_object.h */; };
     261                1A569D230D7E2B82007C3983 /* runtime_object.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A569CF40D7E2B82007C3983 /* runtime_object.h */; settings = {ATTRIBUTES = (Private, ); }; };
    256262                1A569D240D7E2B82007C3983 /* runtime_root.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A569CF50D7E2B82007C3983 /* runtime_root.cpp */; };
    257263                1A569D250D7E2B82007C3983 /* runtime_root.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A569CF60D7E2B82007C3983 /* runtime_root.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    17881794                85FF315A0AAFBFCB00374F38 /* DOMKeyboardEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 85FF31580AAFBFCB00374F38 /* DOMKeyboardEvent.h */; };
    17891795                85FF315B0AAFBFCB00374F38 /* DOMKeyboardEvent.mm in Sources */ = {isa = PBXBuildFile; fileRef = 85FF31590AAFBFCB00374F38 /* DOMKeyboardEvent.mm */; };
     1796                898D1FB30F27934B004BBAC7 /* CanvasPixelArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 898D1FB20F27934B004BBAC7 /* CanvasPixelArray.h */; };
    17901797                929264770B61FC7200B41D34 /* JSDocumentCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 929264760B61FC7200B41D34 /* JSDocumentCustom.cpp */; };
    17911798                9302B0BD0D79F82900C7EE83 /* PageGroup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9302B0BC0D79F82900C7EE83 /* PageGroup.cpp */; };
     
    20442051                93F9B7A10BA6032600854064 /* JSCDATASection.h in Headers */ = {isa = PBXBuildFile; fileRef = 93F9B79F0BA6032600854064 /* JSCDATASection.h */; };
    20452052                93FDAFCA0B11307400E2746F /* EditorInsertAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 93FDAFC90B11307400E2746F /* EditorInsertAction.h */; settings = {ATTRIBUTES = (Private, ); }; };
     2053                A7094AFA0F27AE6000596CEC /* CanvasPixelArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7094AF90F27AE6000596CEC /* CanvasPixelArray.cpp */; };
     2054                A7094AFC0F27AEE300596CEC /* CanvasPixelArray.idl in Resources */ = {isa = PBXBuildFile; fileRef = A7094AFB0F27AEE300596CEC /* CanvasPixelArray.idl */; };
    20462055                A718760E0B2A120100A16ECE /* DragActions.h in Headers */ = {isa = PBXBuildFile; fileRef = A718760D0B2A120100A16ECE /* DragActions.h */; settings = {ATTRIBUTES = (Private, ); }; };
    20472056                A71878900B2D04AC00A16ECE /* DragControllerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = A718788F0B2D04AC00A16ECE /* DragControllerMac.mm */; };
     
    32133222                B24055650B5BE640002A28C0 /* DOMSVGElementInstanceInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = B24055630B5BE640002A28C0 /* DOMSVGElementInstanceInternal.h */; };
    32143223                B24055660B5BE640002A28C0 /* DOMSVGElementInstanceListInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = B24055640B5BE640002A28C0 /* DOMSVGElementInstanceListInternal.h */; };
    3215                 B255992F0D00D8BA00BB825C /* SVGPaintServerCg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B25598930D00D8B800BB825C /* SVGPaintServerCg.cpp */; };
    32163224                B25599350D00D8BA00BB825C /* SVGResourceFilterCg.mm in Sources */ = {isa = PBXBuildFile; fileRef = B25598990D00D8B800BB825C /* SVGResourceFilterCg.mm */; };
    32173225                B25599370D00D8BA00BB825C /* SVGResourceMaskerCg.mm in Sources */ = {isa = PBXBuildFile; fileRef = B255989B0D00D8B800BB825C /* SVGResourceMaskerCg.mm */; };
     
    49494957                08FB84B10ECE373300DC064E /* WMLElementFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLElementFactory.h; sourceTree = "<group>"; };
    49504958                0A4844980CA44CB200B7BD48 /* SoftLinking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SoftLinking.h; sourceTree = "<group>"; };
     4959                0B8C56D30F28627F000502E1 /* HTTPHeaderMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTTPHeaderMap.cpp; sourceTree = "<group>"; };
     4960                0B9056150F2578BE0095FF6A /* DocumentThreadableLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DocumentThreadableLoader.cpp; sourceTree = "<group>"; };
     4961                0B9056160F2578BE0095FF6A /* DocumentThreadableLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DocumentThreadableLoader.h; sourceTree = "<group>"; };
     4962                0B9056170F2578BE0095FF6A /* ThreadableLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadableLoader.h; sourceTree = "<group>"; };
     4963                0B9056180F2578BE0095FF6A /* ThreadableLoaderClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadableLoaderClient.h; sourceTree = "<group>"; };
     4964                0B90561D0F257E930095FF6A /* ThreadableLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ThreadableLoader.cpp; sourceTree = "<group>"; };
    49514965                0BA5D3850F240FB4009B870B /* GenericWorkerTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GenericWorkerTask.h; sourceTree = "<group>"; };
    49524966                0F56028D0E4B76580065B038 /* RenderMarquee.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderMarquee.h; sourceTree = "<group>"; };
     
    66426656                85FF31580AAFBFCB00374F38 /* DOMKeyboardEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMKeyboardEvent.h; sourceTree = "<group>"; };
    66436657                85FF31590AAFBFCB00374F38 /* DOMKeyboardEvent.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMKeyboardEvent.mm; sourceTree = "<group>"; };
     6658                898D1FB20F27934B004BBAC7 /* CanvasPixelArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CanvasPixelArray.h; sourceTree = "<group>"; };
    66446659                929264760B61FC7200B41D34 /* JSDocumentCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSDocumentCustom.cpp; sourceTree = "<group>"; };
    66456660                9302B0BC0D79F82900C7EE83 /* PageGroup.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageGroup.cpp; sourceTree = "<group>"; };
     
    68816896                93F9B79F0BA6032600854064 /* JSCDATASection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCDATASection.h; sourceTree = "<group>"; };
    68826897                93FDAFC90B11307400E2746F /* EditorInsertAction.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = EditorInsertAction.h; sourceTree = "<group>"; };
     6898                A7094AF90F27AE6000596CEC /* CanvasPixelArray.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CanvasPixelArray.cpp; sourceTree = "<group>"; };
     6899                A7094AFB0F27AEE300596CEC /* CanvasPixelArray.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CanvasPixelArray.idl; sourceTree = "<group>"; };
    68836900                A718760D0B2A120100A16ECE /* DragActions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DragActions.h; sourceTree = "<group>"; };
    68846901                A718788F0B2D04AC00A16ECE /* DragControllerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DragControllerMac.mm; sourceTree = "<group>"; };
     
    79387955                B24055630B5BE640002A28C0 /* DOMSVGElementInstanceInternal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMSVGElementInstanceInternal.h; sourceTree = "<group>"; };
    79397956                B24055640B5BE640002A28C0 /* DOMSVGElementInstanceListInternal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMSVGElementInstanceListInternal.h; sourceTree = "<group>"; };
    7940                 B25598930D00D8B800BB825C /* SVGPaintServerCg.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGPaintServerCg.cpp; sourceTree = "<group>"; };
    79417957                B25598990D00D8B800BB825C /* SVGResourceFilterCg.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = SVGResourceFilterCg.mm; sourceTree = "<group>"; };
    79427958                B255989B0D00D8B800BB825C /* SVGResourceMaskerCg.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = SVGResourceMaskerCg.mm; sourceTree = "<group>"; };
     
    99029918                                085B92B80EFDE73D00E6123C /* FormDataBuilder.cpp */,
    99039919                                085B92B90EFDE73D00E6123C /* FormDataBuilder.h */,
     9920                                0B8C56D30F28627F000502E1 /* HTTPHeaderMap.cpp */,
    99049921                                514C765C0CE923A1007EF3CD /* HTTPHeaderMap.h */,
    99059922                                514C765D0CE923A1007EF3CD /* HTTPParsers.cpp */,
     
    1137411391                                93EEC1F209C2877700C515D1 /* CanvasPattern.h */,
    1137511392                                930CAB8F09C49F1B00229C04 /* CanvasPattern.idl */,
     11393                                A7094AF90F27AE6000596CEC /* CanvasPixelArray.cpp */,
     11394                                898D1FB20F27934B004BBAC7 /* CanvasPixelArray.h */,
     11395                                A7094AFB0F27AEE300596CEC /* CanvasPixelArray.idl */,
    1137611396                                93EEC1ED09C2877700C515D1 /* CanvasRenderingContext2D.cpp */,
    1137711397                                93EEC1EE09C2877700C515D1 /* CanvasRenderingContext2D.h */,
     
    1277212792                        isa = PBXGroup;
    1277312793                        children = (
    12774                                 B25598930D00D8B800BB825C /* SVGPaintServerCg.cpp */,
    1277512794                                B25598990D00D8B800BB825C /* SVGResourceFilterCg.mm */,
    1277612795                                B255989B0D00D8B800BB825C /* SVGResourceMaskerCg.mm */,
     
    1350013519                                93E227DB0AF589AD00D48324 /* DocumentLoader.cpp */,
    1350113520                                656D371E0ADBA5DE00A4554D /* DocumentLoader.h */,
     13521                                0B9056150F2578BE0095FF6A /* DocumentThreadableLoader.cpp */,
     13522                                0B9056160F2578BE0095FF6A /* DocumentThreadableLoader.h */,
    1350213523                                B255990D0D00D8B900BB825C /* EmptyClients.h */,
    1350313524                                51E4ADB20C42B4CF0042BC55 /* FTPDirectoryDocument.cpp */,
     
    1354113562                                F523D27802DE43D7018635CA /* TextResourceDecoder.cpp */,
    1354213563                                F523D27902DE43D7018635CA /* TextResourceDecoder.h */,
     13564                                0B90561D0F257E930095FF6A /* ThreadableLoader.cpp */,
     13565                                0B9056170F2578BE0095FF6A /* ThreadableLoader.h */,
     13566                                0B9056180F2578BE0095FF6A /* ThreadableLoaderClient.h */,
    1354313567                                7284ADDB0E6FEB31002EEFBD /* UserStyleSheetLoader.cpp */,
    1354413568                                7284ADDC0E6FEB31002EEFBD /* UserStyleSheetLoader.h */,
     
    1450814532                                93EEC20309C2877700C515D1 /* CanvasGradient.h in Headers */,
    1450914533                                93EEC20409C2877700C515D1 /* CanvasPattern.h in Headers */,
     14534                                898D1FB30F27934B004BBAC7 /* CanvasPixelArray.h in Headers */,
    1451014535                                93EEC20009C2877700C515D1 /* CanvasRenderingContext2D.h in Headers */,
    1451114536                                93EEC20109C2877700C515D1 /* CanvasStyle.h in Headers */,
     
    1530815333                                656D37360ADBA5DE00A4554D /* DocumentLoader.h in Headers */,
    1530915334                                ED2BA83C09A24B91006C0AC4 /* DocumentMarker.h in Headers */,
     15335                                0B90561A0F2578BF0095FF6A /* DocumentThreadableLoader.h in Headers */,
    1531015336                                A8185F3909765766005826D9 /* DocumentType.h in Headers */,
    1531115337                                A718760E0B2A120100A16ECE /* DragActions.h in Headers */,
     
    1642016446                                51DF6D7E0B92A16D00C2DC85 /* ThreadCheck.h in Headers */,
    1642116447                                E1FF57A30F01255B00891EBB /* ThreadGlobalData.h in Headers */,
     16448                                0B90561B0F2578BF0095FF6A /* ThreadableLoader.h in Headers */,
     16449                                0B90561C0F2578BF0095FF6A /* ThreadableLoaderClient.h in Headers */,
    1642216450                                E44613B00CD6331000FADA75 /* TimeRanges.h in Headers */,
    1642316451                                9305B24D098F1B6B00C28855 /* Timer.h in Headers */,
     
    1665516683                        buildActionMask = 2147483647;
    1665616684                        files = (
     16685                                A7094AFC0F27AEE300596CEC /* CanvasPixelArray.idl in Resources */,
    1665716686                                B25599480D00D8BA00BB825C /* WKArithmeticFilter.cikernel in Resources */,
    1665816687                                B255994B0D00D8BA00BB825C /* WKComponentMergeFilter.cikernel in Resources */,
     
    1695716986                                93EEC20209C2877700C515D1 /* CanvasGradient.cpp in Sources */,
    1695816987                                93EEC26F09C3218000C515D1 /* CanvasPattern.cpp in Sources */,
     16988                                A7094AFA0F27AE6000596CEC /* CanvasPixelArray.cpp in Sources */,
    1695916989                                93EEC1FF09C2877700C515D1 /* CanvasRenderingContext2D.cpp in Sources */,
    1696016990                                93EEC27109C3218800C515D1 /* CanvasStyle.cpp in Sources */,
     
    1727817308                                93E227E00AF589AD00D48324 /* DocumentLoader.cpp in Sources */,
    1727917309                                1C26497A0D7E248A00BD10F2 /* DocumentLoaderMac.cpp in Sources */,
     17310                                0B9056190F2578BE0095FF6A /* DocumentThreadableLoader.cpp in Sources */,
    1728017311                                A8185F3A09765766005826D9 /* DocumentType.cpp in Sources */,
    1728117312                                A7CA595E0B27BD9E00FA021D /* DragController.cpp in Sources */,
     
    1745817489                                E44613AA0CD6331000FADA75 /* HTMLVideoElement.cpp in Sources */,
    1745917490                                BCCD74E50A4C8DDF005FDA6D /* HTMLViewSourceDocument.cpp in Sources */,
     17491                                0B8C56D40F28627F000502E1 /* HTTPHeaderMap.cpp in Sources */,
    1746017492                                514C76720CE923A1007EF3CD /* HTTPParsers.cpp in Sources */,
    1746117493                                BC94D1530C275C8B006BC617 /* History.cpp in Sources */,
     
    1822418256                                B2227A530D00BF220071B782 /* SVGPaint.cpp in Sources */,
    1822518257                                B25599A60D00D8BA00BB825C /* SVGPaintServer.cpp in Sources */,
    18226                                 B255992F0D00D8BA00BB825C /* SVGPaintServerCg.cpp in Sources */,
    1822718258                                B25599A80D00D8BA00BB825C /* SVGPaintServerGradient.cpp in Sources */,
    1822818259                                B25599AA0D00D8BA00BB825C /* SVGPaintServerLinearGradient.cpp in Sources */,
     
    1840018431                                51DF6D800B92A18E00C2DC85 /* ThreadCheck.mm in Sources */,
    1840118432                                E1FF57A60F01256B00891EBB /* ThreadGlobalData.cpp in Sources */,
     18433                                0B90561E0F257E930095FF6A /* ThreadableLoader.cpp in Sources */,
    1840218434                                E44613AF0CD6331000FADA75 /* TimeRanges.cpp in Sources */,
    1840318435                                93309EA4099EB78C0056E581 /* Timer.cpp in Sources */,
  • trunk/WebCore/WebCoreSources.bkl

    r40086 r40124  
    522522        html/CanvasGradient.cpp
    523523        html/CanvasPattern.cpp
     524        html/CanvasPixelArray.cpp
    524525        html/CanvasRenderingContext2D.cpp
    525526        html/CanvasStyle.cpp
     
    635636        loader/DocLoader.cpp
    636637        loader/DocumentLoader.cpp
     638        loader/DocumentThreadableLoader.cpp
    637639        loader/FormState.cpp
    638640        loader/FrameLoader.cpp
     
    653655        loader/TextDocument.cpp
    654656        loader/TextResourceDecoder.cpp
     657        loader/ThreadableLoader.cpp
    655658        loader/loader.cpp
    656659    </set>
     
    785788        platform/network/AuthenticationChallengeBase.cpp
    786789        platform/network/Credential.cpp
     790        platform/network/HTTPHeaderMap.cpp
    787791        platform/network/HTTPParsers.cpp
    788792        platform/network/FormData.cpp
  • trunk/WebCore/bindings/js/JSImageDataCustom.cpp

    r40086 r40124  
    5050    DEFINE_STATIC_LOCAL(RefPtr<Structure>, cpaStructure, (JSByteArray::createStructure(jsNull())));
    5151    static const ClassInfo cpaClassInfo = { "CanvasPixelArray", 0, 0, 0 };
    52     wrapper->putDirect(dataName, new (exec) JSByteArray(exec, cpaStructure, imageData->data(), &cpaClassInfo), DontDelete | ReadOnly);
     52    wrapper->putDirect(dataName, new (exec) JSByteArray(exec, cpaStructure, imageData->data()->data(), &cpaClassInfo), DontDelete | ReadOnly);
    5353    exec->heap()->reportExtraMemoryCost(imageData->data()->length());
    5454   
  • trunk/WebCore/css/CSSComputedStyleDeclaration.cpp

    r40086 r40124  
    3737#include "Pair.h"
    3838#include "Rect.h"
    39 #include "RenderObject.h"
     39#include "RenderBox.h"
    4040#include "ShadowValue.h"
    4141#include "WebKitCSSTransformValue.h"
     
    396396static IntRect sizingBox(RenderObject* renderer)
    397397{
    398     return renderer->style()->boxSizing() == CONTENT_BOX ? renderer->contentBox() : renderer->borderBox();
     398    if (!renderer->isBox())
     399        return IntRect();
     400   
     401    RenderBox* box = RenderBox::toRenderBox(renderer);
     402    return box->style()->boxSizing() == CONTENT_BOX ? box->contentBoxRect() : box->borderBoxRect();
    399403}
    400404
  • trunk/WebCore/dom/ContainerNode.cpp

    r40086 r40124  
    3535#include "InlineTextBox.h"
    3636#include "MutationEvent.h"
     37#include "RenderBox.h"
    3738#include "RenderTheme.h"
    3839#include "RootInlineBox.h"
     
    692693            point = o->container()->localToAbsolute();
    693694            if (o->isText() && static_cast<RenderText *>(o)->firstTextBox()) {
    694                 point.move(static_cast<RenderText *>(o)->minXPos(),
     695                point.move(static_cast<RenderText *>(o)->boundingBoxX(),
    695696                           static_cast<RenderText *>(o)->firstTextBox()->root()->topOverflow());
    696             } else
    697                 point.move(o->xPos(), o->yPos());
     697            } else if (o->isBox()) {
     698                RenderBox* box = RenderBox::toRenderBox(o);
     699                point.move(box->x(), box->y());
     700            }
    698701            return true;
    699702        }
     
    718721    if (!o->isInline() || o->isReplaced())
    719722    {
     723        RenderBox* box = RenderBox::toRenderBox(o);
    720724        point = o->localToAbsolute();
    721         point.move(o->width(),
    722                    o->height() + o->borderTopExtra() + o->borderBottomExtra());
     725        point.move(box->width(),
     726                   box->height() + box->borderTopExtra() + box->borderBottomExtra());
    723727        return true;
    724728    }
     
    742746        if (o->isText() || o->isReplaced()) {
    743747            point = o->container()->localToAbsolute();
    744             int xOffset;
    745             if (o->isText())
    746                 xOffset = static_cast<RenderText *>(o)->minXPos() + o->width();
    747             else
    748                 xOffset = o->xPos() + o->width();
    749            
    750             point.move(xOffset, o->yPos() + o->height());
     748            if (o->isText()) {
     749                RenderText* text = static_cast<RenderText*>(o);
     750                point.move(text->boundingBoxX() + text->boundingBoxWidth(), text->boundingBoxHeight());
     751            } else {
     752                RenderBox* box = RenderBox::toRenderBox(o);
     753                point.move(box->x() + box->width(), box->y() + box->height());
     754            }
    751755            return true;
    752756        }
  • trunk/WebCore/dom/Element.cpp

    r40086 r40124  
    275275{
    276276    document()->updateLayoutIgnorePendingStylesheets();
    277     if (RenderObject* rend = renderer())
     277    if (RenderBox* rend = renderBox())
    278278        return adjustForLocalZoom(rend->offsetLeft(), rend);
    279279    return 0;
     
    283283{
    284284    document()->updateLayoutIgnorePendingStylesheets();
    285     if (RenderObject* rend = renderer())
     285    if (RenderBox* rend = renderBox())
    286286        return adjustForLocalZoom(rend->offsetTop(), rend);
    287287    return 0;
     
    291291{
    292292    document()->updateLayoutIgnorePendingStylesheets();
    293     if (RenderObject* rend = renderer())
     293    if (RenderBox* rend = renderBox())
    294294        return adjustForAbsoluteZoom(rend->offsetWidth(), rend);
    295295    return 0;
     
    299299{
    300300    document()->updateLayoutIgnorePendingStylesheets();
    301     if (RenderObject* rend = renderer())
     301    if (RenderBox* rend = renderBox())
    302302        return adjustForAbsoluteZoom(rend->offsetHeight(), rend);
    303303    return 0;
     
    307307{
    308308    document()->updateLayoutIgnorePendingStylesheets();
    309     if (RenderObject* rend = renderer())
     309    if (RenderBox* rend = renderBox())
    310310        if (RenderObject* offsetParent = rend->offsetParent())
    311311            return static_cast<Element*>(offsetParent->element());
     
    317317    document()->updateLayoutIgnorePendingStylesheets();
    318318
    319     if (RenderObject* rend = renderer())
     319    if (RenderBox* rend = renderBox())
    320320        return adjustForAbsoluteZoom(rend->clientLeft(), rend);
    321321    return 0;
     
    326326    document()->updateLayoutIgnorePendingStylesheets();
    327327
    328     if (RenderObject* rend = renderer())
     328    if (RenderBox* rend = renderBox())
    329329        return adjustForAbsoluteZoom(rend->clientTop(), rend);
    330330    return 0;
     
    345345   
    346346
    347     if (RenderObject* rend = renderer())
     347    if (RenderBox* rend = renderBox())
    348348        return adjustForAbsoluteZoom(rend->clientWidth(), rend);
    349349    return 0;
     
    364364    }
    365365   
    366     if (RenderObject* rend = renderer())
     366    if (RenderBox* rend = renderBox())
    367367        return adjustForAbsoluteZoom(rend->clientHeight(), rend);
    368368    return 0;
     
    372372{
    373373    document()->updateLayoutIgnorePendingStylesheets();
    374     if (RenderObject* rend = renderer())
     374    if (RenderBox* rend = renderBox())
    375375        return adjustForAbsoluteZoom(rend->scrollLeft(), rend);
    376376    return 0;
     
    380380{
    381381    document()->updateLayoutIgnorePendingStylesheets();
    382     if (RenderObject* rend = renderer())
     382    if (RenderBox* rend = renderBox())
    383383        return adjustForAbsoluteZoom(rend->scrollTop(), rend);
    384384    return 0;
     
    388388{
    389389    document()->updateLayoutIgnorePendingStylesheets();
    390     if (RenderObject* rend = renderer())
     390    if (RenderBox* rend = renderBox())
    391391        rend->setScrollLeft(static_cast<int>(newLeft * rend->style()->effectiveZoom()));
    392392}
     
    395395{
    396396    document()->updateLayoutIgnorePendingStylesheets();
    397     if (RenderObject* rend = renderer())
     397    if (RenderBox* rend = renderBox())
    398398        rend->setScrollTop(static_cast<int>(newTop * rend->style()->effectiveZoom()));
    399399}
     
    402402{
    403403    document()->updateLayoutIgnorePendingStylesheets();
    404     if (RenderObject* rend = renderer())
     404    if (RenderBox* rend = renderBox())
    405405        return adjustForAbsoluteZoom(rend->scrollWidth(), rend);
    406406    return 0;
     
    410410{
    411411    document()->updateLayoutIgnorePendingStylesheets();
    412     if (RenderObject* rend = renderer())
     412    if (RenderBox* rend = renderBox())
    413413        return adjustForAbsoluteZoom(rend->scrollHeight(), rend);
    414414    return 0;
  • trunk/WebCore/dom/Node.cpp

    r40086 r40124  
    577577}
    578578
     579RenderBox* Node::renderBox() const
     580{
     581    return m_renderer && m_renderer->isBox() ? static_cast<RenderBox*>(m_renderer) : 0;
     582}
     583
    579584IntRect Node::getRect() const
    580585{
    581586    // FIXME: broken with transforms
    582     if (renderer()) {
    583         FloatPoint absPos = renderer()->localToAbsolute();
    584         return IntRect(roundedIntPoint(absPos),
    585                        IntSize(renderer()->width(), renderer()->height() + renderer()->borderTopExtra() + renderer()->borderBottomExtra()));
    586     }
     587    if (renderer())
     588        return renderer()->absoluteBoundingBoxRect();
    587589    return IntRect();
    588590}
  • trunk/WebCore/dom/Node.h

    r40086 r40124  
    5353class QualifiedName;
    5454class RenderArena;
     55class RenderBox;
    5556class RenderObject;
    5657class RenderStyle;
     
    375376    void setRenderer(RenderObject* renderer) { m_renderer = renderer; }
    376377   
     378    // Use with caution. Does no type checking.  Mostly a convenience method for shadow nodes of form controls, where we know exactly
     379    // what kind of renderer we made.
     380    RenderBox* renderBox() const;
     381   
    377382    void checkSetPrefix(const AtomicString& prefix, ExceptionCode&);
    378383    bool isDescendantOf(const Node*) const;
  • trunk/WebCore/dom/Position.cpp

    r40086 r40124  
    285285   
    286286    // There is a VisiblePosition inside an empty inline-block container.
    287     return node->renderer()->isReplaced() && canHaveChildrenForEditing(node) && node->renderer()->height() != 0 && !node->firstChild();
     287    return node->renderer()->isReplaced() && canHaveChildrenForEditing(node) && RenderBox::toRenderBox(node->renderer())->height() != 0 && !node->firstChild();
    288288}
    289289
     
    537537    RenderObject* stop = renderer->nextInPreOrderAfterChildren();
    538538    for (RenderObject *o = renderer->firstChild(); o && o != stop; o = o->nextInPreOrder())
    539         if (o->element() && o->height())
    540             return true;
    541            
     539        if (o->element()) {
     540            if ((o->isText() && static_cast<RenderText*>(o)->boundingBoxHeight()) ||
     541                (o->isBox() && RenderBox::toRenderBox(o)->height()))
     542                return true;
     543        }
    542544    return false;
    543545}
     
    570572
    571573    if (!node()->hasTagName(htmlTag) && renderer->isBlockFlow() && !hasRenderedNonAnonymousDescendantsWithHeight(renderer) &&
    572        (renderer->height() || node()->hasTagName(bodyTag)))
     574       (RenderBox::toRenderBox(renderer)->height() || node()->hasTagName(bodyTag)))
    573575        return offset() == 0 && !nodeIsUserSelectNone(node());
    574576   
  • trunk/WebCore/dom/PositionIterator.cpp

    r40086 r40124  
    2828
    2929#include "Node.h"
    30 #include "RenderObject.h"
     30#include "RenderBlock.h"
    3131#include "htmlediting.h"
    3232
     
    152152
    153153    if (!m_parent->hasTagName(htmlTag) && renderer->isBlockFlow() && !Position::hasRenderedNonAnonymousDescendantsWithHeight(renderer) &&
    154        (renderer->height() || m_parent->hasTagName(bodyTag)))
     154       (static_cast<RenderBlock*>(renderer)->height() || m_parent->hasTagName(bodyTag)))
    155155        return atStartOfNode() && !Position::nodeIsUserSelectNone(m_parent);
    156156   
  • trunk/WebCore/dom/ScriptElement.cpp

    r40086 r40124  
    3030#include "Frame.h"
    3131#include "FrameLoader.h"
     32#include "HTMLNames.h"
     33#include "HTMLScriptElement.h"
    3234#include "MIMETypeRegistry.h"
    3335#include "ScriptController.h"
     
    3739#include "Text.h"
    3840#include <wtf/StdLibExtras.h>
     41
     42#if ENABLE(SVG)
     43#include "SVGNames.h"
     44#include "SVGScriptElement.h"
     45#endif
    3946
    4047namespace WebCore {
     
    270277}
    271278
    272 }
     279ScriptElement* toScriptElement(Element* element)
     280{
     281    if (element->isHTMLElement() && element->hasTagName(HTMLNames::scriptTag))
     282        return static_cast<HTMLScriptElement*>(element);
     283
     284#if ENABLE(SVG)
     285    if (element->isSVGElement() && element->hasTagName(SVGNames::scriptTag))
     286        return static_cast<SVGScriptElement*>(element);
     287#endif
     288
     289    return 0;
     290}
     291
     292}
  • trunk/WebCore/dom/ScriptElement.h

    r40086 r40124  
    9494};
    9595
     96ScriptElement* toScriptElement(Element*);
     97
    9698}
    9799
  • trunk/WebCore/dom/XMLTokenizer.cpp

    r40086 r40124  
    4040#include "HTMLLinkElement.h"
    4141#include "HTMLNames.h"
    42 #include "HTMLScriptElement.h"
    4342#include "HTMLStyleElement.h"
    4443#include "ProcessingInstruction.h"
     
    4847#include "ResourceResponse.h"
    4948#include "ScriptController.h"
     49#include "ScriptElement.h"
    5050#include "ScriptSourceCode.h"
    5151#include "ScriptValue.h"
     
    5858#if ENABLE(SVG)
    5959#include "SVGNames.h"
    60 #include "SVGScriptElement.h"
    6160#include "SVGStyleElement.h"
    6261#endif
     
    6766
    6867const int maxErrors = 25;
    69 
    70 bool isScriptElement(Element* element)
    71 {
    72     return element->hasTagName(HTMLNames::scriptTag)
    73 #if ENABLE(SVG)
    74         || element->hasTagName(SVGNames::scriptTag)
    75 #endif
    76         ;
    77 }
    78 
    79 ScriptElement* castToScriptElement(Element* element)
    80 {
    81     ASSERT(isScriptElement(element));
    82 
    83     if (element->hasTagName(HTMLNames::scriptTag))
    84         return static_cast<HTMLScriptElement*>(element);
    85 
    86 #if ENABLE(SVG)
    87     if (element->hasTagName(SVGNames::scriptTag))
    88         return static_cast<SVGScriptElement*>(element);
    89 #endif
    90 
    91     ASSERT_NOT_REACHED();
    92     return 0;
    93 }
    9468
    9569#if ENABLE(WML)
     
    316290    m_scriptElement = 0;
    317291
    318     ScriptElement* scriptElement = castToScriptElement(e.get());
     292    ScriptElement* scriptElement = toScriptElement(e.get());
    319293    ASSERT(scriptElement);
    320294
  • trunk/WebCore/dom/XMLTokenizer.h

    r40086 r40124  
    180180bool parseXMLDocumentFragment(const String&, DocumentFragment*, Element* parent = 0);
    181181
    182 bool isScriptElement(Element*);
    183 ScriptElement* castToScriptElement(Element*);
    184 
    185182} // namespace WebCore
    186183
  • trunk/WebCore/dom/XMLTokenizerLibxml2.cpp

    r40086 r40124  
    752752    newElement->beginParsingChildren();
    753753
    754     if (isScriptElement(newElement.get()))
     754    ScriptElement* scriptElement = toScriptElement(newElement.get());
     755    if (scriptElement)
    755756        m_scriptStartLine = lineNumber();
    756757
     
    780781    RefPtr<Node> parent = n->parentNode();
    781782    n->finishParsingChildren();
    782    
     783
     784    if (!n->isElementNode() || !m_view) {
     785        setCurrentNode(parent.get());
     786        return;
     787    }
     788
     789    Element* element = static_cast<Element*>(n);
     790    ScriptElement* scriptElement = toScriptElement(element);
     791    if (!scriptElement) {
     792        setCurrentNode(parent.get());
     793        return;
     794    }
     795
    783796    // don't load external scripts for standalone documents (for now)
    784     if (n->isElementNode() && m_view && isScriptElement(static_cast<Element*>(n))) {
    785         ASSERT(!m_pendingScript);
    786         m_requestingScript = true;
    787 
    788         Element* element = static_cast<Element*>(n);
    789         ScriptElement* scriptElement = castToScriptElement(element);
    790 
    791         String scriptHref = scriptElement->sourceAttributeValue();
    792         if (!scriptHref.isEmpty()) {
    793             // we have a src attribute
    794             String scriptCharset = scriptElement->scriptCharset();
    795             if ((m_pendingScript = m_doc->docLoader()->requestScript(scriptHref, scriptCharset))) {
    796                 m_scriptElement = element;
    797                 m_pendingScript->addClient(this);
    798 
    799                 // m_pendingScript will be 0 if script was already loaded and ref() executed it
    800                 if (m_pendingScript)
    801                     pauseParsing();
    802             } else
    803                 m_scriptElement = 0;
    804         } else
    805             m_view->frame()->loader()->executeScript(ScriptSourceCode(scriptElement->scriptContent(), m_doc->url(), m_scriptStartLine));
    806 
    807         m_requestingScript = false;
    808     }
    809 
     797    ASSERT(!m_pendingScript);
     798    m_requestingScript = true;
     799
     800    String scriptHref = scriptElement->sourceAttributeValue();
     801    if (!scriptHref.isEmpty()) {
     802        // we have a src attribute
     803        String scriptCharset = scriptElement->scriptCharset();
     804        if ((m_pendingScript = m_doc->docLoader()->requestScript(scriptHref, scriptCharset))) {
     805            m_scriptElement = element;
     806            m_pendingScript->addClient(this);
     807
     808            // m_pendingScript will be 0 if script was already loaded and ref() executed it
     809            if (m_pendingScript)
     810                pauseParsing();
     811        } else
     812            m_scriptElement = 0;
     813    } else
     814        m_view->frame()->loader()->executeScript(ScriptSourceCode(scriptElement->scriptContent(), m_doc->url(), m_scriptStartLine));
     815
     816    m_requestingScript = false;
    810817    setCurrentNode(parent.get());
    811818}
  • trunk/WebCore/dom/XMLTokenizerQt.cpp

    r40086 r40124  
    541541    }
    542542
    543     if (isScriptElement(newElement.get()))
     543    ScriptElement* scriptElement = toScriptElement(newElement.get());
     544    if (scriptElement)
    544545        m_scriptStartLine = lineNumber();
    545546
     
    562563    n->finishParsingChildren();
    563564
     565    if (!n->isElementNode() || !m_view) {
     566        setCurrentNode(parent.get());
     567        return;
     568    }
     569
     570    Element* element = static_cast<Element*>(n);
     571    ScriptElement* scriptElement = toScriptElement(element);
     572    if (!scriptElement) {
     573        setCurrentNode(parent.get());
     574        return;
     575    }
     576
    564577    // don't load external scripts for standalone documents (for now)
    565     if (n->isElementNode() && m_view && isScriptElement(static_cast<Element*>(n))) {
    566         ASSERT(!m_pendingScript);
    567         m_requestingScript = true;
    568 
    569         Element* element = static_cast<Element*>(n);
    570         ScriptElement* scriptElement = castToScriptElement(element);
    571 
    572         String scriptHref = scriptElement->sourceAttributeValue();
    573         if (!scriptHref.isEmpty()) {
    574             // we have a src attribute
    575             String scriptCharset = scriptElement->scriptCharset();
    576             if ((m_pendingScript = m_doc->docLoader()->requestScript(scriptHref, scriptCharset))) {
    577                 m_scriptElement = element;
    578                 m_pendingScript->addClient(this);
    579 
    580                 // m_pendingScript will be 0 if script was already loaded and ref() executed it
    581                 if (m_pendingScript)
    582                     pauseParsing();
    583             } else
    584                 m_scriptElement = 0;
    585         } else
    586             m_view->frame()->loader()->executeScript(ScriptSourceCode(scriptElement->scriptContent(), m_doc->url(), m_scriptStartLine));
    587 
    588         m_requestingScript = false;
    589     }
    590 
     578    ASSERT(!m_pendingScript);
     579    m_requestingScript = true;
     580
     581    String scriptHref = scriptElement->sourceAttributeValue();
     582    if (!scriptHref.isEmpty()) {
     583        // we have a src attribute
     584        String scriptCharset = scriptElement->scriptCharset();
     585        if ((m_pendingScript = m_doc->docLoader()->requestScript(scriptHref, scriptCharset))) {
     586            m_scriptElement = element;
     587            m_pendingScript->addClient(this);
     588
     589            // m_pendingScript will be 0 if script was already loaded and ref() executed it
     590            if (m_pendingScript)
     591                pauseParsing();
     592        } else
     593            m_scriptElement = 0;
     594    } else
     595        m_view->frame()->loader()->executeScript(ScriptSourceCode(scriptElement->scriptContent(), m_doc->url(), m_scriptStartLine));
     596
     597    m_requestingScript = false;
    591598    setCurrentNode(parent.get());
    592599}
  • trunk/WebCore/editing/ApplyStyleCommand.cpp

    r40086 r40124  
    5353    enum ELegacyHTMLStyles { DoNotUseLegacyHTMLStyles, UseLegacyHTMLStyles };
    5454
    55     explicit StyleChange(CSSStyleDeclaration *, ELegacyHTMLStyles usesLegacyStyles=UseLegacyHTMLStyles);
    56     StyleChange(CSSStyleDeclaration *, const Position &, ELegacyHTMLStyles usesLegacyStyles=UseLegacyHTMLStyles);
     55    explicit StyleChange(CSSStyleDeclaration*, ELegacyHTMLStyles usesLegacyStyles=UseLegacyHTMLStyles);
     56    StyleChange(CSSStyleDeclaration*, const Position&, ELegacyHTMLStyles usesLegacyStyles=UseLegacyHTMLStyles);
    5757
    5858    static ELegacyHTMLStyles styleModeForParseMode(bool);
     
    6161    bool applyBold() const { return m_applyBold; }
    6262    bool applyItalic() const { return m_applyItalic; }
     63    bool applySubscript() const { return m_applySubscript; }
     64    bool applySuperscript() const { return m_applySuperscript; }
    6365    bool applyFontColor() const { return m_applyFontColor.length() > 0; }
    6466    bool applyFontFace() const { return m_applyFontFace.length() > 0; }
     
    7274
    7375private:
    74     void init(PassRefPtr<CSSStyleDeclaration>, const Position &);
    75     bool checkForLegacyHTMLStyleChange(const CSSProperty *);
    76     static bool currentlyHasStyle(const Position &, const CSSProperty *);
     76    void init(PassRefPtr<CSSStyleDeclaration>, const Position&);
     77    bool checkForLegacyHTMLStyleChange(const CSSProperty*);
     78    static bool currentlyHasStyle(const Position&, const CSSProperty*);
    7779   
    7880    String m_cssStyle;
    7981    bool m_applyBold;
    8082    bool m_applyItalic;
     83    bool m_applySubscript;
     84    bool m_applySuperscript;
    8185    String m_applyFontColor;
    8286    String m_applyFontFace;
     
    8791
    8892
    89 StyleChange::StyleChange(CSSStyleDeclaration *style, ELegacyHTMLStyles usesLegacyStyles)
    90     : m_applyBold(false), m_applyItalic(false), m_usesLegacyStyles(usesLegacyStyles)
     93StyleChange::StyleChange(CSSStyleDeclaration* style, ELegacyHTMLStyles usesLegacyStyles)
     94    : m_applyBold(false)
     95    , m_applyItalic(false)
     96    , m_applySubscript(false)
     97    , m_applySuperscript(false)
     98    , m_usesLegacyStyles(usesLegacyStyles)
    9199{
    92100    init(style, Position());
    93101}
    94102
    95 StyleChange::StyleChange(CSSStyleDeclaration *style, const Position &position, ELegacyHTMLStyles usesLegacyStyles)
    96     : m_applyBold(false), m_applyItalic(false), m_usesLegacyStyles(usesLegacyStyles)
     103StyleChange::StyleChange(CSSStyleDeclaration* style, const Position& position, ELegacyHTMLStyles usesLegacyStyles)
     104    : m_applyBold(false)
     105    , m_applyItalic(false)
     106    , m_applySubscript(false)
     107    , m_applySuperscript(false)
     108    , m_usesLegacyStyles(usesLegacyStyles)
    97109{
    98110    init(style, position);
     
    133145        if (property->id() == CSSPropertyWebkitTextDecorationsInEffect) {
    134146            // we have to special-case text decorations
     147            // FIXME: Why?
    135148            CSSProperty alteredProperty(CSSPropertyTextDecoration, property->value(), property->isImportant());
    136149            styleText += alteredProperty.cssText();
     
    153166}
    154167
    155 bool StyleChange::checkForLegacyHTMLStyleChange(const CSSProperty *property)
    156 {
    157     if (!property || !property->value()) {
     168// This function is the mapping from CSS styles to styling tags (like font-weight: bold to <b>)
     169bool StyleChange::checkForLegacyHTMLStyleChange(const CSSProperty* property)
     170{
     171    if (!property || !property->value())
    158172        return false;
    159     }
    160173   
    161174    String valueText(property->value()->cssText());
     
    164177            if (equalIgnoringCase(valueText, "bold")) {
    165178                m_applyBold = true;
     179                return true;
     180            }
     181            break;
     182        case CSSPropertyVerticalAlign:
     183            if (equalIgnoringCase(valueText, "sub")) {
     184                m_applySubscript = true;
     185                return true;
     186            }
     187            if (equalIgnoringCase(valueText, "super")) {
     188                m_applySuperscript = true;
    166189                return true;
    167190            }
     
    266289static PassRefPtr<Element> createFontElement(Document* document)
    267290{
    268     ExceptionCode ec = 0;
    269     RefPtr<Element> fontNode = document->createElementNS(xhtmlNamespaceURI, "font", ec);
    270     ASSERT(ec == 0);
     291    RefPtr<Element> fontNode = createHTMLElement(document, fontTag);
    271292    fontNode->setAttribute(classAttr, styleSpanClassString());
    272293    return fontNode.release();
     
    275296PassRefPtr<HTMLElement> createStyleSpanElement(Document* document)
    276297{
    277     RefPtr<HTMLElement> styleElement = new HTMLElement(spanTag, document);
     298    RefPtr<HTMLElement> styleElement = createHTMLElement(document, spanTag);
    278299    styleElement->setAttribute(classAttr, styleSpanClassString());
    279300    return styleElement.release();
     
    915936}
    916937
    917 bool ApplyStyleCommand::isHTMLStyleNode(CSSMutableStyleDeclaration *style, HTMLElement *elem)
     938// This function maps from styling tags to CSS styles.  Used for knowing which
     939// styling tags should be removed when toggling styles.
     940bool ApplyStyleCommand::isHTMLStyleNode(CSSMutableStyleDeclaration* style, HTMLElement* elem)
    918941{
    919942    CSSMutableStyleDeclaration::const_iterator end = style->end();
    920943    for (CSSMutableStyleDeclaration::const_iterator it = style->begin(); it != end; ++it) {
    921944        switch ((*it).id()) {
    922             case CSSPropertyFontWeight:
    923                 if (elem->hasLocalName(bTag))
    924                     return true;
    925                 break;
    926             case CSSPropertyFontStyle:
    927                 if (elem->hasLocalName(iTag))
    928                     return true;
     945        case CSSPropertyFontWeight:
     946            if (elem->hasLocalName(bTag))
     947                return true;
     948            break;
     949        case CSSPropertyVerticalAlign:
     950            if (elem->hasLocalName(subTag) || elem->hasLocalName(supTag))
     951                return true;
     952            break;
     953        case CSSPropertyFontStyle:
     954            if (elem->hasLocalName(iTag))
     955                return true;
    929956        }
    930957    }
     
    9871014}
    9881015
    989 void ApplyStyleCommand::removeCSSStyle(CSSMutableStyleDeclaration *style, HTMLElement *elem)
     1016void ApplyStyleCommand::removeCSSStyle(CSSMutableStyleDeclaration* style, HTMLElement* elem)
    9901017{
    9911018    ASSERT(style);
    9921019    ASSERT(elem);
    9931020
    994     CSSMutableStyleDeclaration *decl = elem->inlineStyleDecl();
     1021    CSSMutableStyleDeclaration* decl = elem->inlineStyleDecl();
    9951022    if (!decl)
    9961023        return;
     
    10061033        }
    10071034    }
     1035
     1036    // No need to serialize <foo style=""> if we just removed the last css property
     1037    if (decl->length() == 0)
     1038        removeNodeAttribute(elem, styleAttr);
    10081039
    10091040    if (isUnstyledStyleSpan(elem))
     
    14971528    if (m_removeOnly)
    14981529        return;
    1499        
     1530
    15001531    StyleChange styleChange(style, Position(startNode, 0), StyleChange::styleModeForParseMode(document()->inCompatMode()));
    1501     ExceptionCode ec = 0;
    1502    
     1532
    15031533    //
    15041534    // Font tags need to go outside of CSS so that CSS font sizes override leagcy font sizes.
     
    15061536    if (styleChange.applyFontColor() || styleChange.applyFontFace() || styleChange.applyFontSize()) {
    15071537        RefPtr<Element> fontElement = createFontElement(document());
    1508         ASSERT(ec == 0);
    15091538        RenderStyle* computedStyle = startNode->computedStyle();
    15101539
     
    15321561
    15331562    if (styleChange.applyBold())
    1534         surroundNodeRangeWithElement(startNode, endNode, document()->createElementNS(xhtmlNamespaceURI, "b", ec));
     1563        surroundNodeRangeWithElement(startNode, endNode, createHTMLElement(document(), bTag));
    15351564
    15361565    if (styleChange.applyItalic())
    1537         surroundNodeRangeWithElement(startNode, endNode, document()->createElementNS(xhtmlNamespaceURI, "i", ec));
    1538    
     1566        surroundNodeRangeWithElement(startNode, endNode, createHTMLElement(document(), iTag));
     1567
     1568    if (styleChange.applySubscript())
     1569        surroundNodeRangeWithElement(startNode, endNode, createHTMLElement(document(), subTag));
     1570    else if (styleChange.applySuperscript())
     1571        surroundNodeRangeWithElement(startNode, endNode, createHTMLElement(document(), supTag));
     1572
    15391573    if (m_styledInlineElement)
    15401574        surroundNodeRangeWithElement(startNode, endNode, m_styledInlineElement->cloneElement());
  • trunk/WebCore/editing/CompositeEditCommand.cpp

    r40086 r40124  
    5252#include "RemoveNodePreservingChildrenCommand.h"
    5353#include "ReplaceSelectionCommand.h"
     54#include "RenderBlock.h"
    5455#include "SetNodeAttributeCommand.h"
    5556#include "SplitElementCommand.h"
     
    357358void CompositeEditCommand::removeNodeAttribute(PassRefPtr<Element> element, const QualifiedName& attribute)
    358359{
    359     setNodeAttribute(element, attribute, AtomicString());;
     360    setNodeAttribute(element, attribute, AtomicString());
    360361}
    361362
     
    591592    // append the placeholder to make sure it follows
    592593    // any unrendered blocks
    593     if (renderer->height() == 0 || (renderer->isListItem() && renderer->isEmpty()))
     594    RenderBlock* block = static_cast<RenderBlock*>(renderer);
     595    if (block->height() == 0 || (block->isListItem() && block->isEmpty()))
    594596        return appendBlockPlaceholder(container);
    595597
  • trunk/WebCore/editing/DeleteButtonController.cpp

    r40086 r40124  
    4343#include "Range.h"
    4444#include "RemoveNodeCommand.h"
    45 #include "RenderObject.h"
     45#include "RenderBox.h"
    4646#include "SelectionController.h"
    4747
     
    7272
    7373    RenderObject* renderer = node->renderer();
    74     if (!renderer || renderer->width() < minimumWidth || renderer->height() < minimumHeight)
     74    if (!renderer || !renderer->isBox())
     75        return false;
     76
     77    RenderBox* box = RenderBox::toRenderBox(renderer);
     78    if (box->width() < minimumWidth || box->height() < minimumHeight)
    7579        return false;
    7680
  • trunk/WebCore/editing/DeleteSelectionCommand.cpp

    r40086 r40124  
    3939#include "HTMLNames.h"
    4040#include "markup.h"
     41#include "RenderTableCell.h"
    4142#include "ReplaceSelectionCommand.h"
    4243#include "Text.h"
     
    358359        updateLayout();
    359360        RenderObject *r = node->renderer();
    360         if (r && r->isTableCell() && r->contentHeight() <= 0)
     361        if (r && r->isTableCell() && static_cast<RenderTableCell*>(r)->contentHeight() <= 0)
    361362            insertBlockPlaceholder(Position(node,0));
    362363        return;
  • trunk/WebCore/editing/Editor.cpp

    r40086 r40124  
    20722072
    20732073    IntRect rectInPageCoords = container->getOverflowClipRect(0, 0);
    2074     IntRect rectInFrameCoords = IntRect(renderer->xPos() * -1, renderer->yPos() * -1,
     2074    IntRect rectInFrameCoords = IntRect(renderer->x() * -1, renderer->y() * -1,
    20752075                                    rectInPageCoords.width(), rectInPageCoords.height());
    20762076
     
    20982098
    20992099    IntRect rectInPageCoords = container->getOverflowClipRect(0, 0);
    2100     IntRect rectInFrameCoords = IntRect(renderer->xPos() * -1, renderer->yPos() * -1,
     2100    IntRect rectInFrameCoords = IntRect(renderer->x() * -1, renderer->y() * -1,
    21012101                                    rectInPageCoords.width(), rectInPageCoords.height());
    21022102    IntRect resultRect = range->boundingBox();
  • trunk/WebCore/editing/EditorCommand.cpp

    r40086 r40124  
    226226        return 0;
    227227    RenderObject* renderer = focusedNode->renderer();
    228     if (!renderer)
     228    if (!renderer || !renderer->isBox())
    229229        return 0;
    230230    RenderStyle* style = renderer->style();
     
    233233    if (!(style->overflowY() == OSCROLL || style->overflowY() == OAUTO || renderer->isTextArea()))
    234234        return 0;
    235     int height = renderer->clientHeight();
     235    int height = RenderBox::toRenderBox(renderer)->clientHeight();
    236236    return max((height + 1) / 2, height - cAmountToKeepWhenPaging);
    237237}
     
    917917static bool executeSubscript(Frame* frame, Event*, EditorCommandSource source, const String&)
    918918{
    919     return executeApplyStyle(frame, source, EditActionSubscript, CSSPropertyVerticalAlign, "sub");
     919    return executeToggleStyle(frame, source, EditActionSubscript, CSSPropertyVerticalAlign, "baseline", "sub");
    920920}
    921921
    922922static bool executeSuperscript(Frame* frame, Event*, EditorCommandSource source, const String&)
    923923{
    924     return executeApplyStyle(frame, source, EditActionSuperscript, CSSPropertyVerticalAlign, "super");
     924    return executeToggleStyle(frame, source, EditActionSuperscript, CSSPropertyVerticalAlign, "baseline", "super");
    925925}
    926926
  • trunk/WebCore/editing/htmlediting.cpp

    r40086 r40124  
    786786}
    787787
     788PassRefPtr<HTMLElement> createHTMLElement(Document* document, const QualifiedName& name)
     789{
     790    return HTMLElementFactory::createHTMLElement(name, document, 0, false);
     791}
     792
    788793PassRefPtr<HTMLElement> createHTMLElement(Document* document, const AtomicString& tagName)
    789794{
    790     return HTMLElementFactory::createHTMLElement(QualifiedName(nullAtom, tagName, xhtmlNamespaceURI), document, 0, false);
     795    return createHTMLElement(document, QualifiedName(nullAtom, tagName, xhtmlNamespaceURI));
    791796}
    792797
  • trunk/WebCore/editing/htmlediting.h

    r40086 r40124  
    8383PassRefPtr<HTMLElement> createUnorderedListElement(Document*);
    8484PassRefPtr<HTMLElement> createListItemElement(Document*);
     85PassRefPtr<HTMLElement> createHTMLElement(Document*, const QualifiedName&);
    8586PassRefPtr<HTMLElement> createHTMLElement(Document*, const AtomicString&);
    8687
  • trunk/WebCore/html/CanvasRenderingContext2D.cpp

    r40086 r40124  
    11711171static PassRefPtr<ImageData> createEmptyImageData(const IntSize& size)
    11721172{
    1173     PassRefPtr<ImageData> data = ImageData::create(size.width(), size.height());
    1174     memset(data->data()->data(), 0, data->data()->length());
    1175     return data;
     1173    RefPtr<ImageData> data = ImageData::create(size.width(), size.height());
     1174    memset(data->data()->data()->data(), 0, data->data()->data()->length());
     1175    return data.get();
    11761176}
    11771177
  • trunk/WebCore/html/HTMLAnchorElement.cpp

    r40086 r40124  
    108108        return false;
    109109
    110     if (!renderer())
     110    if (!renderer() || !renderer()->isBox())
    111111        return false;
    112112   
     
    114114    // or one of the continuations is non-empty, since this is a faster check and
    115115    // almost always returns true.
    116     for (RenderObject* r = renderer(); r; r = r->virtualContinuation())
     116    RenderBox* box = RenderBox::toRenderBox(renderer());
     117    if (box->width() > 0 && box->height() > 0)
     118        return true;
     119    for (RenderFlow* r = box->virtualContinuation(); r; r = r->continuation())
    117120        if (r->width() > 0 && r->height() > 0)
    118121            return true;
  • trunk/WebCore/html/HTMLCanvasElement.cpp

    r40086 r40124  
    156156    m_imageBuffer->clearImage();
    157157   
    158     if (RenderObject* ro = renderer()) {
    159         FloatRect destRect = ro->contentBox();
     158    if (RenderBox* ro = renderBox()) {
     159        FloatRect destRect = ro->contentBoxRect();
    160160        FloatRect r = mapRect(rect, FloatRect(0, 0, m_size.width(), m_size.height()), destRect);
    161161        r.intersect(destRect);
  • trunk/WebCore/html/HTMLFormControlElement.cpp

    r40086 r40124  
    200200    if (disabled() || !renderer() ||
    201201        (renderer()->style() && renderer()->style()->visibility() != VISIBLE) ||
    202         renderer()->width() == 0 || renderer()->height() == 0)
     202        !renderer()->isBox() || RenderBox::toRenderBox(renderer())->size().isEmpty())
    203203        return false;
    204204    return true;
  • trunk/WebCore/html/HTMLFrameElementBase.cpp

    r40086 r40124  
    312312   
    313313    document()->updateLayoutIgnorePendingStylesheets();
    314     return renderer()->width();
     314    return RenderBox::toRenderBox(renderer())->width();
    315315}
    316316
     
    321321   
    322322    document()->updateLayoutIgnorePendingStylesheets();
    323     return renderer()->height();
     323    return RenderBox::toRenderBox(renderer())->height();
    324324}
    325325
  • trunk/WebCore/html/HTMLImageElement.cpp

    r40086 r40124  
    227227        document()->updateLayout();
    228228
    229     return renderer() ? renderer()->contentWidth() : 0;
     229    return renderBox() ? renderBox()->contentWidth() : 0;
    230230}
    231231
     
    251251        document()->updateLayout();
    252252
    253     return renderer() ? renderer()->contentHeight() : 0;
     253    return renderBox() ? renderBox()->contentHeight() : 0;
    254254}
    255255
  • trunk/WebCore/html/ImageData.cpp

    r40086 r40124  
    3030#include "ImageData.h"
    3131
    32 using namespace WTF;
    33 
    3432namespace WebCore {
    3533
     
    4240    : m_width(width)
    4341    , m_height(height)
    44     , m_data(ByteArray::create(width * height * 4))
     42    , m_data(CanvasPixelArray::create(width * height * 4))
    4543{
    4644}
  • trunk/WebCore/html/ImageData.h

    r40086 r40124  
    11/*
    2  * Copyright (C) 2008 Apple Inc. All rights reserved.
     2 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3030#define ImageData_h
    3131
    32 #include <wtf/ByteArray.h>
     32#include "CanvasPixelArray.h"
    3333#include <wtf/RefCounted.h>
    3434#include <wtf/RefPtr.h>
     
    4242        unsigned width() const { return m_width; }
    4343        unsigned height() const { return m_height; }
    44         WTF::ByteArray* data() const { return m_data.get(); }
     44        CanvasPixelArray* data() const { return m_data.get(); }
    4545
    4646    private:
     
    4848        unsigned m_width;
    4949        unsigned m_height;
    50         RefPtr<WTF::ByteArray> m_data;
     50        RefPtr<CanvasPixelArray> m_data;
    5151    };
    5252
  • trunk/WebCore/html/ImageData.idl

    r40086 r40124  
    11/*
    2  * Copyright (C) 2008 Apple Inc. All rights reserved.
     2 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3535        readonly attribute long width;
    3636        readonly attribute long height;
     37#if !defined(LANGUAGE_JAVASCRIPT) || defined(V8_BINDING)
     38        readonly attribute CanvasPixelArray data;
     39#endif
    3740    };
    3841
  • trunk/WebCore/inspector/InspectorController.cpp

    r40086 r40124  
    27612761        return;
    27622762
    2763     RenderObject* renderer = m_highlightedNode->renderer();
     2763    RenderBox* renderer = m_highlightedNode->renderBox();
    27642764    Frame* containingFrame = m_highlightedNode->document()->frame();
    27652765    if (!renderer || !containingFrame)
    27662766        return;
    27672767
    2768     IntRect contentBox = renderer->contentBox();
     2768    IntRect contentBox = renderer->contentBoxRect();
    27692769
    27702770    // FIXME: Should we add methods to RenderObject to obtain these rects?
  • trunk/WebCore/loader/SubresourceLoaderClient.h

    r40086 r40124  
    4747
    4848    virtual void didReceiveResponse(SubresourceLoader*, const ResourceResponse&) { }
    49     virtual void didReceiveData(SubresourceLoader*, const char*, int) { }
     49    virtual void didReceiveData(SubresourceLoader*, const char*, int /*lengthReceived*/) { }
    5050    virtual void didFinishLoading(SubresourceLoader*) { }
    5151    virtual void didFail(SubresourceLoader*, const ResourceError&) { }
  • trunk/WebCore/page/AccessibilityObject.cpp

    r40086 r40124  
    10291029}
    10301030
     1031void AccessibilityObject::updateBackingStore()
     1032{
     1033}
     1034   
    10311035} // namespace WebCore
  • trunk/WebCore/page/AccessibilityObject.h

    r40086 r40124  
    401401#endif
    402402
     403    // allows for an AccessibilityObject to update its render tree or perform
     404    // other operations update type operations
     405    virtual void updateBackingStore();
     406   
    403407protected:
    404408    unsigned m_id;
  • trunk/WebCore/page/AccessibilityRenderObject.cpp

    r40086 r40124  
    11781178       
    11791179        // check for one-dimensional image
    1180         if (m_renderer->height() <= 1 || m_renderer->width() <= 1)
     1180        RenderImage* image = static_cast<RenderImage*>(m_renderer);
     1181        if (image->height() <= 1 || image->width() <= 1)
    11811182            return true;
    11821183       
    11831184        // check whether rendered image was stretched from one-dimensional file image
    11841185        if (isNativeImage()) {
    1185             RenderImage* image = static_cast<RenderImage*>(m_renderer);
    11861186            if (image->cachedImage()) {
    11871187                IntSize imageSize = image->cachedImage()->imageSize(image->view()->zoomFactor());
     
    22162216void AccessibilityRenderObject::childrenChanged()
    22172217{
    2218     clearChildren();
    2219    
    2220     if (accessibilityIsIgnored()) {
    2221         AccessibilityObject* parent = parentObject();
    2222         if (parent)
    2223             parent->childrenChanged();
     2218    // this method is meant as a quick way of marking dirty
     2219    // a portion of the accessibility tree
     2220   
     2221    markChildrenDirty();
     2222   
     2223    // this object may not be accessible (and thus may not appear
     2224    // in the hierarchy), which means we need to go up the parent
     2225    // chain and mark the parent's dirty. Ideally, we would want
     2226    // to only access the next object that is not ignored, but
     2227    // asking an element if it's ignored can lead to an examination of the
     2228    // render tree which is dangerous.
     2229    for (AccessibilityObject* parent = parentObject(); parent; parent = parent->parentObject()) {
     2230        if (parent->isAccessibilityRenderObject())
     2231            static_cast<AccessibilityRenderObject *>(parent)->markChildrenDirty();
    22242232    }
    22252233}
     
    22452253const AccessibilityObject::AccessibilityChildrenVector& AccessibilityRenderObject::children()
    22462254{
     2255    if (m_childrenDirty) {
     2256        clearChildren();       
     2257        m_childrenDirty = false;
     2258    }
     2259   
    22472260    if (!m_haveChildren)
    22482261        addChildren();
     
    24052418}
    24062419     
     2420void AccessibilityRenderObject::updateBackingStore()
     2421{
     2422    if (!m_renderer)
     2423        return;
     2424    m_renderer->view()->layoutIfNeeded();
     2425}   
    24072426   
    24082427} // namespace WebCore
  • trunk/WebCore/page/AccessibilityRenderObject.h

    r40086 r40124  
    210210    virtual IntRect doAXBoundsForRange(const PlainTextRange&) const;
    211211   
     212    virtual void updateBackingStore();
     213   
    212214protected:
    213215    RenderObject* m_renderer;
    214216    AccessibilityRole m_ariaRole;
     217    mutable bool m_childrenDirty;
    215218   
    216219    void setRenderObject(RenderObject* renderer) { m_renderer = renderer; }
     
    232235    AccessibilityObject* accessibilityParentForImageMap(HTMLMapElement* map) const;
    233236
     237    void markChildrenDirty() const { m_childrenDirty = true; }
    234238};
    235239   
  • trunk/WebCore/page/AccessibilityTable.cpp

    r40086 r40124  
    5454    m_headerContainer(0)
    5555{
    56     // FIXME: We need to disable Accessibility Tables entirely on the Mac until <rdar://problem/6372481> is resolved.
    57 #if PLATFORM(MAC)
     56#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD)
    5857    m_isAccessibilityTable = false;
    59 #else   
     58#else
    6059    m_isAccessibilityTable = isTableExposableThroughAccessibility();
    6160#endif
    62 
    6361}
    6462
  • trunk/WebCore/page/EventHandler.cpp

    r40086 r40124  
    11/*
    2  * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
     2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
    33 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
    44 *
     
    15801580    if (!docRenderer)
    15811581        return false;
     1582   
     1583    RefPtr<FrameView> protector(m_frame->view());
    15821584
    15831585    IntPoint vPoint = m_frame->view()->windowToContents(e.pos());
  • trunk/WebCore/page/FrameView.cpp

    r40086 r40124  
    289289    Element* body = doc->body();
    290290    if (body && body->renderer() && body->renderer()->style()->hasPseudoStyle(RenderStyle::SCROLLBAR))
    291         return RenderScrollbar::createCustomScrollbar(this, orientation, body->renderer());
     291        return RenderScrollbar::createCustomScrollbar(this, orientation, body->renderBox());
    292292   
    293293    // If the <body> didn't have a custom style, then the root element might.
    294294    Element* docElement = doc->documentElement();
    295295    if (docElement && docElement->renderer() && docElement->renderer()->style()->hasPseudoStyle(RenderStyle::SCROLLBAR))
    296         return RenderScrollbar::createCustomScrollbar(this, orientation, docElement->renderer());
     296        return RenderScrollbar::createCustomScrollbar(this, orientation, docElement->renderBox());
    297297       
    298298    // If we have an owning iframe/frame element, then it can set the custom scrollbar also.
     
    461461            } else if (body->hasTagName(bodyTag)) {
    462462                if (!m_firstLayout && m_size.height() != layoutHeight()
    463                         && static_cast<RenderBox*>(body->renderer())->stretchesToViewHeight())
     463                        && RenderBox::toRenderBox(body->renderer())->stretchesToViewHeight())
    464464                    body->renderer()->setChildNeedsLayout(true);
    465465                // It's sufficient to just check the X overflow,
     
    10961096        return;
    10971097    Vector<DashboardRegionValue> newRegions;
    1098     document->renderer()->collectDashboardRegions(newRegions);
     1098    document->renderBox()->collectDashboardRegions(newRegions);
    10991099    if (newRegions == document->dashboardRegions())
    11001100        return;
  • trunk/WebCore/page/animation/AnimationBase.cpp

    r40086 r40124  
    8181
    8282static inline Color blendFunc(const AnimationBase* anim, const Color& from, const Color& to, double progress)
    83 
     83{
     84    // We need to preserve the state of the valid flag at the end of the animation
     85    if (progress == 1 && !to.isValid())
     86        return Color();
     87
    8488    return Color(blendFunc(anim, from.red(), to.red(), progress),
    8589                 blendFunc(anim, from.green(), to.green(), progress),
     
    131135    } else {
    132136        // Convert the TransformOperations into matrices
    133         IntSize size = anim->renderer()->borderBox().size();
     137        IntSize size = anim->renderer()->isBox() ? RenderBox::toRenderBox(anim->renderer())->borderBoxRect().size() : IntSize();
    134138        TransformationMatrix fromT;
    135139        TransformationMatrix toT;
  • trunk/WebCore/page/animation/AnimationController.cpp

    r40086 r40124  
    159159    for (RenderObjectAnimationMap::const_iterator it = m_compositeAnimations.begin(); it != animationsEnd; ++it) {
    160160        RefPtr<CompositeAnimation> compAnim = it->second;
    161         if (!compAnim->isSuspended()) {
     161        if (!compAnim->isSuspended() && compAnim->hasAnimations()) {
    162162            double t = compAnim->willNeedService();
    163163            if (t != -1 && (t < needsService || needsService == -1))
  • trunk/WebCore/page/animation/CompositeAnimation.cpp

    r40086 r40124  
    7474    void resumeOverriddenImplicitAnimations(int property);
    7575
     76    bool hasAnimations() const  { return !m_transitions.isEmpty() || !m_keyframeAnimations.isEmpty(); }
     77
    7678    void styleAvailable();
    7779
     
    110112void CompositeAnimationPrivate::clearRenderer()
    111113{
    112     // Clear the renderers from all running animations, in case we are in the middle of
    113     // an animation callback (see https://bugs.webkit.org/show_bug.cgi?id=22052)
    114     CSSPropertyTransitionsMap::const_iterator transitionsEnd = m_transitions.end();
    115     for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != transitionsEnd; ++it) {
    116         ImplicitAnimation* transition = it->second.get();
    117         transition->clearRenderer();
    118     }
    119 
    120     AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end();
    121     for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) {
    122         KeyframeAnimation* anim = it->second.get();
    123         anim->clearRenderer();
    124     }
    125    
    126 
     114    if (!m_transitions.isEmpty()) {
     115        // Clear the renderers from all running animations, in case we are in the middle of
     116        // an animation callback (see https://bugs.webkit.org/show_bug.cgi?id=22052)
     117        CSSPropertyTransitionsMap::const_iterator transitionsEnd = m_transitions.end();
     118        for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != transitionsEnd; ++it) {
     119            ImplicitAnimation* transition = it->second.get();
     120            transition->clearRenderer();
     121        }
     122    }
     123    if (!m_keyframeAnimations.isEmpty()) {
     124        AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end();
     125        for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) {
     126            KeyframeAnimation* anim = it->second.get();
     127            anim->clearRenderer();
     128        }
     129    }
    127130}
    128131   
     
    267270        // Now that we have transition objects ready, let them know about the new goal state.  We want them
    268271        // to fill in a RenderStyle*& only if needed.
    269         CSSPropertyTransitionsMap::const_iterator end = m_transitions.end();
    270         for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != end; ++it) {
    271             if (ImplicitAnimation* anim = it->second.get())
    272                 anim->animate(m_compositeAnimation, renderer, currentStyle, targetStyle, resultStyle);
     272        if (!m_transitions.isEmpty()) {
     273            CSSPropertyTransitionsMap::const_iterator end = m_transitions.end();
     274            for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != end; ++it) {
     275                if (ImplicitAnimation* anim = it->second.get())
     276                    anim->animate(m_compositeAnimation, renderer, currentStyle, targetStyle, resultStyle);
     277            }
    273278        }
    274279    }
     
    297302void CompositeAnimationPrivate::setAnimating(bool animating)
    298303{
    299     CSSPropertyTransitionsMap::const_iterator transitionsEnd = m_transitions.end();
    300     for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != transitionsEnd; ++it) {
    301         ImplicitAnimation* transition = it->second.get();
    302         transition->setAnimating(animating);
    303     }
    304 
    305     AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end();
    306     for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) {
    307         KeyframeAnimation* anim = it->second.get();
    308         anim->setAnimating(animating);
     304    if (!m_transitions.isEmpty()) {
     305        CSSPropertyTransitionsMap::const_iterator transitionsEnd = m_transitions.end();
     306        for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != transitionsEnd; ++it) {
     307            ImplicitAnimation* transition = it->second.get();
     308            transition->setAnimating(animating);
     309        }
     310    }
     311    if (!m_keyframeAnimations.isEmpty()) {
     312        AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end();
     313        for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) {
     314            KeyframeAnimation* anim = it->second.get();
     315            anim->setAnimating(animating);
     316        }
    309317    }
    310318}
     
    316324    double minT = -1;
    317325   
    318     CSSPropertyTransitionsMap::const_iterator transitionsEnd = m_transitions.end();
    319     for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != transitionsEnd; ++it) {
    320         ImplicitAnimation* transition = it->second.get();
    321         double t = transition ? transition->willNeedService() : -1;
    322         if (t < minT || minT == -1)
    323             minT = t;
    324         if (minT == 0)
    325             return 0;
    326     }
    327 
    328     AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end();
    329     for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) {
    330         KeyframeAnimation* animation = it->second.get();
    331         double t = animation ? animation->willNeedService() : -1;
    332         if (t < minT || minT == -1)
    333             minT = t;
    334         if (minT == 0)
    335             return 0;
     326    if (!m_transitions.isEmpty()) {
     327        CSSPropertyTransitionsMap::const_iterator transitionsEnd = m_transitions.end();
     328        for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != transitionsEnd; ++it) {
     329            ImplicitAnimation* transition = it->second.get();
     330            double t = transition ? transition->willNeedService() : -1;
     331            if (t < minT || minT == -1)
     332                minT = t;
     333            if (minT == 0)
     334                return 0;
     335        }
     336    }
     337    if (!m_keyframeAnimations.isEmpty()) {
     338        AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end();
     339        for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) {
     340            KeyframeAnimation* animation = it->second.get();
     341            double t = animation ? animation->willNeedService() : -1;
     342            if (t < minT || minT == -1)
     343                minT = t;
     344            if (minT == 0)
     345                return 0;
     346        }
    336347    }
    337348
     
    345356    // We want to send back the last animation with the property if there are multiples.
    346357    // So we need to iterate through all animations
    347     AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end();
    348     for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) {
    349         RefPtr<KeyframeAnimation> anim = it->second;
    350         if (anim->hasAnimationForProperty(property))
    351             retval = anim;
     358    if (!m_keyframeAnimations.isEmpty()) {
     359        AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end();
     360        for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) {
     361            RefPtr<KeyframeAnimation> anim = it->second;
     362            if (anim->hasAnimationForProperty(property))
     363                retval = anim;
     364        }
    352365    }
    353366   
     
    362375    // Make a list of transitions to be deleted
    363376    Vector<int> finishedTransitions;
    364     CSSPropertyTransitionsMap::const_iterator transitionsEnd = m_transitions.end();
    365 
    366     for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != transitionsEnd; ++it) {
    367         ImplicitAnimation* anim = it->second.get();
    368         if (!anim)
    369             continue;
    370         if (anim->postActive())
    371             finishedTransitions.append(anim->animatingProperty());
    372     }
    373 
    374     // Delete them
    375     size_t finishedTransitionCount = finishedTransitions.size();
    376     for (size_t i = 0; i < finishedTransitionCount; ++i)
    377         m_transitions.remove(finishedTransitions[i]);
     377    if (!m_transitions.isEmpty()) {
     378        CSSPropertyTransitionsMap::const_iterator transitionsEnd = m_transitions.end();
     379
     380        for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != transitionsEnd; ++it) {
     381            ImplicitAnimation* anim = it->second.get();
     382            if (!anim)
     383                continue;
     384            if (anim->postActive())
     385                finishedTransitions.append(anim->animatingProperty());
     386        }
     387       
     388        // Delete them
     389        size_t finishedTransitionCount = finishedTransitions.size();
     390        for (size_t i = 0; i < finishedTransitionCount; ++i)
     391            m_transitions.remove(finishedTransitions[i]);
     392    }
    378393
    379394    // Make a list of animations to be deleted
    380395    Vector<AtomicStringImpl*> finishedAnimations;
    381     AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end();
    382 
    383     for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) {
    384         KeyframeAnimation* anim = it->second.get();
    385         if (!anim)
    386             continue;
    387         if (anim->postActive())
    388             finishedAnimations.append(anim->name().impl());
    389     }
    390 
    391     // Delete them
    392     size_t finishedAnimationCount = finishedAnimations.size();
    393     for (size_t i = 0; i < finishedAnimationCount; ++i)
    394         m_keyframeAnimations.remove(finishedAnimations[i]);
     396    if (!m_keyframeAnimations.isEmpty()) {
     397        AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end();
     398
     399        for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) {
     400            KeyframeAnimation* anim = it->second.get();
     401            if (!anim)
     402                continue;
     403            if (anim->postActive())
     404                finishedAnimations.append(anim->name().impl());
     405        }
     406
     407        // Delete them
     408        size_t finishedAnimationCount = finishedAnimations.size();
     409        for (size_t i = 0; i < finishedAnimationCount; ++i)
     410            m_keyframeAnimations.remove(finishedAnimations[i]);
     411    }
    395412}
    396413
     
    398415{
    399416    // Set start time on all animations waiting for it
    400     AnimationNameMap::const_iterator end = m_keyframeAnimations.end();
    401     for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != end; ++it) {
    402         KeyframeAnimation* anim = it->second.get();
    403         if (anim && anim->waitingForStartTime())
    404             anim->updateStateMachine(AnimationBase::AnimationStateInputStartTimeSet, t);
     417    if (!m_keyframeAnimations.isEmpty()) {
     418        AnimationNameMap::const_iterator end = m_keyframeAnimations.end();
     419        for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != end; ++it) {
     420            KeyframeAnimation* anim = it->second.get();
     421            if (anim && anim->waitingForStartTime())
     422                anim->updateStateMachine(AnimationBase::AnimationStateInputStartTimeSet, t);
     423        }
    405424    }
    406425}
     
    409428{
    410429    // Set the start time for given property transition
    411     CSSPropertyTransitionsMap::const_iterator end = m_transitions.end();
    412     for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != end; ++it) {
    413         ImplicitAnimation* anim = it->second.get();
    414         if (anim && anim->waitingForStartTime() && anim->animatingProperty() == property)
    415             anim->updateStateMachine(AnimationBase::AnimationStateInputStartTimeSet, t);
     430    if (!m_transitions.isEmpty()) {
     431        CSSPropertyTransitionsMap::const_iterator end = m_transitions.end();
     432        for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != end; ++it) {
     433            ImplicitAnimation* anim = it->second.get();
     434            if (anim && anim->waitingForStartTime() && anim->animatingProperty() == property)
     435                anim->updateStateMachine(AnimationBase::AnimationStateInputStartTimeSet, t);
     436        }
    416437    }
    417438}
     
    424445    m_isSuspended = true;
    425446
    426     AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end();
    427     for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) {
    428         if (KeyframeAnimation* anim = it->second.get())
    429             anim->updatePlayState(false);
    430     }
    431 
    432     CSSPropertyTransitionsMap::const_iterator transitionsEnd = m_transitions.end();
    433     for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != transitionsEnd; ++it) {
    434         ImplicitAnimation* anim = it->second.get();
    435         if (anim && anim->hasStyle())
    436             anim->updatePlayState(false);
     447    if (!m_keyframeAnimations.isEmpty()) {
     448        AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end();
     449        for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) {
     450            if (KeyframeAnimation* anim = it->second.get())
     451                anim->updatePlayState(false);
     452        }
     453    }
     454    if (!m_transitions.isEmpty()) {
     455        CSSPropertyTransitionsMap::const_iterator transitionsEnd = m_transitions.end();
     456        for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != transitionsEnd; ++it) {
     457            ImplicitAnimation* anim = it->second.get();
     458            if (anim && anim->hasStyle())
     459                anim->updatePlayState(false);
     460        }
    437461    }
    438462}
     
    445469    m_isSuspended = false;
    446470
    447     AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end();
    448     for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) {
    449         KeyframeAnimation* anim = it->second.get();
    450         if (anim && anim->playStatePlaying())
    451             anim->updatePlayState(true);
    452     }
    453 
    454     CSSPropertyTransitionsMap::const_iterator transitionsEnd = m_transitions.end();
    455     for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != transitionsEnd; ++it) {
    456         ImplicitAnimation* anim = it->second.get();
    457         if (anim && anim->hasStyle())
    458             anim->updatePlayState(true);
     471    if (!m_keyframeAnimations.isEmpty()) {
     472        AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end();
     473        for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) {
     474            KeyframeAnimation* anim = it->second.get();
     475            if (anim && anim->playStatePlaying())
     476                anim->updatePlayState(true);
     477        }
     478    }
     479
     480    if (!m_transitions.isEmpty()) {
     481        CSSPropertyTransitionsMap::const_iterator transitionsEnd = m_transitions.end();
     482        for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != transitionsEnd; ++it) {
     483            ImplicitAnimation* anim = it->second.get();
     484            if (anim && anim->hasStyle())
     485                anim->updatePlayState(true);
     486        }
    459487    }
    460488}
     
    463491{
    464492    CSSPropertyTransitionsMap::const_iterator end = m_transitions.end();
    465     for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != end; ++it) {
    466         ImplicitAnimation* anim = it->second.get();
    467         if (anim && anim->animatingProperty() == property)
    468             anim->setOverridden(true);
     493    if (!m_transitions.isEmpty()) {
     494        for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != end; ++it) {
     495            ImplicitAnimation* anim = it->second.get();
     496            if (anim && anim->animatingProperty() == property)
     497                anim->setOverridden(true);
     498        }
    469499    }
    470500}
     
    472502void CompositeAnimationPrivate::resumeOverriddenImplicitAnimations(int property)
    473503{
    474     CSSPropertyTransitionsMap::const_iterator end = m_transitions.end();
    475     for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != end; ++it) {
    476         ImplicitAnimation* anim = it->second.get();
    477         if (anim && anim->animatingProperty() == property)
    478             anim->setOverridden(false);
     504    if (!m_transitions.isEmpty()) {
     505        CSSPropertyTransitionsMap::const_iterator end = m_transitions.end();
     506        for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != end; ++it) {
     507            ImplicitAnimation* anim = it->second.get();
     508            if (anim && anim->animatingProperty() == property)
     509                anim->setOverridden(false);
     510        }
    479511    }
    480512}
     
    504536    }
    505537
    506     CSSPropertyTransitionsMap::const_iterator end = m_transitions.end();
    507     for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != end; ++it) {
    508         ImplicitAnimation* anim = it->second.get();
    509         if (anim && anim->waitingForStyleAvailable())
    510             anim->updateStateMachine(AnimationBase::AnimationStateInputStyleAvailable, -1);
     538    if (!m_transitions.isEmpty()) {
     539        CSSPropertyTransitionsMap::const_iterator end = m_transitions.end();
     540        for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != end; ++it) {
     541            ImplicitAnimation* anim = it->second.get();
     542            if (anim && anim->waitingForStyleAvailable())
     543                anim->updateStateMachine(AnimationBase::AnimationStateInputStyleAvailable, -1);
     544        }
    511545    }
    512546}
     
    514548bool CompositeAnimationPrivate::isAnimatingProperty(int property, bool isRunningNow) const
    515549{
    516     AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end();
    517     for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) {
    518         KeyframeAnimation* anim = it->second.get();
    519         if (anim && anim->isAnimatingProperty(property, isRunningNow))
    520             return true;
    521     }
    522 
    523     CSSPropertyTransitionsMap::const_iterator transitionsEnd = m_transitions.end();
    524     for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != transitionsEnd; ++it) {
    525         ImplicitAnimation* anim = it->second.get();
    526         if (anim && anim->isAnimatingProperty(property, isRunningNow))
    527             return true;
     550    if (!m_keyframeAnimations.isEmpty()) {
     551        AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end();
     552        for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) {
     553            KeyframeAnimation* anim = it->second.get();
     554            if (anim && anim->isAnimatingProperty(property, isRunningNow))
     555                return true;
     556        }
     557    }
     558
     559    if (!m_transitions.isEmpty()) {
     560        CSSPropertyTransitionsMap::const_iterator transitionsEnd = m_transitions.end();
     561        for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != transitionsEnd; ++it) {
     562            ImplicitAnimation* anim = it->second.get();
     563            if (anim && anim->isAnimatingProperty(property, isRunningNow))
     564                return true;
     565        }
    528566    }
    529567    return false;
     
    578616    unsigned count = 0;
    579617   
    580     AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end();
    581     for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) {
    582         KeyframeAnimation* anim = it->second.get();
    583         if (anim->running())
    584             ++count;
    585     }
    586 
    587     CSSPropertyTransitionsMap::const_iterator transitionsEnd = m_transitions.end();
    588     for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != transitionsEnd; ++it) {
    589         ImplicitAnimation* anim = it->second.get();
    590         if (anim->running())
    591             ++count;
     618    if (!m_keyframeAnimations.isEmpty()) {
     619        AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end();
     620        for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) {
     621            KeyframeAnimation* anim = it->second.get();
     622            if (anim->running())
     623                ++count;
     624        }
     625    }
     626
     627    if (!m_transitions.isEmpty()) {
     628        CSSPropertyTransitionsMap::const_iterator transitionsEnd = m_transitions.end();
     629        for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != transitionsEnd; ++it) {
     630            ImplicitAnimation* anim = it->second.get();
     631            if (anim->running())
     632                ++count;
     633        }
    592634    }
    593635   
     
    650692}
    651693
     694bool CompositeAnimation::hasAnimations() const
     695{
     696    return m_data->hasAnimations();
     697}
     698
    652699void CompositeAnimation::styleAvailable()
    653700{
  • trunk/WebCore/page/animation/CompositeAnimation.h

    r40086 r40124  
    6767    void resumeAnimations();
    6868    bool isSuspended() const;
     69   
     70    bool hasAnimations() const;
    6971
    7072    void styleAvailable();
  • trunk/WebCore/page/mac/AccessibilityObjectWrapper.mm

    r40086 r40124  
    581581- (NSArray*)accessibilityActionNames
    582582{
     583    m_object->updateBackingStore();
     584
    583585    static NSArray* actionElementActions = [[NSArray alloc] initWithObjects: NSAccessibilityPressAction, NSAccessibilityShowMenuAction, nil];
    584586    static NSArray* defaultElementActions = [[NSArray alloc] initWithObjects: NSAccessibilityShowMenuAction, nil];
     
    600602- (NSArray*)accessibilityAttributeNames
    601603{
     604    m_object->updateBackingStore();
     605   
    602606    if (m_object->isAttachment())
    603607        return [[self attachmentView] accessibilityAttributeNames];
     
    11251129        return nil;
    11261130
     1131    m_object->updateBackingStore();
     1132   
    11271133    if ([attributeName isEqualToString: NSAccessibilityRoleAttribute])
    11281134        return [self role];
     
    14311437- (id)accessibilityFocusedUIElement
    14321438{
     1439    m_object->updateBackingStore();
     1440
    14331441    RefPtr<AccessibilityObject> focusedObj = m_object->focusedUIElement();
    14341442
     
    14411449- (id)accessibilityHitTest:(NSPoint)point
    14421450{
     1451    m_object->updateBackingStore();
     1452
    14431453    RefPtr<AccessibilityObject> axObject = m_object->doAccessibilityHitTest(IntPoint(point));
    14441454    if (axObject)
     
    14491459- (BOOL)accessibilityIsAttributeSettable:(NSString*)attributeName
    14501460{
     1461    m_object->updateBackingStore();
     1462
    14511463    if ([attributeName isEqualToString: @"AXSelectedTextMarkerRange"])
    14521464        return YES;
     
    14831495- (BOOL)accessibilityIsIgnored
    14841496{
     1497    m_object->updateBackingStore();
     1498
    14851499    if (m_object->isAttachment())
    14861500        return [[self attachmentView] accessibilityIsIgnored];
     
    14901504- (NSArray* )accessibilityParameterizedAttributeNames
    14911505{
     1506    m_object->updateBackingStore();
     1507
    14921508    if (m_object->isAttachment())
    14931509        return nil;
     
    15701586- (void)accessibilityPerformPressAction
    15711587{
     1588    m_object->updateBackingStore();
     1589
    15721590    if (m_object->isAttachment())
    15731591        [[self attachmentView] accessibilityPerformAction:NSAccessibilityPressAction];
     
    16141632- (void)accessibilityPerformAction:(NSString*)action
    16151633{
     1634    m_object->updateBackingStore();
     1635
    16161636    if ([action isEqualToString:NSAccessibilityPressAction])
    16171637        [self accessibilityPerformPressAction];
     
    16231643- (void)accessibilitySetValue:(id)value forAttribute:(NSString*)attributeName
    16241644{
     1645    m_object->updateBackingStore();
     1646
    16251647    WebCoreTextMarkerRange* textMarkerRange = nil;
    16261648    NSNumber*               number = nil;
     
    17451767        return nil;
    17461768
     1769    m_object->updateBackingStore();
     1770   
    17471771    // common parameter type check/casting.  Nil checks in handlers catch wrong type case.
    17481772    // NOTE: This assumes nil is not a valid parameter, because it is indistinguishable from
     
    19902014- (NSUInteger)accessibilityIndexOfChild:(id)child
    19912015{
     2016    m_object->updateBackingStore();
     2017   
    19922018    const AccessibilityObject::AccessibilityChildrenVector& children = m_object->children();
    19932019       
     
    20062032- (NSUInteger)accessibilityArrayAttributeCount:(NSString *)attribute
    20072033{
     2034    m_object->updateBackingStore();
     2035   
    20082036    if ([attribute isEqualToString:NSAccessibilityChildrenAttribute]) {
    20092037        const AccessibilityObject::AccessibilityChildrenVector& children = m_object->children();
     
    20192047- (NSArray *)accessibilityArrayAttributeValues:(NSString *)attribute index:(NSUInteger)index maxCount:(NSUInteger)maxCount
    20202048{
     2049    m_object->updateBackingStore();
     2050   
    20212051    if ([attribute isEqualToString:NSAccessibilityChildrenAttribute]) {
    20222052        if (m_object->children().isEmpty()) {
  • trunk/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp

    r40086 r40124  
    9595    PassRefPtr<ImageData> result = ImageData::create(rect.width(), rect.height());
    9696    unsigned char* dataSrc = cairo_image_surface_get_data(m_data.m_surface);
    97     unsigned char* dataDst = result->data()->data();
     97    unsigned char* dataDst = result->data()->data()->data();
    9898
    9999    if (rect.x() < 0 || rect.y() < 0 || (rect.x() + rect.width()) > m_size.width() || (rect.y() + rect.height()) > m_size.height())
     
    180180    int stride = cairo_image_surface_get_stride(m_data.m_surface);
    181181
    182     unsigned char* srcRows = source->data()->data() + originy * srcBytesPerRow + originx * 4;
     182    unsigned char* srcRows = source->data()->data()->data() + originy * srcBytesPerRow + originx * 4;
    183183    for (int y = 0; y < numRows; ++y) {
    184184        unsigned char *row = dataDst + stride * (y + desty);
  • trunk/WebCore/platform/graphics/cg/ImageBufferCG.cpp

    r40086 r40124  
    108108{
    109109    PassRefPtr<ImageData> result = ImageData::create(rect.width(), rect.height());
    110     unsigned char* data = result->data()->data();
     110    unsigned char* data = result->data()->data()->data();
    111111
    112112    if (rect.x() < 0 || rect.y() < 0 || (rect.x() + rect.width()) > m_size.width() || (rect.y() + rect.height()) > m_size.height())
     
    189189    unsigned destBytesPerRow = 4 * m_size.width();
    190190
    191     unsigned char* srcRows = source->data()->data() + originy * srcBytesPerRow + originx * 4;
     191    unsigned char* srcRows = source->data()->data()->data() + originy * srcBytesPerRow + originx * 4;
    192192    unsigned char* destRows = reinterpret_cast<unsigned char*>(m_data.m_data) + desty * destBytesPerRow + destx * 4;
    193193    for (int y = 0; y < numRows; ++y) {
  • trunk/WebCore/platform/gtk/RenderThemeGtk.cpp

    r40086 r40124  
    8383int RenderThemeGtk::baselinePosition(const RenderObject* o) const
    8484{
     85    if (!o->isBox())
     86        return 0;
     87
    8588    // FIXME: This strategy is possibly incorrect for the GTK+ port.
    8689    if (o->style()->appearance() == CheckboxPart ||
    8790        o->style()->appearance() == RadioPart)
    88         return o->marginTop() + o->height() - 2;
     91        return o->marginTop() + RenderBox::toRenderBox(o)->height() - 2;
    8992    return RenderTheme::baselinePosition(o);
    9093}
  • trunk/WebCore/platform/network/HTTPHeaderMap.h

    r40086 r40124  
    3030#include "AtomicStringHash.h"
    3131#include "StringHash.h"
     32#include <memory>
     33#include <utility>
    3234#include <wtf/HashMap.h>
     35#include <wtf/Vector.h>
    3336
    3437namespace WebCore {
    3538
    36     typedef HashMap<AtomicString, String, CaseFoldingHash> HTTPHeaderMap;
     39    typedef Vector<std::pair<String, String> > HTTPHeaderMapData;
     40
     41    class HTTPHeaderMap : public HashMap<AtomicString, String, CaseFoldingHash> {
     42    public:
     43        // Gets a copy of the data suitable for passing to another thread.
     44        std::auto_ptr<HTTPHeaderMapData> copyData() const;
     45
     46        void adopt(std::auto_ptr<HTTPHeaderMapData>);
     47    };
    3748
    3849} // namespace WebCore
  • trunk/WebCore/platform/qt/RenderThemeQt.cpp

    r40086 r40124  
    155155int RenderThemeQt::baselinePosition(const RenderObject* o) const
    156156{
     157    if (!o->isBox())
     158        return 0;
     159
    157160    if (o->style()->appearance() == CheckboxPart ||
    158161        o->style()->appearance() == RadioPart)
    159         return o->marginTop() + o->height() - 2; // Same as in old khtml
     162        return o->marginTop() + RenderBox::toRenderBox(o)->height() - 2; // Same as in old khtml
    160163    return RenderTheme::baselinePosition(o);
    161164}
  • trunk/WebCore/rendering/HitTestResult.cpp

    r40086 r40124  
    225225    if (!image())
    226226        return IntRect();
    227     return m_innerNonSharedNode->renderer()->absoluteContentBox();
     227    return m_innerNonSharedNode->renderBox()->absoluteContentBox();
    228228}
    229229
  • trunk/WebCore/rendering/InlineBox.cpp

    r40086 r40124  
    2424#include "InlineFlowBox.h"
    2525#include "RenderArena.h"
     26#include "RenderBox.h"
    2627#include "RootInlineBox.h"
    2728
     
    8485}
    8586#endif
     87
     88RenderBox* InlineBox::renderBox() const
     89{
     90    ASSERT(m_object->isBox());
     91    return RenderBox::toRenderBox(m_object);
     92}
    8693
    8794int InlineBox::caretMinOffset() const
     
    130137    m_x += dx;
    131138    m_y += dy;
    132     if (m_object->isReplaced() || m_object->isBR())
    133         m_object->setPos(m_object->xPos() + dx, m_object->yPos() + dy);
     139    if (m_object->isReplaced()) {
     140        RenderBox* box = RenderBox::toRenderBox(m_object);
     141        box->move(dx, dy);
     142    }
    134143}
    135144
  • trunk/WebCore/rendering/InlineBox.h

    r40086 r40124  
    2828
    2929class HitTestResult;
     30class RenderBox;
    3031class RootInlineBox;
    3132
     
    240241    bool visibleToHitTesting() const { return object()->style()->visibility() == VISIBLE && object()->style()->pointerEvents() != PE_NONE; }
    241242   
     243    // Use with caution! The type is not checked!
     244    RenderBox* renderBox() const;
     245
    242246public:
    243247    RenderObject* m_object;
  • trunk/WebCore/rendering/InlineFlowBox.cpp

    r40086 r40124  
    326326                    // not the left border box.  We have to subtract |x| from the width of the block
    327327                    // (which can be obtained from the root line box).
    328                     curr->setXPos(root()->object()->width()-x);
     328                    curr->setXPos(root()->block()->width()-x);
    329329                continue; // The positioned object has no effect on the width.
    330330            }
     
    342342                x += curr->object()->marginLeft();
    343343                curr->setXPos(x);
    344                 leftPosition = min(x + curr->object()->overflowLeft(false), leftPosition);
    345                 rightPosition = max(x + curr->object()->overflowWidth(false), rightPosition);
     344                leftPosition = min(x + curr->renderBox()->overflowLeft(false), leftPosition);
     345                rightPosition = max(x + curr->renderBox()->overflowWidth(false), rightPosition);
    346346                x += curr->width() + curr->object()->marginRight();
    347347            }
     
    356356}
    357357
    358 void InlineFlowBox::verticallyAlignBoxes(int& heightOfBlock)
     358int InlineFlowBox::verticallyAlignBoxes(int heightOfBlock)
    359359{
    360360    int maxPositionTop = 0;
     
    390390   
    391391    heightOfBlock += maxHeight;
     392   
     393    return heightOfBlock;
    392394}
    393395
     
    523525
    524526            if (curr->object()->hasReflection()) {
    525                 overflowTop = min(overflowTop, curr->object()->reflectionBox().y());
    526                 overflowBottom = max(overflowBottom, curr->object()->reflectionBox().bottom());
     527                overflowTop = min(overflowTop, curr->renderBox()->reflectionBox().y());
     528                overflowBottom = max(overflowBottom, curr->renderBox()->reflectionBox().bottom());
    527529            }
    528530
     
    536538            newY += curr->object()->marginTop();
    537539            newHeight = curr->height() - (curr->object()->marginTop() + curr->object()->marginBottom());
    538             overflowTop = curr->object()->overflowTop(false);
    539             overflowBottom = curr->object()->overflowHeight(false) - newHeight;
     540            overflowTop = curr->renderBox()->overflowTop(false);
     541            overflowBottom = curr->renderBox()->overflowHeight(false) - newHeight;
    540542        }
    541543
  • trunk/WebCore/rendering/InlineFlowBox.h

    r40086 r40124  
    116116    bool onEndChain(RenderObject* endObject);
    117117    virtual int placeBoxesHorizontally(int x, int& leftPosition, int& rightPosition, bool& needsWordSpacing);
    118     virtual void verticallyAlignBoxes(int& heightOfBlock);
     118    virtual int verticallyAlignBoxes(int heightOfBlock);
    119119    void computeLogicalBoxHeights(int& maxPositionTop, int& maxPositionBottom,
    120120                                  int& maxAscent, int& maxDescent, bool strictMode);
  • trunk/WebCore/rendering/RenderApplet.cpp

    r40086 r40124  
    6767    // use fixed widths/heights from the style system when we can, since the widget might
    6868    // not have an accurate m_width/m_height.
    69     int width = style()->width().isFixed() ? style()->width().value() :
    70         m_width - borderLeft() - borderRight() - paddingLeft() - paddingRight();
    71     int height = style()->height().isFixed() ? style()->height().value() :
    72         m_height - borderTop() - borderBottom() - paddingTop() - paddingBottom();
     69    int contentWidth = style()->width().isFixed() ? style()->width().value() :
     70        width() - borderLeft() - borderRight() - paddingLeft() - paddingRight();
     71    int contentHeight = style()->height().isFixed() ? style()->height().value() :
     72        height() - borderTop() - borderBottom() - paddingTop() - paddingBottom();
    7373    for (Node* child = element->firstChild(); child; child = child->nextSibling()) {
    7474        if (child->hasTagName(paramTag)) {
     
    8181    Frame* frame = document()->frame();
    8282    ASSERT(frame);
    83     setWidget(frame->loader()->createJavaAppletWidget(IntSize(width, height), element, m_args));
     83    setWidget(frame->loader()->createJavaAppletWidget(IntSize(contentWidth, contentHeight), element, m_args));
    8484}
    8585
  • trunk/WebCore/rendering/RenderBlock.cpp

    r40086 r40124  
    423423        for (ShadowData* boxShadow = style()->boxShadow(); boxShadow; boxShadow = boxShadow->next)
    424424            shadowHeight = max(boxShadow->y + boxShadow->blur, shadowHeight);
    425         int height = m_height + shadowHeight;
     425        int inflatedHeight = height() + shadowHeight;
    426426        if (hasReflection())
    427             height = max(height, reflectionBox().bottom());
    428         return height;
     427            inflatedHeight = max(inflatedHeight, reflectionBox().bottom());
     428        return inflatedHeight;
    429429    }
    430430    return m_overflowHeight;
     
    437437        for (ShadowData* boxShadow = style()->boxShadow(); boxShadow; boxShadow = boxShadow->next)
    438438            shadowWidth = max(boxShadow->x + boxShadow->blur, shadowWidth);
    439         int width = m_width + shadowWidth;
     439        int inflatedWidth = width() + shadowWidth;
    440440        if (hasReflection())
    441             width = max(width, reflectionBox().right());
    442         return width;
     441            inflatedWidth = max(inflatedWidth, reflectionBox().right());
     442        return inflatedWidth;
    443443    }
    444444    return m_overflowWidth;
     
    476476{
    477477    if (!includeInterior && hasOverflowClip()) {
    478         IntRect box = borderBox();
     478        IntRect box = borderBoxRect();
    479479        int shadowLeft = 0;
    480480        int shadowRight = 0;
     
    509509
    510510    if (!includeInterior && hasOverflowClip())
    511         return borderBox();
     511        return borderBoxRect();
    512512    int l = overflowLeft(includeInterior);
    513513    int t = min(overflowTop(includeInterior), -borderTopExtra());
     
    523523    // (d) have a min-height
    524524    // (e) have specified that one of our margins can't collapse using a CSS extension
    525     if (m_height > 0 ||
     525    if (height() > 0 ||
    526526        isTable() || (borderBottom() + paddingBottom() + borderTop() + paddingTop()) != 0 ||
    527527        style()->minHeight().isPositive() ||
     
    571571    if (hasControlClip()) {
    572572        // Because of the lightweight clip, there can never be any overflow from children.
    573         m_overflowWidth = m_width;
    574         m_overflowHeight = m_height;
     573        m_overflowWidth = width();
     574        m_overflowHeight = height();
    575575        m_overflowLeft = 0;
    576576        m_overflowTop = 0;
     
    596596    }
    597597
    598     LayoutStateMaintainer statePusher(view(), this, IntSize(xPos(), yPos()), m_hasColumns || hasTransform() || hasReflection());
    599 
    600     int oldWidth = m_width;
     598    LayoutStateMaintainer statePusher(view(), this, IntSize(x(), y()), m_hasColumns || hasTransform() || hasReflection());
     599
     600    int oldWidth = width();
    601601    int oldColumnWidth = desiredColumnWidth();
    602602
     
    604604    calcColumnWidth();
    605605
    606     m_overflowWidth = m_width;
     606    m_overflowWidth = width();
    607607    m_overflowLeft = 0;
    608608
    609     if (oldWidth != m_width || oldColumnWidth != desiredColumnWidth())
     609    if (oldWidth != width() || oldColumnWidth != desiredColumnWidth())
    610610        relayoutChildren = true;
    611611
    612612    clearFloats();
    613613
    614     int previousHeight = m_height;
    615     m_height = 0;
     614    int previousHeight = height();
     615    setHeight(0);
     616
    616617    m_overflowHeight = 0;
    617618
     
    659660    // Expand our intrinsic height to encompass floats.
    660661    int toAdd = borderBottom() + paddingBottom() + horizontalScrollbarHeight();
    661     if (floatBottom() > (m_height - toAdd) && (isInlineBlockOrInlineTable() || isFloatingOrPositioned() || hasOverflowClip() ||
     662    if (floatBottom() > (height() - toAdd) && (isInlineBlockOrInlineTable() || isFloatingOrPositioned() || hasOverflowClip() ||
    662663                                    (parent() && parent()->isFlexibleBox() || m_hasColumns)))
    663         m_height = floatBottom() + toAdd;
     664        setHeight(floatBottom() + toAdd);
    664665   
    665666    // Now lay out our columns within this intrinsic height, since they can slightly affect the intrinsic height as
     
    668669
    669670    // Calculate our new height.
    670     int oldHeight = m_height;
     671    int oldHeight = height();
    671672    calcHeight();
    672     if (oldHeight != m_height) {
    673         if (oldHeight > m_height && maxFloatBottom > m_height && !childrenInline()) {
     673    if (oldHeight != height()) {
     674        if (oldHeight > height() && maxFloatBottom > height() && !childrenInline()) {
    674675            // One of our children's floats may have become an overhanging float for us. We need to look for it.
    675676            for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
    676677                if (child->isBlockFlow() && !child->isFloatingOrPositioned()) {
    677678                    RenderBlock* block = static_cast<RenderBlock*>(child);
    678                     if (block->floatBottom() + block->yPos() > m_height)
    679                         addOverhangingFloats(block, -block->xPos(), -block->yPos(), false);
     679                    if (block->floatBottom() + block->y() > height())
     680                        addOverhangingFloats(block, -block->x(), -block->y(), false);
    680681                }
    681682            }
     
    685686
    686687        // If the block got expanded in size, then increase our overflowheight to match.
    687         if (m_overflowHeight > m_height)
     688        if (m_overflowHeight > height())
    688689            m_overflowHeight -= toAdd;
    689         if (m_overflowHeight < m_height)
    690             m_overflowHeight = m_height;
    691     }
    692     if (previousHeight != m_height)
     690        if (m_overflowHeight < height())
     691            m_overflowHeight = height();
     692    }
     693    if (previousHeight != height())
    693694        relayoutChildren = true;
    694695
    695696    // Some classes of objects (floats and fieldsets with no specified heights and table cells) expand to encompass
    696697    // overhanging floats.
    697     if (hasOverhangingFloats() && expandsToEncloseOverhangingFloats()) {
    698         m_height = floatBottom();
    699         m_height += borderBottom() + paddingBottom();
    700     }
     698    if (hasOverhangingFloats() && expandsToEncloseOverhangingFloats())
     699        setHeight(floatBottom() + borderBottom() + paddingBottom());
    701700
    702701    if ((isCell || isInline() || isFloatingOrPositioned() || isRoot()) && !hasOverflowClip() && !hasControlClip())
     
    708707
    709708    // Always ensure our overflow width/height are at least as large as our width/height.
    710     m_overflowWidth = max(m_overflowWidth, m_width);
    711     m_overflowHeight = max(m_overflowHeight, m_height);
     709    m_overflowWidth = max(m_overflowWidth, width());
     710    m_overflowHeight = max(m_overflowHeight, height());
    712711
    713712    if (!hasOverflowClip()) {
    714713        for (ShadowData* boxShadow = style()->boxShadow(); boxShadow; boxShadow = boxShadow->next) {
    715714            m_overflowLeft = min(m_overflowLeft, boxShadow->x - boxShadow->blur);
    716             m_overflowWidth = max(m_overflowWidth, m_width + boxShadow->x + boxShadow->blur);
     715            m_overflowWidth = max(m_overflowWidth, width() + boxShadow->x + boxShadow->blur);
    717716            m_overflowTop = min(m_overflowTop, boxShadow->y - boxShadow->blur);
    718             m_overflowHeight = max(m_overflowHeight, m_height + boxShadow->y + boxShadow->blur);
     717            m_overflowHeight = max(m_overflowHeight, height() + boxShadow->y + boxShadow->blur);
    719718        }
    720719       
     
    753752
    754753            // Don't allow this rect to spill out of our overflow box.
    755             repaintRect.intersect(IntRect(0, 0, m_width, m_height));
     754            repaintRect.intersect(IntRect(0, 0, width(), height()));
    756755        }
    757756
     
    776775
    777776    if (child->hasStaticY()) {
    778         int y = m_height;
     777        int y = height();
    779778        if (!marginInfo.canCollapseWithTop()) {
    780779            child->calcVerticalMargins();
     
    811810    // an example of this scenario.
    812811    int marginOffset = marginInfo.canCollapseWithTop() ? 0 : marginInfo.margin();
    813     m_height += marginOffset;
     812    setHeight(height() + marginOffset);
    814813    positionNewFloats();
    815     m_height -= marginOffset;
    816 }
    817 
    818 RenderObject* RenderBlock::handleSpecialChild(RenderObject* child, const MarginInfo& marginInfo, CompactInfo& compactInfo, bool& handled)
     814    setHeight(height() - marginOffset);
     815}
     816
     817RenderBox* RenderBlock::handleSpecialChild(RenderBox* child, const MarginInfo& marginInfo, CompactInfo& compactInfo, bool& handled)
    819818{
    820819    // Handle positioned children first.
    821     RenderObject* next = handlePositionedChild(child, marginInfo, handled);
     820    RenderBox* next = handlePositionedChild(child, marginInfo, handled);
    822821    if (handled) return next;
    823822   
     
    835834
    836835
    837 RenderObject* RenderBlock::handlePositionedChild(RenderObject* child, const MarginInfo& marginInfo, bool& handled)
     836RenderBox* RenderBlock::handlePositionedChild(RenderBox* child, const MarginInfo& marginInfo, bool& handled)
    838837{
    839838    if (child->isPositioned()) {
     
    841840        child->containingBlock()->insertPositionedObject(child);
    842841        adjustPositionedBlock(child, marginInfo);
    843         return child->nextSibling();
     842        return child->nextSiblingBox();
    844843    }
    845844
     
    847846}
    848847
    849 RenderObject* RenderBlock::handleFloatingChild(RenderObject* child, const MarginInfo& marginInfo, bool& handled)
     848RenderBox* RenderBlock::handleFloatingChild(RenderBox* child, const MarginInfo& marginInfo, bool& handled)
    850849{
    851850    if (child->isFloating()) {
     
    853852        insertFloatingObject(child);
    854853        adjustFloatingBlock(marginInfo);
    855         return child->nextSibling();
     854        return child->nextSiblingBox();
    856855    }
    857856   
     
    859858}
    860859
    861 RenderObject* RenderBlock::handleCompactChild(RenderObject* child, CompactInfo& compactInfo, bool& handled)
     860RenderBox* RenderBlock::handleCompactChild(RenderBox* child, CompactInfo& compactInfo, bool& handled)
    862861{
    863862    // FIXME: We only deal with one compact at a time.  It is unclear what should be
     
    882881                handled = true;
    883882                compactInfo.set(child, curr);
    884                 child->setPos(0,0); // This position will be updated to reflect the compact's
     883                toRenderBox(child)->setLocation(IntPoint()); // This position will be updated to reflect the compact's
    885884                                    // desired position and the line box for the compact will
    886885                                    // pick that position up.
    887886               
    888887                // Remove the child.
    889                 RenderObject* next = child->nextSibling();
     888                RenderBox* next = child->nextSiblingBox();
    890889                removeChildNode(child);
    891890               
     
    901900}
    902901
    903 void RenderBlock::insertCompactIfNeeded(RenderObject* child, CompactInfo& compactInfo)
     902void RenderBlock::insertCompactIfNeeded(RenderBox* child, CompactInfo& compactInfo)
    904903{
    905904    if (compactInfo.matches(child)) {
    906905        // We have a compact child to squeeze in.
    907         RenderObject* compactChild = compactInfo.compact();
     906        RenderBox* compactChild = compactInfo.compact();
    908907        int compactXPos = borderLeft() + paddingLeft() + compactChild->marginLeft();
    909908        if (style()->direction() == RTL) {
     
    912911                compactChild->width() - compactChild->marginRight();
    913912        }
    914         compactXPos -= child->xPos(); // Put compactXPos into the child's coordinate space.
    915         compactChild->setPos(compactXPos, compactChild->yPos()); // Set the x position.
     913        compactXPos -= child->x(); // Put compactXPos into the child's coordinate space.
     914        compactChild->setLocation(compactXPos, compactChild->y()); // Set the x position.
    916915        compactInfo.clear();
    917916    }
    918917}
    919918
    920 RenderObject* RenderBlock::handleRunInChild(RenderObject* child, bool& handled)
     919RenderBox* RenderBlock::handleRunInChild(RenderBox* child, bool& handled)
    921920{
    922921    // See if we have a run-in element with inline children.  If the
     
    933932            handled = true;
    934933            child->setInline(true);
    935             child->setPos(0,0);
     934            child->setLocation(0,0);
    936935           
    937936            // Remove the child.
    938             RenderObject* next = child->nextSibling();
     937            RenderBox* next = child->nextSiblingBox();
    939938            removeChildNode(child);
    940939           
     
    947946}
    948947
    949 void RenderBlock::collapseMargins(RenderObject* child, MarginInfo& marginInfo, int yPosEstimate)
     948void RenderBlock::collapseMargins(RenderBox* child, MarginInfo& marginInfo, int yPosEstimate)
    950949{
    951950    // Get our max pos and neg top margins.
     
    992991        marginInfo.setTopQuirk(topQuirk);
    993992
    994     int ypos = m_height;
     993    int ypos = height();
    995994    if (child->isSelfCollapsingBlock()) {
    996995        // This child has no height.  We need to compute our
     
    10111010            // that needs to be positioned correctly (e.g., a block that
    10121011            // had a specified height of 0 but that actually had subcontent).
    1013             ypos = m_height + collapsedTopPos - collapsedTopNeg;
     1012            ypos = height() + collapsedTopPos - collapsedTopNeg;
    10141013    }
    10151014    else {
    10161015        if (child->style()->marginTopCollapse() == MSEPARATE) {
    1017             m_height += marginInfo.margin() + child->marginTop();
    1018             ypos = m_height;
     1016            setHeight(height() + marginInfo.margin() + child->marginTop());
     1017            ypos = height();
    10191018        }
    10201019        else if (!marginInfo.atTopOfBlock() ||
     
    10231022            // We're collapsing with a previous sibling's margins and not
    10241023            // with the top of the block.
    1025             m_height += max(marginInfo.posMargin(), posTop) - max(marginInfo.negMargin(), negTop);
    1026             ypos = m_height;
     1024            setHeight(height() + max(marginInfo.posMargin(), posTop) - max(marginInfo.negMargin(), negTop));
     1025            ypos = height();
    10271026        }
    10281027
     
    10371036
    10381037    view()->addLayoutDelta(IntSize(0, yPosEstimate - ypos));
    1039     child->setPos(child->xPos(), ypos);
     1038    child->setLocation(child->x(), ypos);
    10401039    if (ypos != yPosEstimate) {
    10411040        if (child->shrinkToAvoidFloats())
     
    10541053}
    10551054
    1056 void RenderBlock::clearFloatsIfNeeded(RenderObject* child, MarginInfo& marginInfo, int oldTopPosMargin, int oldTopNegMargin)
     1055void RenderBlock::clearFloatsIfNeeded(RenderBox* child, MarginInfo& marginInfo, int oldTopPosMargin, int oldTopNegMargin)
    10571056{
    10581057    int heightIncrease = getClearDelta(child);
     
    10621061    // The child needs to be lowered.  Move the child so that it just clears the float.
    10631062    view()->addLayoutDelta(IntSize(0, -heightIncrease));
    1064     child->setPos(child->xPos(), child->yPos() + heightIncrease);
     1063    child->setLocation(child->x(), child->y() + heightIncrease);
    10651064
    10661065    if (child->isSelfCollapsingBlock()) {
     
    10721071       
    10731072        // Adjust our height such that we are ready to be collapsed with subsequent siblings.
    1074         m_height = child->yPos() - max(0, marginInfo.margin());
     1073        setHeight(child->y() - max(0, marginInfo.margin()));
    10751074       
    10761075        // Set a flag that we cleared a float so that we know both to increase the height of the block
     
    10801079    } else
    10811080        // Increase our height by the amount we had to clear.
    1082         m_height += heightIncrease;
     1081        setHeight(height() + heightIncrease);
    10831082   
    10841083    if (marginInfo.canCollapseWithTop()) {
     
    11101109    // FIXME: We need to eliminate the estimation of vertical position, because when it's wrong we sometimes trigger a pathological
    11111110    // relayout if there are intruding floats.
    1112     int yPosEstimate = m_height;
     1111    int yPosEstimate = height();
    11131112    if (!marginInfo.canCollapseWithTop()) {
    11141113        int childMarginTop = child->selfNeedsLayout() ? child->marginTop() : child->collapsedMarginTop();
     
    11181117}
    11191118
    1120 void RenderBlock::determineHorizontalPosition(RenderObject* child)
     1119void RenderBlock::determineHorizontalPosition(RenderBox* child)
    11211120{
    11221121    if (style()->direction() == LTR) {
     
    11291128        // to shift over as necessary to dodge any floats that might get in the way.
    11301129        if (child->avoidsFloats()) {
    1131             int leftOff = leftOffset(m_height);
     1130            int leftOff = leftOffset(height());
    11321131            if (style()->textAlign() != WEBKIT_CENTER && child->style()->marginLeft().type() != Auto) {
    11331132                if (child->marginLeft() < 0)
     
    11411140                // so that we can just pass the content width in directly to the |calcHorizontalMargins|
    11421141                // function.
    1143                 static_cast<RenderBox*>(child)->calcHorizontalMargins(child->style()->marginLeft(), child->style()->marginRight(), lineWidth(child->yPos()));
     1142                child->calcHorizontalMargins(child->style()->marginLeft(), child->style()->marginRight(), lineWidth(child->y()));
    11441143                chPos = leftOff + child->marginLeft();
    11451144            }
    11461145        }
    1147         view()->addLayoutDelta(IntSize(child->xPos() - chPos, 0));
    1148         child->setPos(chPos, child->yPos());
     1146        view()->addLayoutDelta(IntSize(child->x() - chPos, 0));
     1147        child->setLocation(chPos, child->y());
    11491148    } else {
    1150         int xPos = m_width - borderRight() - paddingRight() - verticalScrollbarWidth();
     1149        int xPos = width() - borderRight() - paddingRight() - verticalScrollbarWidth();
    11511150        int chPos = xPos - (child->width() + child->marginRight());
    11521151        if (child->avoidsFloats()) {
    1153             int rightOff = rightOffset(m_height);
     1152            int rightOff = rightOffset(height());
    11541153            if (style()->textAlign() != WEBKIT_CENTER && child->style()->marginRight().type() != Auto) {
    11551154                if (child->marginRight() < 0)
     
    11621161                // so that we can just pass the content width in directly to the |calcHorizontalMargins|
    11631162                // function.
    1164                 static_cast<RenderBox*>(child)->calcHorizontalMargins(child->style()->marginLeft(), child->style()->marginRight(), lineWidth(child->yPos()));
     1163                toRenderBox(child)->calcHorizontalMargins(child->style()->marginLeft(), child->style()->marginRight(), lineWidth(child->y()));
    11651164                chPos = rightOff - child->marginRight() - child->width();
    11661165            }
    11671166        }
    1168         view()->addLayoutDelta(IntSize(child->xPos() - chPos, 0));
    1169         child->setPos(chPos, child->yPos());
     1167        view()->addLayoutDelta(IntSize(child->x() - chPos, 0));
     1168        child->setLocation(chPos, child->y());
    11701169    }
    11711170}
     
    12061205    if (!marginInfo.canCollapseWithBottom() && !marginInfo.canCollapseWithTop()
    12071206        && (!style()->htmlHacks() || !marginInfo.quirkContainer() || !marginInfo.bottomQuirk()))
    1208         m_height += marginInfo.margin();
     1207        setHeight(height() + marginInfo.margin());
    12091208       
    12101209    // Now add in our bottom border/padding.
    1211     m_height += bottom;
     1210    setHeight(height() + bottom);
    12121211
    12131212    // Negative margins can cause our height to shrink below our minimal height (border/padding).
    12141213    // If this happens, ensure that the computed height is increased to the minimal height.
    1215     m_height = max(m_height, top + bottom);
     1214    setHeight(max(height(), top + bottom));
    12161215
    12171216    // Always make sure our overflow height is at least our height.
    1218     m_overflowHeight = max(m_height, m_overflowHeight);
     1217    m_overflowHeight = max(height(), m_overflowHeight);
    12191218
    12201219    // Update our bottom collapsed margin info.
     
    12451244    int bottom = borderBottom() + paddingBottom() + horizontalScrollbarHeight();
    12461245
    1247     m_height = m_overflowHeight = top;
     1246    m_overflowHeight = top;
     1247    setHeight(m_overflowHeight);
    12481248
    12491249    // The margin struct caches all our current margin collapsing state.  The compact struct caches state when we encounter compacts,
     
    12581258    maxFloatBottom = 0;
    12591259
    1260     RenderObject* child = firstChild();
     1260    RenderBox* child = firstChildBox();
    12611261    while (child) {
    12621262        if (legend == child) {
    1263             child = child->nextSibling();
     1263            child = child->nextSiblingBox();
    12641264            continue; // Skip the legend, since it has already been positioned up in the fieldset's border.
    12651265        }
     
    12811281        // run-ins.  When we encounter these four types of objects, we don't actually lay them out as normal flow blocks.
    12821282        bool handled = false;
    1283         RenderObject* next = handleSpecialChild(child, marginInfo, compactInfo, handled);
     1283        RenderBox* next = handleSpecialChild(child, marginInfo, compactInfo, handled);
    12841284        if (handled) {
    12851285            child = next;
     
    13021302
    13031303        // Cache our old rect so that we can dirty the proper repaint rects if the child moves.
    1304         IntRect oldRect(child->xPos(), child->yPos() , child->width(), child->height());
     1304        IntRect oldRect(child->x(), child->y() , child->width(), child->height());
    13051305#ifndef NDEBUG
    13061306        IntSize oldLayoutDelta = view()->layoutDelta();
    13071307#endif
    13081308        // Go ahead and position the child as though it didn't collapse with the top.
    1309         view()->addLayoutDelta(IntSize(0, child->yPos() - yPosEstimate));
    1310         child->setPos(child->xPos(), yPosEstimate);
     1309        view()->addLayoutDelta(IntSize(0, child->y() - yPosEstimate));
     1310        child->setLocation(child->x(), yPosEstimate);
    13111311
    13121312        bool markDescendantsWithFloats = false;
     
    13171317            // layout.
    13181318            int fb = max(previousFloatBottom, floatBottom());
    1319             if (fb > m_height || fb > yPosEstimate)
     1319            if (fb > height() || fb > yPosEstimate)
    13201320                markDescendantsWithFloats = true;
    13211321        }
     
    13481348
    13491349        // Update our height now that the child has been placed in the correct position.
    1350         m_height += child->height();
     1350        setHeight(height() + child->height());
    13511351        if (child->style()->marginBottomCollapse() == MSEPARATE) {
    1352             m_height += child->marginBottom();
     1352            setHeight(height() + child->marginBottom());
    13531353            marginInfo.clearMargin();
    13541354        }
    13551355        // If the child has overhanging floats that intrude into following siblings (or possibly out
    13561356        // of this block), then the parent gets notified of the floats now.
    1357         maxFloatBottom = max(maxFloatBottom, addOverhangingFloats(static_cast<RenderBlock *>(child), -child->xPos(), -child->yPos(), !childNeededLayout));
     1357        maxFloatBottom = max(maxFloatBottom, addOverhangingFloats(static_cast<RenderBlock*>(child), -child->x(), -child->y(), !childNeededLayout));
    13581358
    13591359        // Update our overflow in case the child spills out the block.
    1360         m_overflowTop = min(m_overflowTop, child->yPos() + child->overflowTop(false));
    1361         m_overflowHeight = max(m_overflowHeight, m_height + child->overflowHeight(false) - child->height());
    1362         m_overflowWidth = max(child->xPos() + child->overflowWidth(false), m_overflowWidth);
    1363         m_overflowLeft = min(child->xPos() + child->overflowLeft(false), m_overflowLeft);
     1360        m_overflowTop = min(m_overflowTop, child->y() + child->overflowTop(false));
     1361        m_overflowHeight = max(m_overflowHeight, height() + child->overflowHeight(false) - child->height());
     1362        m_overflowWidth = max(child->x() + child->overflowWidth(false), m_overflowWidth);
     1363        m_overflowLeft = min(child->x() + child->overflowLeft(false), m_overflowLeft);
    13641364       
    13651365        // Insert our compact into the block margin if we have one.
    13661366        insertCompactIfNeeded(child, compactInfo);
    13671367
    1368         IntSize childOffset(child->xPos() - oldRect.x(), child->yPos() - oldRect.y());
     1368        IntSize childOffset(child->x() - oldRect.x(), child->y() - oldRect.y());
    13691369        if (childOffset.width() || childOffset.height()) {
    13701370            view()->addLayoutDelta(childOffset);
     
    13811381
    13821382        ASSERT(oldLayoutDelta == view()->layoutDelta());
    1383         child = child->nextSibling();
     1383        child = child->nextSiblingBox();
    13841384    }
    13851385
     
    13941394        return false;
    13951395
    1396     LayoutStateMaintainer statePusher(view(), this, IntSize(xPos(), yPos()), m_hasColumns || hasTransform() || hasReflection());
     1396    LayoutStateMaintainer statePusher(view(), this, IntSize(x(), y()), m_hasColumns || hasTransform() || hasReflection());
    13971397
    13981398    if (needsPositionedMovementLayout()) {
     
    14171417{
    14181418    if (m_positionedObjects) {
    1419         RenderObject* r;
     1419        RenderBox* r;
    14201420        Iterator end = m_positionedObjects->end();
    14211421        for (Iterator it = m_positionedObjects->begin(); it != end; ++it) {
     
    14441444{
    14451445    if (m_positionedObjects) {
    1446         RenderObject* r;
     1446        RenderBox* r;
    14471447        Iterator end = m_positionedObjects->end();
    14481448        for (Iterator it = m_positionedObjects->begin(); it != end; ++it) {
     
    14731473            // is our responsibility to paint (m_shouldPaint is set). When paintAllDescendants is true, the latter
    14741474            // condition is replaced with being a descendant of us.
    1475             if (r->m_bottom > m_height && (paintAllDescendants && r->m_renderer->isDescendantOf(this) || r->m_shouldPaint) && !r->m_renderer->hasLayer()) {               
     1475            if (r->m_bottom > height() && (paintAllDescendants && r->m_renderer->isDescendantOf(this) || r->m_shouldPaint) && !r->m_renderer->hasLayer()) {               
    14761476                r->m_renderer->repaint();
    14771477                r->m_renderer->repaintOverhangingFloats();
     
    14841484void RenderBlock::paint(PaintInfo& paintInfo, int tx, int ty)
    14851485{
    1486     tx += m_x;
    1487     ty += m_y;
     1486    tx += x();
     1487    ty += m_frameRect.y();
    14881488   
    14891489    PaintPhase phase = paintInfo.phase;
     
    16201620    bool isPrinting = document()->printing();
    16211621
    1622     for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {       
     1622    for (RenderBox* child = firstChildBox(); child; child = child->nextSiblingBox()) {       
    16231623        // Check for page-break-before: always, and if it's set, break and bail.
    16241624        if (isPrinting && !childrenInline() && child->style()->pageBreakBefore() == PBALWAYS &&
    1625             inRootBlockContext() && (ty + child->yPos()) > paintInfo.rect.y() &&
    1626             (ty + child->yPos()) < paintInfo.rect.bottom()) {
    1627             view()->setBestTruncatedAt(ty + child->yPos(), this, true);
     1625            inRootBlockContext() && (ty + child->y()) > paintInfo.rect.y() &&
     1626            (ty + child->y()) < paintInfo.rect.bottom()) {
     1627            view()->setBestTruncatedAt(ty + child->y(), this, true);
    16281628            return;
    16291629        }
     
    16341634        // Check for page-break-after: always, and if it's set, break and bail.
    16351635        if (isPrinting && !childrenInline() && child->style()->pageBreakAfter() == PBALWAYS &&
    1636             inRootBlockContext() && (ty + child->yPos() + child->height()) > paintInfo.rect.y() &&
    1637             (ty + child->yPos() + child->height()) < paintInfo.rect.bottom()) {
    1638             view()->setBestTruncatedAt(ty + child->yPos() + child->height() + max(0, child->collapsedMarginBottom()), this, true);
     1636            inRootBlockContext() && (ty + child->y() + child->height()) > paintInfo.rect.y() &&
     1637            (ty + child->y() + child->height()) < paintInfo.rect.bottom()) {
     1638            view()->setBestTruncatedAt(ty + child->y() + child->height() + max(0, child->collapsedMarginBottom()), this, true);
    16391639            return;
    16401640        }
     
    17131713    // 5. paint outline.
    17141714    if (!inlineFlow && (paintPhase == PaintPhaseOutline || paintPhase == PaintPhaseSelfOutline) && hasOutline() && style()->visibility() == VISIBLE)
    1715         RenderObject::paintOutline(paintInfo.context, tx, ty, width(), height(), style());
     1715        RenderBox::paintOutline(paintInfo.context, tx, ty, width(), height(), style());
    17161716
    17171717    // 6. paint continuation outlines.
     
    17221722                containingBlock()->addContinuationWithOutline(inlineFlow);
    17231723            else if (!inlineFlow->firstLineBox())
    1724                 inlineFlow->paintOutline(paintInfo.context, tx - xPos() + inlineFlow->containingBlock()->xPos(),
    1725                                          ty - yPos() + inlineFlow->containingBlock()->yPos());
     1724                inlineFlow->paintOutline(paintInfo.context, tx - x() + inlineFlow->containingBlock()->x(),
     1725                                         ty - y() + inlineFlow->containingBlock()->y());
    17261726        }
    17271727        paintContinuationOutlines(paintInfo, tx, ty);
     
    17491749            PaintInfo currentPaintInfo(paintInfo);
    17501750            currentPaintInfo.phase = preservePhase ? paintInfo.phase : PaintPhaseBlockBackground;
    1751             int currentTX = tx + r->m_left - r->m_renderer->xPos() + r->m_renderer->marginLeft();
    1752             int currentTY = ty + r->m_top - r->m_renderer->yPos() + r->m_renderer->marginTop();
     1751            int currentTX = tx + r->m_left - r->m_renderer->x() + r->m_renderer->marginLeft();
     1752            int currentTY = ty + r->m_top - r->m_renderer->y() + r->m_renderer->marginTop();
    17531753            r->m_renderer->paint(currentPaintInfo, currentTX, currentTY);
    17541754            if (!preservePhase) {
     
    18301830        RenderBlock* block = flow->containingBlock();
    18311831        for ( ; block && block != this; block = block->containingBlock()) {
    1832             tx += block->xPos();
    1833             ty += block->yPos();
     1832            tx += block->x();
     1833            ty += block->y();
    18341834        }
    18351835        ASSERT(block);   
     
    19201920}
    19211921
    1922 static void clipOutPositionedObjects(const RenderObject::PaintInfo* paintInfo, int tx, int ty, ListHashSet<RenderObject*>* positionedObjects)
     1922static void clipOutPositionedObjects(const RenderObject::PaintInfo* paintInfo, int tx, int ty, ListHashSet<RenderBox*>* positionedObjects)
    19231923{
    19241924    if (!positionedObjects)
    19251925        return;
    19261926   
    1927     ListHashSet<RenderObject*>::const_iterator end = positionedObjects->end();
    1928     for (ListHashSet<RenderObject*>::const_iterator it = positionedObjects->begin(); it != end; ++it) {
    1929         RenderObject* r = *it;
    1930         paintInfo->context->clipOut(IntRect(tx + r->xPos(), ty + r->yPos(), r->width(), r->height()));
     1927    ListHashSet<RenderBox*>::const_iterator end = positionedObjects->end();
     1928    for (ListHashSet<RenderBox*>::const_iterator it = positionedObjects->begin(); it != end; ++it) {
     1929        RenderBox* r = *it;
     1930        paintInfo->context->clipOut(IntRect(tx + r->x(), ty + r->y(), r->width(), r->height()));
    19311931    }
    19321932}
     
    19421942        if (isBody() || isRoot()) // The <body> must make sure to examine its containingBlock's positioned objects.
    19431943            for (RenderBlock* cb = containingBlock(); cb && !cb->isRenderView(); cb = cb->containingBlock())
    1944                 clipOutPositionedObjects(paintInfo, cb->xPos(), cb->yPos(), cb->m_positionedObjects);
     1944                clipOutPositionedObjects(paintInfo, cb->x(), cb->y(), cb->m_positionedObjects);
    19451945        if (m_floatingObjects) {
    19461946            for (DeprecatedPtrListIterator<FloatingObject> it(*m_floatingObjects); it.current(); ++it) {
     
    20362036
    20372037    // Go ahead and jump right to the first block child that contains some selected objects.
    2038     RenderObject* curr;
    2039     for (curr = firstChild(); curr && curr->selectionState() == SelectionNone; curr = curr->nextSibling()) { }
    2040 
    2041     for (bool sawSelectionEnd = false; curr && !sawSelectionEnd; curr = curr->nextSibling()) {
     2038    RenderBox* curr;
     2039    for (curr = firstChildBox(); curr && curr->selectionState() == SelectionNone; curr = curr->nextSiblingBox()) { }
     2040
     2041    for (bool sawSelectionEnd = false; curr && !sawSelectionEnd; curr = curr->nextSiblingBox()) {
    20422042        SelectionState childState = curr->selectionState();
    20432043        if (childState == SelectionBoth || childState == SelectionEnd)
     
    20622062                // Fill the gap above the object.
    20632063                result.uniteCenter(fillVerticalSelectionGap(lastTop, lastLeft, lastRight,
    2064                                                             ty + curr->yPos(), rootBlock, blockX, blockY, paintInfo));
     2064                                                            ty + curr->y(), rootBlock, blockX, blockY, paintInfo));
    20652065
    20662066            // Only fill side gaps for objects that paint their own selection if we know for sure the selection is going to extend all the way *past*
     
    20742074
    20752075            if (leftGap)
    2076                 result.uniteLeft(fillLeftSelectionGap(this, curr->xPos(), curr->yPos(), curr->height(), rootBlock, blockX, blockY, tx, ty, paintInfo));
     2076                result.uniteLeft(fillLeftSelectionGap(this, curr->x(), curr->y(), curr->height(), rootBlock, blockX, blockY, tx, ty, paintInfo));
    20772077            if (rightGap)
    2078                 result.uniteRight(fillRightSelectionGap(this, curr->xPos() + curr->width(), curr->yPos(), curr->height(), rootBlock, blockX, blockY, tx, ty, paintInfo));
     2078                result.uniteRight(fillRightSelectionGap(this, curr->x() + curr->width(), curr->y(), curr->height(), rootBlock, blockX, blockY, tx, ty, paintInfo));
    20792079
    20802080            // Update lastTop to be just underneath the object.  lastLeft and lastRight extend as far as
    20812081            // they can without bumping into floating or positioned objects.  Ideally they will go right up
    20822082            // to the border of the root selection block.
    2083             lastTop = (ty - blockY) + (curr->yPos() + curr->height());
    2084             lastLeft = leftSelectionOffset(rootBlock, curr->yPos() + curr->height());
    2085             lastRight = rightSelectionOffset(rootBlock, curr->yPos() + curr->height());
     2083            lastTop = (ty - blockY) + (curr->y() + curr->height());
     2084            lastLeft = leftSelectionOffset(rootBlock, curr->y() + curr->height());
     2085            lastRight = rightSelectionOffset(rootBlock, curr->y() + curr->height());
    20862086        } else if (childState != SelectionNone)
    20872087            // We must be a block that has some selected object inside it.  Go ahead and recur.
    2088             result.unite(static_cast<RenderBlock*>(curr)->fillSelectionGaps(rootBlock, blockX, blockY, tx + curr->xPos(), ty + curr->yPos(),
     2088            result.unite(static_cast<RenderBlock*>(curr)->fillSelectionGaps(rootBlock, blockX, blockY, tx + curr->x(), ty + curr->y(),
    20892089                                                                            lastTop, lastLeft, lastRight, paintInfo));
    20902090    }
     
    21662166}
    21672167
    2168 int RenderBlock::leftSelectionOffset(RenderBlock* rootBlock, int y)
    2169 {
    2170     int left = leftOffset(y);
     2168int RenderBlock::leftSelectionOffset(RenderBlock* rootBlock, int yPos)
     2169{
     2170    int left = leftOffset(yPos);
    21712171    if (left == borderLeft() + paddingLeft()) {
    21722172        if (rootBlock != this)
    21732173            // The border can potentially be further extended by our containingBlock().
    2174             return containingBlock()->leftSelectionOffset(rootBlock, y + yPos());
     2174            return containingBlock()->leftSelectionOffset(rootBlock, yPos + y());
    21752175        return left;
    21762176    }
     
    21782178        RenderBlock* cb = this;
    21792179        while (cb != rootBlock) {
    2180             left += cb->xPos();
     2180            left += cb->x();
    21812181            cb = cb->containingBlock();
    21822182        }
     
    21862186}
    21872187
    2188 int RenderBlock::rightSelectionOffset(RenderBlock* rootBlock, int y)
    2189 {
    2190     int right = rightOffset(y);
     2188int RenderBlock::rightSelectionOffset(RenderBlock* rootBlock, int yPos)
     2189{
     2190    int right = rightOffset(yPos);
    21912191    if (right == (contentWidth() + (borderLeft() + paddingLeft()))) {
    21922192        if (rootBlock != this)
    21932193            // The border can potentially be further extended by our containingBlock().
    2194             return containingBlock()->rightSelectionOffset(rootBlock, y + yPos());
     2194            return containingBlock()->rightSelectionOffset(rootBlock, yPos + y());
    21952195        return right;
    21962196    }
     
    21982198        RenderBlock* cb = this;
    21992199        while (cb != rootBlock) {
    2200             right += cb->xPos();
     2200            right += cb->x();
    22012201            cb = cb->containingBlock();
    22022202        }
     
    22052205}
    22062206
    2207 void RenderBlock::insertPositionedObject(RenderObject *o)
     2207void RenderBlock::insertPositionedObject(RenderBox* o)
    22082208{
    22092209    // Create the list of special objects if we don't aleady have one
    22102210    if (!m_positionedObjects)
    2211         m_positionedObjects = new ListHashSet<RenderObject*>;
     2211        m_positionedObjects = new ListHashSet<RenderBox*>;
    22122212
    22132213    m_positionedObjects->add(o);
    22142214}
    22152215
    2216 void RenderBlock::removePositionedObject(RenderObject *o)
     2216void RenderBlock::removePositionedObject(RenderBox* o)
    22172217{
    22182218    if (m_positionedObjects)
     
    22252225        return;
    22262226   
    2227     RenderObject* r;
     2227    RenderBox* r;
    22282228   
    22292229    Iterator end = m_positionedObjects->end();
    22302230   
    2231     Vector<RenderObject*, 16> deadObjects;
     2231    Vector<RenderBox*, 16> deadObjects;
    22322232
    22332233    for (Iterator it = m_positionedObjects->begin(); it != end; ++it) {
     
    22532253}
    22542254
    2255 void RenderBlock::insertFloatingObject(RenderObject *o)
     2255void RenderBlock::insertFloatingObject(RenderBox* o)
    22562256{
    22572257    ASSERT(o->isFloating());
     
    22872287}
    22882288
    2289 void RenderBlock::removeFloatingObject(RenderObject *o)
     2289void RenderBlock::removeFloatingObject(RenderBox* o)
    22902290{
    22912291    if (m_floatingObjects) {
     
    23222322    }
    23232323
    2324     int y = m_height;
     2324    int y = height();
    23252325   
    23262326    // The float cannot start above the y position of the last positioned float.
     
    23372337        }
    23382338
    2339         RenderObject* o = f->m_renderer;
     2339        RenderBox* o = f->m_renderer;
    23402340        int _height = o->height() + o->marginTop() + o->marginBottom();
    23412341
     
    23462346            fwidth = ro - lo; // Never look for more than what will be available.
    23472347       
    2348         IntRect oldRect(o->xPos(), o->yPos() , o->width(), o->height());
     2348        IntRect oldRect(o->x(), o->y() , o->width(), o->height());
    23492349       
    23502350        if (o->style()->clear() & CLEFT)
     
    23632363            fx = max(0, fx);
    23642364            f->m_left = fx;
    2365             o->setPos(fx + o->marginLeft(), y + o->marginTop());
     2365            o->setLocation(fx + o->marginLeft(), y + o->marginTop());
    23662366        } else {
    23672367            int heightRemainingLeft = 1;
     
    23732373            }
    23742374            f->m_left = fx - f->m_width;
    2375             o->setPos(fx - o->marginRight() - o->width(), y + o->marginTop());
     2375            o->setLocation(fx - o->marginRight() - o->width(), y + o->marginTop());
    23762376        }
    23772377
     
    24062406            break;
    24072407    }
    2408     if (m_height < newY)
    2409         m_height = newY;
     2408    if (height() < newY)
     2409        setHeight(newY);
    24102410}
    24112411
     
    26042604       
    26052605    if (m_positionedObjects) {
    2606         RenderObject* r;
     2606        RenderBox* r;
    26072607        Iterator end = m_positionedObjects->end();
    26082608        for (Iterator it = m_positionedObjects->begin(); it != end; ++it) {
     
    26142614                // If a positioned object lies completely to the left of the root it will be unreachable via scrolling.
    26152615                // Therefore we should not allow it to contribute to the lowest position.
    2616                 if (!isRenderView() || r->xPos() + r->width() > 0 || r->xPos() + r->rightmostPosition(false) > 0) {
    2617                     int lp = r->yPos() + r->lowestPosition(false);
     2616                if (!isRenderView() || r->x() + r->width() > 0 || r->x() + r->rightmostPosition(false) > 0) {
     2617                    int lp = r->y() + r->lowestPosition(false);
    26182618                    bottom = max(bottom, lp + relativeOffset);
    26192619                }
     
    26612661
    26622662    if (m_positionedObjects) {
    2663         RenderObject* r;
     2663        RenderBox* r;
    26642664        Iterator end = m_positionedObjects->end();
    26652665        for (Iterator it = m_positionedObjects->begin() ; it != end; ++it) {
     
    26712671                // If a positioned object lies completely above the root it will be unreachable via scrolling.
    26722672                // Therefore we should not allow it to contribute to the rightmost position.
    2673                 if (!isRenderView() || r->yPos() + r->height() > 0 || r->yPos() + r->lowestPosition(false) > 0) {
    2674                     int rp = r->xPos() + r->rightmostPosition(false);
     2673                if (!isRenderView() || r->y() + r->height() > 0 || r->y() + r->lowestPosition(false) > 0) {
     2674                    int rp = r->x() + r->rightmostPosition(false);
    26752675                    right = max(right, rp + relativeOffset);
    26762676                }
     
    27232723
    27242724    if (m_positionedObjects) {
    2725         RenderObject* r;
     2725        RenderBox* r;
    27262726        Iterator end = m_positionedObjects->end();
    27272727        for (Iterator it = m_positionedObjects->begin(); it != end; ++it) {
     
    27332733                // If a positioned object lies completely above the root it will be unreachable via scrolling.
    27342734                // Therefore we should not allow it to contribute to the leftmost position.
    2735                 if (!isRenderView() || r->yPos() + r->height() > 0 || r->yPos() + r->lowestPosition(false) > 0) {
    2736                     int lp = r->xPos() + r->leftmostPosition(false);
     2735                if (!isRenderView() || r->y() + r->height() > 0 || r->y() + r->lowestPosition(false) > 0) {
     2736                    int lp = r->x() + r->leftmostPosition(false);
    27372737                    left = min(left, lp + relativeOffset);
    27382738                }
     
    28382838    // to avoid floats.
    28392839    bool parentHasFloats = false;
    2840     RenderObject *prev = previousSibling();
    2841     while (prev && (!prev->isRenderBlock() || prev->avoidsFloats() || prev->isFloatingOrPositioned())) {
     2840    RenderObject* prev = previousSibling();
     2841    while (prev && (!prev->isBox() || !prev->isRenderBlock() || prev->avoidsFloats() || prev->isFloatingOrPositioned())) {
    28422842        if (prev->isFloating())
    28432843            parentHasFloats = true;
     
    28462846
    28472847    // First add in floats from the parent.
    2848     int offset = m_y;
     2848    int offset = m_frameRect.y();
    28492849    if (parentHasFloats)
    28502850        addIntrudingFloats(static_cast<RenderBlock *>(parent()),
    28512851                           parent()->borderLeft() + parent()->paddingLeft(), offset);
    28522852
     2853   
    28532854    int xoffset = 0;
    28542855    if (prev)
    2855         offset -= prev->yPos();
     2856        offset -= toRenderBox(prev)->y();
    28562857    else {
    28572858        prev = parent();
     
    29172918    DeprecatedPtrListIterator<FloatingObject> it(*child->m_floatingObjects);
    29182919    for (FloatingObject* r; (r = it.current()); ++it) {
    2919         int bottom = child->yPos() + r->m_bottom;
     2920        int bottom = child->y() + r->m_bottom;
    29202921        lowestFloatBottom = max(lowestFloatBottom, bottom);
    29212922
     
    30303031}
    30313032
    3032 void RenderBlock::markAllDescendantsWithFloatsForLayout(RenderObject* floatToRemove)
     3033void RenderBlock::markAllDescendantsWithFloatsForLayout(RenderBox* floatToRemove)
    30333034{
    30343035    setChildNeedsLayout(true);
     
    30473048}
    30483049
    3049 int RenderBlock::getClearDelta(RenderObject *child)
     3050int RenderBlock::getClearDelta(RenderBox* child)
    30503051{
    30513052    // There is no need to compute clearance if we have no floats.
     
    30753076    // Do not allow tables to wrap in quirks or even in almost strict mode
    30763077    // (ebay on the PLT, finance.yahoo.com in the real world, versiontracker.com forces even almost strict mode not to work)
    3077     int result = clearSet ? max(0, bottom - child->yPos()) : 0;
     3078    int result = clearSet ? max(0, bottom - child->y()) : 0;
    30783079    if (!result && child->avoidsFloats() && child->style()->width().isFixed() &&
    3079         child->minPrefWidth() > lineWidth(child->yPos()) && child->minPrefWidth() <= availableWidth() &&
     3080        child->minPrefWidth() > lineWidth(child->y()) && child->minPrefWidth() <= availableWidth() &&
    30803081        document()->inStrictMode())   
    3081         result = max(0, floatBottom() - child->yPos());
     3082        result = max(0, floatBottom() - child->y());
    30823083    return result;
    30833084}
     
    31053106    bool inlineFlow = isInlineFlow();
    31063107
    3107     int tx = _tx + m_x;
    3108     int ty = _ty + m_y + borderTopExtra();
     3108    int tx = _tx + x();
     3109    int ty = _ty + y();
    31093110
    31103111    if (!inlineFlow && !isRenderView()) {
     
    31513152            for (it.toLast(); (o = it.current()); --it) {
    31523153                if (o->m_shouldPaint && !o->m_renderer->hasLayer()) {
    3153                     int xoffset = scrolledX + o->m_left + o->m_renderer->marginLeft() - o->m_renderer->xPos();
    3154                     int yoffset =  scrolledY + o->m_top + o->m_renderer->marginTop() - o->m_renderer->yPos();
     3154                    int xoffset = scrolledX + o->m_left + o->m_renderer->marginLeft() - o->m_renderer->x();
     3155                    int yoffset =  scrolledY + o->m_top + o->m_renderer->marginTop() - o->m_renderer->y();
    31553156                    if (o->m_renderer->hitTest(request, result, IntPoint(_x, _y), xoffset, yoffset)) {
    31563157                        updateHitTestResult(result, IntPoint(_x - xoffset, _y - yoffset));
     
    31653166    if (!inlineFlow && (hitTestAction == HitTestBlockBackground || hitTestAction == HitTestChildBlockBackground)) {
    31663167        int topExtra = borderTopExtra();
    3167         IntRect boundsRect(tx, ty - topExtra, m_width, m_height + topExtra + borderBottomExtra());
     3168        IntRect boundsRect(tx, ty - topExtra, width(), height() + topExtra + borderBottomExtra());
    31683169        if (visibleToHitTesting() && boundsRect.contains(_x, _y)) {
    31693170            updateHitTestResult(result, IntPoint(_x - tx, _y - ty + topExtra));
     
    33013302        if (y < top || (isEditableRoot && (y < bottom && x < left))) {
    33023303            if (!isEditableRoot)
    3303                 if (RenderObject* c = firstChild()) { // FIXME: This code doesn't make any sense.  This child could be an inline or a positioned element or a float or a compact, etc.
    3304                     VisiblePosition p = c->positionForCoordinates(contentsX - c->xPos(), contentsY - c->yPos());
     3304                if (RenderBox* c = firstChildBox()) { // FIXME: This code doesn't make any sense.  This child could be an inline or a positioned element or a float or a compact, etc.
     3305                    VisiblePosition p = c->positionForCoordinates(contentsX - c->x(), contentsY - c->y());
    33053306                    if (p.isNotNull())
    33063307                        return p;
     
    33173318        if (y >= bottom || (isEditableRoot && (y >= top && x >= right))) {
    33183319            if (!isEditableRoot)
    3319                 if (RenderObject* c = lastChild()) { // FIXME: This code doesn't make any sense.  This child could be an inline or a positioned element or a float or a compact, ect.
    3320                     VisiblePosition p = c->positionForCoordinates(contentsX - c->xPos(), contentsY - c->yPos());
     3320                if (RenderBox* c = lastChildBox()) { // FIXME: This code doesn't make any sense.  This child could be an inline or a positioned element or a float or a compact, ect.
     3321                    VisiblePosition p = c->positionForCoordinates(contentsX - c->x(), contentsY - c->y());
    33213322                    if (p.isNotNull())
    33223323                        return p;
     
    33653366   
    33663367    // See if any child blocks exist at this y coordinate.
    3367     if (firstChild() && contentsY < firstChild()->yPos())
     3368    if (firstChildBox() && contentsY < firstChildBox()->y())
    33683369        return VisiblePosition(n, 0, DOWNSTREAM);
    3369     for (RenderObject* renderer = firstChild(); renderer; renderer = renderer->nextSibling()) {
     3370    for (RenderBox* renderer = firstChildBox(); renderer; renderer = renderer->nextSiblingBox()) {
    33703371        if (renderer->height() == 0 || renderer->style()->visibility() != VISIBLE || renderer->isFloatingOrPositioned())
    33713372            continue;
    3372         RenderObject* next = renderer->nextSibling();
     3373        RenderBox* next = renderer->nextSiblingBox();
    33733374        while (next && next->isFloatingOrPositioned())
    3374             next = next->nextSibling();
     3375            next = next->nextSiblingBox();
    33753376        if (next)
    3376             bottom = next->yPos();
     3377            bottom = next->y();
    33773378        else
    33783379            bottom = top + scrollHeight();
    3379         if (contentsY >= renderer->yPos() && contentsY < bottom)
    3380             return renderer->positionForCoordinates(contentsX - renderer->xPos(), contentsY - renderer->yPos());
     3380        if (contentsY >= renderer->y() && contentsY < bottom)
     3381            return renderer->positionForCoordinates(contentsX - renderer->x(), contentsY - renderer->y());
    33813382    }
    33823383   
     
    35963597    }
    35973598
    3598     m_overflowWidth = max(m_width, currX - colGap);
     3599    m_overflowWidth = max(width(), currX - colGap);
    35993600    m_overflowLeft = min(0, currX + desiredColumnWidth + colGap);
    36003601
     
    36033604       
    36043605    if (computeIntrinsicHeight)
    3605         m_height = m_overflowHeight + toAdd;
     3606        setHeight(m_overflowHeight + toAdd);
    36063607
    36073608    v->setPrintRect(IntRect());
     
    42524253    }
    42534254    else {
    4254         for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling()) {
     4255        for (RenderBox* curr = firstChildBox(); curr; curr = curr->nextSiblingBox()) {
    42554256            if (!curr->isFloatingOrPositioned()) {
    42564257                int result = curr->getBaselineOfFirstLineBox();
    42574258                if (result != -1)
    4258                     return curr->yPos() + result; // Translate to our coordinate space.
     4259                    return curr->y() + result; // Translate to our coordinate space.
    42594260            }
    42604261        }
     
    42784279    else {
    42794280        bool haveNormalFlowChild = false;
    4280         for (RenderObject* curr = lastChild(); curr; curr = curr->previousSibling()) {
     4281        for (RenderBox* curr = lastChildBox(); curr; curr = curr->previousSiblingBox()) {
    42814282            if (!curr->isFloatingOrPositioned()) {
    42824283                haveNormalFlowChild = true;
    42834284                int result = curr->getBaselineOfLastLineBox();
    42844285                if (result != -1)
    4285                     return curr->yPos() + result; // Translate to our coordinate space.
     4286                    return curr->y() + result; // Translate to our coordinate space.
    42864287            }
    42874288        }
     
    45014502        }
    45024503        else {
    4503             RenderObject* normalFlowChildWithoutLines = 0;
    4504             for (RenderObject* obj = block->firstChild(); obj; obj = obj->nextSibling()) {
     4504            RenderBox* normalFlowChildWithoutLines = 0;
     4505            for (RenderBox* obj = block->firstChildBox(); obj; obj = obj->nextSiblingBox()) {
    45054506                if (shouldCheckLines(obj)) {
    45064507                    int result = getHeightForLineCount(static_cast<RenderBlock*>(obj), l, false, count);
    45074508                    if (result != -1)
    4508                         return result + obj->yPos() + (includeBottom ? (block->borderBottom() + block->paddingBottom()) : 0);
     4509                        return result + obj->y() + (includeBottom ? (block->borderBottom() + block->paddingBottom()) : 0);
    45094510                }
    45104511                else if (!obj->isFloatingOrPositioned() && !obj->isCompact() && !obj->isRunIn())
     
    45124513            }
    45134514            if (normalFlowChildWithoutLines && l == 0)
    4514                 return normalFlowChildWithoutLines->yPos() + normalFlowChildWithoutLines->height();
     4515                return normalFlowChildWithoutLines->y() + normalFlowChildWithoutLines->height();
    45154516        }
    45164517    }
     
    45604561        }
    45614562        else {
    4562             for (RenderObject* obj = firstChild(); obj; obj = obj->nextSibling()) {
     4563            for (RenderBox* obj = firstChildBox(); obj; obj = obj->nextSiblingBox()) {
    45634564                if (!obj->isFloatingOrPositioned()) {
    45644565                    if (obj->isBlockFlow() && !obj->hasOverflowClip())
    4565                         static_cast<RenderBlock*>(obj)->adjustForBorderFit(x + obj->xPos(), left, right);
     4566                        static_cast<RenderBlock*>(obj)->adjustForBorderFit(x + obj->x(), left, right);
    45664567                    else if (obj->style()->visibility() == VISIBLE) {
    45674568                        // We are a replaced element or some kind of non-block-flow object.
    4568                         left = min(left, x + obj->xPos());
    4569                         right = max(right, x + obj->xPos() + obj->width());
     4569                        left = min(left, x + obj->x());
     4570                        right = max(right, x + obj->x() + obj->width());
    45704571                    }
    45714572                }
     
    45794580                // Only examine the object if our m_shouldPaint flag is set.
    45804581                if (r->m_shouldPaint) {
    4581                     int floatLeft = r->m_left - r->m_renderer->xPos() + r->m_renderer->marginLeft();
     4582                    int floatLeft = r->m_left - r->m_renderer->x() + r->m_renderer->marginLeft();
    45824583                    int floatRight = floatLeft + r->m_renderer->width();
    45834584                    left = min(left, floatLeft);
  • trunk/WebCore/rendering/RenderBlock.h

    r40086 r40124  
    113113
    114114    void layoutPositionedObjects(bool relayoutChildren);
    115     void insertPositionedObject(RenderObject*);
    116     void removePositionedObject(RenderObject*);
     115    void insertPositionedObject(RenderBox*);
     116    void removePositionedObject(RenderBox*);
    117117    virtual void removePositionedObjects(RenderBlock*);
    118118
     
    129129    // the implementation of the following functions is in bidi.cpp
    130130    struct FloatWithRect {
    131         FloatWithRect(RenderObject* f)
     131        FloatWithRect(RenderBox* f)
    132132            : object(f)
    133             , rect(IntRect(f->xPos() - f->marginLeft(), f->yPos() - f->marginTop(), f->width() + f->marginLeft() + f->marginRight(), f->height() + f->marginTop() + f->marginBottom()))
     133            , rect(IntRect(f->x() - f->marginLeft(), f->y() - f->marginTop(), f->width() + f->marginLeft() + f->marginRight(), f->height() + f->marginTop() + f->marginBottom()))
    134134        {
    135135        }
    136136
    137         RenderObject* object;
     137        RenderBox* object;
    138138        IntRect rect;
    139139    };
     
    170170    void paintCaret(PaintInfo&, int tx, int ty, CaretType);
    171171
    172     void insertFloatingObject(RenderObject*);
    173     void removeFloatingObject(RenderObject*);
     172    void insertFloatingObject(RenderBox*);
     173    void removeFloatingObject(RenderBox*);
    174174
    175175    // Called from lineWidth, to position the floats added in the last line.
     
    177177    bool positionNewFloats();
    178178    void clearFloats();
    179     int getClearDelta(RenderObject* child);
    180     virtual void markAllDescendantsWithFloatsForLayout(RenderObject* floatToRemove = 0);
     179    int getClearDelta(RenderBox* child);
     180    virtual void markAllDescendantsWithFloatsForLayout(RenderBox* floatToRemove = 0);
    181181    void markPositionedObjectsForLayout();
    182182
     
    186186    virtual bool avoidsFloats() const;
    187187
    188     virtual bool hasOverhangingFloats() { return !hasColumns() && floatBottom() > m_height; }
     188    virtual bool hasOverhangingFloats() { return !hasColumns() && floatBottom() > height(); }
    189189    void addIntrudingFloats(RenderBlock* prev, int xoffset, int yoffset);
    190190    int addOverhangingFloats(RenderBlock* child, int xoffset, int yoffset, bool makeChildPaintOtherFloats);
     
    353353        Type type() { return static_cast<Type>(m_type); }
    354354
    355         RenderObject* m_renderer;
     355        RenderBox* m_renderer;
    356356        int m_top;
    357357        int m_bottom;
     
    366366    class CompactInfo {
    367367        // A compact child that needs to be collapsed into the margin of the following block.
    368         RenderObject* m_compact;
     368        RenderBox* m_compact;
    369369
    370370        // The block with the open margin that the compact child is going to place itself within.
     
    372372
    373373    public:
    374         RenderObject* compact() const { return m_compact; }
     374        RenderBox* compact() const { return m_compact; }
    375375        RenderObject* block() const { return m_block; }
    376376        bool matches(RenderObject* child) const { return m_compact && m_block == child; }
    377377
    378378        void clear() { set(0, 0); }
    379         void set(RenderObject* c, RenderObject* b) { m_compact = c; m_block = b; }
     379        void set(RenderBox* c, RenderObject* b) { m_compact = c; m_block = b; }
    380380
    381381        CompactInfo() { clear(); }
     
    450450    void adjustPositionedBlock(RenderObject* child, const MarginInfo&);
    451451    void adjustFloatingBlock(const MarginInfo&);
    452     RenderObject* handleSpecialChild(RenderObject* child, const MarginInfo&, CompactInfo&, bool& handled);
    453     RenderObject* handleFloatingChild(RenderObject* child, const MarginInfo&, bool& handled);
    454     RenderObject* handlePositionedChild(RenderObject* child, const MarginInfo&, bool& handled);
    455     RenderObject* handleCompactChild(RenderObject* child, CompactInfo&, bool& handled);
    456     RenderObject* handleRunInChild(RenderObject* child, bool& handled);
    457     void collapseMargins(RenderObject* child, MarginInfo&, int yPosEstimate);
    458     void clearFloatsIfNeeded(RenderObject* child, MarginInfo&, int oldTopPosMargin, int oldTopNegMargin);
    459     void insertCompactIfNeeded(RenderObject* child, CompactInfo&);
     452    RenderBox* handleSpecialChild(RenderBox* child, const MarginInfo&, CompactInfo&, bool& handled);
     453    RenderBox* handleFloatingChild(RenderBox* child, const MarginInfo&, bool& handled);
     454    RenderBox* handlePositionedChild(RenderBox* child, const MarginInfo&, bool& handled);
     455    RenderBox* handleCompactChild(RenderBox* child, CompactInfo&, bool& handled);
     456    RenderBox* handleRunInChild(RenderBox* child, bool& handled);
     457    void collapseMargins(RenderBox* child, MarginInfo&, int yPosEstimate);
     458    void clearFloatsIfNeeded(RenderBox* child, MarginInfo&, int oldTopPosMargin, int oldTopNegMargin);
     459    void insertCompactIfNeeded(RenderBox* child, CompactInfo&);
    460460    int estimateVerticalPosition(RenderObject* child, const MarginInfo&);
    461     void determineHorizontalPosition(RenderObject* child);
     461    void determineHorizontalPosition(RenderBox* child);
    462462    void handleBottomOfBlock(int top, int bottom, MarginInfo&);
    463463    void setCollapsedBottomMargin(const MarginInfo&);
     
    465465
    466466private:
    467     typedef ListHashSet<RenderObject*>::const_iterator Iterator;
     467    typedef ListHashSet<RenderBox*>::const_iterator Iterator;
    468468    DeprecatedPtrList<FloatingObject>* m_floatingObjects;
    469     ListHashSet<RenderObject*>* m_positionedObjects;
     469    ListHashSet<RenderBox*>* m_positionedObjects;
    470470         
    471471    // Allocated only when some of these fields have non-default values
  • trunk/WebCore/rendering/RenderBox.cpp

    r40086 r40124  
    3838#include "RenderArena.h"
    3939#include "RenderFlexibleBox.h"
     40#include "RenderInline.h"
    4041#include "RenderLayer.h"
    4142#include "RenderReplica.h"
     
    6162RenderBox::RenderBox(Node* node)
    6263    : RenderObject(node)
    63     , m_width(0)
    64     , m_height(0)
    65     , m_x(0)
    66     , m_y(0)
    6764    , m_marginLeft(0)
    6865    , m_marginRight(0)
     
    7471    , m_inlineBoxWrapper(0)
    7572{
     73    setIsBox();
    7674}
    7775
     
    215213}
    216214
     215
     216int RenderBox::offsetLeft() const
     217{
     218    RenderBox* offsetPar = offsetParent();
     219    if (!offsetPar)
     220        return 0;
     221    int xPos = x() - offsetPar->borderLeft();
     222    if (!isPositioned()) {
     223        if (isRelPositioned())
     224            xPos += relativePositionOffsetX();
     225        RenderObject* curr = parent();
     226        while (curr && curr != offsetPar) {
     227            // FIXME: What are we supposed to do inside SVG content?
     228            if (curr->isBox() && !curr->isTableRow())
     229                xPos += toRenderBox(curr)->x();
     230            curr = curr->parent();
     231        }
     232        if (offsetPar->isBody() && !offsetPar->isRelPositioned() && !offsetPar->isPositioned())
     233            xPos += offsetPar->x();
     234    }
     235    return xPos;
     236}
     237
     238int RenderBox::offsetTop() const
     239{
     240    RenderBox* offsetPar = offsetParent();
     241    if (!offsetPar)
     242        return 0;
     243    int yPos = m_frameRect.y() - offsetPar->borderTop();
     244    if (!isPositioned()) {
     245        if (isRelPositioned())
     246            yPos += relativePositionOffsetY();
     247        RenderObject* curr = parent();
     248        while (curr && curr != offsetPar) {
     249            // FIXME: What are we supposed to do inside SVG content?
     250            if (curr->isBox() && !curr->isTableRow())
     251                yPos += toRenderBox(curr)->y();
     252            curr = curr->parent();
     253        }
     254        if (offsetPar->isBody() && !offsetPar->isRelPositioned() && !offsetPar->isPositioned())
     255            yPos += offsetPar->y();
     256    }
     257    return yPos;
     258}
     259
     260RenderBox* RenderBox::offsetParent() const
     261{
     262    // FIXME: It feels like this function could almost be written using containing blocks.
     263    if (isBody())
     264        return 0;
     265
     266    bool skipTables = isPositioned() || isRelPositioned();
     267    float currZoom = style()->effectiveZoom();
     268    RenderObject* curr = parent();
     269    while (curr && (!curr->element() ||
     270                    (!curr->isPositioned() && !curr->isRelPositioned() && !curr->isBody()))) {
     271        Node* element = curr->element();
     272        if (!skipTables && element) {
     273            bool isTableElement = element->hasTagName(tableTag) ||
     274                                  element->hasTagName(tdTag) ||
     275                                  element->hasTagName(thTag);
     276
     277#if ENABLE(WML)
     278            if (!isTableElement && element->isWMLElement())
     279                isTableElement = element->hasTagName(WMLNames::tableTag) ||
     280                                 element->hasTagName(WMLNames::tdTag);
     281#endif
     282
     283            if (isTableElement)
     284                break;
     285        }
     286
     287        float newZoom = curr->style()->effectiveZoom();
     288        if (currZoom != newZoom)
     289            break;
     290        currZoom = newZoom;
     291        curr = curr->parent();
     292    }
     293    return curr && curr->isBox() ? toRenderBox(curr) : 0;
     294}
     295
     296// More IE extensions.  clientWidth and clientHeight represent the interior of an object
     297// excluding border and scrollbar.
     298int RenderBox::clientWidth() const
     299{
     300    return width() - borderLeft() - borderRight() - verticalScrollbarWidth();
     301}
     302
     303int RenderBox::clientHeight() const
     304{
     305    return height() - borderTop() - borderBottom() - horizontalScrollbarHeight();
     306}
     307
     308// scrollWidth/scrollHeight will be the same as clientWidth/clientHeight unless the
     309// object has overflow:hidden/scroll/auto specified and also has overflow.
     310int RenderBox::scrollWidth() const
     311{
     312    return hasOverflowClip() ? m_layer->scrollWidth() : overflowWidth();
     313}
     314
     315int RenderBox::scrollHeight() const
     316{
     317    return hasOverflowClip() ? m_layer->scrollHeight() : overflowHeight();
     318}
     319
     320int RenderBox::scrollLeft() const
     321{
     322    return hasOverflowClip() ? m_layer->scrollXOffset() : 0;
     323}
     324
     325int RenderBox::scrollTop() const
     326{
     327    return hasOverflowClip() ? m_layer->scrollYOffset() : 0;
     328}
     329
     330void RenderBox::setScrollLeft(int newLeft)
     331{
     332    if (hasOverflowClip())
     333        m_layer->scrollToXOffset(newLeft);
     334}
     335
     336void RenderBox::setScrollTop(int newTop)
     337{
     338    if (hasOverflowClip())
     339        m_layer->scrollToYOffset(newTop);
     340}
     341
     342void RenderBox::absoluteRects(Vector<IntRect>& rects, int tx, int ty, bool topLevel)
     343{
     344    // For blocks inside inlines, we go ahead and include margins so that we run right up to the
     345    // inline boxes above and below us (thus getting merged with them to form a single irregular
     346    // shape).
     347    RenderFlow* continuation = virtualContinuation();
     348    if (topLevel && continuation) {
     349        rects.append(IntRect(tx, ty - collapsedMarginTop(),
     350                             width(), height() + collapsedMarginTop() + collapsedMarginBottom()));
     351        continuation->absoluteRects(rects,
     352                                    tx - x() + continuation->containingBlock()->x(),
     353                                    ty - y() + continuation->containingBlock()->y(), topLevel);
     354    } else
     355        rects.append(IntRect(tx, ty, width(), height() + borderTopExtra() + borderBottomExtra()));
     356}
     357
     358void RenderBox::absoluteQuads(Vector<FloatQuad>& quads, bool topLevel)
     359{
     360    // For blocks inside inlines, we go ahead and include margins so that we run right up to the
     361    // inline boxes above and below us (thus getting merged with them to form a single irregular
     362    // shape).
     363    RenderFlow* continuation = virtualContinuation();
     364    if (topLevel && continuation) {
     365        FloatRect localRect(0, -collapsedMarginTop(),
     366                            width(), height() + collapsedMarginTop() + collapsedMarginBottom());
     367        quads.append(localToAbsoluteQuad(localRect));
     368        continuation->absoluteQuads(quads, topLevel);
     369    } else
     370        quads.append(localToAbsoluteQuad(FloatRect(0, 0, width(), height() + borderTopExtra() + borderBottomExtra())));
     371}
     372
     373IntRect RenderBox::absoluteContentBox() const
     374{
     375    IntRect rect = contentBoxRect();
     376    FloatPoint absPos = localToAbsoluteForContent(FloatPoint());
     377    rect.move(absPos.x(), absPos.y());
     378    return rect;
     379}
     380
     381FloatQuad RenderBox::absoluteContentQuad() const
     382{
     383    IntRect rect = contentBoxRect();
     384    return localToAbsoluteQuad(FloatRect(rect));
     385}
     386
     387
     388IntRect RenderBox::absoluteOutlineBounds() const
     389{
     390    IntRect box = borderBoxRect();
     391    adjustRectForOutlineAndShadow(box);
     392
     393    FloatQuad absOutlineQuad = localToAbsoluteQuad(FloatRect(box));
     394    box = absOutlineQuad.enclosingBoundingBox();
     395    box.move(view()->layoutDelta());
     396
     397    return box;
     398}
     399
     400void RenderBox::addFocusRingRects(GraphicsContext* graphicsContext, int tx, int ty)
     401{
     402    // For blocks inside inlines, we go ahead and include margins so that we run right up to the
     403    // inline boxes above and below us (thus getting merged with them to form a single irregular
     404    // shape).
     405    RenderFlow* continuation = virtualContinuation();
     406    if (continuation) {
     407        graphicsContext->addFocusRingRect(IntRect(tx, ty - collapsedMarginTop(), width(), height() + collapsedMarginTop() + collapsedMarginBottom()));
     408        continuation->addFocusRingRects(graphicsContext,
     409                                        tx - x() + continuation->containingBlock()->x(),
     410                                        ty - y() + continuation->containingBlock()->y());
     411    } else
     412        graphicsContext->addFocusRingRect(IntRect(tx, ty, width(), height()));
     413}
     414
     415
     416IntRect RenderBox::reflectionBox() const
     417{
     418    IntRect result;
     419    if (!style()->boxReflect())
     420        return result;
     421    IntRect box = borderBoxRect();
     422    result = box;
     423    switch (style()->boxReflect()->direction()) {
     424        case ReflectionBelow:
     425            result.move(0, box.height() + reflectionOffset());
     426            break;
     427        case ReflectionAbove:
     428            result.move(0, -box.height() - reflectionOffset());
     429            break;
     430        case ReflectionLeft:
     431            result.move(-box.width() - reflectionOffset(), 0);
     432            break;
     433        case ReflectionRight:
     434            result.move(box.width() + reflectionOffset(), 0);
     435            break;
     436    }
     437    return result;
     438}
     439
     440int RenderBox::reflectionOffset() const
     441{
     442    if (!style()->boxReflect())
     443        return 0;
     444    if (style()->boxReflect()->direction() == ReflectionLeft || style()->boxReflect()->direction() == ReflectionRight)
     445        return style()->boxReflect()->offset().calcValue(borderBoxRect().width());
     446    return style()->boxReflect()->offset().calcValue(borderBoxRect().height());
     447}
     448
     449IntRect RenderBox::reflectedRect(const IntRect& r) const
     450{
     451    if (!style()->boxReflect())
     452        return IntRect();
     453
     454    IntRect box = borderBoxRect();
     455    IntRect result = r;
     456    switch (style()->boxReflect()->direction()) {
     457        case ReflectionBelow:
     458            result.setY(box.bottom() + reflectionOffset() + (box.bottom() - r.bottom()));
     459            break;
     460        case ReflectionAbove:
     461            result.setY(box.y() - reflectionOffset() - box.height() + (box.bottom() - r.bottom()));
     462            break;
     463        case ReflectionLeft:
     464            result.setX(box.x() - reflectionOffset() - box.width() + (box.right() - r.right()));
     465            break;
     466        case ReflectionRight:
     467            result.setX(box.right() + reflectionOffset() + (box.right() - r.right()));
     468            break;
     469    }
     470    return result;
     471}
     472
    217473int RenderBox::minPrefWidth() const
    218474{
     
    255511int RenderBox::overrideWidth() const
    256512{
    257     return hasOverrideSize() ? overrideSize() : m_width;
     513    return hasOverrideSize() ? overrideSize() : width();
    258514}
    259515
    260516int RenderBox::overrideHeight() const
    261517{
    262     return hasOverrideSize() ? overrideSize() : m_height;
    263 }
    264 
    265 void RenderBox::setPos(int xPos, int yPos)
    266 {
    267     // Optimize for the case where we don't move at all.
    268     if (xPos == m_x && yPos == m_y)
    269         return;
    270 
    271     m_x = xPos;
    272     m_y = yPos;
     518    return hasOverrideSize() ? overrideSize() : height();
    273519}
    274520
     
    304550
    305551// Hit Testing
    306 bool RenderBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int x, int y, int tx, int ty, HitTestAction action)
    307 {
    308     tx += m_x;
    309     ty += m_y;
     552bool RenderBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int xPos, int yPos, int tx, int ty, HitTestAction action)
     553{
     554    tx += x();
     555    ty += m_frameRect.y();
    310556
    311557    // Check kids first.
     
    315561        // table-specific hit-test method (which we should do for performance reasons anyway),
    316562        // then we can remove this check.
    317         if (!child->hasLayer() && !child->isInlineFlow() && child->nodeAtPoint(request, result, x, y, tx, ty, action)) {
    318             updateHitTestResult(result, IntPoint(x - tx, y - ty));
     563        if (!child->hasLayer() && !child->isInlineFlow() && child->nodeAtPoint(request, result, xPos, yPos, tx, ty, action)) {
     564            updateHitTestResult(result, IntPoint(xPos - tx, yPos - ty));
    319565            return true;
    320566        }
     
    323569    // Check our bounds next. For this purpose always assume that we can only be hit in the
    324570    // foreground phase (which is true for replaced elements like images).
    325     if (visibleToHitTesting() && action == HitTestForeground && IntRect(tx, ty, m_width, m_height).contains(x, y)) {
    326         updateHitTestResult(result, IntPoint(x - tx, y - ty));
     571    if (visibleToHitTesting() && action == HitTestForeground && IntRect(tx, ty, width(), height()).contains(xPos, yPos)) {
     572        updateHitTestResult(result, IntPoint(xPos - tx, yPos - ty));
    327573        return true;
    328574    }
     
    335581void RenderBox::paint(PaintInfo& paintInfo, int tx, int ty)
    336582{
    337     tx += m_x;
    338     ty += m_y;
     583    tx += x();
     584    ty += m_frameRect.y();
    339585
    340586    // default implementation. Just pass paint through to the children
     
    490736IntRect RenderBox::maskClipRect()
    491737{
    492     IntRect bbox = borderBox();
     738    IntRect bbox = borderBoxRect();
    493739    if (style()->maskBoxImage().image())
    494740        return bbox;
     
    607853                } else {
    608854                    layerRenderer = this;
    609                     rendererRect = borderBox();
     855                    rendererRect = borderBoxRect();
    610856                }
    611857            }
     
    8881134    if (r) {
    8891135        FloatRect rootRect(tx + r->xPos(), ty + r->selectionTop(), r->width(), r->selectionHeight());
    890         FloatRect imageRect(tx + m_x, rootRect.y(), width(), rootRect.height());
     1136        FloatRect imageRect(tx + x(), rootRect.y(), width(), rootRect.height());
    8911137        page->chrome()->client()->paintCustomHighlight(node(), type, imageRect, rootRect, behindText, false);
    8921138    } else {
    893         FloatRect imageRect(tx + m_x, ty + m_y, width(), height());
     1139        FloatRect imageRect(tx + x(), ty + m_frameRect.y(), width(), height());
    8941140        page->chrome()->client()->paintCustomHighlight(node(), type, imageRect, imageRect, behindText, false);
    8951141    }
     
    9081154    int clipX = tx + bLeft;
    9091155    int clipY = ty + bTop;
    910     int clipWidth = m_width - bLeft - borderRight();
    911     int clipHeight = m_height - bTop - borderBottom() + borderTopExtra() + borderBottomExtra();
     1156    int clipWidth = width() - bLeft - borderRight();
     1157    int clipHeight = height() - bTop - borderBottom() + borderTopExtra() + borderBottomExtra();
    9121158
    9131159    // Subtract out scrollbars if we have them.
     
    9241170    int clipX = tx;
    9251171    int clipY = ty;
    926     int clipWidth = m_width;
    927     int clipHeight = m_height;
     1172    int clipWidth = width();
     1173    int clipHeight = height();
    9281174
    9291175    if (!style()->clipLeft().isAuto()) {
    930         int c = style()->clipLeft().calcValue(m_width);
     1176        int c = style()->clipLeft().calcValue(width());
    9311177        clipX += c;
    9321178        clipWidth -= c;
     
    9341180
    9351181    if (!style()->clipRight().isAuto())
    936         clipWidth -= m_width - style()->clipRight().calcValue(m_width);
     1182        clipWidth -= width() - style()->clipRight().calcValue(width());
    9371183
    9381184    if (!style()->clipTop().isAuto()) {
    939         int c = style()->clipTop().calcValue(m_height);
     1185        int c = style()->clipTop().calcValue(height());
    9401186        clipY += c;
    9411187        clipHeight -= c;
     
    9431189
    9441190    if (!style()->clipBottom().isAuto())
    945         clipHeight -= m_height - style()->clipBottom().calcValue(m_height);
     1191        clipHeight -= height() - style()->clipBottom().calcValue(height());
    9461192
    9471193    return IntRect(clipX, clipY, clipWidth, clipHeight);
     
    9541200        return 0;
    9551201    if (shrinkToAvoidFloats())
    956         return cb->lineWidth(m_y);
     1202        return cb->lineWidth(m_frameRect.y());
    9571203    return cb->availableWidth();
    9581204}
     
    10011247            LayoutState* layoutState = v->layoutState();
    10021248            IntSize offset = layoutState->m_offset;
    1003             offset.expand(m_x, m_y);
     1249            offset.expand(x(), m_frameRect.y());
    10041250            localPoint += offset;
    10051251            if (style()->position() == RelativePosition && m_layer)
     
    10941340        if (o->isBlockFlow() && style()->position() != AbsolutePosition && style()->position() != FixedPosition
    10951341                && (cb = static_cast<RenderBlock*>(o))->hasColumns()) {
    1096             IntRect rect(m_x, m_y, 1, 1);
     1342            IntRect rect(x(), m_frameRect.y(), 1, 1);
    10971343            cb->adjustRectForColumns(rect);
    10981344            offset.expand(rect.x(), rect.y());
    10991345        } else
    1100             offset.expand(m_x, m_y);
     1346            offset.expand(x(), m_frameRect.y());
    11011347    }
    11021348
     
    11451391        box->destroy(renderArena());
    11461392    } else if (isReplaced()) {
    1147         m_x = box->xPos();
    1148         m_y = box->yPos();
     1393        setLocation(box->xPos(), box->yPos());
    11491394        m_inlineBoxWrapper = box;
    11501395    }
     
    11961441                rect.move(m_layer->relativePositionOffset());
    11971442
    1198             rect.move(m_x, m_y);
     1443            rect.move(x(), m_frameRect.y());
    11991444            rect.move(layoutState->m_offset);
    12001445            if (layoutState->m_clipped)
     
    12121457
    12131458    IntPoint topLeft = rect.location();
    1214     topLeft.move(m_x, m_y);
     1459    topLeft.move(x(), m_frameRect.y());
    12151460
    12161461    if (style()->position() == FixedPosition)
     
    12341479        // FIXME: this clobbers topLeft adjustment done for multicol above
    12351480        topLeft = rect.location();
    1236         topLeft.move(m_x, m_y);
     1481        topLeft.move(x(), m_frameRect.y());
    12371482    }
    12381483
     
    12681513void RenderBox::repaintDuringLayoutIfMoved(const IntRect& rect)
    12691514{
    1270     int newX = m_x;
    1271     int newY = m_y;
    1272     int newWidth = m_width;
    1273     int newHeight = m_height;
     1515    int newX = x();
     1516    int newY = m_frameRect.y();
     1517    int newWidth = width();
     1518    int newHeight = height();
    12741519    if (rect.x() != newX || rect.y() != newY) {
    12751520        // The child moved.  Invalidate the object's old and new positions.  We have to do this
    12761521        // since the object may not have gotten a layout.
    1277         m_x = rect.x();
    1278         m_y = rect.y();
    1279         m_width = rect.width();
    1280         m_height = rect.height();
     1522        m_frameRect = rect;
    12811523        repaint();
    12821524        repaintOverhangingFloats(true);
    1283 
    1284         m_x = newX;
    1285         m_y = newY;
    1286         m_width = newWidth;
    1287         m_height = newHeight;
     1525        m_frameRect = IntRect(newX, newY, newWidth, newHeight);
    12881526        repaint();
    12891527        repaintOverhangingFloats(true);
     
    13301568    if (hasOverrideSize() &&  parent()->style()->boxOrient() == HORIZONTAL
    13311569            && parent()->isFlexibleBox() && parent()->isFlexingChildren()) {
    1332         m_width = overrideSize();
     1570        setWidth(overrideSize());
    13331571        return;
    13341572    }
     
    13381576    bool treatAsReplaced = shouldCalculateSizeAsReplaced() && (!inVerticalBox || !stretching);
    13391577
    1340     Length width = (treatAsReplaced) ? Length(calcReplacedWidth(), Fixed) : style()->width();
     1578    Length w = (treatAsReplaced) ? Length(calcReplacedWidth(), Fixed) : style()->width();
    13411579
    13421580    RenderBlock* cb = containingBlock();
     
    13511589        m_marginRight = marginRight.calcMinValue(containerWidth);
    13521590        if (treatAsReplaced)
    1353             m_width = max(width.value() + borderLeft() + borderRight() + paddingLeft() + paddingRight(), minPrefWidth());
     1591            setWidth(max(w.value() + borderLeft() + borderRight() + paddingLeft() + paddingRight(), minPrefWidth()));
    13541592
    13551593        return;
     
    13581596    // Width calculations
    13591597    if (treatAsReplaced)
    1360         m_width = width.value() + borderLeft() + borderRight() + paddingLeft() + paddingRight();
     1598        setWidth(w.value() + borderLeft() + borderRight() + paddingLeft() + paddingRight());
    13611599    else {
    13621600        // Calculate Width
    1363         m_width = calcWidthUsing(Width, containerWidth);
     1601        setWidth(calcWidthUsing(Width, containerWidth));
    13641602
    13651603        // Calculate MaxWidth
    13661604        if (!style()->maxWidth().isUndefined()) {
    13671605            int maxW = calcWidthUsing(MaxWidth, containerWidth);
    1368             if (m_width > maxW) {
    1369                 m_width = maxW;
    1370                 width = style()->maxWidth();
     1606            if (width() > maxW) {
     1607                setWidth(maxW);
     1608                w = style()->maxWidth();
    13711609            }
    13721610        }
     
    13741612        // Calculate MinWidth
    13751613        int minW = calcWidthUsing(MinWidth, containerWidth);
    1376         if (m_width < minW) {
    1377             m_width = minW;
    1378             width = style()->minWidth();
     1614        if (width() < minW) {
     1615            setWidth(minW);
     1616            w = style()->minWidth();
    13791617        }
    13801618    }
    13811619
    13821620    if (stretchesToMinIntrinsicWidth()) {
    1383         m_width = max(m_width, minPrefWidth());
    1384         width = Length(m_width, Fixed);
     1621        setWidth(max(width(), minPrefWidth()));
     1622        w = Length(width(), Fixed);
    13851623    }
    13861624
    13871625    // Margin calculations
    1388     if (width.isAuto()) {
     1626    if (w.isAuto()) {
    13891627        m_marginLeft = marginLeft.calcMinValue(containerWidth);
    13901628        m_marginRight = marginRight.calcMinValue(containerWidth);
     
    13951633    }
    13961634
    1397     if (containerWidth && containerWidth != (m_width + m_marginLeft + m_marginRight)
     1635    if (containerWidth && containerWidth != (width() + m_marginLeft + m_marginRight)
    13981636            && !isFloating() && !isInline() && !cb->isFlexibleBox()) {
    13991637        if (cb->style()->direction() == LTR)
    1400             m_marginRight = containerWidth - m_width - m_marginLeft;
     1638            m_marginRight = containerWidth - width() - m_marginLeft;
    14011639        else
    1402             m_marginLeft = containerWidth - m_width - m_marginRight;
     1640            m_marginLeft = containerWidth - width() - m_marginRight;
    14031641    }
    14041642}
     
    14061644int RenderBox::calcWidthUsing(WidthType widthType, int cw)
    14071645{
    1408     int width = m_width;
     1646    int widthResult = width();
    14091647    Length w;
    14101648    if (widthType == Width)
     
    14191657        int marginRight = style()->marginRight().calcMinValue(cw);
    14201658        if (cw)
    1421             width = cw - marginLeft - marginRight;
     1659            widthResult = cw - marginLeft - marginRight;
    14221660
    14231661        if (sizesToIntrinsicWidth(widthType)) {
    1424             width = max(width, minPrefWidth());
    1425             width = min(width, maxPrefWidth());
     1662            widthResult = max(widthResult, minPrefWidth());
     1663            widthResult = min(widthResult, maxPrefWidth());
    14261664        }
    14271665    } else
    1428         width = calcBorderBoxWidth(w.calcValue(cw));
    1429 
    1430     return width;
     1666        widthResult = calcBorderBoxWidth(w.calcValue(cw));
     1667
     1668    return widthResult;
    14311669}
    14321670
     
    14711709    }
    14721710
    1473     if ((marginLeft.isAuto() && marginRight.isAuto() && m_width < containerWidth)
     1711    if ((marginLeft.isAuto() && marginRight.isAuto() && width() < containerWidth)
    14741712            || (!marginLeft.isAuto() && !marginRight.isAuto() && containingBlock()->style()->textAlign() == WEBKIT_CENTER)) {
    1475         m_marginLeft = max(0, (containerWidth - m_width) / 2);
    1476         m_marginRight = containerWidth - m_width - m_marginLeft;
    1477     } else if ((marginRight.isAuto() && m_width < containerWidth)
     1713        m_marginLeft = max(0, (containerWidth - width()) / 2);
     1714        m_marginRight = containerWidth - width() - m_marginLeft;
     1715    } else if ((marginRight.isAuto() && width() < containerWidth)
    14781716            || (!marginLeft.isAuto() && containingBlock()->style()->direction() == RTL && containingBlock()->style()->textAlign() == WEBKIT_LEFT)) {
    14791717        m_marginLeft = marginLeft.calcValue(containerWidth);
    1480         m_marginRight = containerWidth - m_width - m_marginLeft;
    1481     } else if ((marginLeft.isAuto() && m_width < containerWidth)
     1718        m_marginRight = containerWidth - width() - m_marginLeft;
     1719    } else if ((marginLeft.isAuto() && width() < containerWidth)
    14821720            || (!marginRight.isAuto() && containingBlock()->style()->direction() == LTR && containingBlock()->style()->textAlign() == WEBKIT_RIGHT)) {
    14831721        m_marginRight = marginRight.calcValue(containerWidth);
    1484         m_marginLeft = containerWidth - m_width - m_marginRight;
     1722        m_marginLeft = containerWidth - width() - m_marginRight;
    14851723    } else {
    1486         // This makes auto margins 0 if we failed a m_width < containerWidth test above (css2.1, 10.3.3).
     1724        // This makes auto margins 0 if we failed a width() < containerWidth test above (css2.1, 10.3.3).
    14871725        m_marginLeft = marginLeft.calcMinValue(containerWidth);
    14881726        m_marginRight = marginRight.calcMinValue(containerWidth);
     
    15261764        if (h.isAuto() && parent()->isFlexibleBox() && parent()->style()->boxOrient() == HORIZONTAL
    15271765                && parent()->isStretchingChildren()) {
    1528             h = Length(parent()->contentHeight() - marginTop() - marginBottom() -
     1766            h = Length(parentBox()->contentHeight() - marginTop() - marginBottom() -
    15291767                       borderTop() - paddingTop() - borderBottom() - paddingBottom(), Fixed);
    15301768            checkMinMaxHeight = false;
    15311769        }
    15321770
    1533         int height;
     1771        int heightResult;
    15341772        if (checkMinMaxHeight) {
    1535             height = calcHeightUsing(style()->height());
    1536             if (height == -1)
    1537                 height = m_height;
     1773            heightResult = calcHeightUsing(style()->height());
     1774            if (heightResult == -1)
     1775                heightResult = height();
    15381776            int minH = calcHeightUsing(style()->minHeight()); // Leave as -1 if unset.
    1539             int maxH = style()->maxHeight().isUndefined() ? height : calcHeightUsing(style()->maxHeight());
     1777            int maxH = style()->maxHeight().isUndefined() ? heightResult : calcHeightUsing(style()->maxHeight());
    15401778            if (maxH == -1)
    1541                 maxH = height;
    1542             height = min(maxH, height);
    1543             height = max(minH, height);
     1779                maxH = heightResult;
     1780            heightResult = min(maxH, heightResult);
     1781            heightResult = max(minH, heightResult);
    15441782        } else
    15451783            // The only times we don't check min/max height are when a fixed length has
    15461784            // been given as an override.  Just use that.  The value has already been adjusted
    15471785            // for box-sizing.
    1548             height = h.value() + borderTop() + borderBottom() + paddingTop() + paddingBottom();
    1549 
    1550         m_height = height;
    1551     }
     1786            heightResult = h.value() + borderTop() + borderBottom() + paddingTop() + paddingBottom();
     1787
     1788            setHeight(heightResult);
     1789        }
    15521790
    15531791    // WinIE quirk: The <html> block always fills the entire canvas in quirks mode.  The <body> always fills the
     
    15581796        int visHeight = view()->viewHeight();
    15591797        if (isRoot())
    1560             m_height = max(m_height, visHeight - margins);
     1798            setHeight(max(height(), visHeight - margins));
    15611799        else {
    15621800            int marginsBordersPadding = margins + parent()->marginTop() + parent()->marginBottom()
    15631801                + parent()->borderTop() + parent()->borderBottom()
    15641802                + parent()->paddingTop() + parent()->paddingBottom();
    1565             m_height = max(m_height, visHeight - marginsBordersPadding);
     1803            setHeight(max(height(), visHeight - marginsBordersPadding));
    15661804        }
    15671805    }
     
    16341872            result = cb->calcContentBoxHeight(result);
    16351873    } else if (cb->isRenderView() || (cb->isBody() && style()->htmlHacks()) || isPositionedWithSpecifiedHeight) {
    1636         // Don't allow this to affect the block' m_height member variable, since this
     1874        // Don't allow this to affect the block' height() member variable, since this
    16371875        // can get called while the block is still laying out its kids.
    16381876        int oldHeight = cb->height();
     
    17151953            }
    17161954           
    1717             int availableHeight = isPositioned() ? containingBlockHeightForPositioned(cb) : cb->availableHeight();
     1955            int availableHeight = isPositioned() ? containingBlockHeightForPositioned(cb) : toRenderBox(cb)->availableHeight();
    17181956
    17191957            // It is necessary to use the border-box to match WinIE's broken
     
    18382076    }
    18392077
    1840     return containingBlock->width() - containingBlock->borderLeft() - containingBlock->borderRight() - containingBlock->verticalScrollbarWidth();
     2078    return RenderBox::toConstRenderBox(containingBlock)->width() - containingBlock->borderLeft() - containingBlock->borderRight() - containingBlock->verticalScrollbarWidth();
    18412079}
    18422080
    18432081int RenderBox::containingBlockHeightForPositioned(const RenderObject* containingBlock) const
    18442082{
    1845     return containingBlock->height() - containingBlock->borderTop() - containingBlock->borderBottom();
     2083    int heightResult;
     2084    if (containingBlock->isRenderInline()) {
     2085        ASSERT(containingBlock->isRelPositioned());
     2086        heightResult = static_cast<const RenderInline*>(containingBlock)->boundingBoxHeight();
     2087    } else
     2088        heightResult = RenderBox::toConstRenderBox(containingBlock)->height();
     2089   
     2090    return heightResult - containingBlock->borderTop() - containingBlock->borderBottom();
    18462091}
    18472092
     
    18682113
    18692114    // FIXME 3: Can perhaps optimize out cases when max-width/min-width are greater
    1870     // than or less than the computed m_width.  Be careful of box-sizing and
     2115    // than or less than the computed width().  Be careful of box-sizing and
    18712116    // percentage issues.
    18722117
     
    19242169            // 'staticX' should already have been set through layout of the parent.
    19252170            int staticPosition = staticX() - containerBlock->borderLeft();
    1926             for (RenderObject* po = parent(); po && po != containerBlock; po = po->parent())
    1927                 staticPosition += po->xPos();
     2171            for (RenderBox* po = parentBox(); po && po != containerBlock; po = po->parentBox())
     2172                staticPosition += po->x();
    19282173            left.setValue(Fixed, staticPosition);
    19292174        } else {
    1930             RenderObject* po = parent();
     2175            RenderBox* po = parentBox();
    19312176            // 'staticX' should already have been set through layout of the parent.
    19322177            int staticPosition = staticX() + containerWidth + containerBlock->borderRight() - po->width();
    1933             for (; po && po != containerBlock; po = po->parent())
    1934                 staticPosition -= po->xPos();
     2178            for (; po && po != containerBlock; po = po->parentBox())
     2179                staticPosition -= po->x();
    19352180            right.setValue(Fixed, staticPosition);
    19362181        }
     
    19382183
    19392184    // Calculate constraint equation values for 'width' case.
     2185    int widthResult;
     2186    int xResult;
    19402187    calcAbsoluteHorizontalValues(style()->width(), containerBlock, containerDirection,
    19412188                                 containerWidth, bordersPlusPadding,
    19422189                                 left, right, marginLeft, marginRight,
    1943                                  m_width, m_marginLeft, m_marginRight, m_x);
     2190                                 widthResult, m_marginLeft, m_marginRight, xResult);
     2191    setWidth(widthResult);
     2192    setX(xResult);
    19442193
    19452194    // Calculate constraint equation values for 'max-width' case.
     
    19552204                                     maxWidth, maxMarginLeft, maxMarginRight, maxXPos);
    19562205
    1957         if (m_width > maxWidth) {
    1958             m_width = maxWidth;
     2206        if (width() > maxWidth) {
     2207            setWidth(maxWidth);
    19592208            m_marginLeft = maxMarginLeft;
    19602209            m_marginRight = maxMarginRight;
    1961             m_x = maxXPos;
     2210            m_frameRect.setX(maxXPos);
    19622211        }
    19632212    }
     
    19752224                                     minWidth, minMarginLeft, minMarginRight, minXPos);
    19762225
    1977         if (m_width < minWidth) {
    1978             m_width = minWidth;
     2226        if (width() < minWidth) {
     2227            setWidth(minWidth);
    19792228            m_marginLeft = minMarginLeft;
    19802229            m_marginRight = minMarginRight;
    1981             m_x = minXPos;
    1982         }
    1983     }
    1984 
    1985     if (stretchesToMinIntrinsicWidth() && m_width < minPrefWidth() - bordersPlusPadding)
     2230            m_frameRect.setX(minXPos);
     2231        }
     2232    }
     2233
     2234    if (stretchesToMinIntrinsicWidth() && width() < minPrefWidth() - bordersPlusPadding) {
    19862235        calcAbsoluteHorizontalValues(Length(minPrefWidth() - bordersPlusPadding, Fixed), containerBlock, containerDirection,
    19872236                                     containerWidth, bordersPlusPadding,
    19882237                                     left, right, marginLeft, marginRight,
    1989                                      m_width, m_marginLeft, m_marginRight, m_x);
    1990 
    1991     // Put m_width into correct form.
    1992     m_width += bordersPlusPadding;
     2238                                     widthResult, m_marginLeft, m_marginRight, xResult);
     2239        setWidth(widthResult);
     2240        setX(xResult);
     2241    }
     2242
     2243    // Put width() into correct form.
     2244    setWidth(width() + bordersPlusPadding);
    19932245}
    19942246
     
    22122464        // staticY should already have been set through layout of the parent()
    22132465        int staticTop = staticY() - containerBlock->borderTop();
    2214         for (RenderObject* po = parent(); po && po != containerBlock; po = po->parent()) {
     2466        for (RenderBox* po = parentBox(); po && po != containerBlock; po = po->parentBox()) {
    22152467            if (!po->isTableRow())
    2216                 staticTop += po->yPos();
     2468                staticTop += po->y();
    22172469        }
    22182470        top.setValue(Fixed, staticTop);
     
    22202472
    22212473
    2222     int height; // Needed to compute overflow.
     2474    int h; // Needed to compute overflow.
     2475    int y;
    22232476
    22242477    // Calculate constraint equation values for 'height' case.
    22252478    calcAbsoluteVerticalValues(style()->height(), containerBlock, containerHeight, bordersPlusPadding,
    22262479                               top, bottom, marginTop, marginBottom,
    2227                                height, m_marginTop, m_marginBottom, m_y);
     2480                               h, m_marginTop, m_marginBottom, y);
     2481    setY(y);
    22282482
    22292483    // Avoid doing any work in the common case (where the values of min-height and max-height are their defaults).
     
    22412495                                   maxHeight, maxMarginTop, maxMarginBottom, maxYPos);
    22422496
    2243         if (height > maxHeight) {
    2244             height = maxHeight;
     2497        if (h > maxHeight) {
     2498            h = maxHeight;
    22452499            m_marginTop = maxMarginTop;
    22462500            m_marginBottom = maxMarginBottom;
    2247             m_y = maxYPos;
     2501            m_frameRect.setY(maxYPos);
    22482502        }
    22492503    }
     
    22602514                                   minHeight, minMarginTop, minMarginBottom, minYPos);
    22612515
    2262         if (height < minHeight) {
    2263             height = minHeight;
     2516        if (h < minHeight) {
     2517            h = minHeight;
    22642518            m_marginTop = minMarginTop;
    22652519            m_marginBottom = minMarginBottom;
    2266             m_y = minYPos;
     2520            m_frameRect.setY(minYPos);
    22672521        }
    22682522    }
    22692523
    22702524    // Set final height value.
    2271     m_height = height + bordersPlusPadding;
    2272 }
    2273 
    2274 void RenderBox::calcAbsoluteVerticalValues(Length height, const RenderObject* containerBlock,
     2525    setHeight(h + bordersPlusPadding);
     2526}
     2527
     2528void RenderBox::calcAbsoluteVerticalValues(Length h, const RenderObject* containerBlock,
    22752529                                           const int containerHeight, const int bordersPlusPadding,
    22762530                                           const Length top, const Length bottom, const Length marginTop, const Length marginBottom,
     
    22812535    ASSERT(!(top.isAuto() && bottom.isAuto()));
    22822536
    2283     int contentHeight = m_height - bordersPlusPadding;
     2537    int contentHeight = height() - bordersPlusPadding;
    22842538
    22852539    int topValue = 0;
    22862540
    2287     bool heightIsAuto = height.isAuto();
     2541    bool heightIsAuto = h.isAuto();
    22882542    bool topIsAuto = top.isAuto();
    22892543    bool bottomIsAuto = bottom.isAuto();
     
    22912545    // Height is never unsolved for tables.
    22922546    if (isTable()) {
    2293         height.setValue(Fixed, contentHeight);
     2547        h.setValue(Fixed, contentHeight);
    22942548        heightIsAuto = false;
    22952549    }
     
    23072561        // case because the value is not used for any further calculations.
    23082562
    2309         heightValue = calcContentBoxHeight(height.calcValue(containerHeight));
     2563        heightValue = calcContentBoxHeight(h.calcValue(containerHeight));
    23102564        topValue = top.calcValue(containerHeight);
    23112565
     
    23742628        } else if (topIsAuto && !heightIsAuto && !bottomIsAuto) {
    23752629            // RULE 4: (solve of top)
    2376             heightValue = calcContentBoxHeight(height.calcValue(containerHeight));
     2630            heightValue = calcContentBoxHeight(h.calcValue(containerHeight));
    23772631            topValue = availableSpace - (heightValue + bottom.calcValue(containerHeight));
    23782632        } else if (!topIsAuto && heightIsAuto && !bottomIsAuto) {
     
    23822636        } else if (!topIsAuto && !heightIsAuto && bottomIsAuto) {
    23832637            // RULE 6: (no need solve of bottom)
    2384             heightValue = calcContentBoxHeight(height.calcValue(containerHeight));
     2638            heightValue = calcContentBoxHeight(h.calcValue(containerHeight));
    23852639            topValue = top.calcValue(containerHeight);
    23862640        }
     
    24232677    // are dealt with in calcReplacedWidth().  This means that the steps to produce
    24242678    // correct max/min in the non-replaced version, are not necessary.
    2425     m_width = calcReplacedWidth() + borderLeft() + borderRight() + paddingLeft() + paddingRight();
    2426     const int availableSpace = containerWidth - m_width;
     2679    setWidth(calcReplacedWidth() + borderLeft() + borderRight() + paddingLeft() + paddingRight());
     2680    const int availableSpace = containerWidth - width();
    24272681
    24282682    /*-----------------------------------------------------------------------*\
     
    24372691            // 'staticX' should already have been set through layout of the parent.
    24382692            int staticPosition = staticX() - containerBlock->borderLeft();
    2439             for (RenderObject* po = parent(); po && po != containerBlock; po = po->parent())
    2440                 staticPosition += po->xPos();
     2693            for (RenderBox* po = parentBox(); po && po != containerBlock; po = po->parentBox())
     2694                staticPosition += po->x();
    24412695            left.setValue(Fixed, staticPosition);
    24422696        } else {
    2443             RenderObject* po = parent();
     2697            RenderBox* po = parentBox();
    24442698            // 'staticX' should already have been set through layout of the parent.
    24452699            int staticPosition = staticX() + containerWidth + containerBlock->borderRight() - po->width();
    2446             for (; po && po != containerBlock; po = po->parent())
    2447                 staticPosition -= po->xPos();
     2700            for (; po && po != containerBlock; po = po->parentBox())
     2701                staticPosition -= po->x();
    24482702            right.setValue(Fixed, staticPosition);
    24492703        }
     
    25422796    // NOTE:  It is not necessary to solve for 'right' when the direction is
    25432797    // LTR because the value is not used.
    2544     int totalWidth = m_width + leftValue + rightValue +  m_marginLeft + m_marginRight;
     2798    int totalWidth = width() + leftValue + rightValue +  m_marginLeft + m_marginRight;
    25452799    if (totalWidth > containerWidth && (containerDirection == RTL))
    25462800        leftValue = containerWidth - (totalWidth - leftValue);
     
    25572811        InlineFlowBox* lastLine = flow->lastLineBox();
    25582812        if (firstLine && lastLine && firstLine != lastLine) {
    2559             m_x = leftValue + m_marginLeft + lastLine->borderLeft() + (lastLine->xPos() - firstLine->xPos());
     2813            m_frameRect.setX(leftValue + m_marginLeft + lastLine->borderLeft() + (lastLine->xPos() - firstLine->xPos()));
    25602814            return;
    25612815        }
    25622816    }
    25632817
    2564     m_x = leftValue + m_marginLeft + containerBlock->borderLeft();
     2818    m_frameRect.setX(leftValue + m_marginLeft + containerBlock->borderLeft());
    25652819}
    25662820
     
    25922846    // are dealt with in calcReplacedHeight().  This means that the steps to produce
    25932847    // correct max/min in the non-replaced version, are not necessary.
    2594     m_height = calcReplacedHeight() + borderTop() + borderBottom() + paddingTop() + paddingBottom();
    2595     const int availableSpace = containerHeight - m_height;
     2848    setHeight(calcReplacedHeight() + borderTop() + borderBottom() + paddingTop() + paddingBottom());
     2849    const int availableSpace = containerHeight - height();
    25962850
    25972851    /*-----------------------------------------------------------------------*\
     
    26032857        // staticY should already have been set through layout of the parent().
    26042858        int staticTop = staticY() - containerBlock->borderTop();
    2605         for (RenderObject* po = parent(); po && po != containerBlock; po = po->parent()) {
     2859        for (RenderBox* po = parentBox(); po && po != containerBlock; po = po->parentBox()) {
    26062860            if (!po->isTableRow())
    2607                 staticTop += po->yPos();
     2861                staticTop += po->y();
    26082862        }
    26092863        top.setValue(Fixed, staticTop);
     
    26942948
    26952949    // Use computed values to calculate the vertical position.
    2696     m_y = topValue + m_marginTop + containerBlock->borderTop();
     2950    m_frameRect.setY(topValue + m_marginTop + containerBlock->borderTop());
    26972951}
    26982952
     
    27062960    // FIXME: What about border and padding?
    27072961    const int caretWidth = 1;
    2708     IntRect rect(xPos(), yPos(), caretWidth, m_height);
     2962    IntRect rect(x(), y(), caretWidth, height());
    27092963    TextDirection direction = box ? box->direction() : style()->direction();
    27102964
    27112965    if ((!caretOffset) ^ (direction == LTR))
    2712         rect.move(IntSize(m_width - caretWidth, 0));
     2966        rect.move(IntSize(width() - caretWidth, 0));
    27132967
    27142968    if (box) {
     
    27322986
    27332987    if (extraWidthToEndOfLine)
    2734         *extraWidthToEndOfLine = xPos() + m_width - rect.right();
     2988        *extraWidthToEndOfLine = x() + width() - rect.right();
    27352989
    27362990    // Move to local coords
    2737     rect.move(-xPos(), -yPos());
     2991    rect.move(-x(), -y());
    27382992    return rect;
    27392993}
     
    27412995int RenderBox::lowestPosition(bool /*includeOverflowInterior*/, bool includeSelf) const
    27422996{
    2743     if (!includeSelf || !m_width)
     2997    if (!includeSelf || !width())
    27442998        return 0;
    2745     int bottom = m_height;
     2999    int bottom = height();
    27463000    if (isRelPositioned())
    27473001        bottom += relativePositionOffsetY();
     
    27513005int RenderBox::rightmostPosition(bool /*includeOverflowInterior*/, bool includeSelf) const
    27523006{
    2753     if (!includeSelf || !m_height)
     3007    if (!includeSelf || !height())
    27543008        return 0;
    2755     int right = m_width;
     3009    int right = width();
    27563010    if (isRelPositioned())
    27573011        right += relativePositionOffsetX();
     
    27613015int RenderBox::leftmostPosition(bool /*includeOverflowInterior*/, bool includeSelf) const
    27623016{
    2763     if (!includeSelf || !m_height)
    2764         return m_width;
     3017    if (!includeSelf || !height())
     3018        return width();
    27653019    int left = 0;
    27663020    if (isRelPositioned())
     
    27693023}
    27703024
     3025#if ENABLE(SVG)
     3026
     3027TransformationMatrix RenderBox::localTransform() const
     3028{
     3029    return TransformationMatrix(1, 0, 0, 1, x(), y());
     3030}
     3031
     3032#endif
     3033
    27713034} // namespace WebCore
  • trunk/WebCore/rendering/RenderBox.h

    r40086 r40124  
    2828namespace WebCore {
    2929
    30     enum WidthType { Width, MinWidth, MaxWidth };
     30enum WidthType { Width, MinWidth, MaxWidth };
    3131
    3232class RenderBox : public RenderObject {
     
    3737    virtual const char* renderName() const { return "RenderBox"; }
    3838
     39    static RenderBox* toRenderBox(RenderObject* o) { ASSERT(!o || o->isBox()); return static_cast<RenderBox*>(o); }
     40    static const RenderBox* toConstRenderBox(const RenderObject* o) { ASSERT(!o || o->isBox()); return static_cast<const RenderBox*>(o);}
     41   
     42    int x() const { return m_frameRect.x(); }
     43    int y() const { return m_frameRect.y() + borderTopExtra(); } // FIXME: Need to deal with the borderTopExtra() lie in a sane way.
     44    int width() const { return m_frameRect.width(); }
     45    int height() const { return m_frameRect.height(); }
     46   
     47    void setX(int x) { m_frameRect.setX(x); }
     48    void setY(int y) { m_frameRect.setY(y); }
     49    void setWidth(int width) { m_frameRect.setWidth(width); }
     50    void setHeight(int height) { m_frameRect.setHeight(height); }
     51   
     52    IntPoint location() const { return m_frameRect.location(); } // FIXME: Be aware that this is not equivalent to x(), y() because of y()'s borderTopExtra() lie!
     53    IntSize size() const { return m_frameRect.size(); }
     54
     55    void setLocation(const IntPoint& location) { m_frameRect.setLocation(location); }
     56    void setLocation(int x, int y) { setLocation(IntPoint(x, y)); }
     57   
     58    void setSize(const IntSize& size) { m_frameRect.setSize(size); }
     59    void move(int dx, int dy) { m_frameRect.move(dx, dy); }
     60
     61    IntRect frameRect() const { return m_frameRect; }
     62    void setFrameRect(const IntRect& rect) { m_frameRect = rect; }
     63
     64    IntRect borderBoxRect() const { return IntRect(0, -borderTopExtra(), width(), height() + borderTopExtra() + borderBottomExtra()); }
     65   
     66    // The content area of the box (excludes padding and border).
     67    IntRect contentBoxRect() const { return IntRect(borderLeft() + paddingLeft(), borderTop() + paddingTop(), contentWidth(), contentHeight()); }
     68    // The content box in absolute coords. Ignores transforms.
     69    IntRect absoluteContentBox() const;
     70    // The content box converted to absolute coords (taking transforms into account).
     71    FloatQuad absoluteContentQuad() const;
     72
     73    // Bounds of the outline box in absolute coords. Respects transforms
     74    virtual IntRect absoluteOutlineBounds() const;
     75    virtual void addFocusRingRects(GraphicsContext*, int tx, int ty);
     76
     77    // Use this with caution! No type checking is done!
     78    RenderBox* previousSiblingBox() const { ASSERT(!previousSibling() || previousSibling()->isBox()); return toRenderBox(previousSibling()); }
     79    RenderBox* nextSiblingBox() const { ASSERT(!nextSibling() || nextSibling()->isBox()); return toRenderBox(nextSibling()); }
     80    RenderBox* parentBox() const { ASSERT(!parent() || parent()->isBox()); return toRenderBox(parent()); }
     81
     82    // The height of a block when you include normal flow overflow spillage out of the bottom
     83    // of the block (e.g., a <div style="height:25px"> that has a 100px tall image inside
     84    // it would have an overflow height of borderTop() + paddingTop() + 100px.
     85    virtual int overflowHeight(bool /*includeInterior*/ = true) const { return height(); }
     86    virtual int overflowWidth(bool /*includeInterior*/ = true) const { return width(); }
     87    virtual void setOverflowHeight(int) { }
     88    virtual void setOverflowWidth(int) { }
     89    virtual int overflowLeft(bool /*includeInterior*/ = true) const { return 0; }
     90    virtual int overflowTop(bool /*includeInterior*/ = true) const { return 0; }
     91    virtual IntRect overflowRect(bool /*includeInterior*/ = true) const { return borderBoxRect(); }
     92
     93    int contentWidth() const { return clientWidth() - paddingLeft() - paddingRight(); }
     94    int contentHeight() const { return clientHeight() - paddingTop() - paddingBottom(); }
     95
     96    // IE extensions. Used to calculate offsetWidth/Height.  Overridden by inlines (RenderFlow)
     97    // to return the remaining width on a given line (and the height of a single line).
     98    virtual int offsetWidth() const { return width(); }
     99    virtual int offsetHeight() const { return height() + borderTopExtra() + borderBottomExtra(); }
     100    virtual int offsetLeft() const;
     101    virtual int offsetTop() const;
     102    virtual RenderBox* offsetParent() const;
     103
     104    // More IE extensions.  clientWidth and clientHeight represent the interior of an object
     105    // excluding border and scrollbar.  clientLeft/Top are just the borderLeftWidth and borderTopWidth.
     106    int clientLeft() const { return borderLeft(); }
     107    int clientTop() const { return borderTop(); }
     108    int clientWidth() const;
     109    int clientHeight() const;
     110
     111    // scrollWidth/scrollHeight will be the same as clientWidth/clientHeight unless the
     112    // object has overflow:hidden/scroll/auto specified and also has overflow.
     113    // scrollLeft/Top return the current scroll position.  These methods are virtual so that objects like
     114    // textareas can scroll shadow content (but pretend that they are the objects that are
     115    // scrolling).
     116    virtual int scrollLeft() const;
     117    virtual int scrollTop() const;
     118    virtual int scrollWidth() const;
     119    virtual int scrollHeight() const;
     120    virtual void setScrollLeft(int);
     121    virtual void setScrollTop(int);
     122
     123    virtual void absoluteRects(Vector<IntRect>&, int tx, int ty, bool topLevel = true);
     124    virtual void absoluteQuads(Vector<FloatQuad>&, bool topLevel = true);
     125   
     126    IntRect reflectionBox() const;
     127    int reflectionOffset() const;
     128    // Given a rect in the object's coordinate space, returns the corresponding rect in the reflection.
     129    IntRect reflectedRect(const IntRect&) const;
     130
    39131    virtual void paint(PaintInfo&, int tx, int ty);
    40132    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
     
    56148    virtual IntSize offsetFromContainer(RenderObject*) const;
    57149
    58     virtual int xPos() const { return m_x; }
    59     virtual int yPos() const { return m_y; }
    60     virtual void setPos(int x, int y);
    61 
    62     virtual int width() const { return m_width; }
    63     virtual int height() const { return m_height; }
    64     virtual void setWidth(int width) { m_width = width; }
    65     virtual void setHeight(int height) { m_height = height; }
    66 
    67150    virtual int marginTop() const { return m_marginTop; }
    68151    virtual int marginBottom() const { return m_marginBottom; }
    69152    virtual int marginLeft() const { return m_marginLeft; }
    70153    virtual int marginRight() const { return m_marginRight; }
    71 
    72     virtual IntRect borderBox() const { return IntRect(0, -borderTopExtra(), width(), height() + borderTopExtra() + borderBottomExtra()); }
    73154
    74155    int calcBorderBoxWidth(int width) const;
     
    133214    int calcPercentageHeight(const Length& height);
    134215
     216    // Block flows subclass availableWidth to handle multi column layout (shrinking the width available to children when laying out.)
     217    virtual int availableWidth() const { return contentWidth(); }
    135218    virtual int availableHeight() const;
    136219    int availableHeightUsing(const Length&) const;
     
    166249    virtual void tryLayoutDoingPositionedMovementOnly()
    167250    {
    168         int oldWidth = m_width;
     251        int oldWidth = width();
    169252        calcWidth();
    170253        // If we shrink to fit our width may have changed, so we still need full layout.
    171         if (oldWidth != m_width)
     254        if (oldWidth != width())
    172255            return;
    173256        calcHeight();
     
    175258    }
    176259
    177     virtual IntRect maskClipRect();
    178    
     260    IntRect maskClipRect();
     261   
     262#if ENABLE(SVG)
     263    virtual TransformationMatrix localTransform() const;
     264#endif
     265
    179266protected:
    180267    virtual void styleWillChange(RenderStyle::Diff, const RenderStyle* newStyle);
     
    223310
    224311protected:
    225     // The width/height of the contents + borders + padding.
    226     int m_width;
    227     int m_height;
    228 
    229     int m_x;
    230     int m_y;
     312    // The width/height of the contents + borders + padding.  The x/y location is relative to our container (which is not always our parent).
     313    IntRect m_frameRect;
    231314
    232315    int m_marginLeft;
  • trunk/WebCore/rendering/RenderButton.cpp

    r40086 r40124  
    173173{
    174174    // Clip to the padding box to at least give content the extra padding space.
    175     return IntRect(tx + borderLeft(), ty + borderTop(), m_width - borderLeft() - borderRight(), m_height - borderTop() - borderBottom());
     175    return IntRect(tx + borderLeft(), ty + borderTop(), width() - borderLeft() - borderRight(), height() - borderTop() - borderBottom());
    176176}
    177177
  • trunk/WebCore/rendering/RenderContainer.cpp

    r40086 r40124  
    525525    ASSERT(needsLayout());
    526526
    527     LayoutStateMaintainer statePusher(view(), this, IntSize(m_x, m_y));
     527    LayoutStateMaintainer statePusher(view(), this, IntSize(x(), m_frameRect.y()));
    528528
    529529    RenderObject* child = m_firstChild;
     
    581581}
    582582
    583 VisiblePosition RenderContainer::positionForCoordinates(int x, int y)
     583VisiblePosition RenderContainer::positionForCoordinates(int xPos, int yPos)
    584584{
    585585    // no children...return this render object's element, if there is one, and offset 0
     
    591591        int bottom = contentHeight() + borderTop() + paddingTop() + borderBottom() + paddingBottom();
    592592       
    593         if (x < 0 || x > right || y < 0 || y > bottom) {
    594             if (x <= right / 2)
     593        if (xPos < 0 || xPos > right || yPos < 0 || yPos > bottom) {
     594            if (xPos <= right / 2)
    595595                return VisiblePosition(Position(element(), 0));
    596596            else
     
    601601    // Pass off to the closest child.
    602602    int minDist = INT_MAX;
    603     RenderObject* closestRenderer = 0;
    604     int newX = x;
    605     int newY = y;
     603    RenderBox* closestRenderer = 0;
     604    int newX = xPos;
     605    int newY = yPos;
    606606    if (isTableRow()) {
    607         newX += xPos();
    608         newY += yPos();
    609     }
    610     for (RenderObject* renderer = m_firstChild; renderer; renderer = renderer->nextSibling()) {
    611         if (!renderer->firstChild() && !renderer->isInline() && !renderer->isBlockFlow()
    612             || renderer->style()->visibility() != VISIBLE)
     607        newX += x();
     608        newY += y();
     609    }
     610    for (RenderObject* renderObject = m_firstChild; renderObject; renderObject = renderObject->nextSibling()) {
     611        if (!renderObject->firstChild() && !renderObject->isInline() && !renderObject->isBlockFlow()
     612            || renderObject->style()->visibility() != VISIBLE)
    613613            continue;
    614614       
    615         int top = borderTop() + paddingTop() + (isTableRow() ? 0 : renderer->yPos());
     615        if (!renderObject->isBox())
     616            continue;
     617       
     618        RenderBox* renderer = toRenderBox(renderObject);
     619
     620        int top = borderTop() + paddingTop() + (isTableRow() ? 0 : renderer->y());
    616621        int bottom = top + renderer->contentHeight();
    617         int left = borderLeft() + paddingLeft() + (isTableRow() ? 0 : renderer->xPos());
     622        int left = borderLeft() + paddingLeft() + (isTableRow() ? 0 : renderer->x());
    618623        int right = left + renderer->contentWidth();
    619624       
    620         if (x <= right && x >= left && y <= top && y >= bottom) {
     625        if (xPos <= right && xPos >= left && yPos <= top && yPos >= bottom) {
    621626            if (renderer->isTableRow())
    622                 return renderer->positionForCoordinates(x + newX - renderer->xPos(), y + newY - renderer->yPos());
    623             return renderer->positionForCoordinates(x - renderer->xPos(), y - renderer->yPos());
     627                return renderer->positionForCoordinates(xPos + newX - renderer->x(), yPos + newY - renderer->y());
     628            return renderer->positionForCoordinates(xPos - renderer->x(), yPos - renderer->y());
    624629        }
    625630
     
    627632        // and use a different compare depending on which piece (x, y) is in.
    628633        IntPoint cmp;
    629         if (x > right) {
    630             if (y < top)
     634        if (xPos > right) {
     635            if (yPos < top)
    631636                cmp = IntPoint(right, top);
    632             else if (y > bottom)
     637            else if (yPos > bottom)
    633638                cmp = IntPoint(right, bottom);
    634639            else
    635                 cmp = IntPoint(right, y);
    636         } else if (x < left) {
    637             if (y < top)
     640                cmp = IntPoint(right, yPos);
     641        } else if (xPos < left) {
     642            if (yPos < top)
    638643                cmp = IntPoint(left, top);
    639             else if (y > bottom)
     644            else if (yPos > bottom)
    640645                cmp = IntPoint(left, bottom);
    641646            else
    642                 cmp = IntPoint(left, y);
     647                cmp = IntPoint(left, yPos);
    643648        } else {
    644             if (y < top)
    645                 cmp = IntPoint(x, top);
     649            if (yPos < top)
     650                cmp = IntPoint(xPos, top);
    646651            else
    647                 cmp = IntPoint(x, bottom);
    648         }
    649        
    650         int x1minusx2 = cmp.x() - x;
    651         int y1minusy2 = cmp.y() - y;
     652                cmp = IntPoint(xPos, bottom);
     653        }
     654       
     655        int x1minusx2 = cmp.x() - xPos;
     656        int y1minusy2 = cmp.y() - yPos;
    652657       
    653658        int dist = x1minusx2 * x1minusx2 + y1minusy2 * y1minusy2;
     
    659664   
    660665    if (closestRenderer)
    661         return closestRenderer->positionForCoordinates(newX - closestRenderer->xPos(), newY - closestRenderer->yPos());
     666        return closestRenderer->positionForCoordinates(newX - closestRenderer->x(), newY - closestRenderer->y());
    662667   
    663668    return VisiblePosition(element(), 0, DOWNSTREAM);
  • trunk/WebCore/rendering/RenderContainer.h

    r40086 r40124  
    3535    virtual RenderObject* lastChild() const { return m_lastChild; }
    3636
     37    // Use this with caution! No type checking is done!
     38    RenderBox* firstChildBox() const { ASSERT(!firstChild() || firstChild()->isBox()); return toRenderBox(m_firstChild); }
     39    RenderBox* lastChildBox() const { ASSERT(!lastChild() || lastChild()->isBox()); return toRenderBox(m_lastChild); }
     40   
    3741    virtual bool canHaveChildren() const;
    3842    virtual void addChild(RenderObject* newChild, RenderObject* beforeChild = 0);
     
    6670    virtual void collectAbsoluteLineBoxQuads(Vector<FloatQuad>&, unsigned startOffset = 0, unsigned endOffset = UINT_MAX, bool useSelectionHeight = false);
    6771
    68 private:
     72protected:
    6973    RenderObject* m_firstChild;
    7074    RenderObject* m_lastChild;
  • trunk/WebCore/rendering/RenderFieldset.cpp

    r40086 r40124  
    4949{
    5050    RenderBlock::calcPrefWidths();
    51     if (RenderObject* legend = findLegend()) {
     51    if (RenderBox* legend = findLegend()) {
    5252        int legendMinWidth = legend->minPrefWidth();
    5353
     
    6767RenderObject* RenderFieldset::layoutLegend(bool relayoutChildren)
    6868{
    69     RenderObject* legend = findLegend();
     69    RenderBox* legend = findLegend();
    7070    if (legend) {
    7171        if (relayoutChildren)
     
    8080                    break;
    8181                case CENTER:
    82                     xPos = (m_width - legend->width()) / 2;
     82                    xPos = (width() - legend->width()) / 2;
    8383                    break;
    8484                default:
    85                     xPos = m_width - paddingRight() - borderRight() - legend->width() - legend->marginRight();
     85                    xPos = width() - paddingRight() - borderRight() - legend->width() - legend->marginRight();
    8686            }
    8787        } else {
    8888            switch (legend->style()->textAlign()) {
    8989                case RIGHT:
    90                     xPos = m_width - paddingRight() - borderRight() - legend->width();
     90                    xPos = width() - paddingRight() - borderRight() - legend->width();
    9191                    break;
    9292                case CENTER:
    93                     xPos = (m_width - legend->width()) / 2;
     93                    xPos = (width() - legend->width()) / 2;
    9494                    break;
    9595                default:
     
    9999        int b = borderTop();
    100100        int h = legend->height();
    101         legend->setPos(xPos, max((b-h)/2, 0));
    102         m_height = max(b,h) + paddingTop();
     101        legend->setLocation(xPos, max((b-h)/2, 0));
     102        setHeight(max(b,h) + paddingTop());
    103103    }
    104104    return legend;
    105105}
    106106
    107 RenderObject* RenderFieldset::findLegend() const
     107RenderBox* RenderFieldset::findLegend() const
    108108{
    109109    for (RenderObject* legend = firstChild(); legend; legend = legend->nextSibling()) {
     
    114114#endif
    115115           )
    116             return legend;
     116            return toRenderBox(legend);
    117117    }
    118118    return 0;
     
    123123    int w = width();
    124124    int h = height() + borderTopExtra() + borderBottomExtra();
    125     RenderObject* legend = findLegend();
     125    RenderBox* legend = findLegend();
    126126    if (!legend)
    127127        return RenderBlock::paintBoxDecorations(paintInfo, tx, ty);
    128128
    129     int yOff = (legend->yPos() > 0) ? 0 : (legend->height() - borderTop()) / 2;
    130     int legendBottom = ty + legend->yPos() + legend->height();
     129    int yOff = (legend->y() > 0) ? 0 : (legend->height() - borderTop()) / 2;
     130    int legendBottom = ty + legend->y() + legend->height();
    131131    h -= yOff;
    132132    ty += yOff - borderTopExtra();
     
    145145    // Save time by not saving and restoring the GraphicsContext in the straight border case
    146146    if (!style()->hasBorderRadius())
    147         return paintBorderMinusLegend(paintInfo.context, tx, ty, w, h, style(), legend->xPos(), legend->width(), legendBottom);
     147        return paintBorderMinusLegend(paintInfo.context, tx, ty, w, h, style(), legend->x(), legend->width(), legendBottom);
    148148   
    149149    // We have rounded borders, create a clipping region
     
    155155    int clipHeight = max(static_cast<int>(style()->borderTopWidth()), legend->height());
    156156
    157     graphicsContext->clipOut(IntRect(tx + legend->xPos(), clipTop,
     157    graphicsContext->clipOut(IntRect(tx + legend->x(), clipTop,
    158158                                       legend->width(), clipHeight));
    159159    paintBorder(paintInfo.context, tx, ty, w, h, style(), true, true);
     
    169169    int w = width();
    170170    int h = height() + borderTopExtra() + borderBottomExtra();
    171     RenderObject* legend = findLegend();
     171    RenderBox* legend = findLegend();
    172172    if (!legend)
    173173        return RenderBlock::paintMask(paintInfo, tx, ty);
    174174
    175     int yOff = (legend->yPos() > 0) ? 0 : (legend->height() - borderTop()) / 2;
     175    int yOff = (legend->y() > 0) ? 0 : (legend->height() - borderTop()) / 2;
    176176    h -= yOff;
    177177    ty += yOff - borderTopExtra();
  • trunk/WebCore/rendering/RenderFieldset.h

    r40086 r40124  
    4545    virtual bool stretchesToMinIntrinsicWidth() const { return true; }
    4646
    47     RenderObject* findLegend() const;
     47    RenderBox* findLegend() const;
    4848
    4949protected:
  • trunk/WebCore/rendering/RenderFileUploadControl.cpp

    r40086 r40124  
    148148int RenderFileUploadControl::maxFilenameWidth() const
    149149{
    150     return max(0, contentWidth() - m_button->renderer()->width() - afterButtonSpacing
     150    return max(0, contentWidth() - m_button->renderBox()->width() - afterButtonSpacing
    151151        - (m_fileChooser->icon() ? iconWidth + iconFilenameSpacing : 0));
    152152}
     
    191191        // Determine where the filename should be placed
    192192        int contentLeft = tx + borderLeft() + paddingLeft();
    193         int buttonAndIconWidth = m_button->renderer()->width() + afterButtonSpacing
     193        int buttonAndIconWidth = m_button->renderBox()->width() + afterButtonSpacing
    194194            + (m_fileChooser->icon() ? iconWidth + iconFilenameSpacing : 0);
    195195        int textX;
     
    214214            int iconX;
    215215            if (style()->direction() == LTR)
    216                 iconX = contentLeft + m_button->renderer()->width() + afterButtonSpacing;
     216                iconX = contentLeft + m_button->renderBox()->width() + afterButtonSpacing;
    217217            else
    218                 iconX = contentLeft + contentWidth() - m_button->renderer()->width() - afterButtonSpacing - iconWidth;
     218                iconX = contentLeft + contentWidth() - m_button->renderBox()->width() - afterButtonSpacing - iconWidth;
    219219
    220220            // Draw the file icon
  • trunk/WebCore/rendering/RenderFlexibleBox.cpp

    r40086 r40124  
    4646        if (!forward) {
    4747            // No choice, since we're going backwards, we have to find out the highest ordinal up front.
    48             RenderObject* child = box->firstChild();
     48            RenderBox* child = box->firstChildBox();
    4949            while (child) {
    5050                if (child->style()->boxOrdinalGroup() > lastOrdinal)
    5151                    lastOrdinal = child->style()->boxOrdinalGroup();
    52                 child = child->nextSibling();
     52                child = child->nextSiblingBox();
    5353            }
    5454        }
     
    6262    }
    6363
    64     RenderObject* first() {
     64    RenderBox* first() {
    6565        reset();
    6666        return next();
    6767    }
    6868   
    69     RenderObject* next() {
    70 
     69    RenderBox* next() {
    7170        do {
    7271            if (!current) {
     
    7574                    if (currentOrdinal > lastOrdinal)
    7675                        return 0;
    77                     current = box->firstChild();
     76                    current = box->firstChildBox();
    7877                } else {
    7978                    currentOrdinal--;
    8079                    if (currentOrdinal == 0)
    8180                        return 0;
    82                     current = box->lastChild();
     81                    current = box->lastChildBox();
    8382                }
    8483            }
    8584            else
    86                 current = forward ? current->nextSibling() : current->previousSibling();
     85                current = forward ? current->nextSiblingBox() : current->previousSiblingBox();
    8786            if (current && current->style()->boxOrdinalGroup() > lastOrdinal)
    8887                lastOrdinal = current->style()->boxOrdinalGroup();
     
    9493private:
    9594    RenderFlexibleBox* box;
    96     RenderObject* current;
     95    RenderBox* current;
    9796    bool forward;
    9897    unsigned int currentOrdinal;
     
    113112void RenderFlexibleBox::calcHorizontalPrefWidths()
    114113{
    115     RenderObject *child = firstChild();
    116     while (child) {
     114    for (RenderBox* child = firstChildBox(); child; child = child->nextSiblingBox()) {
    117115        // positioned children don't affect the minmaxwidth
    118         if (child->isPositioned() || child->style()->visibility() == COLLAPSE) {
    119             child = child->nextSibling();
     116        if (child->isPositioned() || child->style()->visibility() == COLLAPSE)
    120117            continue;
    121         }
    122118
    123119        // A margin basically has three types: fixed, percentage, and auto (variable).
     
    135131        m_minPrefWidth += child->minPrefWidth() + margin;
    136132        m_maxPrefWidth += child->maxPrefWidth() + margin;
    137 
    138         child = child->nextSibling();
    139133    }   
    140134}
     
    142136void RenderFlexibleBox::calcVerticalPrefWidths()
    143137{
    144     RenderObject *child = firstChild();
    145     while(child != 0)
    146     {
     138    for (RenderBox* child = firstChildBox(); child; child = child->nextSiblingBox()) {
    147139        // Positioned children and collapsed children don't affect the min/max width
    148         if (child->isPositioned() || child->style()->visibility() == COLLAPSE) {
    149             child = child->nextSibling();
     140        if (child->isPositioned() || child->style()->visibility() == COLLAPSE)
    150141            continue;
    151         }
    152142
    153143        // A margin basically has three types: fixed, percentage, and auto (variable).
     
    167157        w = child->maxPrefWidth() + margin;
    168158        m_maxPrefWidth = max(w, m_maxPrefWidth);
    169 
    170         child = child->nextSibling();
    171159    }   
    172160}
     
    221209    }
    222210
    223     LayoutStateMaintainer statePusher(view(), this, IntSize(m_x, m_y), hasTransform() || hasReflection());
    224 
    225     int previousWidth = m_width;
    226     int previousHeight = m_height;
     211    LayoutStateMaintainer statePusher(view(), this, IntSize(x(), m_frameRect.y()), hasTransform() || hasReflection());
     212
     213    int previousWidth = width();
     214    int previousHeight = height();
    227215   
    228216    calcWidth();
    229217    calcHeight();
    230     m_overflowWidth = m_width;
    231 
    232     if (previousWidth != m_width || previousHeight != m_height ||
     218    m_overflowWidth = width();
     219
     220    if (previousWidth != width() || previousHeight != height() ||
    233221        (parent()->isFlexibleBox() && parent()->style()->boxOrient() == HORIZONTAL &&
    234222         parent()->style()->boxAlign() == BSTRETCH))
    235223        relayoutChildren = true;
    236224
    237     m_height = 0;
     225    setHeight(0);
    238226    m_overflowHeight = 0;
    239227    m_flexingChildren = m_stretchingChildren = false;
     
    254242        layoutVerticalBox(relayoutChildren);
    255243
    256     int oldHeight = m_height;
     244    int oldHeight = height();
    257245    calcHeight();
    258     if (oldHeight != m_height) {
     246    if (oldHeight != height()) {
    259247        // If the block got expanded in size, then increase our overflowheight to match.
    260         if (m_overflowHeight > m_height)
     248        if (m_overflowHeight > height())
    261249            m_overflowHeight -= (borderBottom() + paddingBottom() + horizontalScrollbarHeight());
    262         if (m_overflowHeight < m_height)
    263             m_overflowHeight = m_height;
    264     }
    265     if (previousHeight != m_height)
     250        if (m_overflowHeight < height())
     251            m_overflowHeight = height();
     252    }
     253    if (previousHeight != height())
    266254        relayoutChildren = true;
    267255
    268256    layoutPositionedObjects(relayoutChildren || isRoot());
    269257
    270     if (!isFloatingOrPositioned() && m_height == 0) {
     258    if (!isFloatingOrPositioned() && height() == 0) {
    271259        // We are a block with no border and padding and a computed height
    272260        // of 0.  The CSS spec states that zero-height blocks collapse their margins
     
    287275
    288276    // Always ensure our overflow width is at least as large as our width.
    289     if (m_overflowWidth < m_width)
    290         m_overflowWidth = m_width;
     277    if (m_overflowWidth < width())
     278        m_overflowWidth = width();
    291279
    292280    if (!hasOverflowClip()) {
    293281        for (ShadowData* boxShadow = style()->boxShadow(); boxShadow; boxShadow = boxShadow->next) {
    294282            m_overflowLeft = min(m_overflowLeft, boxShadow->x - boxShadow->blur);
    295             m_overflowWidth = max(m_overflowWidth, m_width + boxShadow->x + boxShadow->blur);
     283            m_overflowWidth = max(m_overflowWidth, width() + boxShadow->x + boxShadow->blur);
    296284            m_overflowTop = min(m_overflowTop, boxShadow->y - boxShadow->blur);
    297             m_overflowHeight = max(m_overflowHeight, m_height + boxShadow->y + boxShadow->blur);
     285            m_overflowHeight = max(m_overflowHeight, height() + boxShadow->y + boxShadow->blur);
    298286        }
    299287       
     
    333321    bool haveFlex = false;
    334322    int remainingSpace = 0;
    335     m_overflowHeight = m_height;
     323    m_overflowHeight = height();
    336324
    337325    // The first walk over our kids is to find out if we have any flexible children.
    338326    FlexBoxIterator iterator(this);
    339     RenderObject* child = iterator.next();
     327    RenderBox* child = iterator.next();
    340328    while (child) {
    341329        // Check to see if this child flexes.
     
    362350    do {
    363351        // Reset our height.
    364         m_height = yPos;
    365         m_overflowHeight = m_height;
     352        setHeight(yPos);
     353        m_overflowHeight = height();
    366354        xPos = borderLeft() + paddingLeft();
    367355               
     
    401389               
    402390                // Now update our height.
    403                 m_height = max(yPos + maxAscent + maxDescent, m_height);
     391                setHeight(max(yPos + maxAscent + maxDescent, height()));
    404392            }
    405393            else
    406                 m_height = max(m_height, yPos + child->marginTop() + child->height() + child->marginBottom());
     394                setHeight(max(height(), yPos + child->marginTop() + child->height() + child->marginBottom()));
    407395
    408396            child = iterator.next();
     
    410398       
    411399        if (!iterator.first() && hasLineIfEmpty())
    412             m_height += lineHeight(true, true);
     400            setHeight(height() + lineHeight(true, true));
    413401       
    414         m_height += toAdd;
     402        setHeight(height() + toAdd);
    415403
    416404        // Always make sure our overflowheight is at least our height.
    417         if (m_overflowHeight < m_height)
    418             m_overflowHeight = m_height;
     405        if (m_overflowHeight < height())
     406            m_overflowHeight = height();
    419407       
    420         oldHeight = m_height;
     408        oldHeight = height();
    421409        calcHeight();
    422410
    423411        relayoutChildren = false;
    424         if (oldHeight != m_height)
     412        if (oldHeight != height())
    425413            heightSpecified = true;
    426414       
     
    446434            // Now do a layout.
    447435            int oldChildHeight = child->height();
    448             static_cast<RenderBox*>(child)->calcHeight();
     436            toRenderBox(child)->calcHeight();
    449437            if (oldChildHeight != child->height())
    450438                child->setChildNeedsLayout(true, false);
     
    479467
    480468            m_overflowHeight = max(m_overflowHeight, childY + child->overflowHeight(false));
    481             m_overflowTop = min(m_overflowTop, child->yPos() + child->overflowTop(false));
     469            m_overflowTop = min(m_overflowTop, child->y() + child->overflowTop(false));
    482470           
    483471            xPos += child->width() + child->marginRight();
     
    620608                    totalChildren--;
    621609
    622                     placeChild(child, child->xPos()+offset, child->yPos());
     610                    placeChild(child, child->x()+offset, child->y());
    623611                    child = iterator.next();
    624612                }
     
    635623                    continue;
    636624                }
    637                 placeChild(child, child->xPos()+offset, child->yPos());
     625                placeChild(child, child->x()+offset, child->y());
    638626                child = iterator.next();
    639627            }
     
    647635   
    648636    if (child) {
    649         m_overflowLeft = min(child->xPos() + child->overflowLeft(false), m_overflowLeft);
    650 
    651         RenderObject* lastChild = child;
     637        m_overflowLeft = min(child->x() + child->overflowLeft(false), m_overflowLeft);
     638
     639        RenderBox* lastChild = child;
    652640        while ((child = iterator.next())) {
    653641            if (!child->isPositioned())
    654642                lastChild = child;
    655643        }
    656         m_overflowWidth = max(lastChild->xPos() + lastChild->overflowWidth(false), m_overflowWidth);
     644        m_overflowWidth = max(lastChild->x() + lastChild->overflowWidth(false), m_overflowWidth);
    657645    }
    658646   
     
    660648    // a height change, we revert our height back to the intrinsic height before returning.
    661649    if (heightSpecified)
    662         m_height = oldHeight;
     650        setHeight(oldHeight);
    663651}
    664652
     
    668656    int yPos = borderTop() + paddingTop();
    669657    if( style()->direction() == RTL )
    670         xPos = m_width - paddingRight() - borderRight();
     658        xPos = width() - paddingRight() - borderRight();
    671659    int toAdd = borderBottom() + paddingBottom() + horizontalScrollbarHeight();
    672660    bool heightSpecified = false;
     
    680668    // The first walk over our kids is to find out if we have any flexible children.
    681669    FlexBoxIterator iterator(this);
    682     RenderObject *child = iterator.next();
     670    RenderBox* child = iterator.next();
    683671    while (child) {
    684672        // Check to see if this child flexes.
     
    809797    // out within the box.
    810798    do {
    811         m_height = borderTop() + paddingTop();
    812         int minHeight = m_height + toAdd;
    813         m_overflowHeight = m_height;
     799        setHeight(borderTop() + paddingTop());
     800        int minHeight = height() + toAdd;
     801        m_overflowHeight = height();
    814802
    815803        child = iterator.first();
     
    829817                }
    830818                if (child->hasStaticY())
    831                     child->setStaticY(m_height);
     819                    child->setStaticY(height());
    832820                child = iterator.next();
    833821                continue;
     
    838826   
    839827            // Add in the child's marginTop to our height.
    840             m_height += child->marginTop();
     828            setHeight(height() + child->marginTop());
    841829   
    842830            // Now do a layout.
     
    865853   
    866854            // Place the child.
    867             placeChild(child, childX, m_height);
    868             m_height += child->height() + child->marginBottom();
     855            placeChild(child, childX, height());
     856            setHeight(height() + child->height() + child->marginBottom());
    869857   
    870858            if (child->isRenderBlock())
     
    872860
    873861            // See if this child has made our overflow need to grow.
    874             m_overflowWidth = max(child->xPos() + child->overflowWidth(false), m_overflowWidth);
    875             m_overflowLeft = min(child->xPos() + child->overflowLeft(false), m_overflowLeft);
     862            m_overflowWidth = max(child->x() + child->overflowWidth(false), m_overflowWidth);
     863            m_overflowLeft = min(child->x() + child->overflowLeft(false), m_overflowLeft);
    876864           
    877865            child = iterator.next();
    878866        }
    879867
    880         yPos = m_height;
     868        yPos = height();
    881869       
    882870        if (!iterator.first() && hasLineIfEmpty())
    883             m_height += lineHeight(true, true);
    884    
    885         m_height += toAdd;
     871            setHeight(height() + lineHeight(true, true));
     872   
     873        setHeight(height() + toAdd);
    886874
    887875        // Negative margins can cause our height to shrink below our minimal height (border/padding).
    888876        // If this happens, ensure that the computed height is increased to the minimal height.
    889         if (m_height < minHeight)
    890             m_height = minHeight;
     877        if (height() < minHeight)
     878            setHeight(minHeight);
    891879
    892880        // Always make sure our overflowheight is at least our height.
    893         if (m_overflowHeight < m_height)
    894             m_overflowHeight = m_height;
     881        if (m_overflowHeight < height())
     882            m_overflowHeight = height();
    895883
    896884        // Now we have to calc our height, so we know how much space we have remaining.
    897         oldHeight = m_height;
     885        oldHeight = height();
    898886        calcHeight();
    899         if (oldHeight != m_height)
     887        if (oldHeight != height())
    900888            heightSpecified = true;
    901889
     
    10291017                    remainingSpace -= (remainingSpace/totalChildren);
    10301018                    totalChildren--;
    1031                     placeChild(child, child->xPos(), child->yPos()+offset);
     1019                    placeChild(child, child->x(), child->y()+offset);
    10321020                    child = iterator.next();
    10331021                }
     
    10441032                    continue;
    10451033                }
    1046                 placeChild(child, child->xPos(), child->yPos()+offset);
     1034                placeChild(child, child->x(), child->y()+offset);
    10471035                child = iterator.next();
    10481036            }
     
    10561044   
    10571045    if (child) {
    1058         m_overflowTop = min(child->yPos() + child->overflowTop(false), m_overflowTop);
    1059 
    1060         RenderObject* lastChild = child;
     1046        m_overflowTop = min(child->y() + child->overflowTop(false), m_overflowTop);
     1047
     1048        RenderBox* lastChild = child;
    10611049        while ((child = iterator.next())) {
    10621050            if (!child->isPositioned())
    10631051                lastChild = child;
    10641052        }
    1065         m_overflowHeight = max(lastChild->yPos() + lastChild->overflowHeight(false), m_overflowHeight);
     1053        m_overflowHeight = max(lastChild->y() + lastChild->overflowHeight(false), m_overflowHeight);
    10661054    }
    10671055
     
    10691057    // a height change, we revert our height back to the intrinsic height before returning.
    10701058    if (heightSpecified)
    1071         m_height = oldHeight;
     1059        setHeight(oldHeight);
    10721060}
    10731061
    1074 void RenderFlexibleBox::placeChild(RenderObject* child, int x, int y)
     1062void RenderFlexibleBox::placeChild(RenderBox* child, int x, int y)
    10751063{
    1076     IntRect oldRect(child->xPos(), child->yPos() , child->width(), child->height());
     1064    IntRect oldRect(child->x(), child->y() , child->width(), child->height());
    10771065
    10781066    // Place the child.
    1079     child->setPos(x, y);
     1067    child->setLocation(x, y);
    10801068
    10811069    // If the child moved, we have to repaint it as well as any floating/positioned
     
    10861074}
    10871075
    1088 int RenderFlexibleBox::allowedChildFlex(RenderObject* child, bool expanding, unsigned int group)
     1076int RenderFlexibleBox::allowedChildFlex(RenderBox* child, bool expanding, unsigned int group)
    10891077{
    10901078    if (child->isPositioned() || child->style()->boxFlex() == 0.0f || child->style()->boxFlexGroup() != group)
  • trunk/WebCore/rendering/RenderFlexibleBox.h

    r40086 r40124  
    4949    virtual bool isStretchingChildren() const { return m_stretchingChildren; }
    5050
    51     void placeChild(RenderObject* child, int x, int y);
     51    void placeChild(RenderBox* child, int x, int y);
    5252
    5353protected:
    54     int allowedChildFlex(RenderObject* child, bool expanding, unsigned group);
     54    int allowedChildFlex(RenderBox* child, bool expanding, unsigned group);
    5555
    5656    bool hasMultipleLines() const { return style()->boxLines() == MULTIPLE; }
  • trunk/WebCore/rendering/RenderFlow.cpp

    r40086 r40124  
    501501        int ow = style() ? style()->outlineSize() : 0;
    502502        if (isCompact())
    503             left -= m_x;
     503            left -= x();
    504504       
    505505        // We need to add in the relative position offsets of any inlines (including us) up to our
     
    553553    ASSERT(!isInlineFlow());
    554554    if (!includeOverflowInterior && (hasOverflowClip() || hasControlClip()))
    555         return includeSelf && m_width > 0 ? overflowHeight(false) : 0;
    556 
    557     int bottom = includeSelf && m_width > 0 ? m_height : 0;
     555        return includeSelf && width() > 0 ? overflowHeight(false) : 0;
     556
     557    int bottom = includeSelf && width() > 0 ? height() : 0;
    558558    if (!hasColumns()) {
    559559        // FIXME: Come up with a way to use the layer tree to avoid visiting all the kids.
     
    563563        for (RenderObject* c = firstChild(); c; c = c->nextSibling()) {
    564564            if (!c->isFloatingOrPositioned() && !c->isText() && !c->isInlineFlow())
    565                 bottom = max(bottom, c->yPos() + c->lowestPosition(false));
     565                bottom = max(bottom, toRenderBox(c)->y() + c->lowestPosition(false));
    566566        }
    567567    }
     
    577577    ASSERT(!isInlineFlow());
    578578    if (!includeOverflowInterior && (hasOverflowClip() || hasControlClip()))
    579         return includeSelf && m_height > 0 ? overflowWidth(false) : 0;
    580 
    581     int right = includeSelf && m_height > 0 ? m_width : 0;
     579        return includeSelf && height() > 0 ? overflowWidth(false) : 0;
     580
     581    int right = includeSelf && height() > 0 ? width() : 0;
     582
    582583    if (!hasColumns()) {
    583584        // FIXME: Come up with a way to use the layer tree to avoid visiting all the kids.
     
    586587        // the abs div.
    587588        for (RenderObject* c = firstChild(); c; c = c->nextSibling()) {
    588             if (!c->isFloatingOrPositioned() && !c->isText() && !c->isInlineFlow())
    589                 right = max(right, c->xPos() + c->rightmostPosition(false));
     589            if (!c->isFloatingOrPositioned() && c->isBox() && !c->isInlineFlow())
     590                right = max(right, toRenderBox(c)->x() + c->rightmostPosition(false));
    590591        }
    591592    }
     
    601602    ASSERT(!isInlineFlow());
    602603    if (!includeOverflowInterior && (hasOverflowClip() || hasControlClip()))
    603         return includeSelf && m_height > 0 ? overflowLeft(false) : m_width;
    604 
    605     int left = includeSelf && m_height > 0 ? 0 : m_width;
     604        return includeSelf && height() > 0 ? overflowLeft(false) : width();
     605
     606    int left = includeSelf && height() > 0 ? 0 : width();
    606607    if (!hasColumns()) {
    607608        // FIXME: Come up with a way to use the layer tree to avoid visiting all the kids.
     
    610611        // the abs div.
    611612        for (RenderObject* c = firstChild(); c; c = c->nextSibling()) {
    612             if (!c->isFloatingOrPositioned() && !c->isText() && !c->isInlineFlow())
    613                 left = min(left, c->xPos() + c->leftmostPosition(false));
     613            if (!c->isFloatingOrPositioned() && c->isBox() && !c->isInlineFlow())
     614                left = min(left, toRenderBox(c)->x() + c->leftmostPosition(false));
    614615        }
    615616    }
     
    688689            FloatPoint absRightPoint = localToAbsoluteForContent(FloatPoint(myRight, 0));
    689690
    690             int containerRight = containingBlock()->xPos() + containingBlockWidth();
     691            int containerRight = containingBlock()->x() + containingBlockWidth();
    691692            FloatPoint absContainerPoint = localToAbsoluteForContent(FloatPoint(containerRight, 0));
    692693
     
    720721
    721722        for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling())
    722             if (!curr->isText() && !curr->isListMarker()) {
     723            if (!curr->isText() && !curr->isListMarker() && curr->isBox()) {
     724                RenderBox* box = toRenderBox(curr);
    723725                FloatPoint pos;
    724726                // FIXME: This doesn't work correctly with transforms.
     
    726728                    pos = curr->localToAbsolute();
    727729                else
    728                     pos = FloatPoint(tx + curr->xPos(), ty + curr->yPos());
    729                 curr->addFocusRingRects(graphicsContext, pos.x(), pos.y());
     730                    pos = FloatPoint(tx + box->x(), ty + box->y());
     731                box->addFocusRingRects(graphicsContext, pos.x(), pos.y());
    730732            }
    731733    }
     
    734736        if (isInline())
    735737            continuation()->addFocusRingRects(graphicsContext,
    736                                               tx - containingBlock()->xPos() + continuation()->xPos(),
    737                                               ty - containingBlock()->yPos() + continuation()->yPos());
     738                                              tx - containingBlock()->x() + continuation()->x(),
     739                                              ty - containingBlock()->y() + continuation()->y());
    738740        else
    739741            continuation()->addFocusRingRects(graphicsContext,
    740                                               tx - xPos() + continuation()->containingBlock()->xPos(),
    741                                               ty - yPos() + continuation()->containingBlock()->yPos());
     742                                              tx - x() + continuation()->containingBlock()->x(),
     743                                              ty - y() + continuation()->containingBlock()->y());
    742744    }
    743745}
  • trunk/WebCore/rendering/RenderFrameSet.cpp

    r40086 r40124  
    127127
    128128    // Add in our offsets.
    129     tx += m_x;
    130     ty += m_y;
     129    tx += x();
     130    ty += m_frameRect.y();
    131131
    132132    int rows = frameSet()->totalRows();
     
    458458
    459459    if (!parent()->isFrameSet() && !document()->printing()) {
    460         m_width = view()->viewWidth();
    461         m_height = view()->viewHeight();
     460        setWidth(view()->viewWidth());
     461        setHeight(view()->viewHeight());
    462462    }
    463463
     
    471471
    472472    int borderThickness = frameSet()->border();
    473     layOutAxis(m_rows, frameSet()->rowLengths(), m_height - (rows - 1) * borderThickness);
    474     layOutAxis(m_cols, frameSet()->colLengths(), m_width - (cols - 1) * borderThickness);
     473    layOutAxis(m_rows, frameSet()->rowLengths(), height() - (rows - 1) * borderThickness);
     474    layOutAxis(m_cols, frameSet()->colLengths(), width() - (cols - 1) * borderThickness);
    475475
    476476    positionFrames();
     
    492492void RenderFrameSet::positionFrames()
    493493{
    494     RenderObject* child = firstChild();
     494    RenderBox* child = firstChildBox();
    495495    if (!child)
    496496        return;
     
    505505        int height = m_rows.m_sizes[r];
    506506        for (int c = 0; c < cols; c++) {
    507             child->setPos(xPos, yPos);
     507            child->setLocation(xPos, yPos);
    508508            int width = m_cols.m_sizes[c];
    509509
     
    518518            xPos += width + borderThickness;
    519519
    520             child = child->nextSibling();
     520            child = child->nextSiblingBox();
    521521            if (!child)
    522522                return;
     
    526526
    527527    // all the remaining frames are hidden to avoid ugly spurious unflowed frames
    528     for (; child; child = child->nextSibling()) {
     528    for (; child; child = child->nextSiblingBox()) {
    529529        child->setWidth(0);
    530530        child->setHeight(0);
  • trunk/WebCore/rendering/RenderHTMLCanvas.cpp

    r40086 r40124  
    4444void RenderHTMLCanvas::paintReplaced(PaintInfo& paintInfo, int tx, int ty)
    4545{
    46     IntRect rect = contentBox();
     46    IntRect rect = contentBoxRect();
    4747    rect.move(tx, ty);
    4848    static_cast<HTMLCanvasElement*>(node())->paint(paintInfo.context, rect);
     
    5151void RenderHTMLCanvas::canvasSizeChanged()
    5252{
    53     IntSize size = static_cast<HTMLCanvasElement*>(node())->size();
    54     IntSize zoomedSize(size.width() * style()->effectiveZoom(), size.height() * style()->effectiveZoom());
     53    IntSize canvasSize = static_cast<HTMLCanvasElement*>(node())->size();
     54    IntSize zoomedSize(canvasSize.width() * style()->effectiveZoom(), canvasSize.height() * style()->effectiveZoom());
    5555
    56     if (size == intrinsicSize())
     56    if (canvasSize == intrinsicSize())
    5757        return;
    5858
    59     setIntrinsicSize(size);
     59    setIntrinsicSize(canvasSize);
    6060
    6161    if (!prefWidthsDirty())
    6262        setPrefWidthsDirty(true);
    6363
    64     IntSize oldSize = IntSize(m_width, m_height);
     64    IntSize oldSize = size();
    6565    calcWidth();
    6666    calcHeight();
    67     if (oldSize == IntSize(m_width, m_height))
     67    if (oldSize == size())
    6868        return;
    6969
  • trunk/WebCore/rendering/RenderImage.cpp

    r40086 r40124  
    282282        if (containingBlock()) {
    283283            // lets see if we need to relayout at all..
    284             int oldwidth = m_width;
    285             int oldheight = m_height;
     284            int oldwidth = width();
     285            int oldheight = height();
    286286            if (!prefWidthsDirty())
    287287                setPrefWidthsDirty(true);
     
    289289            calcHeight();
    290290
    291             if (imageSizeChanged || m_width != oldwidth || m_height != oldheight) {
     291            if (imageSizeChanged || width() != oldwidth || height() != oldheight) {
    292292                shouldRepaint = false;
    293293                if (!selfNeedsLayout())
     
    295295            }
    296296
    297             m_width = oldwidth;
    298             m_height = oldheight;
     297            setWidth(oldwidth);
     298            setHeight(oldheight);
    299299        }
    300300    }
     
    305305            // The image changed rect is in source image coordinates (pre-zooming),
    306306            // so map from the bounds of the image to the contentsBox.
    307             repaintRect = enclosingIntRect(mapRect(*rect, FloatRect(FloatPoint(), imageSize(1.0f)), contentBox()));
     307            repaintRect = enclosingIntRect(mapRect(*rect, FloatRect(FloatPoint(), imageSize(1.0f)), contentBoxRect()));
    308308            // Guard against too-large changed rects.
    309             repaintRect.intersect(contentBox());
     309            repaintRect.intersect(contentBoxRect());
    310310        } else
    311             repaintRect = contentBox();
     311            repaintRect = contentBoxRect();
    312312       
    313313        repaintRectangle(repaintRect);
     
    397397#if PLATFORM(MAC)
    398398        if (style()->highlight() != nullAtom && !paintInfo.context->paintingDisabled())
    399             paintCustomHighlight(tx - m_x, ty - m_y, style()->highlight(), true);
     399            paintCustomHighlight(tx - x(), ty - m_frameRect.y(), style()->highlight(), true);
    400400#endif
    401401
     
    425425
    426426    if (inside && element()) {
    427         int tx = _tx + m_x;
    428         int ty = _ty + m_y;
     427        int tx = _tx + x();
     428        int ty = _ty + m_frameRect.y();
    429429       
    430430        HTMLMapElement* map = imageMap();
     
    491491{
    492492    if (imageHasRelativeWidth())
    493         if (RenderObject* cb = isPositioned() ? container() : containingBlock())
    494             setImageContainerSize(IntSize(cb->availableWidth(), cb->availableHeight()));
     493        if (RenderObject* cb = isPositioned() ? container() : containingBlock()) {
     494            if (cb->isBox())
     495                setImageContainerSize(IntSize(toRenderBox(cb)->availableWidth(), toRenderBox(cb)->availableHeight()));
     496        }
    495497
    496498    int width;
  • trunk/WebCore/rendering/RenderInline.cpp

    r40086 r40124  
    293293
    294294    for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling()) {
    295         if (!curr->isText())
    296             curr->absoluteRects(rects, tx + curr->xPos(), ty + curr->yPos(), false);
     295        if (curr->isBox()) {
     296            RenderBox* box = toRenderBox(curr);
     297            curr->absoluteRects(rects, tx + box->x(), ty + box->y(), false);
     298        }
    297299    }
    298300
    299301    if (continuation() && topLevel)
    300302        continuation()->absoluteRects(rects,
    301                                       tx - containingBlock()->xPos() + continuation()->xPos(),
    302                                       ty - containingBlock()->yPos() + continuation()->yPos(),
     303                                      tx - containingBlock()->x() + continuation()->x(),
     304                                      ty - containingBlock()->y() + continuation()->y(),
    303305                                      topLevel);
    304306}
     
    325327}
    326328
    327 int RenderInline::width() const
     329int RenderInline::boundingBoxWidth() const
    328330{
    329331    // Return the width of the minimal left side and the maximal right side.
     
    340342}
    341343
    342 int RenderInline::height() const
     344int RenderInline::boundingBoxHeight() const
    343345{
    344346    // See <rdar://problem/5289721>, for an unknown reason the linked list here is sometimes inconsistent, first is non-zero and last is zero.  We have been
     
    386388    // Translate the coords from the pre-anonymous block to the post-anonymous block.
    387389    RenderBlock* cb = containingBlock();
    388     int parentBlockX = cb->xPos() + x;
    389     int parentBlockY = cb->yPos() + y;
     390    int parentBlockX = cb->x() + x;
     391    int parentBlockY = cb->y() + y;
    390392    for (RenderFlow* c = continuation(); c; c = c->continuation()) {
    391         RenderObject* contBlock = c;
     393        RenderFlow* contBlock = c;
    392394        if (c->isInline())
    393395            contBlock = c->containingBlock();
    394396        if (c->isInline() || c->firstChild())
    395             return c->positionForCoordinates(parentBlockX - contBlock->xPos(), parentBlockY - contBlock->yPos());
     397            return c->positionForCoordinates(parentBlockX - contBlock->x(), parentBlockY - contBlock->y());
    396398    }
    397399
  • trunk/WebCore/rendering/RenderInline.h

    r40086 r40124  
    6060    virtual bool requiresLayer();
    6161
    62     virtual int width() const;
    63     virtual int height() const;
     62    int boundingBoxWidth() const;
     63    int boundingBoxHeight() const;
    6464
    65     // used to calculate offsetWidth/Height.  Overridden by inlines (RenderFlow) to return
    66     // the remaining width on a given line (and the height of a single line).
    6765    virtual int offsetLeft() const;
    6866    virtual int offsetTop() const;
     67    virtual int offsetWidth() const { return boundingBoxWidth(); }
     68    virtual int offsetHeight() const { return boundingBoxHeight(); }
    6969
    7070    void absoluteRects(Vector<IntRect>&, int tx, int ty, bool topLevel = true);
  • trunk/WebCore/rendering/RenderLayer.cpp

    r40086 r40124  
    278278    if (hasTransform) {
    279279        m_transform->reset();
    280         renderer()->style()->applyTransform(*m_transform, renderer()->borderBox().size());
     280        renderer()->style()->applyTransform(*m_transform, renderer()->borderBoxRect().size());
    281281    }
    282282}
     
    378378    clearClipRects();
    379379
    380     int x = renderer()->xPos();
    381     int y = renderer()->yPos() - renderer()->borderTopExtra();
     380    int x = renderer()->x();
     381    int y = renderer()->y() - renderer()->borderTopExtra();
    382382
    383383    if (!renderer()->isPositioned() && renderer()->parent()) {
    384384        // We must adjust our position by walking up the render tree looking for the
    385385        // nearest enclosing object with a layer.
    386         RenderObject* curr = renderer()->parent();
     386        RenderBox* curr = renderer()->parentBox();
    387387        while (curr && !curr->hasLayer()) {
    388388            if (!curr->isTableRow()) {
    389389                // Rows and cells share the same coordinate space (that of the section).
    390390                // Omit them when computing our xpos/ypos.
    391                 x += curr->xPos();
    392                 y += curr->yPos();
     391                x += curr->x();
     392                y += curr->y();
    393393            }
    394             curr = curr->parent();
     394            curr = curr->parentBox();
    395395        }
    396396        y += curr->borderTopExtra();
    397397        if (curr->isTableRow()) {
    398398            // Put ourselves into the row coordinate space.
    399             x -= curr->xPos();
    400             y -= curr->yPos();
     399            x -= curr->x();
     400            y -= curr->y();
    401401        }
    402402    }
     
    404404    m_relX = m_relY = 0;
    405405    if (renderer()->isRelPositioned()) {
    406         m_relX = static_cast<RenderBox*>(renderer())->relativePositionOffsetX();
    407         m_relY = static_cast<RenderBox*>(renderer())->relativePositionOffsetY();
     406        m_relX = RenderBox::toRenderBox(renderer())->relativePositionOffsetX();
     407        m_relY = RenderBox::toRenderBox(renderer())->relativePositionOffsetY();
    408408        x += m_relX; y += m_relY;
    409409    }
     
    417417       
    418418        if (renderer()->isPositioned()) {
    419             IntSize offset = static_cast<RenderBox*>(renderer())->offsetForPositionedInContainer(positionedParent->renderer());
     419            IntSize offset = RenderBox::toRenderBox(renderer())->offsetForPositionedInContainer(positionedParent->renderer());
    420420            x += offset.width();
    421421            y += offset.height();
     
    424424        parent()->subtractScrolledContentOffset(x, y);
    425425   
    426     setPos(x,y);
    427 
    428     setWidth(renderer()->width());
    429     setHeight(renderer()->height() + renderer()->borderTopExtra() + renderer()->borderBottomExtra());
     426    // FIXME: We'd really like to just get rid of the concept of a layer rectangle and rely on the renderers.
     427
     428    setPos(x, y);
     429
     430    if (renderer()->isRenderInline()) {
     431        RenderInline* inlineFlow = static_cast<RenderInline*>(renderer());
     432        setWidth(inlineFlow->boundingBoxWidth());
     433        setHeight(inlineFlow->boundingBoxHeight());
     434    } else {
     435        setWidth(renderer()->width());
     436        setHeight(renderer()->height() + renderer()->borderTopExtra() + renderer()->borderBottomExtra());
     437    }
    430438
    431439    if (!renderer()->hasOverflowClip()) {
     
    10361044    // This is necessary for textarea elements since the resizable layer is in the shadow content.
    10371045    Element* element = static_cast<Element*>(renderer()->node()->shadowAncestorNode());
    1038     RenderBox* renderer = static_cast<RenderBox*>(element->renderer());
     1046    RenderBox* renderer = RenderBox::toRenderBox(element->renderer());
    10391047
    10401048    EResize resize = renderer->style()->resize();
     
    11721180bool RenderLayer::scrollbarCornerPresent() const
    11731181{
    1174     return !scrollCornerRect(this, renderer()->borderBox()).isEmpty();
     1182    return !scrollCornerRect(this, renderer()->borderBoxRect()).isEmpty();
    11751183}
    11761184
     
    11901198    bool hasCustomScrollbarStyle = renderer()->node()->shadowAncestorNode()->renderer()->style()->hasPseudoStyle(RenderStyle::SCROLLBAR);
    11911199    if (hasCustomScrollbarStyle)
    1192         widget = RenderScrollbar::createCustomScrollbar(this, orientation, renderer()->node()->shadowAncestorNode()->renderer());
     1200        widget = RenderScrollbar::createCustomScrollbar(this, orientation, renderer()->node()->shadowAncestorNode()->renderBox());
    11931201    else
    11941202        widget = Scrollbar::createNativeScrollbar(this, orientation, RegularScrollbar);
     
    12801288        return;
    12811289   
    1282     IntRect borderBox = renderer()->borderBox();
     1290    IntRect borderBox = renderer()->borderBoxRect();
    12831291    IntRect scrollCorner(scrollCornerRect(this, borderBox));
    12841292    IntRect absBounds(borderBox.x() + tx, borderBox.y() + ty, borderBox.width(), borderBox.height());
     
    12961304   
    12971305    if (m_scrollCorner)
    1298         m_scrollCorner->setRect(scrollCorner);
     1306        m_scrollCorner->setFrameRect(scrollCorner);
    12991307    if (m_resizer)
    1300         m_resizer->setRect(resizerCornerRect(this, borderBox));
     1308        m_resizer->setFrameRect(resizerCornerRect(this, borderBox));
    13011309}
    13021310
     
    14941502void RenderLayer::paintScrollCorner(GraphicsContext* context, int tx, int ty, const IntRect& damageRect)
    14951503{
    1496     IntRect cornerRect = scrollCornerRect(this, renderer()->borderBox());
     1504    IntRect cornerRect = scrollCornerRect(this, renderer()->borderBoxRect());
    14971505    IntRect absRect = IntRect(cornerRect.x() + tx, cornerRect.y() + ty, cornerRect.width(), cornerRect.height());
    14981506    if (!absRect.intersects(damageRect))
     
    15171525        return;
    15181526
    1519     IntRect cornerRect = resizerCornerRect(this, renderer()->borderBox());
     1527    IntRect cornerRect = resizerCornerRect(this, renderer()->borderBoxRect());
    15201528    IntRect absRect = IntRect(cornerRect.x() + tx, cornerRect.y() + ty, cornerRect.width(), cornerRect.height());
    15211529    if (!absRect.intersects(damageRect))
     
    17251733    int x = layerBounds.x();
    17261734    int y = layerBounds.y();
    1727     int tx = x - renderer()->xPos();
    1728     int ty = y - renderer()->yPos() + renderer()->borderTopExtra();
     1735    int tx = x - renderer()->x();
     1736    int ty = y - renderer()->y() + renderer()->borderTopExtra();
    17291737                             
    17301738    // Ensure our lists are up-to-date.
     
    19491957    if (fgRect.contains(hitTestPoint) &&
    19501958        renderer()->hitTest(request, result, hitTestPoint,
    1951                             layerBounds.x() - renderer()->xPos(),
    1952                             layerBounds.y() - renderer()->yPos() + renderer()->borderTopExtra(),
     1959                            layerBounds.x() - renderer()->x(),
     1960                            layerBounds.y() - renderer()->y() + renderer()->borderTopExtra(),
    19531961                            HitTestDescendants)) {
    19541962        // For positioned generated content, we might still not have a
     
    19791987    if (bgRect.contains(hitTestPoint) &&
    19801988        renderer()->hitTest(request, result, hitTestPoint,
    1981                             layerBounds.x() - renderer()->xPos(),
    1982                             layerBounds.y() - renderer()->yPos() + renderer()->borderTopExtra(),
     1989                            layerBounds.x() - renderer()->x(),
     1990                            layerBounds.y() - renderer()->y() + renderer()->borderTopExtra(),
    19831991                            HitTestSelf)) {
    19841992        if (!result.innerNode() || !result.innerNonSharedNode()) {
     
    21232131    int y = 0;
    21242132    convertToLayerCoords(rootLayer, x, y);
    2125     layerBounds = IntRect(x,y,width(),height());
     2133    layerBounds = IntRect(x, y, width(), height());
    21262134   
    21272135    // Update the clip rects that will be passed to child layers.
     
    22182226        for (InlineRunBox* curr = firstBox->nextLineBox(); curr; curr = curr->nextLineBox())
    22192227            left = min(left, curr->xPos());
    2220         result = IntRect(m_x + left, m_y + (top - renderer()->yPos()), width(), bottom - top);
     2228        result = IntRect(m_x + left, m_y + (top - renderer()->y()), width(), bottom - top);
    22212229    } else if (renderer()->isTableRow()) {
    22222230        // Our bounding box is just the union of all of our cells' border/overflow rects.
    22232231        for (RenderObject* child = renderer()->firstChild(); child; child = child->nextSibling()) {
    22242232            if (child->isTableCell()) {
    2225                 IntRect bbox = child->borderBox();
     2233                IntRect bbox = RenderBox::toRenderBox(child)->borderBoxRect();
    22262234                bbox.move(0, child->borderTopExtra());
    22272235                result.unite(bbox);
     
    22372245            result = renderer()->maskClipRect();
    22382246        else {
    2239             IntRect bbox = renderer()->borderBox();
     2247            IntRect bbox = renderer()->borderBoxRect();
    22402248            result = bbox;
    22412249            IntRect overflowRect = renderer()->overflowRect(false);
     
    22452253
    22462254        // We have to adjust the x/y of this result so that it is in the coordinate space of the layer.
    2247         // We also have to add in borderTopExtra here, since borderBox(), in order to play well with methods like
     2255        // We also have to add in intrinsicPaddingTop here, since borderBoxRect(), in order to play well with methods like
    22482256        // floatRect that deal with child content, uses an origin of (0,0) that is at the child content box (so
    22492257        // border box returns a y coord of -borderTopExtra().  The layer, however, uses the outer box.  This is all
  • trunk/WebCore/rendering/RenderListBox.cpp

    r40086 r40124  
    225225 
    226226    int itemHeight = RenderListBox::itemHeight();
    227     m_height = itemHeight * size() - rowSpacing + toAdd;
     227    setHeight(itemHeight * size() - rowSpacing + toAdd);
    228228   
    229229    RenderBlock::calcHeight();
     
    582582IntRect RenderListBox::controlClipRect(int tx, int ty) const
    583583{
    584     IntRect clipRect = contentBox();
     584    IntRect clipRect = contentBoxRect();
    585585    clipRect.move(tx, ty);
    586586    return clipRect;
  • trunk/WebCore/rendering/RenderListItem.cpp

    r40086 r40124  
    236236{
    237237    if (m_marker && !m_marker->isInside() && m_marker->inlineBoxWrapper()) {
    238         int markerOldX = m_marker->xPos();
     238        int markerOldX = m_marker->x();
    239239        int yOffset = 0;
    240240        int xOffset = 0;
    241         for (RenderObject* o = m_marker->parent(); o != this; o = o->parent()) {
    242             yOffset += o->yPos();
    243             xOffset += o->xPos();
     241        for (RenderBox* o = m_marker->parentBox(); o != this; o = o->parentBox()) {
     242            yOffset += o->y();
     243            xOffset += o->x();
    244244        }
    245245
     
    268268        if (adjustOverflow) {
    269269            IntRect markerRect(markerXPos + xOffset, yOffset, m_marker->width(), m_marker->height());
    270             RenderObject* o = m_marker;
     270            RenderBox* o = m_marker;
    271271            do {
    272                 o = o->parent();
     272                o = o->parentBox();
    273273                if (o->isRenderBlock())
    274274                    static_cast<RenderBlock*>(o)->addVisualOverflow(markerRect);
    275                 markerRect.move(-o->xPos(), -o->yPos());
     275                markerRect.move(-o->x(), -o->y());
    276276            } while (o != this);
    277277        }
     
    281281void RenderListItem::paint(PaintInfo& paintInfo, int tx, int ty)
    282282{
    283     if (!m_height)
     283    if (!height())
    284284        return;
    285285
  • trunk/WebCore/rendering/RenderListMarker.cpp

    r40086 r40124  
    531531    marker.move(tx, ty);
    532532
    533     IntRect box(tx + m_x, ty + m_y, m_width, m_height);
     533    IntRect box(tx + x(), ty + m_frameRect.y(), width(), height());
    534534
    535535    if (box.y() > paintInfo.rect.bottom() || box.y() + box.height() < paintInfo.rect.y())
     
    637637
    638638    if (isImage()) {
    639         m_width = m_image->imageSize(this, style()->effectiveZoom()).width();
    640         m_height = m_image->imageSize(this, style()->effectiveZoom()).height();
     639        setWidth(m_image->imageSize(this, style()->effectiveZoom()).width());
     640        setHeight(m_image->imageSize(this, style()->effectiveZoom()).height());
    641641    } else {
    642         m_width = minPrefWidth();
    643         m_height = style()->font().height();
     642        setWidth(minPrefWidth());
     643        setHeight(style()->font().height());
    644644    }
    645645
     
    662662        return;
    663663
    664     if (m_width != m_image->imageSize(this, style()->effectiveZoom()).width() || m_height != m_image->imageSize(this, style()->effectiveZoom()).height() || m_image->errorOccurred())
     664    if (width() != m_image->imageSize(this, style()->effectiveZoom()).width() || height() != m_image->imageSize(this, style()->effectiveZoom()).height() || m_image->errorOccurred())
    665665        setNeedsLayoutAndPrefWidthsRecalc();
    666666    else
     
    830830{
    831831    if (isImage())
    832         return IntRect(m_x, m_y, m_image->imageSize(this, style()->effectiveZoom()).width(), m_image->imageSize(this, style()->effectiveZoom()).height());
     832        return IntRect(x(), m_frameRect.y(), m_image->imageSize(this, style()->effectiveZoom()).width(), m_image->imageSize(this, style()->effectiveZoom()).height());
    833833
    834834    switch (style()->listStyleType()) {
     
    840840            int ascent = font.ascent();
    841841            int bulletWidth = (ascent * 2 / 3 + 1) / 2;
    842             return IntRect(m_x + 1, m_y + 3 * (ascent - ascent * 2 / 3) / 2, bulletWidth, bulletWidth);
     842            return IntRect(x() + 1, m_frameRect.y() + 3 * (ascent - ascent * 2 / 3) / 2, bulletWidth, bulletWidth);
    843843        }
    844844        case LNONE:
     
    867867            const UChar periodSpace[2] = { '.', ' ' };
    868868            int periodSpaceWidth = font.width(TextRun(periodSpace, 2));
    869             return IntRect(m_x, m_y + font.ascent(), itemWidth + periodSpaceWidth, font.height());
     869            return IntRect(x(), m_frameRect.y() + font.ascent(), itemWidth + periodSpaceWidth, font.height());
    870870    }
    871871
     
    890890
    891891    RootInlineBox* root = inlineBoxWrapper()->root();
    892     IntRect rect(0, root->selectionTop() - yPos(), width(), root->selectionHeight());
     892    IntRect rect(0, root->selectionTop() - y(), width(), root->selectionHeight());
    893893           
    894894    if (clipToVisibleContent)
  • trunk/WebCore/rendering/RenderMarquee.cpp

    r40086 r40124  
    106106int RenderMarquee::computePosition(EMarqueeDirection dir, bool stopAtContentEdge)
    107107{
    108     RenderObject* o = m_layer->renderer();
     108    RenderBox* o = m_layer->renderer();
    109109    RenderStyle* s = o->style();
    110110    if (isHorizontal()) {
  • trunk/WebCore/rendering/RenderMedia.cpp

    r40086 r40124  
    106106void RenderMedia::layout()
    107107{
    108     IntSize oldSize = contentBox().size();
     108    IntSize oldSize = contentBoxRect().size();
    109109
    110110    RenderReplaced::layout();
    111111
    112     RenderObject* controlsRenderer = m_controlsShadowRoot ? m_controlsShadowRoot->renderer() : 0;
     112    RenderBox* controlsRenderer = m_controlsShadowRoot ? m_controlsShadowRoot->renderBox() : 0;
    113113    if (!controlsRenderer)
    114114        return;
    115     IntSize newSize = contentBox().size();
     115    IntSize newSize = contentBoxRect().size();
    116116    if (newSize != oldSize || controlsRenderer->needsLayout()) {
    117         controlsRenderer->setPos(borderLeft() + paddingLeft(), borderTop() + paddingTop());
     117        controlsRenderer->setLocation(borderLeft() + paddingLeft(), borderTop() + paddingTop());
    118118        controlsRenderer->style()->setHeight(Length(newSize.height(), Fixed));
    119119        controlsRenderer->style()->setWidth(Length(newSize.width(), Fixed));
     
    441441        return bottom;
    442442   
    443     return max(bottom,  m_controlsShadowRoot->renderer()->yPos() + m_controlsShadowRoot->renderer()->lowestPosition(includeOverflowInterior, includeSelf));
     443    return max(bottom,  m_controlsShadowRoot->renderBox()->y() + m_controlsShadowRoot->renderer()->lowestPosition(includeOverflowInterior, includeSelf));
    444444}
    445445
     
    450450        return right;
    451451   
    452     return max(right, m_controlsShadowRoot->renderer()->xPos() + m_controlsShadowRoot->renderer()->rightmostPosition(includeOverflowInterior, includeSelf));
     452    return max(right, m_controlsShadowRoot->renderBox()->x() + m_controlsShadowRoot->renderer()->rightmostPosition(includeOverflowInterior, includeSelf));
    453453}
    454454
     
    459459        return left;
    460460   
    461     return min(left, m_controlsShadowRoot->renderer()->xPos() +  m_controlsShadowRoot->renderer()->leftmostPosition(includeOverflowInterior, includeSelf));
     461    return min(left, m_controlsShadowRoot->renderBox()->x() +  m_controlsShadowRoot->renderer()->leftmostPosition(includeOverflowInterior, includeSelf));
    462462}
    463463
  • trunk/WebCore/rendering/RenderMenuList.cpp

    r40086 r40124  
    228228                   contentHeight());
    229229   
    230     IntRect innerBox(tx + m_innerBlock->xPos() + m_innerBlock->paddingLeft(),
    231                    ty + m_innerBlock->yPos() + m_innerBlock->paddingTop(),
     230    IntRect innerBox(tx + m_innerBlock->x() + m_innerBlock->paddingLeft(),
     231                   ty + m_innerBlock->y() + m_innerBlock->paddingTop(),
    232232                   m_innerBlock->contentWidth(),
    233233                   m_innerBlock->contentHeight());
  • trunk/WebCore/rendering/RenderObject.cpp

    r40086 r40124  
    189189    , m_isAnonymous(node == node->document())
    190190    , m_isText(false)
     191    , m_isBox(false)
    191192    , m_inline(true)
    192193    , m_replaced(false)
     
    505506}
    506507
    507 int RenderObject::offsetLeft() const
    508 {
    509     RenderObject* offsetPar = offsetParent();
    510     if (!offsetPar)
    511         return 0;
    512     int x = xPos() - offsetPar->borderLeft();
    513     if (!isPositioned()) {
    514         if (isRelPositioned())
    515             x += static_cast<const RenderBox*>(this)->relativePositionOffsetX();
    516         RenderObject* curr = parent();
    517         while (curr && curr != offsetPar) {
    518             x += curr->xPos();
    519             curr = curr->parent();
    520         }
    521         if (offsetPar->isBody() && !offsetPar->isRelPositioned() && !offsetPar->isPositioned())
    522             x += offsetPar->xPos();
    523     }
    524     return x;
    525 }
    526 
    527 int RenderObject::offsetTop() const
    528 {
    529     RenderObject* offsetPar = offsetParent();
    530     if (!offsetPar)
    531         return 0;
    532     int y = yPos() - borderTopExtra() - offsetPar->borderTop();
    533     if (!isPositioned()) {
    534         if (isRelPositioned())
    535             y += static_cast<const RenderBox*>(this)->relativePositionOffsetY();
    536         RenderObject* curr = parent();
    537         while (curr && curr != offsetPar) {
    538             if (!curr->isTableRow())
    539                 y += curr->yPos();
    540             curr = curr->parent();
    541         }
    542         if (offsetPar->isBody() && !offsetPar->isRelPositioned() && !offsetPar->isPositioned())
    543             y += offsetPar->yPos();
    544     }
    545     return y;
    546 }
    547 
    548 RenderObject* RenderObject::offsetParent() const
    549 {
    550     // FIXME: It feels like this function could almost be written using containing blocks.
    551     if (isBody())
    552         return 0;
    553 
    554     bool skipTables = isPositioned() || isRelPositioned();
    555     float currZoom = style()->effectiveZoom();
    556     RenderObject* curr = parent();
    557     while (curr && (!curr->element() ||
    558                     (!curr->isPositioned() && !curr->isRelPositioned() && !curr->isBody()))) {
    559         Node* element = curr->element();
    560         if (!skipTables && element) {
    561             bool isTableElement = element->hasTagName(tableTag) ||
    562                                   element->hasTagName(tdTag) ||
    563                                   element->hasTagName(thTag);
    564 
    565 #if ENABLE(WML)
    566             if (!isTableElement && element->isWMLElement())
    567                 isTableElement = element->hasTagName(WMLNames::tableTag) ||
    568                                  element->hasTagName(WMLNames::tdTag);
    569 #endif
    570 
    571             if (isTableElement)
    572                 break;
    573         }
    574 
    575         float newZoom = curr->style()->effectiveZoom();
    576         if (currZoom != newZoom)
    577             break;
    578         currZoom = newZoom;
    579         curr = curr->parent();
    580     }
    581     return curr;
    582 }
    583 
    584508int RenderObject::verticalScrollbarWidth() const
    585509{
     
    590514{
    591515    return includeHorizontalScrollbarSize() ? layer()->horizontalScrollbarHeight() : 0;
    592 }
    593 
    594 // More IE extensions.  clientWidth and clientHeight represent the interior of an object
    595 // excluding border and scrollbar.
    596 int RenderObject::clientWidth() const
    597 {
    598     return width() - borderLeft() - borderRight() - verticalScrollbarWidth();
    599 }
    600 
    601 int RenderObject::clientHeight() const
    602 {
    603     return height() - borderTop() - borderBottom() - horizontalScrollbarHeight();
    604 }
    605 
    606 // scrollWidth/scrollHeight will be the same as clientWidth/clientHeight unless the
    607 // object has overflow:hidden/scroll/auto specified and also has overflow.
    608 int RenderObject::scrollWidth() const
    609 {
    610     return hasOverflowClip() ? layer()->scrollWidth() : overflowWidth();
    611 }
    612 
    613 int RenderObject::scrollHeight() const
    614 {
    615     return hasOverflowClip() ? layer()->scrollHeight() : overflowHeight();
    616 }
    617 
    618 int RenderObject::scrollLeft() const
    619 {
    620     return hasOverflowClip() ? layer()->scrollXOffset() : 0;
    621 }
    622 
    623 int RenderObject::scrollTop() const
    624 {
    625     return hasOverflowClip() ? layer()->scrollYOffset() : 0;
    626 }
    627 
    628 void RenderObject::setScrollLeft(int newLeft)
    629 {
    630     if (hasOverflowClip())
    631         layer()->scrollToXOffset(newLeft);
    632 }
    633 
    634 void RenderObject::setScrollTop(int newTop)
    635 {
    636     if (hasOverflowClip())
    637         layer()->scrollToYOffset(newTop);
    638516}
    639517
     
    677555}
    678556
    679 void RenderObject::markAllDescendantsWithFloatsForLayout(RenderObject*)
     557void RenderObject::markAllDescendantsWithFloatsForLayout(RenderBox*)
    680558{
    681559}
     
    16981576}
    16991577
    1700 void RenderObject::addLineBoxRects(Vector<IntRect>&, unsigned, unsigned, bool)
    1701 {
    1702 }
    1703 
    1704 void RenderObject::absoluteRects(Vector<IntRect>& rects, int tx, int ty, bool topLevel)
    1705 {
    1706     // For blocks inside inlines, we go ahead and include margins so that we run right up to the
    1707     // inline boxes above and below us (thus getting merged with them to form a single irregular
    1708     // shape).
    1709     RenderFlow* continuation = virtualContinuation();
    1710     if (topLevel && continuation) {
    1711         rects.append(IntRect(tx, ty - collapsedMarginTop(),
    1712                              width(), height() + collapsedMarginTop() + collapsedMarginBottom()));
    1713         continuation->absoluteRects(rects,
    1714                                     tx - xPos() + continuation->containingBlock()->xPos(),
    1715                                     ty - yPos() + continuation->containingBlock()->yPos(), topLevel);
    1716     } else
    1717         rects.append(IntRect(tx, ty, width(), height() + borderTopExtra() + borderBottomExtra()));
    1718 }
    1719 
    1720 IntRect RenderObject::absoluteBoundingBoxRect(bool useTransforms)
    1721 {
    1722     if (useTransforms) {
    1723         Vector<FloatQuad> quads;
    1724         absoluteQuads(quads);
    1725 
    1726         size_t n = quads.size();
    1727         if (!n)
    1728             return IntRect();
    1729    
    1730         IntRect result = quads[0].enclosingBoundingBox();
    1731         for (size_t i = 1; i < n; ++i)
    1732             result.unite(quads[i].enclosingBoundingBox());
    1733         return result;
    1734     }
    1735 
    1736     FloatPoint absPos = localToAbsolute();
    1737     Vector<IntRect> rects;
    1738     absoluteRects(rects, absPos.x(), absPos.y());
    1739 
    1740     size_t n = rects.size();
    1741     if (!n)
    1742         return IntRect();
    1743 
    1744     IntRect result = rects[0];
    1745     for (size_t i = 1; i < n; ++i)
    1746         result.unite(rects[i]);
    1747     return result;
    1748 }
    1749 
    1750 void RenderObject::collectAbsoluteLineBoxQuads(Vector<FloatQuad>&, unsigned, unsigned, bool)
    1751 {
    1752 }
    1753 
    1754 void RenderObject::absoluteQuads(Vector<FloatQuad>& quads, bool topLevel)
    1755 {
    1756     // For blocks inside inlines, we go ahead and include margins so that we run right up to the
    1757     // inline boxes above and below us (thus getting merged with them to form a single irregular
    1758     // shape).
    1759     RenderFlow* continuation = virtualContinuation();
    1760     if (topLevel && continuation) {
    1761         FloatRect localRect(0, -collapsedMarginTop(),
    1762                             width(), height() + collapsedMarginTop() + collapsedMarginBottom());
    1763         quads.append(localToAbsoluteQuad(localRect));
    1764         continuation->absoluteQuads(quads, topLevel);
    1765     } else
    1766         quads.append(localToAbsoluteQuad(FloatRect(0, 0, width(), height() + borderTopExtra() + borderBottomExtra())));
    1767 }
    1768 
    1769 void RenderObject::addAbsoluteRectForLayer(IntRect& result)
    1770 {
    1771     if (hasLayer())
    1772         result.unite(absoluteBoundingBoxRect());
    1773     for (RenderObject* current = firstChild(); current; current = current->nextSibling())
    1774         current->addAbsoluteRectForLayer(result);
    1775 }
    1776 
    1777 IntRect RenderObject::paintingRootRect(IntRect& topLevelRect)
    1778 {
    1779     IntRect result = absoluteBoundingBoxRect();
    1780     topLevelRect = result;
    1781     for (RenderObject* current = firstChild(); current; current = current->nextSibling())
    1782         current->addAbsoluteRectForLayer(result);
    1783     return result;
    1784 }
    1785 
    17861578void RenderObject::addPDFURLRect(GraphicsContext* context, const IntRect& rect)
    17871579{
     
    17971589}
    17981590
    1799 
    1800 void RenderObject::addFocusRingRects(GraphicsContext* graphicsContext, int tx, int ty)
    1801 {
    1802     // For blocks inside inlines, we go ahead and include margins so that we run right up to the
    1803     // inline boxes above and below us (thus getting merged with them to form a single irregular
    1804     // shape).
    1805     RenderFlow* continuation = virtualContinuation();
    1806     if (continuation) {
    1807         graphicsContext->addFocusRingRect(IntRect(tx, ty - collapsedMarginTop(), width(), height() + collapsedMarginTop() + collapsedMarginBottom()));
    1808         continuation->addFocusRingRects(graphicsContext,
    1809                                         tx - xPos() + continuation->containingBlock()->xPos(),
    1810                                         ty - yPos() + continuation->containingBlock()->yPos());
    1811     } else
    1812         graphicsContext->addFocusRingRect(IntRect(tx, ty, width(), height()));
    1813 }
    1814 
    18151591void RenderObject::paintOutline(GraphicsContext* graphicsContext, int tx, int ty, int w, int h, const RenderStyle* style)
    18161592{
     
    18191595
    18201596    int ow = style->outlineWidth();
    1821 
    18221597    EBorderStyle os = style->outlineStyle();
    18231598
     
    18631638    drawBorder(graphicsContext, tx - ow, ty + h, tx + w + ow, ty + h + ow,
    18641639               BSBottom, Color(oc), style->color(), os, ow, ow);
     1640}
     1641
     1642void RenderObject::addLineBoxRects(Vector<IntRect>&, unsigned, unsigned, bool)
     1643{
     1644}
     1645
     1646IntRect RenderObject::absoluteBoundingBoxRect(bool useTransforms)
     1647{
     1648    if (useTransforms) {
     1649        Vector<FloatQuad> quads;
     1650        absoluteQuads(quads);
     1651
     1652        size_t n = quads.size();
     1653        if (!n)
     1654            return IntRect();
     1655   
     1656        IntRect result = quads[0].enclosingBoundingBox();
     1657        for (size_t i = 1; i < n; ++i)
     1658            result.unite(quads[i].enclosingBoundingBox());
     1659        return result;
     1660    }
     1661
     1662    FloatPoint absPos = localToAbsolute();
     1663    Vector<IntRect> rects;
     1664    absoluteRects(rects, absPos.x(), absPos.y());
     1665
     1666    size_t n = rects.size();
     1667    if (!n)
     1668        return IntRect();
     1669
     1670    IntRect result = rects[0];
     1671    for (size_t i = 1; i < n; ++i)
     1672        result.unite(rects[i]);
     1673    return result;
     1674}
     1675
     1676void RenderObject::addAbsoluteRectForLayer(IntRect& result)
     1677{
     1678    if (hasLayer())
     1679        result.unite(absoluteBoundingBoxRect());
     1680    for (RenderObject* current = firstChild(); current; current = current->nextSibling())
     1681        current->addAbsoluteRectForLayer(result);
     1682}
     1683
     1684IntRect RenderObject::paintingRootRect(IntRect& topLevelRect)
     1685{
     1686    IntRect result = absoluteBoundingBoxRect();
     1687    topLevelRect = result;
     1688    for (RenderObject* current = firstChild(); current; current = current->nextSibling())
     1689        current->addAbsoluteRectForLayer(result);
     1690    return result;
    18651691}
    18661692
     
    25582384        // aren't we'll get the root of our little subtree (most likely
    25592385        // we'll just return 0).
     2386        // FIXME: The definition of view() has changed to not crawl up the render tree.  It might
     2387        // be safe now to use it.
    25602388        while (o && o->parent() && !(o->hasTransform() && o->isRenderBlock()))
    25612389            o = o->parent();
     
    25972425
    25982426        if (outermostBlock)
    2599             outermostBlock->markAllDescendantsWithFloatsForLayout(this);
     2427            outermostBlock->markAllDescendantsWithFloatsForLayout(RenderBox::toRenderBox(this));
    26002428    }
    26012429
     
    26042432        for (p = parent(); p; p = p->parent()) {
    26052433            if (p->isRenderBlock())
    2606                 static_cast<RenderBlock*>(p)->removePositionedObject(this);
     2434                static_cast<RenderBlock*>(p)->removePositionedObject(RenderBox::toRenderBox(this));
    26072435        }
    26082436    }
     
    26232451        RenderCounter::destroyCounterNodes(this);
    26242452
    2625     if (AXObjectCache::accessibilityEnabled())
     2453    if (AXObjectCache::accessibilityEnabled()) {
     2454        document()->axObjectCache()->childrenChanged(this->parent());
    26262455        document()->axObjectCache()->remove(this);
    2627 
     2456    }
    26282457    animation()->cancelAnimations(this);
    26292458
     
    27352564            // We're in the continuation of a split inline.  Adjust our local point to be in the coordinate space
    27362565            // of the principal renderer's containing block.  This will end up being the innerNonSharedNode.
    2737             RenderObject* firstBlock = node->renderer()->containingBlock();
     2566            RenderBlock* firstBlock = node->renderer()->containingBlock();
    27382567           
    27392568            // Get our containing block.
    2740             RenderObject* block = this;
     2569            RenderBox* block = RenderBox::toRenderBox(this);
    27412570            if (isInline())
    27422571                block = containingBlock();
    27432572       
    2744             localPoint.move(block->xPos() - firstBlock->xPos(), block->yPos() - firstBlock->yPos());
     2573            localPoint.move(block->x() - firstBlock->x(), block->y() - firstBlock->y());
    27452574        }
    27462575
     
    30012830{
    30022831    // Convert the style regions to absolute coordinates.
    3003     if (style()->visibility() != VISIBLE)
     2832    if (style()->visibility() != VISIBLE || !isBox())
    30042833        return;
     2834   
     2835    RenderBox* box = RenderBox::toRenderBox(this);
    30052836
    30062837    const Vector<StyleDashboardRegion>& styleRegions = style()->dashboardRegions();
     
    30092840        StyleDashboardRegion styleRegion = styleRegions[i];
    30102841
    3011         int w = width();
    3012         int h = height();
     2842        int w = box->width();
     2843        int h = box->height();
    30132844
    30142845        DashboardRegionValue region;
     
    31302961}
    31312962
    3132 IntRect RenderObject::contentBox() const
    3133 {
    3134     return IntRect(borderLeft() + paddingLeft(), borderTop() + paddingTop(),
    3135         contentWidth(), contentHeight());
    3136 }
    3137 
    3138 IntRect RenderObject::absoluteContentBox() const
    3139 {
    3140     IntRect rect = contentBox();
    3141     FloatPoint absPos = localToAbsoluteForContent(FloatPoint());
    3142     rect.move(absPos.x(), absPos.y());
    3143     return rect;
    3144 }
    3145 
    3146 FloatQuad RenderObject::absoluteContentQuad() const
    3147 {
    3148     IntRect rect = contentBox();
    3149     return localToAbsoluteQuad(FloatRect(rect));
    3150 }
    3151 
    31522963void RenderObject::adjustRectForOutlineAndShadow(IntRect& rect) const
    31532964{
     
    31752986}
    31762987
    3177 IntRect RenderObject::absoluteOutlineBounds() const
    3178 {
    3179     IntRect box = borderBox();
    3180     adjustRectForOutlineAndShadow(box);
    3181 
    3182     FloatQuad absOutlineQuad = localToAbsoluteQuad(FloatRect(box));
    3183     box = absOutlineQuad.enclosingBoundingBox();
    3184     box.move(view()->layoutDelta());
    3185 
    3186     return box;
    3187 }
    3188 
    31892988bool RenderObject::isScrollable() const
    31902989{
     
    32033002}
    32043003
    3205 IntRect RenderObject::reflectionBox() const
    3206 {
    3207     IntRect result;
    3208     if (!m_style->boxReflect())
    3209         return result;
    3210     IntRect box = borderBox();
    3211     result = box;
    3212     switch (m_style->boxReflect()->direction()) {
    3213         case ReflectionBelow:
    3214             result.move(0, box.height() + reflectionOffset());
    3215             break;
    3216         case ReflectionAbove:
    3217             result.move(0, -box.height() - reflectionOffset());
    3218             break;
    3219         case ReflectionLeft:
    3220             result.move(-box.width() - reflectionOffset(), 0);
    3221             break;
    3222         case ReflectionRight:
    3223             result.move(box.width() + reflectionOffset(), 0);
    3224             break;
    3225     }
    3226     return result;
    3227 }
    3228 
    3229 int RenderObject::reflectionOffset() const
    3230 {
    3231     if (!m_style->boxReflect())
    3232         return 0;
    3233     if (m_style->boxReflect()->direction() == ReflectionLeft || m_style->boxReflect()->direction() == ReflectionRight)
    3234         return m_style->boxReflect()->offset().calcValue(borderBox().width());
    3235     return m_style->boxReflect()->offset().calcValue(borderBox().height());
    3236 }
    3237 
    3238 IntRect RenderObject::reflectedRect(const IntRect& r) const
    3239 {
    3240     if (!m_style->boxReflect())
    3241         return IntRect();
    3242 
    3243     IntRect box = borderBox();
    3244     IntRect result = r;
    3245     switch (m_style->boxReflect()->direction()) {
    3246         case ReflectionBelow:
    3247             result.setY(box.bottom() + reflectionOffset() + (box.bottom() - r.bottom()));
    3248             break;
    3249         case ReflectionAbove:
    3250             result.setY(box.y() - reflectionOffset() - box.height() + (box.bottom() - r.bottom()));
    3251             break;
    3252         case ReflectionLeft:
    3253             result.setX(box.x() - reflectionOffset() - box.width() + (box.right() - r.right()));
    3254             break;
    3255         case ReflectionRight:
    3256             result.setX(box.right() + reflectionOffset() + (box.right() - r.right()));
    3257             break;
    3258     }
    3259     return result;
    3260 }
    3261 
    32623004#if ENABLE(SVG)
    32633005
     
    32693011TransformationMatrix RenderObject::localTransform() const
    32703012{
    3271     return TransformationMatrix(1, 0, 0, 1, xPos(), yPos());
     3013    return TransformationMatrix();
    32723014}
    32733015
  • trunk/WebCore/rendering/RenderObject.h

    r40086 r40124  
    5151class RenderArena;
    5252class RenderBlock;
     53class RenderBox;
    5354class RenderFlow;
    5455class RenderFrameSet;
     
    330331    bool isRelPositioned() const { return m_relPositioned; } // relative positioning
    331332    bool isText() const  { return m_isText; }
     333    bool isBox() const { return m_isBox; }
    332334    bool isInline() const { return m_inline; }  // inline object
    333335    bool isCompact() const { return style()->display() == COMPACT; } // compact object
     
    371373    bool hasTransform() const { return m_hasTransform; }
    372374    bool hasMask() const { return style() && style()->hasMask(); }
    373     virtual IntRect maskClipRect() { return borderBox(); }
    374375
    375376private:
     
    403404    RenderObject* hoverAncestor() const;
    404405
    405     virtual void markAllDescendantsWithFloatsForLayout(RenderObject* floatToRemove = 0);
     406    virtual void markAllDescendantsWithFloatsForLayout(RenderBox* floatToRemove = 0);
    406407    void markContainingBlocksForLayout(bool scheduleRelayout = true, RenderObject* newRoot = 0);
    407408    void setNeedsLayout(bool b, bool markParents = true);
     
    423424    void setInline(bool b = true) { m_inline = b; }
    424425    void setHasBoxDecorations(bool b = true) { m_paintBackground = b; }
    425     void setRenderText() { m_isText = true; }
     426    void setIsText() { m_isText = true; }
     427    void setIsBox() { m_isBox = true; }
    426428    void setReplaced(bool b = true) { m_replaced = b; }
    427429    void setHasOverflowClip(bool b = true) { m_hasOverflowClip = b; }
     
    480482    void paintBorder(GraphicsContext*, int tx, int ty, int w, int h, const RenderStyle*, bool begin = true, bool end = true);
    481483    bool paintNinePieceImage(GraphicsContext*, int tx, int ty, int w, int h, const RenderStyle*, const NinePieceImage&, CompositeOperator = CompositeSourceOver);
    482     void paintOutline(GraphicsContext*, int tx, int ty, int w, int h, const RenderStyle*);
    483484    void paintBoxShadow(GraphicsContext*, int tx, int ty, int w, int h, const RenderStyle*, bool begin = true, bool end = true);
    484485
     
    520521    virtual void updateFromElement() { }
    521522
    522     // Block flows subclass availableWidth to handle multi column layout (shrinking the width available to children when laying out.)
    523     virtual int availableWidth() const { return contentWidth(); }
    524    
    525     virtual int availableHeight() const { return 0; }
    526 
    527523    virtual void updateWidgetPosition();
    528524
     
    560556    // return just the height of the containing block
    561557    virtual int containingBlockHeight() const;
    562 
    563     // content area (box minus padding/border)
    564     IntRect contentBox() const;
    565     // absolute coords of content area. Ignores transforms.
    566     IntRect absoluteContentBox() const;
    567     // content rect converted to absolute coords, taking transforms into account
    568     FloatQuad absoluteContentQuad() const;
    569    
    570     int contentWidth() const { return clientWidth() - paddingLeft() - paddingRight(); }
    571     int contentHeight() const { return clientHeight() - paddingTop() - paddingBottom(); }
    572558
    573559    // used by flexible boxes to impose a flexed width/height override
     
    577563    virtual void setOverrideSize(int /*overrideSize*/) { }
    578564
    579     // relative to parent node
    580     virtual void setPos(int /*xPos*/, int /*yPos*/) { }
    581     virtual void setWidth(int /*width*/) { }
    582     virtual void setHeight(int /*height*/) { }
    583     virtual void setRect(const IntRect& rect) { setPos(rect.x(), rect.y()); setWidth(rect.width()); setHeight(rect.height()); }
    584 
    585     virtual int xPos() const { return 0; }
    586     virtual int yPos() const { return 0; }
    587 
    588565    // Convert the given local point to absolute coordinates
    589566    // FIXME: Temporary. If useTransforms is true, take transforms into account. Eventually localToAbsolute() will always be transform-aware.
     
    591568    virtual FloatPoint absoluteToLocal(FloatPoint, bool fixed = false, bool useTransforms = false) const;
    592569
    593     // This function is used to deal with the extra top space that can occur in table cells (called borderTopExtra).
     570    // This function is used to deal with the extra top space that can occur in table cells (called intrinsicPaddingTop).
    594571    // The children of the cell do not factor this space in, so we have to add it in.  Any code that wants to
    595572    // accurately deal with the contents of a cell must call this function instad of absolutePosition.
     
    605582    // Return the offset from the container() renderer (excluding transforms)
    606583    virtual IntSize offsetFromContainer(RenderObject*) const;
    607 
    608     // width and height are without margins but include paddings and borders
    609     virtual int width() const { return 0; }
    610     virtual int height() const { return 0; }
    611 
    612     virtual IntRect borderBox() const { return IntRect(0, 0, width(), height()); }
    613     // Bounds of the outline box in absolute coords. Respects transforms
    614     IntRect absoluteOutlineBounds() const;
    615 
    616     // The height of a block when you include normal flow overflow spillage out of the bottom
    617     // of the block (e.g., a <div style="height:25px"> that has a 100px tall image inside
    618     // it would have an overflow height of borderTop() + paddingTop() + 100px.
    619     virtual int overflowHeight(bool /*includeInterior*/ = true) const { return height(); }
    620     virtual int overflowWidth(bool /*includeInterior*/ = true) const { return width(); }
    621     virtual void setOverflowHeight(int) { }
    622     virtual void setOverflowWidth(int) { }
    623     virtual int overflowLeft(bool /*includeInterior*/ = true) const { return 0; }
    624     virtual int overflowTop(bool /*includeInterior*/ = true) const { return 0; }
    625     virtual IntRect overflowRect(bool /*includeInterior*/ = true) const { return borderBox(); }
    626 
    627     // IE extensions. Used to calculate offsetWidth/Height.  Overridden by inlines (RenderFlow)
    628     // to return the remaining width on a given line (and the height of a single line).
    629     virtual int offsetWidth() const { return width(); }
    630     virtual int offsetHeight() const { return height() + borderTopExtra() + borderBottomExtra(); }
    631 
    632     // IE extensions.  Also supported by Gecko.  We override in render flow to get the
    633     // left and top correct. -dwh
    634     virtual int offsetLeft() const;
    635     virtual int offsetTop() const;
    636     virtual RenderObject* offsetParent() const;
    637 
    638     // More IE extensions.  clientWidth and clientHeight represent the interior of an object
    639     // excluding border and scrollbar.  clientLeft/Top are just the borderLeftWidth and borderTopWidth.
    640     int clientLeft() const { return borderLeft(); }
    641     int clientTop() const { return borderTop(); }
    642     int clientWidth() const;
    643     int clientHeight() const;
    644 
    645     // scrollWidth/scrollHeight will be the same as clientWidth/clientHeight unless the
    646     // object has overflow:hidden/scroll/auto specified and also has overflow.
    647     // scrollLeft/Top return the current scroll position.  These methods are virtual so that objects like
    648     // textareas can scroll shadow content (but pretend that they are the objects that are
    649     // scrolling).
    650     virtual int scrollLeft() const;
    651     virtual int scrollTop() const;
    652     virtual int scrollWidth() const;
    653     virtual int scrollHeight() const;
    654     virtual void setScrollLeft(int);
    655     virtual void setScrollTop(int);
    656584
    657585    virtual bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1.0f);
     
    690618    virtual int paddingRight() const;
    691619
     620    virtual int borderTopExtra() const { return 0; }
     621    virtual int borderBottomExtra() const { return 0; }
     622
    692623    virtual int borderTop() const { return style()->borderTopWidth(); }
    693624    virtual int borderBottom() const { return style()->borderBottomWidth(); }
    694     virtual int borderTopExtra() const { return 0; }
    695     virtual int borderBottomExtra() const { return 0; }
    696625    virtual int borderLeft() const { return style()->borderLeftWidth(); }
    697626    virtual int borderRight() const { return style()->borderRightWidth(); }
    698627
    699628    virtual void addLineBoxRects(Vector<IntRect>&, unsigned startOffset = 0, unsigned endOffset = UINT_MAX, bool useSelectionHeight = false);
    700 
    701     virtual void absoluteRects(Vector<IntRect>&, int tx, int ty, bool topLevel = true);
     629   
     630    virtual void absoluteRects(Vector<IntRect>&, int, int, bool = true) { }
    702631    // FIXME: useTransforms should go away eventually
    703632    IntRect absoluteBoundingBoxRect(bool useTransforms = false);
    704633
    705634    // Build an array of quads in absolute coords for line boxes
    706     virtual void collectAbsoluteLineBoxQuads(Vector<FloatQuad>&, unsigned startOffset = 0, unsigned endOffset = UINT_MAX, bool useSelectionHeight = false);
    707     virtual void absoluteQuads(Vector<FloatQuad>&, bool topLevel = true);
     635    virtual void collectAbsoluteLineBoxQuads(Vector<FloatQuad>&, unsigned /*startOffset*/ = 0, unsigned /*endOffset*/ = UINT_MAX, bool /*useSelectionHeight*/ = false) { };
     636    virtual void absoluteQuads(Vector<FloatQuad>&, bool /*topLevel*/ = true) { };
    708637
    709638    // the rect that will be painted if this object is passed as the paintingRoot
    710639    IntRect paintingRootRect(IntRect& topLevelRect);
    711 
    712     void addPDFURLRect(GraphicsContext*, const IntRect&);
    713 
    714     virtual void addFocusRingRects(GraphicsContext*, int tx, int ty);
    715640
    716641    virtual int minPrefWidth() const { return 0; }
     
    757682    // coordinate space.  This method deals with outlines and overflow.
    758683    virtual IntRect absoluteClippedOverflowRect();
    759 
     684   
    760685    IntRect getAbsoluteRepaintRectWithOutline(int ow);
    761686
     
    784709
    785710    bool hasReflection() const { return m_hasReflection; }
    786     IntRect reflectionBox() const;
    787     int reflectionOffset() const;
    788     // Given a rect in the object's coordinate space, returns the corresponding rect in the reflection.
    789     IntRect reflectedRect(const IntRect&) const;
    790711
    791712    // Applied as a "slop" to dirty rect checks during the outline painting phase's dirty-rect checks.
     
    915836    bool visibleToHitTesting() const { return style()->visibility() == VISIBLE && style()->pointerEvents() != PE_NONE; }
    916837   
     838    virtual void addFocusRingRects(GraphicsContext*, int /*tx*/, int /*ty*/) { };
     839    virtual IntRect absoluteOutlineBounds() const { return IntRect(); }
     840
    917841protected:
    918842    // Overrides should call the superclass at the end
     
    922846   
    923847    virtual void printBoxDecorations(GraphicsContext*, int /*x*/, int /*y*/, int /*w*/, int /*h*/, int /*tx*/, int /*ty*/) { }
     848
     849    void paintOutline(GraphicsContext*, int tx, int ty, int w, int h, const RenderStyle*);
     850    void addPDFURLRect(GraphicsContext*, const IntRect&);
    924851
    925852    virtual IntRect viewRect() const;
     
    959886    bool m_isAnonymous               : 1;
    960887    bool m_isText                    : 1;
     888    bool m_isBox                     : 1;
    961889    bool m_inline                    : 1;
    962890    bool m_replaced                  : 1;
  • trunk/WebCore/rendering/RenderPart.cpp

    r40086 r40124  
    8989        return;
    9090   
    91     int width, height;
    9291    FloatPoint absPos = localToAbsolute();
    9392    absPos.move(borderLeft() + paddingLeft(), borderTop() + paddingTop());
    94     width = m_width - borderLeft() - borderRight() - paddingLeft() - paddingRight();
    95     height = m_height - borderTop() - borderBottom() - paddingTop() - paddingBottom();
    96     IntRect newBounds(absPos.x(), absPos.y(), width, height);
     93    int w = width() - borderLeft() - borderRight() - paddingLeft() - paddingRight();
     94    int h = height() - borderTop() - borderBottom() - paddingTop() - paddingBottom();
     95    IntRect newBounds(absPos.x(), absPos.y(), w, h);
    9796    bool boundsChanged = newBounds != m_widget->frameRect();
    9897    if (boundsChanged) {
  • trunk/WebCore/rendering/RenderPath.cpp

    r40086 r40124  
    172172
    173173    m_absoluteBounds = absoluteClippedOverflowRect();
    174 
    175     setWidth(m_absoluteBounds.width());
    176     setHeight(m_absoluteBounds.height());
    177174
    178175    if (checkForRepaint)
     
    486483}
    487484
     485IntRect RenderPath::absoluteOutlineBounds() const
     486{
     487    IntRect result = m_absoluteBounds;
     488    adjustRectForOutlineAndShadow(result);
     489    return result;
     490}
     491
    488492}
    489493
  • trunk/WebCore/rendering/RenderPath.h

    r40086 r40124  
    7474    FloatRect drawMarkersIfNeeded(GraphicsContext*, const FloatRect&, const Path&) const;
    7575   
     76    virtual IntRect absoluteOutlineBounds() const;
     77
    7678private:
    7779    FloatPoint mapAbsolutePointToLocal(const FloatPoint&) const;
  • trunk/WebCore/rendering/RenderReplaced.cpp

    r40086 r40124  
    8686    }
    8787   
    88     m_height = minimumReplacedHeight();
     88    setHeight(minimumReplacedHeight());
    8989   
    9090    calcWidth();
     
    111111        return;
    112112   
    113     tx += m_x;
    114     ty += m_y;
     113    tx += x();
     114    ty += m_frameRect.y();
    115115   
    116116    if (hasBoxDecorations() && (paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseSelection))
     
    160160        return false;
    161161
    162     int currentTX = tx + m_x;
    163     int currentTY = ty + m_y;
     162    int currentTX = tx + x();
     163    int currentTY = ty + m_frameRect.y();
    164164
    165165    // Early exit if the element touches the edges.
     
    216216}
    217217
    218 VisiblePosition RenderReplaced::positionForCoordinates(int x, int y)
     218VisiblePosition RenderReplaced::positionForCoordinates(int xPos, int yPos)
    219219{
    220220    InlineBox* box = inlineBoxWrapper();
     
    229229    int bottom = root->nextRootBox() ? root->nextRootBox()->topOverflow() : root->bottomOverflow();
    230230
    231     if (y + yPos() < top)
     231    if (yPos + y() < top)
    232232        return VisiblePosition(element(), caretMinOffset(), DOWNSTREAM); // coordinates are above
    233233   
    234     if (y + yPos() >= bottom)
     234    if (yPos + y() >= bottom)
    235235        return VisiblePosition(element(), caretMaxOffset(), DOWNSTREAM); // coordinates are below
    236236   
    237237    if (element()) {
    238         if (x <= width() / 2)
     238        if (xPos <= width() / 2)
    239239            return VisiblePosition(element(), 0, DOWNSTREAM);
    240240        return VisiblePosition(element(), 1, DOWNSTREAM);
    241241    }
    242242
    243     return RenderBox::positionForCoordinates(x, y);
     243    return RenderBox::positionForCoordinates(xPos, yPos);
    244244}
    245245
     
    276276   
    277277    RootInlineBox* root = m_inlineBoxWrapper->root();
    278     return IntRect(0, root->selectionTop() - yPos(), width(), root->selectionHeight());
     278    return IntRect(0, root->selectionTop() - y(), width(), root->selectionHeight());
    279279}
    280280
     
    328328    IntRect overflow;
    329329    for (ShadowData* boxShadow = style()->boxShadow(); boxShadow; boxShadow = boxShadow->next) {
    330         IntRect shadow = borderBox();
     330        IntRect shadow = borderBoxRect();
    331331        shadow.move(boxShadow->x, boxShadow->y);
    332332        shadow.inflate(boxShadow->blur);
     
    337337        if (!gOverflowRectMap)
    338338            gOverflowRectMap = new OverflowRectMap();
    339         overflow.unite(borderBox());
     339        overflow.unite(borderBoxRect());
    340340        gOverflowRectMap->set(this, overflow);
    341341        m_hasOverflow = true;
     
    387387        return gOverflowRectMap->find(this)->second;
    388388
    389     return borderBox();
     389    return borderBoxRect();
    390390}
    391391
  • trunk/WebCore/rendering/RenderReplica.cpp

    r40086 r40124  
    4343void RenderReplica::layout()
    4444{
    45     IntRect box = parent()->borderBox();
    46     m_x = box.x();
    47     m_y = box.y();
    48     m_width = box.width();
    49     m_height = box.height();
     45    m_frameRect = parentBox()->borderBoxRect();
    5046    setNeedsLayout(false);
    5147}
     
    5349void RenderReplica::calcPrefWidths()
    5450{
    55     m_minPrefWidth = parent()->width();
     51    m_minPrefWidth = parentBox()->width();
    5652    m_maxPrefWidth = m_minPrefWidth;
    5753    setPrefWidthsDirty(false);
     
    6359        return;
    6460 
    65     tx += m_x;
    66     ty += m_y;
     61    tx += x();
     62    ty += m_frameRect.y();
    6763
    6864    if (paintInfo.phase == PaintPhaseForeground)
  • trunk/WebCore/rendering/RenderSVGContainer.cpp

    r40086 r40124  
    4545    , m_drawsContents(true)
    4646{
    47     setReplaced(true);
    4847}
    4948
     
    432431}
    433432
     433IntRect RenderSVGContainer::absoluteOutlineBounds() const
     434{
     435    IntRect result = m_absoluteBounds;
     436    adjustRectForOutlineAndShadow(result);
     437    return result;
     438}
     439
    434440}
    435441
  • trunk/WebCore/rendering/RenderSVGContainer.h

    r40086 r40124  
    4141    virtual RenderObject* lastChild() const { return m_lastChild; }
    4242
    43     virtual int width() const { return m_width; }
    44     virtual int height() const { return m_height; }
     43    int width() const { return m_width; }
     44    int height() const { return m_height; }
    4545
    4646    virtual bool canHaveChildren() const;
     
    9090    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
    9191
     92    virtual IntRect absoluteOutlineBounds() const;
     93
    9294protected:
    9395    virtual void applyContentTransforms(PaintInfo&);
  • trunk/WebCore/rendering/RenderSVGImage.cpp

    r40086 r40124  
    148148   
    149149    // minimum height
    150     m_height = errorOccurred() ? intrinsicSize().height() : 0;
     150    setHeight(errorOccurred() ? intrinsicSize().height() : 0);
    151151
    152152    calcWidth();
  • trunk/WebCore/rendering/RenderSVGInlineText.cpp

    r40086 r40124  
    130130    TransformationMatrix htmlParentCtm = root->RenderContainer::absoluteTransform();
    131131
    132     FloatRect fixedRect(narrowPrecisionToFloat(rect.x() + absPos.x() - xPos() - htmlParentCtm.e()),
    133                         narrowPrecisionToFloat(rect.y() + absPos.y() - yPos() - htmlParentCtm.f()), rect.width(), rect.height());
     132    FloatRect fixedRect(narrowPrecisionToFloat(rect.x() + absPos.x() - (firstTextBox() ? firstTextBox()->xPos() : 0) - htmlParentCtm.e()),
     133                        narrowPrecisionToFloat(rect.y() + absPos.y() - (firstTextBox() ? firstTextBox()->yPos() : 0) - htmlParentCtm.f()), rect.width(), rect.height());
    134134    // FIXME: broken with CSS transforms
    135135    return enclosingIntRect(absoluteTransform().mapRect(fixedRect));
     
    156156
    157157    SVGRootInlineBox* rootBox = textBox->svgRootInlineBox();
    158     RenderObject* object = rootBox ? rootBox->object() : 0;
     158    RenderBlock* object = rootBox ? rootBox->block() : 0;
    159159
    160160    if (!object)
     
    164164
    165165    for (SVGInlineTextBox* box = textBox; box; box = static_cast<SVGInlineTextBox*>(box->nextTextBox())) {
    166         if (box->svgCharacterHitsPosition(x + object->xPos(), y + object->yPos(), offset)) {
     166        if (box->svgCharacterHitsPosition(x + object->x(), y + object->y(), offset)) {
    167167            // If we're not at the end/start of the box, stop looking for other selected boxes.
    168168            if (box->direction() == LTR) {
  • trunk/WebCore/rendering/RenderSVGRoot.cpp

    r40086 r40124  
    103103    m_absoluteBounds = absoluteClippedOverflowRect();
    104104    SVGSVGElement* svg = static_cast<SVGSVGElement*>(element());
    105     m_width = static_cast<int>(m_width * svg->currentScale());
    106     m_height = static_cast<int>(m_height * svg->currentScale());
     105    setWidth(static_cast<int>(width() * svg->currentScale()));
     106    setHeight(static_cast<int>(height() * svg->currentScale()));
    107107   
    108108    for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
     
    126126    IntPoint origin;
    127127    origin.move(parentX, parentY);
    128     origin.move(m_x, m_y);
     128    origin.move(x(), m_frameRect.y());
    129129    origin.move(borderLeft(), borderTop());
    130130    origin.move(paddingLeft(), paddingTop());
     
    166166    // This should only exist for <svg> renderers
    167167    if (hasBoxDecorations() && (paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseSelection))
    168         paintBoxDecorations(paintInfo, m_x + parentX, m_y + parentY);
     168        paintBoxDecorations(paintInfo, x() + parentX, m_frameRect.y() + parentY);
    169169
    170170    if (!firstChild()) {
     
    269269{
    270270    TransformationMatrix ctm = RenderContainer::absoluteTransform();
    271     ctm.translate(m_x, m_y);
     271    ctm.translate(x(), m_frameRect.y());
    272272    SVGSVGElement* svg = static_cast<SVGSVGElement*>(element());
    273273    ctm.scale(svg->currentScale());
     
    309309        && style()->overflowX() == OHIDDEN
    310310        && style()->overflowY() == OHIDDEN) {
    311         int tx = m_x - _tx + sx;
    312         int ty = m_y - _ty + sy;
     311        int tx = x() - _tx + sx;
     312        int ty = m_frameRect.y() - _ty + sy;
    313313
    314314        // Check if we need to do anything at all.
  • trunk/WebCore/rendering/RenderSVGTSpan.cpp

    r40086 r40124  
    2828
    2929#include "FloatRect.h"
     30#include "RenderBlock.h"
    3031#include "SVGInlineTextBox.h"
    3132#include "SVGRootInlineBox.h"
     
    4344
    4445    SVGRootInlineBox* rootBox = firstBox ? static_cast<SVGInlineTextBox*>(firstBox)->svgRootInlineBox() : 0;
    45     RenderObject* object = rootBox ? rootBox->object() : 0;
     46    RenderBox* object = rootBox ? rootBox->block() : 0;
    4647
    4748    if (!object)
    4849        return;
    4950
    50     int xRef = object->xPos() + xPos();
    51     int yRef = object->yPos() + yPos();
     51    int xRef = object->x() + x();
     52    int yRef = object->y() + y();
    5253 
    5354    for (InlineRunBox* curr = firstBox; curr; curr = curr->nextLineBox()) {
     
    6364
    6465    SVGRootInlineBox* rootBox = firstBox ? static_cast<SVGInlineTextBox*>(firstBox)->svgRootInlineBox() : 0;
    65     RenderObject* object = rootBox ? rootBox->object() : 0;
     66    RenderBox* object = rootBox ? rootBox->block() : 0;
    6667
    6768    if (!object)
    6869        return;
    6970
    70     int xRef = object->xPos() + xPos();
    71     int yRef = object->yPos() + yPos();
     71    int xRef = object->x() + x();
     72    int yRef = object->y() + y();
    7273 
    7374    for (InlineRunBox* curr = firstBox; curr; curr = curr->nextLineBox()) {
  • trunk/WebCore/rendering/RenderSVGText.cpp

    r40086 r40124  
    9797    int xOffset = (int)(text->x()->getFirst().value(text));
    9898    int yOffset = (int)(text->y()->getFirst().value(text));
    99     setPos(xOffset, yOffset);
     99    setLocation(xOffset, yOffset);
    100100   
    101101    calculateLocalTransform();
     
    232232    }
    233233
    234     repaintRect.move(xPos(), yPos());
     234    repaintRect.move(x(), y());
    235235    return repaintRect;
    236236}
  • trunk/WebCore/rendering/RenderSVGTextPath.cpp

    r40086 r40124  
    2727
    2828#include "FloatRect.h"
     29#include "RenderBlock.h"
    2930#include "SVGInlineTextBox.h"
    3031#include "SVGPathElement.h"
     
    8384
    8485    SVGRootInlineBox* rootBox = firstBox ? static_cast<SVGInlineTextBox*>(firstBox)->svgRootInlineBox() : 0;
    85     RenderObject* object = rootBox ? rootBox->object() : 0;
     86    RenderBlock* object = rootBox ? rootBox->block() : 0;
    8687
    8788    if (!object)
    8889        return;
    8990
    90     int xRef = object->xPos() + xPos();
    91     int yRef = object->yPos() + yPos();
     91    int xRef = object->x() + x();
     92    int yRef = object->y() + y();
    9293
    9394    for (InlineRunBox* curr = firstBox; curr; curr = curr->nextLineBox()) {
     
    103104
    104105    SVGRootInlineBox* rootBox = firstBox ? static_cast<SVGInlineTextBox*>(firstBox)->svgRootInlineBox() : 0;
    105     RenderObject* object = rootBox ? rootBox->object() : 0;
     106    RenderBlock* object = rootBox ? rootBox->block() : 0;
    106107
    107108    if (!object)
    108109        return;
    109110
    110     int xRef = object->xPos() + xPos();
    111     int yRef = object->yPos() + yPos();
     111    int xRef = object->x() + x();
     112    int yRef = object->y() + y();
    112113
    113114    for (InlineRunBox* curr = firstBox; curr; curr = curr->nextLineBox()) {
  • trunk/WebCore/rendering/RenderSVGViewportContainer.cpp

    r40086 r40124  
    3838    : RenderSVGContainer(node)
    3939{
    40     setReplaced(true);
    4140}
    4241
     
    160159        && style()->overflowY() == OHIDDEN) {
    161160        // Check if we need to do anything at all.
    162         IntRect overflowBox = overflowRect(false);
     161        IntRect overflowBox = IntRect(0, 0, width(), height());
    163162        overflowBox.move(_tx, _ty);
    164163        TransformationMatrix ctm = RenderObject::absoluteTransform();
  • trunk/WebCore/rendering/RenderScrollbar.cpp

    r40086 r40124  
    3131namespace WebCore {
    3232
    33 PassRefPtr<Scrollbar> RenderScrollbar::createCustomScrollbar(ScrollbarClient* client, ScrollbarOrientation orientation, RenderObject* renderer)
     33PassRefPtr<Scrollbar> RenderScrollbar::createCustomScrollbar(ScrollbarClient* client, ScrollbarOrientation orientation, RenderBox* renderer)
    3434{
    3535    return adoptRef(new RenderScrollbar(client, orientation, renderer));
    3636}
    3737
    38 RenderScrollbar::RenderScrollbar(ScrollbarClient* client, ScrollbarOrientation orientation, RenderObject* renderer)
     38RenderScrollbar::RenderScrollbar(ScrollbarClient* client, ScrollbarOrientation orientation, RenderBox* renderer)
    3939    : Scrollbar(client, orientation, RegularScrollbar, RenderScrollbarTheme::renderScrollbarTheme())
    4040    , m_owner(renderer)
     
    5151    Scrollbar::setParent(parent);
    5252    if (!parent) {
    53         // Destroy all of the scrollbar's RenderObjects.
     53        // Destroy all of the scrollbar's RenderBoxes.
    5454        updateScrollbarParts(true);
    5555    }
  • trunk/WebCore/rendering/RenderScrollbar.h

    r40086 r40124  
    3333namespace WebCore {
    3434
    35 class RenderObject;
     35class RenderBox;
    3636class RenderScrollbarPart;
    3737class RenderStyle;
     
    3939class RenderScrollbar : public Scrollbar {
    4040protected:
    41     RenderScrollbar(ScrollbarClient*, ScrollbarOrientation, RenderObject*);
     41    RenderScrollbar(ScrollbarClient*, ScrollbarOrientation, RenderBox*);
    4242
    4343public:
    4444    friend class Scrollbar;
    45     static PassRefPtr<Scrollbar> createCustomScrollbar(ScrollbarClient*, ScrollbarOrientation, RenderObject*);
     45    static PassRefPtr<Scrollbar> createCustomScrollbar(ScrollbarClient*, ScrollbarOrientation, RenderBox*);
    4646    virtual ~RenderScrollbar();
    4747
     
    6161    virtual void styleChanged();
    6262
    63     RenderObject* owningRenderer() const { return m_owner; }
     63    RenderBox* owningRenderer() const { return m_owner; }
    6464
    6565    void paintPart(GraphicsContext*, ScrollbarPart, const IntRect&);
     
    7575    void updateScrollbarPart(ScrollbarPart, bool destroy = false);
    7676
    77     RenderObject* m_owner;
     77    RenderBox* m_owner;
    7878    HashMap<unsigned, RenderScrollbarPart*> m_parts;
    7979};
  • trunk/WebCore/rendering/RenderScrollbarPart.cpp

    r40086 r40124  
    4646void RenderScrollbarPart::layout()
    4747{
    48     setPos(0, 0); // We don't worry about positioning ourselves.  We're just determining our minimum width/height.
     48    setLocation(IntPoint()); // We don't worry about positioning ourselves.  We're just determining our minimum width/height.
    4949    if (m_scrollbar->orientation() == HorizontalScrollbar)
    5050        layoutHorizontalPart();
     
    5252        layoutVerticalPart();
    5353
    54     m_overflowWidth = max(m_width, m_overflowWidth);
    55     m_overflowHeight = max(m_height, m_overflowHeight);
     54    m_overflowWidth = max(width(), m_overflowWidth);
     55    m_overflowHeight = max(height(), m_overflowHeight);
    5656   
    5757    setNeedsLayout(false);
     
    6161{
    6262    if (m_part == ScrollbarBGPart) {
    63         m_width = m_scrollbar->width();
     63        setWidth(m_scrollbar->width());
    6464        computeScrollbarHeight();
    6565    } else {
    6666        computeScrollbarWidth();
    67         m_height = m_scrollbar->height();
     67        setHeight(m_scrollbar->height());
    6868    }
    6969}
     
    7373    if (m_part == ScrollbarBGPart) {
    7474        computeScrollbarWidth();
    75         m_height = m_scrollbar->height();
     75        setHeight(m_scrollbar->height());
    7676    } else {
    77         m_width = m_scrollbar->width();
     77        setWidth(m_scrollbar->width());
    7878        computeScrollbarHeight();
    7979    }
     
    9090{
    9191    int visibleSize = m_scrollbar->owningRenderer()->width() - m_scrollbar->owningRenderer()->borderLeft() - m_scrollbar->owningRenderer()->borderRight();
    92     int width = calcScrollbarThicknessUsing(style()->width(), visibleSize);
     92    int w = calcScrollbarThicknessUsing(style()->width(), visibleSize);
    9393    int minWidth = calcScrollbarThicknessUsing(style()->minWidth(), visibleSize);
    94     int maxWidth = style()->maxWidth().isUndefined() ? width : calcScrollbarThicknessUsing(style()->maxWidth(), visibleSize);
    95     m_width = max(minWidth, min(maxWidth, width));
     94    int maxWidth = style()->maxWidth().isUndefined() ? w : calcScrollbarThicknessUsing(style()->maxWidth(), visibleSize);
     95    setWidth(max(minWidth, min(maxWidth, w)));
    9696   
    9797    // Buttons and track pieces can all have margins along the axis of the scrollbar.
     
    103103{
    104104    int visibleSize = m_scrollbar->owningRenderer()->height() -  m_scrollbar->owningRenderer()->borderTop() - m_scrollbar->owningRenderer()->borderBottom();
    105     int height = calcScrollbarThicknessUsing(style()->height(), visibleSize);
     105    int h = calcScrollbarThicknessUsing(style()->height(), visibleSize);
    106106    int minHeight = calcScrollbarThicknessUsing(style()->minHeight(), visibleSize);
    107     int maxHeight = style()->maxHeight().isUndefined() ? height : calcScrollbarThicknessUsing(style()->maxHeight(), visibleSize);
    108     m_height = max(minHeight, min(maxHeight, height));
     107    int maxHeight = style()->maxHeight().isUndefined() ? h : calcScrollbarThicknessUsing(style()->maxHeight(), visibleSize);
     108    setHeight(max(minHeight, min(maxHeight, h)));
    109109
    110110    // Buttons and track pieces can all have margins along the axis of the scrollbar.
     
    145145{
    146146    // Make sure our dimensions match the rect.
    147     setPos(rect.x() - tx, rect.y() - ty);
     147    setLocation(rect.x() - tx, rect.y() - ty);
    148148    setWidth(rect.width());
    149149    setHeight(rect.height());
  • trunk/WebCore/rendering/RenderSlider.cpp

    r40086 r40124  
    106106            int newPosition = slider->positionForOffset(
    107107                IntPoint(m_initialPosition + curPoint.x() - m_initialClickPoint.x()
    108                         + (renderer()->width() / 2),
     108                        + (renderBox()->width() / 2),
    109109                    m_initialPosition + curPoint.y() - m_initialClickPoint.y()
    110                         + (renderer()->height() / 2)));
     110                        + (renderBox()->height() / 2)));
    111111            if (slider->currentPosition() != newPosition) {
    112112                slider->setCurrentPosition(newPosition);
     
    214214    if (m_thumb && m_thumb->renderer()) {
    215215           
    216         int oldWidth = m_width;
     216        int oldWidth = width();
    217217        calcWidth();
    218         int oldHeight = m_height;
     218        int oldHeight = height();
    219219        calcHeight();
    220220       
    221         if (oldWidth != m_width || oldHeight != m_height)
     221        if (oldWidth != width() || oldHeight != height())
    222222            relayoutChildren = true; 
    223223
     
    269269#endif
    270270    {
    271         FloatPoint localPoint = m_thumb->renderer()->absoluteToLocal(FloatPoint(evt->pageX(), evt->pageY()), false, true);
    272         IntRect thumbBounds = m_thumb->renderer()->borderBox();
     271        FloatPoint localPoint = m_thumb->renderBox()->absoluteToLocal(FloatPoint(evt->pageX(), evt->pageY()), false, true);
     272        IntRect thumbBounds = m_thumb->renderBox()->borderBoxRect();
    273273        return thumbBounds.contains(roundedIntPoint(localPoint));
    274274    }
     
    352352    int position;
    353353    if (style()->appearance() == SliderVerticalPart)
    354         position = p.y() - m_thumb->renderer()->height() / 2;
     354        position = p.y() - m_thumb->renderBox()->height() / 2;
    355355    else
    356         position = p.x() - m_thumb->renderer()->width() / 2;
     356        position = p.x() - m_thumb->renderBox()->width() / 2;
    357357   
    358358    return max(0, min(position, trackSize()));
     
    396396
    397397    if (style()->appearance() == SliderVerticalPart)
    398         return contentHeight() - m_thumb->renderer()->height();
    399     return contentWidth() - m_thumb->renderer()->width();
     398        return contentHeight() - m_thumb->renderBox()->height();
     399    return contentWidth() - m_thumb->renderBox()->width();
    400400}
    401401
  • trunk/WebCore/rendering/RenderTable.cpp

    r40086 r40124  
    220220    if (widthType > Relative && style()->width().isPositive()) {
    221221        // Percent or fixed table
    222         m_width = style()->width().calcMinValue(availableWidth);
    223         m_width = max(minPrefWidth(), m_width);
     222        setWidth(style()->width().calcMinValue(availableWidth));
     223        setWidth(max(minPrefWidth(), width()));
    224224    } else {
    225225        // An auto width table should shrink to fit within the line width if necessary in order to
    226226        // avoid overlapping floats.
    227         availableWidth = cb->lineWidth(m_y);
     227        availableWidth = cb->lineWidth(m_frameRect.y());
    228228       
    229229        // Subtract out any fixed margins from our available width for auto width tables.
     
    238238       
    239239        // Ensure we aren't bigger than our max width or smaller than our min width.
    240         m_width = min(availContentWidth, maxPrefWidth());
     240        setWidth(min(availContentWidth, maxPrefWidth()));
    241241    }
    242242   
    243     m_width = max(m_width, minPrefWidth());
     243    setWidth(max(width(), minPrefWidth()));
    244244
    245245    // Finally, with our true width determined, compute our margins for real.
     
    266266    }
    267267   
    268     LayoutStateMaintainer statePusher(view(), this, IntSize(m_x, m_y));
    269 
    270     m_height = 0;
     268    LayoutStateMaintainer statePusher(view(), this, IntSize(x(), m_frameRect.y()));
     269
     270    setHeight(0);
    271271    m_overflowHeight = 0;
    272272    m_overflowTop = 0;
    273273    initMaxMarginValues();
    274274   
    275     int oldWidth = m_width;
     275    int oldWidth = width();
    276276    calcWidth();
    277277
    278     if (m_caption && m_width != oldWidth)
     278    if (m_caption && width() != oldWidth)
    279279        m_caption->setNeedsLayout(true, false);
    280280
     
    283283    // layout that tells us if something has changed in the min max
    284284    // calculations to do it correctly.
    285 //     if ( oldWidth != m_width || columns.size() + 1 != columnPos.size() )
     285//     if ( oldWidth != width() || columns.size() + 1 != columnPos.size() )
    286286    m_tableLayout->layout();
    287287
     
    306306    }
    307307
    308     m_overflowWidth = m_width + (collapsing ? outerBorderRight() - borderRight() : 0);
     308    m_overflowWidth = width() + (collapsing ? outerBorderRight() - borderRight() : 0);
    309309    m_overflowLeft = collapsing ? borderLeft() - outerBorderLeft() : 0;
    310310
     
    317317    // FIXME: Collapse caption margin.
    318318    if (m_caption && m_caption->style()->captionSide() != CAPBOTTOM) {
    319         IntRect captionRect(m_caption->xPos(), m_caption->yPos(), m_caption->width(), m_caption->height());
    320 
    321         m_caption->setPos(m_caption->marginLeft(), m_height);
     319        IntRect captionRect(m_caption->x(), m_caption->y(), m_caption->width(), m_caption->height());
     320
     321        m_caption->setLocation(m_caption->marginLeft(), height());
    322322        if (!selfNeedsLayout() && m_caption->checkForRepaintDuringLayout())
    323323            m_caption->repaintDuringLayoutIfMoved(captionRect);
    324324
    325         m_height += m_caption->height() + m_caption->marginTop() + m_caption->marginBottom();
    326         m_overflowLeft = min(m_overflowLeft, m_caption->xPos() + m_caption->overflowLeft(false));
    327         m_overflowWidth = max(m_overflowWidth, m_caption->xPos() + m_caption->overflowWidth(false));
    328         m_overflowTop = min(m_overflowTop, m_caption->yPos() + m_caption->overflowTop(false));
    329         m_overflowHeight = max(m_overflowHeight, m_caption->yPos() + m_caption->overflowHeight(false));
    330 
    331         if (m_height != oldTableTop) {
     325        setHeight(height() + m_caption->height() + m_caption->marginTop() + m_caption->marginBottom());
     326        m_overflowLeft = min(m_overflowLeft, m_caption->x() + m_caption->overflowLeft(false));
     327        m_overflowWidth = max(m_overflowWidth, m_caption->x() + m_caption->overflowWidth(false));
     328        m_overflowTop = min(m_overflowTop, m_caption->y() + m_caption->overflowTop(false));
     329        m_overflowHeight = max(m_overflowHeight, m_caption->y() + m_caption->overflowHeight(false));
     330
     331        if (height() != oldTableTop) {
    332332            sectionMoved = true;
    333             movedSectionTop = min(m_height, oldTableTop);
     333            movedSectionTop = min(height(), oldTableTop);
    334334        }
    335335    }
     
    338338    int bpBottom = borderBottom() + (collapsing ? 0 : paddingBottom());
    339339   
    340     m_height += bpTop;
     340    setHeight(height() + bpTop);
    341341
    342342    if (!isPositioned())
     
    362362        // Completely empty tables (with no sections or anything) should at least honor specified height
    363363        // in strict mode.
    364         m_height += th;
     364        setHeight(height() + th);
    365365    }
    366366   
     
    372372    RenderTableSection* section = m_head ? m_head : (m_firstBody ? m_firstBody : m_foot);
    373373    while (section) {
    374         if (!sectionMoved && section->yPos() != m_height) {
     374        if (!sectionMoved && section->y() != height()) {
    375375            sectionMoved = true;
    376             movedSectionTop = min(m_height, section->yPos()) + section->overflowTop(false);
    377         }
    378         section->setPos(bl, m_height);
    379 
    380         m_height += section->height();
    381         m_overflowLeft = min(m_overflowLeft, section->xPos() + section->overflowLeft(false));
    382         m_overflowWidth = max(m_overflowWidth, section->xPos() + section->overflowWidth(false));
    383         m_overflowTop = min(m_overflowTop, section->yPos() + section->overflowTop(false));
    384         m_overflowHeight = max(m_overflowHeight, section->yPos() + section->overflowHeight(false));
     376            movedSectionTop = min(height(), section->y()) + section->overflowTop(false);
     377        }
     378        section->setLocation(bl, height());
     379
     380        setHeight(height() + section->height());
     381        m_overflowLeft = min(m_overflowLeft, section->x() + section->overflowLeft(false));
     382        m_overflowWidth = max(m_overflowWidth, section->x() + section->overflowWidth(false));
     383        m_overflowTop = min(m_overflowTop, section->y() + section->overflowTop(false));
     384        m_overflowHeight = max(m_overflowHeight, section->y() + section->overflowHeight(false));
    385385        section = sectionBelow(section);
    386386    }
    387387
    388     m_height += bpBottom;
     388    setHeight(height() + bpBottom);
    389389
    390390    if (m_caption && m_caption->style()->captionSide() == CAPBOTTOM) {
    391         IntRect captionRect(m_caption->xPos(), m_caption->yPos(), m_caption->width(), m_caption->height());
    392 
    393         m_caption->setPos(m_caption->marginLeft(), m_height);
     391        IntRect captionRect(m_caption->x(), m_caption->y(), m_caption->width(), m_caption->height());
     392
     393        m_caption->setLocation(m_caption->marginLeft(), height());
    394394        if (!selfNeedsLayout() && m_caption->checkForRepaintDuringLayout())
    395395            m_caption->repaintDuringLayoutIfMoved(captionRect);
    396396
    397         m_height += m_caption->height() + m_caption->marginTop() + m_caption->marginBottom();
    398         m_overflowLeft = min(m_overflowLeft, m_caption->xPos() + m_caption->overflowLeft(false));
    399         m_overflowWidth = max(m_overflowWidth, m_caption->xPos() + m_caption->overflowWidth(false));
     397        setHeight(height() + m_caption->height() + m_caption->marginTop() + m_caption->marginBottom());
     398        m_overflowLeft = min(m_overflowLeft, m_caption->x() + m_caption->overflowLeft(false));
     399        m_overflowWidth = max(m_overflowWidth, m_caption->x() + m_caption->overflowWidth(false));
    400400    }
    401401
     
    403403        calcHeight();
    404404
    405     m_overflowHeight = max(m_overflowHeight, m_height);
     405    m_overflowHeight = max(m_overflowHeight, height());
    406406
    407407    // table can be containing block of positioned elements.
     
    412412        for (ShadowData* boxShadow = style()->boxShadow(); boxShadow; boxShadow = boxShadow->next) {
    413413            m_overflowLeft = min(m_overflowLeft, boxShadow->x - boxShadow->blur);
    414             m_overflowWidth = max(m_overflowWidth, m_width + boxShadow->x + boxShadow->blur);
     414            m_overflowWidth = max(m_overflowWidth, width() + boxShadow->x + boxShadow->blur);
    415415            m_overflowTop = min(m_overflowTop, boxShadow->y - boxShadow->blur);
    416             m_overflowHeight = max(m_overflowHeight, m_height + boxShadow->y + boxShadow->blur);
     416            m_overflowHeight = max(m_overflowHeight, height() + boxShadow->y + boxShadow->blur);
    417417        }
    418418       
     
    448448void RenderTable::paint(PaintInfo& paintInfo, int tx, int ty)
    449449{
    450     tx += xPos();
    451     ty += yPos();
     450    tx += x();
     451    ty += y();
    452452
    453453    PaintPhase paintPhase = paintInfo.phase;
     
    11291129        return -1;
    11301130
    1131     return firstNonEmptySection->yPos() + firstNonEmptySection->getBaselineOfFirstLineBox();
     1131    return firstNonEmptySection->y() + firstNonEmptySection->getBaselineOfFirstLineBox();
    11321132}
    11331133
  • trunk/WebCore/rendering/RenderTableCell.cpp

    r40086 r40124  
    124124}
    125125
    126 void RenderTableCell::setWidth(int width)
    127 {
    128     if (width != m_width) {
    129         m_width = width;
     126void RenderTableCell::updateWidth(int w)
     127{
     128    if (w != width()) {
     129        setWidth(w);
    130130        m_widthChanged = true;
    131131    }
     
    193193    RenderView* v = view();
    194194    if ((!v || !v->layoutStateEnabled()) && parent())
    195         r.move(-parent()->xPos(), -parent()->yPos()); // Rows are in the same coordinate space, so don't add their offset in.
     195        r.move(-parentBox()->x(), -parentBox()->y()); // Rows are in the same coordinate space, so don't add their offset in.
    196196    RenderBlock::computeAbsoluteRepaintRect(r, fixed);
    197197}
     
    202202    if ((!v || !v->layoutStateEnabled()) && parent()) {
    203203        // Rows are in the same coordinate space, so don't add their offset in.
    204         localPoint.move(-parent()->xPos(), -parent()->yPos());
     204        localPoint.move(-parentBox()->x(), -parentBox()->y());
    205205    }
    206206    return RenderBlock::localToAbsolute(localPoint, fixed, useTransforms);
     
    212212    if (parent()) {
    213213        // Rows are in the same coordinate space, so add their offset back in.
    214         localPoint.move(parent()->xPos(), parent()->yPos());
     214        localPoint.move(parentBox()->x(), parentBox()->y());
    215215    }
    216216    return localPoint;
     
    222222    if (parent()) {
    223223        // Rows are in the same coordinate space, so don't add their offset in.
    224         quad.move(-parent()->xPos(), -parent()->yPos());
     224        quad.move(-parentBox()->x(), -parentBox()->y());
    225225    }
    226226    return RenderBlock::localToAbsoluteQuad(quad, fixed);
     
    631631void RenderTableCell::paint(PaintInfo& paintInfo, int tx, int ty)
    632632{
    633     tx += m_x;
    634     ty += m_y;
     633    tx += x();
     634    ty += m_frameRect.y();
    635635
    636636    // check if we need to do anything at all...
     
    639639    if (paintInfo.phase == PaintPhaseCollapsedTableBorders && style()->visibility() == VISIBLE) {
    640640        if (ty - table()->outerBorderTop() >= paintInfo.rect.bottom() + os ||
    641                 ty + m_topExtra + m_height + m_bottomExtra + table()->outerBorderBottom() <= paintInfo.rect.y() - os)
     641                ty + m_topExtra + height() + m_bottomExtra + table()->outerBorderBottom() <= paintInfo.rect.y() - os)
    642642            return;
    643643        int w = width();
     
    808808
    809809    if (backgroundObject != this) {
    810         tx += m_x;
    811         ty += m_y + m_topExtra;
     810        tx += x();
     811        ty += m_frameRect.y() + m_topExtra;
    812812    }
    813813
  • trunk/WebCore/rendering/RenderTableCell.h

    r40086 r40124  
    6464    virtual void calcPrefWidths();
    6565    virtual void calcWidth();
    66     virtual void setWidth(int);
     66    void updateWidth(int);
    6767
    6868    virtual bool expandsToEncloseOverhangingFloats() const { return true; }
     
    9696    void paintCollapsedBorder(GraphicsContext*, int x, int y, int w, int h);
    9797    void paintBackgroundsBehindCell(PaintInfo&, int tx, int ty, RenderObject* backgroundObject);
    98 
    99     // Lie about position to outside observers.
    100     virtual int yPos() const { return m_y + m_topExtra; }
    10198
    10299    virtual IntRect absoluteClippedOverflowRect();
  • trunk/WebCore/rendering/RenderTableSection.cpp

    r40086 r40124  
    132132        return;
    133133
    134     m_grid[m_cRow].rowRenderer = child;
     134    m_grid[m_cRow].rowRenderer = static_cast<RenderTableRow*>(child);
    135135
    136136    if (!beforeChild) {
     
    175175}
    176176
    177 void RenderTableSection::addCell(RenderTableCell* cell, RenderObject* row)
     177void RenderTableSection::addCell(RenderTableCell* cell, RenderTableRow* row)
    178178{
    179179    int rSpan = cell->rowSpan();
     
    284284                        // Technically, we should also push state for the row, but since
    285285                        // rows don't push a coordinate transform, that's not necessary.
    286                         statePusher.push(this, IntSize(m_x, m_y));
     286                        statePusher.push(this, IntSize(x(), m_frameRect.y()));
    287287                    }
    288288                    cell->repaint();
    289289                }
    290                 cell->setWidth(w);
     290                cell->updateWidth(w);
    291291            }
    292292        }
     
    334334                    // Technically, we should also push state for the row, but since
    335335                    // rows don't push a coordinate transform, that's not necessary.
    336                     statePusher.push(this, IntSize(m_x, m_y));
     336                    statePusher.push(this, IntSize(x(), m_frameRect.y()));
    337337                }
    338338                cell->setOverrideSize(-1);
     
    385385   
    386386    // Set the width of our section now.  The rows will also be this width.
    387     m_width = table()->contentWidth();
     387    setWidth(table()->contentWidth());
    388388    m_overflowLeft = 0;
    389     m_overflowWidth = m_width;
     389    m_overflowWidth = width();
    390390    m_overflowTop = 0;
    391391    m_overflowHeight = 0;
     
    455455    int nEffCols = table()->numEffCols();
    456456
    457     LayoutStateMaintainer statePusher(view(), this, IntSize(m_x, m_y));
     457    LayoutStateMaintainer statePusher(view(), this, IntSize(x(), m_frameRect.y()));
    458458
    459459    for (int r = 0; r < totalRows; r++) {
    460460        // Set the row's x/y position and width/height.
    461         if (RenderObject* rowRenderer = m_grid[r].rowRenderer) {
    462             rowRenderer->setPos(0, m_rowPos[r]);
    463             rowRenderer->setWidth(m_width);
     461        if (RenderTableRow* rowRenderer = m_grid[r].rowRenderer) {
     462            rowRenderer->setLocation(0, m_rowPos[r]);
     463            rowRenderer->setWidth(width());
    464464            rowRenderer->setHeight(m_rowPos[r + 1] - m_rowPos[r] - vspacing);
    465465        }
     
    553553                cell->repaint();
    554554           
    555             IntRect oldCellRect(cell->xPos(), cell->yPos() - cell->borderTopExtra() , cell->width(), cell->height());
     555            IntRect oldCellRect(cell->x(), cell->y() - cell->borderTopExtra() , cell->width(), cell->height());
    556556       
    557557            if (style()->direction() == RTL) {
    558                 cell->setPos(table()->columnPositions()[nEffCols] - table()->columnPositions()[table()->colToEffCol(cell->col() + cell->colSpan())] + hspacing, m_rowPos[rindx]);
     558                cell->setLocation(table()->columnPositions()[nEffCols] - table()->columnPositions()[table()->colToEffCol(cell->col() + cell->colSpan())] + hspacing, m_rowPos[rindx]);
    559559            } else
    560                 cell->setPos(table()->columnPositions()[c] + hspacing, m_rowPos[rindx]);
    561 
    562             m_overflowLeft = min(m_overflowLeft, cell->xPos() + cell->overflowLeft(false));
    563             m_overflowWidth = max(m_overflowWidth, cell->xPos() + cell->overflowWidth(false));
    564             m_overflowTop = min(m_overflowTop, cell->yPos() + cell->overflowTop(false));
    565             m_overflowHeight = max(m_overflowHeight, cell->yPos() + cell->overflowHeight(false));
     560                cell->setLocation(table()->columnPositions()[c] + hspacing, m_rowPos[rindx]);
     561
     562            m_overflowLeft = min(m_overflowLeft, cell->x() + cell->overflowLeft(false));
     563            m_overflowWidth = max(m_overflowWidth, cell->x() + cell->overflowWidth(false));
     564            m_overflowTop = min(m_overflowTop, cell->y() + cell->overflowTop(false));
     565            m_overflowHeight = max(m_overflowHeight, cell->y() + cell->overflowHeight(false));
    566566            m_hasOverflowingCell |= cell->overflowLeft(false) || cell->overflowWidth(false) > cell->width() || cell->overflowTop(false) || cell->overflowHeight(false) > cell->height();
    567567
     
    576576    statePusher.pop();
    577577
    578     m_height = m_rowPos[totalRows];
    579     m_overflowHeight = max(m_overflowHeight, m_height);
    580     return m_height;
     578    setHeight(m_rowPos[totalRows]);
     579    m_overflowHeight = max(m_overflowHeight, height());
     580    return height();
    581581}
    582582
     
    590590        for (RenderObject* cell = row->firstChild(); cell; cell = cell->nextSibling()) {
    591591            if (cell->isTableCell())
    592                 bottom = max(bottom, cell->yPos() + cell->lowestPosition(false));
     592                bottom = max(bottom, static_cast<RenderTableCell*>(cell)->y() + cell->lowestPosition(false));
    593593        }
    594594    }
     
    606606        for (RenderObject* cell = row->firstChild(); cell; cell = cell->nextSibling()) {
    607607            if (cell->isTableCell())
    608                 right = max(right, cell->xPos() + cell->rightmostPosition(false));
     608                right = max(right, static_cast<RenderTableCell*>(cell)->x() + cell->rightmostPosition(false));
    609609        }
    610610    }
     
    622622        for (RenderObject* cell = row->firstChild(); cell; cell = cell->nextSibling()) {
    623623            if (cell->isTableCell())
    624                 left = min(left, cell->xPos() + cell->leftmostPosition(false));
     624                left = min(left, static_cast<RenderTableCell*>(cell)->x() + cell->leftmostPosition(false));
    625625        }
    626626    }
     
    852852        RenderTableCell* cell = firstRow->at(i).cell;
    853853        if (cell)
    854             firstLineBaseline = max(firstLineBaseline, cell->yPos() + cell->paddingTop() + cell->borderTop() + cell->contentHeight());
     854            firstLineBaseline = max(firstLineBaseline, cell->y() + cell->paddingTop() + cell->borderTop() + cell->contentHeight());
    855855    }
    856856
     
    872872        return;
    873873
    874     tx += m_x;
    875     ty += m_y;
     874    tx += x();
     875    ty += m_frameRect.y();
    876876
    877877    // Check which rows and cols are visible and only paint these.
     
    993993            if (!ensureRows(m_cRow + 1))
    994994                break;
    995             m_grid[m_cRow].rowRenderer = row;
     995           
     996            RenderTableRow* tableRow = static_cast<RenderTableRow*>(row);
     997            m_grid[m_cRow].rowRenderer = tableRow;
    996998
    997999            for (RenderObject* cell = row->firstChild(); cell; cell = cell->nextSibling()) {
    9981000                if (cell->isTableCell())
    999                     addCell(static_cast<RenderTableCell*>(cell), row);
     1001                    addCell(static_cast<RenderTableCell*>(cell), tableRow);
    10001002            }
    10011003        }
     
    10571059
    10581060// Hit Testing
    1059 bool RenderTableSection::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int x, int y, int tx, int ty, HitTestAction action)
     1061bool RenderTableSection::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int xPos, int yPos, int tx, int ty, HitTestAction action)
    10601062{
    10611063    // Table sections cannot ever be hit tested.  Effectively they do not exist.
    10621064    // Just forward to our children always.
    1063     tx += m_x;
    1064     ty += m_y;
     1065    tx += x();
     1066    ty += m_frameRect.y();
    10651067
    10661068    for (RenderObject* child = lastChild(); child; child = child->previousSibling()) {
     
    10691071        // table-specific hit-test method (which we should do for performance reasons anyway),
    10701072        // then we can remove this check.
    1071         if (!child->hasLayer() && !child->isInlineFlow() && child->nodeAtPoint(request, result, x, y, tx, ty, action)) {
    1072             updateHitTestResult(result, IntPoint(x - tx, y - ty));
     1073        if (!child->hasLayer() && !child->isInlineFlow() && child->nodeAtPoint(request, result, xPos, yPos, tx, ty, action)) {
     1074            updateHitTestResult(result, IntPoint(xPos - tx, yPos - ty));
    10731075            return true;
    10741076        }
  • trunk/WebCore/rendering/RenderTableSection.h

    r40086 r40124  
    3434
    3535class RenderTableCell;
     36class RenderTableRow;
    3637
    3738class RenderTableSection : public RenderContainer {
     
    5051    virtual int getBaselineOfFirstLineBox() const;
    5152
    52     void addCell(RenderTableCell*, RenderObject* row);
     53    void addCell(RenderTableCell*, RenderTableRow* row);
    5354
    5455    void setCellWidths();
     
    6768    struct RowStruct {
    6869        Row* row;
    69         RenderObject* rowRenderer;
     70        RenderTableRow* rowRenderer;
    7071        int baseline;
    7172        Length height;
     
    7879    void splitColumn(int pos, int newSize);
    7980
    80     virtual int overflowWidth(bool includeInterior = true) const { return (!includeInterior && hasOverflowClip()) ? m_width : m_overflowWidth; }
     81    virtual int overflowWidth(bool includeInterior = true) const { return (!includeInterior && hasOverflowClip()) ? width() : m_overflowWidth; }
    8182    virtual int overflowLeft(bool includeInterior = true) const { return (!includeInterior && hasOverflowClip()) ? 0 : m_overflowLeft; }
    82     virtual int overflowHeight(bool includeInterior = true) const { return (!includeInterior && hasOverflowClip()) ? m_height : m_overflowHeight; }
     83    virtual int overflowHeight(bool includeInterior = true) const { return (!includeInterior && hasOverflowClip()) ? height() : m_overflowHeight; }
    8384    virtual int overflowTop(bool includeInterior = true) const { return (!includeInterior && hasOverflowClip()) ? 0 : m_overflowTop; }
    8485
  • trunk/WebCore/rendering/RenderText.cpp

    r40086 r40124  
    6767{
    6868    ASSERT(m_text);
    69     setRenderText();
     69    setIsText();
    7070    m_text = document()->displayStringModifiedByEncoding(PassRefPtr<StringImpl>(m_text));
    7171
     
    736736}
    737737
    738 int RenderText::minXPos() const
     738int RenderText::boundingBoxX() const
    739739{
    740740    if (!m_firstTextBox)
     
    748748}
    749749
    750 int RenderText::xPos() const
     750int RenderText::boundingBoxY() const
     751{
     752    if (!m_firstTextBox)
     753        return 0;
     754
     755    // FIXME: we should not use an arbitrary value like this.  Perhaps we should use INT_MAX.
     756    int minYPos = 6666666;
     757    for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox())
     758        minYPos = min(minYPos, static_cast<int>(box->m_y));
     759    return minYPos;
     760}
     761
     762int RenderText::firstRunX() const
    751763{
    752764    return m_firstTextBox ? m_firstTextBox->m_x : 0;
    753765}
    754766
    755 int RenderText::yPos() const
     767int RenderText::firstRunY() const
    756768{
    757769    return m_firstTextBox ? m_firstTextBox->m_y : 0;
    758770}
    759 
     771   
    760772void RenderText::setSelectionState(SelectionState state)
    761773{
     
    974986}
    975987
    976 int RenderText::height() const
     988int RenderText::boundingBoxHeight() const
    977989{
    978990    int retval = 0;
     
    10661078}
    10671079
    1068 int RenderText::width() const
     1080int RenderText::boundingBoxWidth() const
    10691081{
    10701082    // FIXME: we should not use an arbitrary value like this.  Perhaps we should use INT_MAX.
  • trunk/WebCore/rendering/RenderText.h

    r40086 r40124  
    7171    virtual unsigned width(unsigned from, unsigned len, const Font&, int xPos) const;
    7272    virtual unsigned width(unsigned from, unsigned len, int xPos, bool firstLine = false) const;
    73     virtual int width() const;
    74     virtual int height() const;
    7573
    7674    virtual int lineHeight(bool firstLine, bool isRootLineBox = false) const;
     
    8684                           int& minW, int& maxW, bool& stripFrontSpaces);
    8785
    88     // returns the minimum x position of all runs relative to the parent.
    89     // defaults to 0.
    90     int minXPos() const;
     86    // Returns the leftmost (and topmost) position of the bounding box that encloses all text runs
     87    int boundingBoxX() const;
     88    int boundingBoxY() const;
    9189
    92     virtual int xPos() const;
    93     virtual int yPos() const;
     90    // Returns the width and height of the bounding box that encloses all text runs.
     91    int boundingBoxWidth() const;
     92    int boundingBoxHeight() const;
     93
     94    int firstRunX() const;
     95    int firstRunY() const;
    9496
    9597    virtual int verticalPositionHint(bool firstLine) const;
  • trunk/WebCore/rendering/RenderTextControl.cpp

    r40086 r40124  
    127127int RenderTextControl::textBlockHeight() const
    128128{
    129     return m_height - paddingTop() - paddingBottom() - borderTop() - borderBottom();
     129    return height() - paddingTop() - paddingBottom() - borderTop() - borderBottom();
    130130}
    131131
    132132int RenderTextControl::textBlockWidth() const
    133133{
    134     return m_width - paddingLeft() - paddingRight() - borderLeft() - borderRight()
     134    return width() - paddingLeft() - paddingRight() - borderLeft() - borderRight()
    135135           - m_innerText->renderer()->paddingLeft() - m_innerText->renderer()->paddingRight();
    136136}
     
    218218    document()->updateLayout();
    219219
    220     if (style()->visibility() == HIDDEN || !m_innerText || !m_innerText->renderer() || !m_innerText->renderer()->height()) {
     220    if (style()->visibility() == HIDDEN || !m_innerText || !m_innerText->renderer() || !m_innerText->renderBox()->height()) {
    221221        cacheSelection(start, end);
    222222        return;
     
    419419void RenderTextControl::calcHeight()
    420420{
    421     m_height = m_innerText->renderer()->borderTop() + m_innerText->renderer()->borderBottom() +
    422                m_innerText->renderer()->paddingTop() + m_innerText->renderer()->paddingBottom() +
    423                m_innerText->renderer()->marginTop() + m_innerText->renderer()->marginBottom();
     421    setHeight(m_innerText->renderer()->borderTop() + m_innerText->renderer()->borderBottom() +
     422              m_innerText->renderer()->paddingTop() + m_innerText->renderer()->paddingBottom() +
     423              m_innerText->renderer()->marginTop() + m_innerText->renderer()->marginBottom());
    424424
    425425    adjustControlHeightBasedOnLineHeight(m_innerText->renderer()->lineHeight(true, true));
    426     m_height += paddingTop() + paddingBottom() + borderTop() + borderBottom();
     426    setHeight(height() + paddingTop() + paddingBottom() + borderTop() + borderBottom());
    427427
    428428    // We are able to have a horizontal scrollbar if the overflow style is scroll, or if its auto and there's no word wrap.
    429429    if (m_innerText->renderer()->style()->overflowX() == OSCROLL ||  (m_innerText->renderer()->style()->overflowX() == OAUTO && m_innerText->renderer()->style()->wordWrap() == NormalWordWrap))
    430         m_height += scrollbarThickness();
     430        setHeight(height() + scrollbarThickness());
    431431
    432432    RenderBlock::calcHeight();
    433433}
    434434
    435 void RenderTextControl::hitInnerTextBlock(HitTestResult& result, int x, int y, int tx, int ty)
     435void RenderTextControl::hitInnerTextBlock(HitTestResult& result, int xPos, int yPos, int tx, int ty)
    436436{
    437437    result.setInnerNode(m_innerText.get());
    438     result.setLocalPoint(IntPoint(x - tx - m_x - m_innerText->renderer()->xPos(),
    439                                   y - ty - m_y - m_innerText->renderer()->yPos()));
     438    result.setLocalPoint(IntPoint(xPos - tx - x() - m_innerText->renderBox()->x(),
     439                                  yPos - ty - y() - m_innerText->renderBox()->y()));
    440440}
    441441
     
    449449IntRect RenderTextControl::controlClipRect(int tx, int ty) const
    450450{
    451     IntRect clipRect = contentBox();
     451    IntRect clipRect = contentBoxRect();
    452452    clipRect.move(tx, ty);
    453453    return clipRect;
  • trunk/WebCore/rendering/RenderTextControlMultiLine.cpp

    r40086 r40124  
    5555void RenderTextControlMultiLine::layout()
    5656{
    57     int oldHeight = m_height;
     57    int oldHeight = height();
    5858    calcHeight();
    5959
    60     int oldWidth = m_width;
     60    int oldWidth = width();
    6161    calcWidth();
    6262
    63     bool relayoutChildren = oldHeight != m_height || oldWidth != m_width;
    64     RenderObject* innerTextRenderer = innerTextElement()->renderer();
     63    bool relayoutChildren = oldHeight != height() || oldWidth != width();
     64    RenderBox* innerTextRenderer = innerTextElement()->renderBox();
    6565
    6666    // Set the text block height
     
    105105void RenderTextControlMultiLine::adjustControlHeightBasedOnLineHeight(int lineHeight)
    106106{
    107     m_height += lineHeight * static_cast<HTMLTextAreaElement*>(node())->rows();
     107    setHeight(height() + lineHeight * static_cast<HTMLTextAreaElement*>(node())->rows());
    108108}
    109109
  • trunk/WebCore/rendering/RenderTextControlSingleLine.cpp

    r40086 r40124  
    198198
    199199    if (paintInfo.phase == PaintPhaseBlockBackground && m_shouldDrawCapsLockIndicator) {
    200         IntRect contentsRect = contentBox();
     200        IntRect contentsRect = contentBoxRect();
    201201
    202202        // Convert the rect into the coords used for painting the content
    203         contentsRect.move(tx + xPos(), ty + yPos());
     203        contentsRect.move(tx + x(), ty + y());
    204204        theme()->paintCapsLockIndicator(this, paintInfo, contentsRect);
    205205    }
     
    208208void RenderTextControlSingleLine::layout()
    209209{
    210     int oldHeight = m_height;
     210    int oldHeight = height();
    211211    calcHeight();
    212212
    213     int oldWidth = m_width;
     213    int oldWidth = width();
    214214    calcWidth();
    215215
    216     bool relayoutChildren = oldHeight != m_height || oldWidth != m_width;
    217 
    218     RenderObject* innerTextRenderer = innerTextElement()->renderer();
    219     RenderObject* innerBlockRenderer = m_innerBlock ? m_innerBlock->renderer() : 0;
     216    bool relayoutChildren = oldHeight != height() || oldWidth != width();
     217
     218    RenderBox* innerTextRenderer = innerTextElement()->renderBox();
     219    RenderBox* innerBlockRenderer = m_innerBlock ? m_innerBlock->renderBox() : 0;
    220220
    221221    // Set the text block height
     
    223223    int currentHeight = innerTextRenderer->height();
    224224
    225     if (m_innerBlock || currentHeight > m_height) {
     225    if (m_innerBlock || currentHeight > height()) {
    226226        if (desiredHeight != currentHeight)
    227227            relayoutChildren = true;
     
    243243
    244244    if (m_innerBlock) {
    245         int innerBlockWidth = m_width - paddingLeft() - paddingRight() - borderLeft() - borderRight();
     245        int innerBlockWidth = width() - paddingLeft() - paddingRight() - borderLeft() - borderRight();
    246246        if (innerBlockWidth != innerBlockRenderer->width())
    247247            relayoutChildren = true;
     
    255255    if (!m_innerBlock) {
    256256        currentHeight = innerTextRenderer->height();
    257         if (currentHeight < m_height)
    258             innerTextRenderer->setPos(innerTextRenderer->xPos(), (m_height - currentHeight) / 2);
    259     }
    260 }
    261 
    262 bool RenderTextControlSingleLine::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int x, int y, int tx, int ty, HitTestAction hitTestAction)
     257        if (currentHeight < height())
     258            innerTextRenderer->setLocation(innerTextRenderer->x(), (height() - currentHeight) / 2);
     259    }
     260}
     261
     262bool RenderTextControlSingleLine::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int xPos, int yPos, int tx, int ty, HitTestAction hitTestAction)
    263263{
    264264    // If we're within the text control, we want to act as if we've hit the inner text block element, in case the point
     
    268268    // and act as if we've hit the close block if we're to the right of the inner text block.
    269269
    270     if (!RenderTextControl::nodeAtPoint(request, result, x, y, tx, ty, hitTestAction))
     270    if (!RenderTextControl::nodeAtPoint(request, result, xPos, yPos, tx, ty, hitTestAction))
    271271        return false;
    272272
     
    274274        return false;
    275275
    276     hitInnerTextBlock(result, x, y, tx, ty);
     276    hitInnerTextBlock(result, xPos, yPos, tx, ty);
    277277
    278278    if (!m_innerBlock)
     
    280280
    281281    Node* innerNode = 0;
    282     RenderObject* innerBlockRenderer = m_innerBlock->renderer();
    283     RenderObject* innerTextRenderer = innerTextElement()->renderer();
     282    RenderBox* innerBlockRenderer = m_innerBlock->renderBox();
     283    RenderBox* innerTextRenderer = innerTextElement()->renderBox();
    284284
    285285    IntPoint localPoint = result.localPoint();
    286     localPoint.move(-innerBlockRenderer->xPos(), -innerBlockRenderer->yPos());
    287 
    288     int textLeft = tx + m_x + innerBlockRenderer->xPos() + innerTextRenderer->xPos();
    289     if (m_resultsButton && m_resultsButton->renderer() && x < textLeft)
     286    localPoint.move(-innerBlockRenderer->x(), -innerBlockRenderer->y());
     287
     288    int textLeft = tx + x() + innerBlockRenderer->x() + innerTextRenderer->x();
     289    if (m_resultsButton && m_resultsButton->renderer() && xPos < textLeft)
    290290        innerNode = m_resultsButton.get();
    291291
    292292    if (!innerNode) {
    293293        int textRight = textLeft + innerTextRenderer->width();
    294         if (m_cancelButton && m_cancelButton->renderer() && x > textRight)
     294        if (m_cancelButton && m_cancelButton->renderer() && xPos > textRight)
    295295            innerNode = m_cancelButton.get();
    296296    }
     
    298298    if (innerNode) {
    299299        result.setInnerNode(innerNode);
    300         localPoint.move(-innerNode->renderer()->xPos(), -innerNode->renderer()->yPos());
     300        localPoint.move(-innerNode->renderBox()->x(), -innerNode->renderBox()->y());
    301301    }
    302302
     
    307307void RenderTextControlSingleLine::forwardEvent(Event* event)
    308308{
    309     RenderObject* innerTextRenderer = innerTextElement()->renderer();
     309    RenderBox* innerTextRenderer = innerTextElement()->renderBox();
    310310
    311311    if (event->type() == eventNames().blurEvent) {
     
    325325
    326326    FloatPoint localPoint = innerTextRenderer->absoluteToLocal(FloatPoint(static_cast<MouseEvent*>(event)->pageX(), static_cast<MouseEvent*>(event)->pageY()), false, true);
    327     if (m_resultsButton && localPoint.x() < innerTextRenderer->borderBox().x())
     327    if (m_resultsButton && localPoint.x() < innerTextRenderer->borderBoxRect().x())
    328328        m_resultsButton->defaultEventHandler(event);
    329     else if (m_cancelButton && localPoint.x() > innerTextRenderer->borderBox().right())
     329    else if (m_cancelButton && localPoint.x() > innerTextRenderer->borderBoxRect().right())
    330330        m_cancelButton->defaultEventHandler(event);
    331331    else
     
    380380    int width = RenderTextControl::textBlockWidth();
    381381
    382     if (RenderObject* resultsRenderer = m_resultsButton ? m_resultsButton->renderer() : 0) {
     382    if (RenderBox* resultsRenderer = m_resultsButton ? m_resultsButton->renderBox() : 0) {
    383383        resultsRenderer->calcWidth();
    384384        width -= resultsRenderer->width() + resultsRenderer->marginLeft() + resultsRenderer->marginRight();
    385385    }
    386386
    387     if (RenderObject* cancelRenderer = m_cancelButton ? m_cancelButton->renderer() : 0) {
     387    if (RenderBox* cancelRenderer = m_cancelButton ? m_cancelButton->renderBox() : 0) {
    388388        cancelRenderer->calcWidth();
    389389        width -= cancelRenderer->width() + cancelRenderer->marginLeft() + cancelRenderer->marginRight();
     
    414414void RenderTextControlSingleLine::adjustControlHeightBasedOnLineHeight(int lineHeight)
    415415{
    416     if (RenderObject* resultsRenderer = m_resultsButton ? m_resultsButton->renderer() : 0) {
     416    if (RenderBox* resultsRenderer = m_resultsButton ? m_resultsButton->renderBox() : 0) {
    417417        static_cast<RenderBlock*>(resultsRenderer)->calcHeight();
    418         m_height = max(m_height,
    419                        resultsRenderer->borderTop() + resultsRenderer->borderBottom() +
    420                        resultsRenderer->paddingTop() + resultsRenderer->paddingBottom() +
    421                        resultsRenderer->marginTop() + resultsRenderer->marginBottom());
     418        setHeight(max(height(),
     419                  resultsRenderer->borderTop() + resultsRenderer->borderBottom() +
     420                  resultsRenderer->paddingTop() + resultsRenderer->paddingBottom() +
     421                  resultsRenderer->marginTop() + resultsRenderer->marginBottom()));
    422422        lineHeight = max(lineHeight, resultsRenderer->height());
    423423    }
    424424
    425     if (RenderObject* cancelRenderer = m_cancelButton ? m_cancelButton->renderer() : 0) {
     425    if (RenderBox* cancelRenderer = m_cancelButton ? m_cancelButton->renderBox() : 0) {
    426426        static_cast<RenderBlock*>(cancelRenderer)->calcHeight();
    427         m_height = max(m_height,
    428                        cancelRenderer->borderTop() + cancelRenderer->borderBottom() +
    429                        cancelRenderer->paddingTop() + cancelRenderer->paddingBottom() +
    430                        cancelRenderer->marginTop() + cancelRenderer->marginBottom());
     427        setHeight(max(height(),
     428                  cancelRenderer->borderTop() + cancelRenderer->borderBottom() +
     429                  cancelRenderer->paddingTop() + cancelRenderer->paddingBottom() +
     430                  cancelRenderer->marginTop() + cancelRenderer->marginBottom()));
    431431        lineHeight = max(lineHeight, cancelRenderer->height());
    432432    }
    433433
    434     m_height += lineHeight;
     434    setHeight(height() + lineHeight);
    435435}
    436436
     
    696696    int padding = paddingLeft();
    697697
    698     if (RenderObject* resultsRenderer = m_resultsButton ? m_resultsButton->renderer() : 0)
     698    if (RenderBox* resultsRenderer = m_resultsButton ? m_resultsButton->renderBox() : 0)
    699699        padding += resultsRenderer->width();
    700700
     
    706706    int padding = paddingRight();
    707707
    708     if (RenderObject* cancelRenderer = m_cancelButton ? m_cancelButton->renderer() : 0)
     708    if (RenderBox* cancelRenderer = m_cancelButton ? m_cancelButton->renderBox() : 0)
    709709        padding += cancelRenderer->width();
    710710
  • trunk/WebCore/rendering/RenderTheme.cpp

    r40086 r40124  
    372372bool RenderTheme::hitTestMediaControlPart(RenderObject* o, const IntPoint& absPoint)
    373373{
     374    if (!o->isBox())
     375        return false;
     376
    374377    FloatPoint localPoint = o->absoluteToLocal(absPoint, false, true);  // respect transforms
    375 
    376     return o->borderBox().contains(roundedIntPoint(localPoint));
     378    return RenderBox::toRenderBox(o)->borderBoxRect().contains(roundedIntPoint(localPoint));
    377379}
    378380#endif
     
    409411{
    410412    if (!m_activeListBoxSelectionBackgroundColor.isValid())
    411         m_activeListBoxSelectionBackgroundColor = platformActiveSelectionBackgroundColor();
     413        m_activeListBoxSelectionBackgroundColor = platformActiveListBoxSelectionBackgroundColor();
    412414    return m_activeListBoxSelectionBackgroundColor;
    413415}
     
    416418{
    417419    if (!m_inactiveListBoxSelectionBackgroundColor.isValid())
    418         m_inactiveListBoxSelectionBackgroundColor = platformInactiveSelectionBackgroundColor();
     420        m_inactiveListBoxSelectionBackgroundColor = platformInactiveListBoxSelectionBackgroundColor();
    419421    return m_inactiveListBoxSelectionBackgroundColor;
    420422}
     
    423425{
    424426    if (!m_activeListBoxSelectionForegroundColor.isValid() && supportsListBoxSelectionForegroundColors())
    425         m_activeListBoxSelectionForegroundColor = platformActiveSelectionForegroundColor();
     427        m_activeListBoxSelectionForegroundColor = platformActiveListBoxSelectionForegroundColor();
    426428    return m_activeListBoxSelectionForegroundColor;
    427429}
     
    430432{
    431433    if (!m_inactiveListBoxSelectionForegroundColor.isValid() && supportsListBoxSelectionForegroundColors())
    432         m_inactiveListBoxSelectionForegroundColor = platformInactiveSelectionForegroundColor();
     434        m_inactiveListBoxSelectionForegroundColor = platformInactiveListBoxSelectionForegroundColor();
    433435    return m_inactiveListBoxSelectionForegroundColor;
    434436}
     
    481483int RenderTheme::baselinePosition(const RenderObject* o) const
    482484{
     485    if (!o->isBox())
     486        return 0;
     487
    483488#if USE(NEW_THEME)
    484     return o->height() + o->marginTop() + m_theme->baselinePositionAdjustment(o->style()->appearance()) * o->style()->effectiveZoom();
     489    return RenderBox::toConstRenderBox(o)->height() + o->marginTop() + m_theme->baselinePositionAdjustment(o->style()->appearance()) * o->style()->effectiveZoom();
    485490#else
    486     return o->height() + o->marginTop();
     491    return RenderBox::toConstRenderBox(o)->height() + o->marginTop();
    487492#endif
    488493}
  • trunk/WebCore/rendering/RenderThemeMac.mm

    r40086 r40124  
    154154Color RenderThemeMac::platformInactiveListBoxSelectionBackgroundColor() const
    155155{
    156     return Color(128, 128, 128);
     156    return platformInactiveSelectionBackgroundColor();
    157157}
    158158
     
    12551255{
    12561256    Node* input = o->node()->shadowAncestorNode();
     1257    if (!input->renderer()->isBox())
     1258        return false;
     1259
    12571260    setSearchCellState(input->renderer(), r);
    12581261
     
    12651268    float zoomLevel = o->style()->effectiveZoom();
    12661269
    1267     FloatRect localBounds = [search cancelButtonRectForBounds:NSRect(input->renderer()->borderBox())];
     1270    FloatRect localBounds = [search cancelButtonRectForBounds:NSRect(input->renderBox()->borderBoxRect())];
    12681271    localBounds = convertToPaintingRect(input->renderer(), o, localBounds, r);
    12691272
     
    13291332{
    13301333    Node* input = o->node()->shadowAncestorNode();
     1334    if (!input->renderer()->isBox())
     1335        return false;
     1336
    13311337    setSearchCellState(input->renderer(), r);
    13321338
     
    13361342        [search setSearchMenuTemplate:nil];
    13371343
    1338     FloatRect localBounds = [search searchButtonRectForBounds:NSRect(input->renderer()->borderBox())];
     1344    FloatRect localBounds = [search searchButtonRectForBounds:NSRect(input->renderBox()->borderBoxRect())];
    13391345    localBounds = convertToPaintingRect(input->renderer(), o, localBounds, r);
    13401346
     
    13561362{
    13571363    Node* input = o->node()->shadowAncestorNode();
     1364    if (!input->renderer()->isBox())
     1365        return false;
     1366
    13581367    setSearchCellState(input->renderer(), r);
    13591368
     
    13671376    float zoomLevel = o->style()->effectiveZoom();
    13681377
    1369     FloatRect localBounds = [search searchButtonRectForBounds:NSRect(input->renderer()->borderBox())];
     1378    FloatRect localBounds = [search searchButtonRectForBounds:NSRect(input->renderBox()->borderBoxRect())];
    13701379    localBounds = convertToPaintingRect(input->renderer(), o, localBounds, r);
    13711380   
     
    15951604bool RenderThemeMac::hitTestMediaControlPart(RenderObject* o, const IntPoint& absPoint)
    15961605{
     1606    if (!o->isBox())
     1607        return false;
     1608       
    15971609    if (mediaControllerTheme() == MediaControllerThemeQT) {
    15981610        ControlPart part = o->style()->appearance();
    15991611        FloatPoint localPoint = o->absoluteToLocal(absPoint, false, true);  // respect transforms
    1600         return wkHitTestMediaUIPart(part - MediaFullscreenButtonPart, MediaControllerThemeQT, CGRect(o->borderBox()), CGPoint(localPoint));
     1612        return wkHitTestMediaUIPart(part - MediaFullscreenButtonPart, MediaControllerThemeQT, CGRect(RenderBox::toRenderBox(o)->borderBoxRect()), CGPoint(localPoint));
    16011613    }
    16021614    else
  • trunk/WebCore/rendering/RenderThemeSafari.cpp

    r40086 r40124  
    273273int RenderThemeSafari::baselinePosition(const RenderObject* o) const
    274274{
     275    if (!o->isBox())
     276        return 0;
     277
    275278    if (o->style()->appearance() == CheckboxPart || o->style()->appearance() == RadioPart)
    276         return o->marginTop() + o->height() - 2; // The baseline is 2px up from the bottom of the checkbox/radio in AppKit.
     279        return o->marginTop() + RenderBox::toConstRenderBox(o)->height() - 2; // The baseline is 2px up from the bottom of the checkbox/radio in AppKit.
    277280    return RenderTheme::baselinePosition(o);
    278281}
  • trunk/WebCore/rendering/RenderThemeWin.cpp

    r40086 r40124  
    741741    IntRect bounds = r;
    742742    ASSERT(o->parent());
    743     if (!o->parent())
     743    if (!o->parent() || !o->parent()->isBox())
    744744        return false;
    745     IntRect parentBox = o->parent()->absoluteContentBox();
     745   
     746    RenderBox* parentRenderBox = RenderBox::toRenderBox(o->parent());
     747
     748    IntRect parentBox = parentRenderBox->absoluteContentBox();
    746749   
    747750    // Make sure the scaled button stays square and will fit in its parent's box
     
    789792    IntRect bounds = r;
    790793    ASSERT(o->parent());
    791     if (!o->parent())
     794    if (!o->parent() || !o->parent()->isBox())
    792795        return false;
    793     IntRect parentBox = o->parent()->absoluteContentBox();
     796   
     797    RenderBox* parentRenderBox = RenderBox::toRenderBox(o->parent());
     798    IntRect parentBox = parentRenderBox->absoluteContentBox();
    794799   
    795800    // Make sure the scaled decoration stays square and will fit in its parent's box
     
    823828    if (!o->parent())
    824829        return false;
    825     IntRect parentBox = o->parent()->absoluteContentBox();
     830    if (!o->parent() || !o->parent()->isBox())
     831        return false;
     832   
     833    RenderBox* parentRenderBox = RenderBox::toRenderBox(o->parent());
     834    IntRect parentBox = parentRenderBox->absoluteContentBox();
    826835   
    827836    // Make sure the scaled decoration will fit in its parent's box
  • trunk/WebCore/rendering/RenderTreeAsText.cpp

    r40086 r40124  
    3535#include "InlineTextBox.h"
    3636#include "RenderBR.h"
     37#include "RenderInline.h"
    3738#include "RenderListMarker.h"
    3839#include "RenderTableCell.h"
     
    181182    }
    182183
    183     IntRect r(o.xPos(), o.yPos(), o.width(), o.height());
     184    IntRect r;
     185    if (o.isText()) {
     186        // FIXME: Would be better to dump the bounding box x and y rather than the first run's x and y, but that would involve updating
     187        // many test results.
     188        const RenderText& text = static_cast<const RenderText&>(o);
     189        r = IntRect(text.firstRunX(), text.firstRunY(), text.boundingBoxWidth(), text.boundingBoxHeight());
     190    } else if (o.isBox()) {
     191        if (o.isRenderInline()) {
     192            // FIXME: Would be better not to just dump 0, 0 as the x and y here.
     193            const RenderInline& inlineFlow = static_cast<const RenderInline&>(o);
     194            r = IntRect(0, 0, inlineFlow.boundingBoxWidth(), inlineFlow.boundingBoxHeight());
     195        } else {
     196            // FIXME: We can't just use the actual frameRect of the box because dump render tree dumps the "inner box" of table cells.
     197            // Because of the lie we have to call y().  We would like to fix dump render tree to dump the actual dimensions of the table
     198            // cell including the extra intrinsic padding.
     199            const RenderBox& box = static_cast<const RenderBox&>(o);
     200            r = IntRect(box.x(), box.y(), box.width(), box.height());
     201        }
     202    }
     203
    184204    ts << " " << r;
    185205
  • trunk/WebCore/rendering/RenderVideo.cpp

    r40086 r40124  
    6969IntRect RenderVideo::videoBox() const
    7070{
    71     IntRect contentRect = contentBox();
     71    IntRect contentRect = contentBoxRect();
    7272   
    7373    if (intrinsicSize().isEmpty() || contentRect.isEmpty())
  • trunk/WebCore/rendering/RenderView.cpp

    r40086 r40124  
    5151    // init RenderObject attributes
    5252    setInline(false);
    53 
    54     // try to contrain the width to the views width
    55     m_width = 0;
    56     m_height = 0;
     53   
    5754    m_minPrefWidth = 0;
    5855    m_maxPrefWidth = 0;
     
    7471{
    7572    if (!printing() && m_frameView)
    76         m_height = viewHeight();
     73        setHeight(viewHeight());
    7774}
    7875
     
    8077{
    8178    if (!printing() && m_frameView)
    82         m_width = viewWidth();
     79        setWidth(viewWidth());
    8380    m_marginLeft = 0;
    8481    m_marginRight = 0;
     
    9794{
    9895    if (printing())
    99         m_minPrefWidth = m_maxPrefWidth = m_width;
     96        m_minPrefWidth = m_maxPrefWidth = width();
    10097
    10198    // Use calcWidth/Height to get the new width/height, since this will take the full page zoom factor into account.
    102     bool relayoutChildren = !printing() && (!m_frameView || m_width != viewWidth() || m_height != viewHeight());
     99    bool relayoutChildren = !printing() && (!m_frameView || width() != viewWidth() || height() != viewHeight());
    103100    if (relayoutChildren) {
    104101        setChildNeedsLayout(true, false);
     
    119116
    120117    // Ensure that docWidth() >= width() and docHeight() >= height().
    121     setOverflowWidth(m_width);
    122     setOverflowHeight(m_height);
     118    setOverflowWidth(width());
     119    setOverflowHeight(height());
    123120
    124121    setOverflowWidth(docWidth());
     
    515512{
    516513    if (printing())
    517         return IntRect(0, 0, m_width, m_height);
     514        return IntRect(0, 0, width(), height());
    518515    if (m_frameView)
    519516        return m_frameView->visibleContentRect();
     
    523520int RenderView::docHeight() const
    524521{
    525     int h = m_height;
     522    int h = height();
    526523    int lowestPos = lowestPosition();
    527524    if (lowestPos > h)
     
    532529    // when we call RenderBlock::layout.
    533530    int dh = 0;
    534     for (RenderObject* c = firstChild(); c; c = c->nextSibling())
     531    for (RenderBox* c = firstChildBox(); c; c = c->nextSiblingBox())
    535532        dh += c->height() + c->marginTop() + c->marginBottom();
    536533
     
    543540int RenderView::docWidth() const
    544541{
    545     int w = m_width;
     542    int w = width();
    546543    int rightmostPos = rightmostPosition();
    547544    if (rightmostPos > w)
    548545        w = rightmostPos;
    549 
    550     for (RenderObject *c = firstChild(); c; c = c->nextSibling()) {
     546   
     547    for (RenderBox* c = firstChildBox(); c; c = c->nextSiblingBox()) {
    551548        int dw = c->width() + c->marginLeft() + c->marginRight();
    552549        if (dw > w)
     
    579576// The idea here is to take into account what object is moving the pagination point, and
    580577// thus choose the best place to chop it.
    581 void RenderView::setBestTruncatedAt(int y, RenderObject* forRenderer, bool forcedBreak)
     578void RenderView::setBestTruncatedAt(int y, RenderBox* forRenderer, bool forcedBreak)
    582579{
    583580    // Nobody else can set a page break once we have a forced break.
     
    593590
    594591    // prefer the widest object who tries to move the pagination point
    595     int width = forRenderer->width();
    596     if (width > m_truncatorWidth) {
    597         m_truncatorWidth = width;
     592    if (forRenderer->width() > m_truncatorWidth) {
     593        m_truncatorWidth = forRenderer->width();
    598594        m_bestTruncatedAt = y;
    599595    }
  • trunk/WebCore/rendering/RenderView.h

    r40086 r40124  
    7777    bool printImages() const { return m_printImages; }
    7878    void setTruncatedAt(int y) { m_truncatedAt = y; m_bestTruncatedAt = m_truncatorWidth = 0; m_forcedPageBreak = false; }
    79     void setBestTruncatedAt(int y, RenderObject *forRenderer, bool forcedBreak = false);
     79    void setBestTruncatedAt(int y, RenderBox* forRenderer, bool forcedBreak = false);
    8080    int bestTruncatedAt() const { return m_bestTruncatedAt; }
    8181
  • trunk/WebCore/rendering/RenderWidget.cpp

    r40086 r40124  
    7676        v->removeWidget(this);
    7777
    78     if (AXObjectCache::accessibilityEnabled())
     78    if (AXObjectCache::accessibilityEnabled()) {
     79        document()->axObjectCache()->childrenChanged(this->parent());
    7980        document()->axObjectCache()->remove(this);
    80 
     81    }
    8182    remove();
    8283
     
    173174        return;
    174175
    175     tx += m_x;
    176     ty += m_y;
     176    tx += x();
     177    ty += m_frameRect.y();
    177178
    178179    if (hasBoxDecorations() && (paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseSelection))
     
    189190#if PLATFORM(MAC)
    190191    if (style()->highlight() != nullAtom && !paintInfo.context->paintingDisabled())
    191         paintCustomHighlight(tx - m_x, ty - m_y, style()->highlight(), true);
     192        paintCustomHighlight(tx - x(), ty - m_frameRect.y(), style()->highlight(), true);
    192193#endif
    193194
     
    223224    absPos.move(borderLeft() + paddingLeft(), borderTop() + paddingTop());
    224225
    225     int width = m_width - borderLeft() - borderRight() - paddingLeft() - paddingRight();
    226     int height = m_height - borderTop() - borderBottom() - paddingTop() - paddingBottom();
    227 
    228     IntRect newBounds(absPos.x(), absPos.y(), width, height);
     226    int w = width() - borderLeft() - borderRight() - paddingLeft() - paddingRight();
     227    int h = height() - borderTop() - borderBottom() - paddingTop() - paddingBottom();
     228
     229    IntRect newBounds(absPos.x(), absPos.y(), w, h);
    229230    IntRect oldBounds(m_widget->frameRect());
    230231    if (newBounds != oldBounds) {
     
    272273    // Check to see if we are really over the widget itself (and not just in the border/padding area).
    273274    if (inside && !hadResult && result.innerNode() == element())
    274         result.setIsOverWidget(contentBox().contains(result.localPoint()));
     275        result.setIsOverWidget(contentBoxRect().contains(result.localPoint()));
    275276    return inside;
    276277}
  • trunk/WebCore/rendering/RootInlineBox.h

    r40086 r40124  
    120120    InlineBox* closestLeafChildForXPos(int x, bool onlyEditableLeaves = false);
    121121
    122     Vector<RenderObject*>& floats()
     122    Vector<RenderBox*>& floats()
    123123    {
    124124        ASSERT(!isDirty());
     
    128128    }
    129129
    130     Vector<RenderObject*>* floatsPtr() { ASSERT(!isDirty()); return m_overflow ? &m_overflow->floats : 0; }
     130    Vector<RenderBox*>* floatsPtr() { ASSERT(!isDirty()); return m_overflow ? &m_overflow->floats : 0; }
    131131
    132132protected:
     
    159159        // Floats hanging off the line are pushed into this vector during layout. It is only
    160160        // good for as long as the line has not been marked dirty.
    161         Vector<RenderObject*> floats;
     161        Vector<RenderBox*> floats;
    162162    private:
    163163        void* operator new(size_t) throw();
  • trunk/WebCore/rendering/SVGInlineFlowBox.cpp

    r40086 r40124  
    4444}
    4545
    46 void SVGInlineFlowBox::verticallyAlignBoxes(int&)
     46int SVGInlineFlowBox::verticallyAlignBoxes(int)
    4747{
    4848    // no-op
     49    return 0;
    4950}
    5051
  • trunk/WebCore/rendering/SVGInlineFlowBox.h

    r40086 r40124  
    3939    virtual void paint(RenderObject::PaintInfo&, int tx, int ty);
    4040    virtual int placeBoxesHorizontally(int x, int& leftPosition, int& rightPosition, bool& needsWordSpacing);
    41     virtual void verticallyAlignBoxes(int& heightOfBlock);
     41    virtual int verticallyAlignBoxes(int heightOfBlock);
    4242};
    4343
  • trunk/WebCore/rendering/SVGRenderTreeAsText.cpp

    r40086 r40124  
    330330
    331331    Vector<SVGTextChunk>& chunks = const_cast<Vector<SVGTextChunk>& >(box->svgTextChunks());
    332     ts << " at (" << text.xPos() << "," << text.yPos() << ") size " << box->width() << "x" << box->height() << " contains " << chunks.size() << " chunk(s)";
     332    ts << " at (" << text.x() << "," << text.y() << ") size " << box->width() << "x" << box->height() << " contains " << chunks.size() << " chunk(s)";
    333333
    334334    if (text.parent() && (text.parent()->style()->color() != text.style()->color()))
     
    515515    }
    516516
    517     ts << " at (" << text.xPos() << "," << text.yPos() << ") size " << text.width() << "x" << text.height() << "\n";
     517    ts << " at (" << text.firstRunX() << "," << text.firstRunY() << ") size " << text.boundingBoxWidth() << "x" << text.boundingBoxHeight() << "\n";
    518518    writeSVGInlineText(ts, text, indent);
    519519}
  • trunk/WebCore/rendering/SVGRootInlineBox.cpp

    r40086 r40124  
    3131#include "Frame.h"
    3232#include "GraphicsContext.h"
     33#include "RenderBlock.h"
    3334#include "RenderSVGRoot.h"
    3435#include "SVGInlineFlowBox.h"
     
    612613}
    613614
    614 void SVGRootInlineBox::verticallyAlignBoxes(int& heightOfBlock)
     615int SVGRootInlineBox::verticallyAlignBoxes(int)
    615616{
    616617    // height is set by layoutInlineBoxes.
    617     heightOfBlock = height();
     618    return height();
    618619}
    619620
     
    888889    // Propogate this knownledge to our RenderSVGText parent.
    889890    FloatPoint topLeft = topLeftPositionOfCharacterRange(m_svgChars);
    890     object()->setPos((int) floorf(topLeft.x()), (int) floorf(topLeft.y()));
     891    block()->setLocation((int) floorf(topLeft.x()), (int) floorf(topLeft.y()));
    891892
    892893    // Layout all InlineText/Flow boxes
     
    10391040            int maxY = minY + enclosedStringRect.height();
    10401041
    1041             curr->setXPos(minX - object()->xPos());
     1042            curr->setXPos(minX - block()->x());
    10421043            curr->setWidth(enclosedStringRect.width());
    10431044
    1044             curr->setYPos(minY - object()->yPos());
     1045            curr->setYPos(minY - block()->y());
    10451046            curr->setBaseline(font.ascent());
    10461047            curr->setHeight(enclosedStringRect.height());
     
    10721073            layoutInlineBoxes(flowBox, it, minX, maxX, minY, maxY);
    10731074
    1074             curr->setXPos(minX - object()->xPos());
     1075            curr->setXPos(minX - block()->x());
    10751076            curr->setWidth(maxX - minX);
    10761077
    1077             curr->setYPos(minY - object()->yPos());
     1078            curr->setYPos(minY - block()->y());
    10781079            curr->setBaseline(font.ascent());
    10791080            curr->setHeight(maxY - minY);
     
    10941095
    10951096    if (start->isRootInlineBox()) {
    1096         int top = lowY - object()->yPos();
    1097         int bottom = highY - object()->yPos();
    1098 
    1099         start->setXPos(lowX - object()->xPos());
     1097        int top = lowY - block()->y();
     1098        int bottom = highY - block()->y();
     1099
     1100        start->setXPos(lowX - block()->x());
    11001101        start->setYPos(top);
    11011102
  • trunk/WebCore/rendering/SVGRootInlineBox.h

    r40086 r40124  
    5656
    5757    virtual int placeBoxesHorizontally(int x, int& leftPosition, int& rightPosition, bool& needsWordSpacing);
    58     virtual void verticallyAlignBoxes(int& heightOfBlock);
     58    virtual int verticallyAlignBoxes(int heightOfBlock);
    5959
    6060    virtual void computePerCharacterLayoutInformation();
  • trunk/WebCore/rendering/bidi.cpp

    r40086 r40124  
    567567{
    568568    // First determine our total width.
    569     int availableWidth = lineWidth(m_height);
     569    int availableWidth = lineWidth(height());
    570570    int totWidth = lineBox->getFlowSpacingWidth();
    571571    bool needsWordSpacing = false;
     
    598598        } else if (!r->m_object->isInlineFlow()) {
    599599            r->m_object->calcWidth();
    600             r->m_box->setWidth(r->m_object->width());
     600            r->m_box->setWidth(toRenderBox(r->m_object)->width());
    601601            if (!r->m_compact)
    602602                 totWidth += r->m_object->marginLeft() + r->m_object->marginRight();
     
    612612    // objects horizontally.  The total width of the line can be increased if we end up
    613613    // justifying text.
    614     int x = leftOffset(m_height);
     614    int x = leftOffset(height());
    615615    switch(textAlign) {
    616616        case LEFT:
     
    721721void RenderBlock::computeVerticalPositionsForLine(RootInlineBox* lineBox, BidiRun* firstRun)
    722722{
    723     lineBox->verticallyAlignBoxes(m_height);
    724     lineBox->setBlockHeight(m_height);
     723    setHeight(lineBox->verticallyAlignBoxes(height()));
     724    lineBox->setBlockHeight(height());
    725725
    726726    // See if the line spilled out.  If so set overflow height accordingly.
    727727    int bottomOfLine = lineBox->bottomOverflow();
    728     if (bottomOfLine > m_height && bottomOfLine > m_overflowHeight)
     728    if (bottomOfLine > height() && bottomOfLine > m_overflowHeight)
    729729        m_overflowHeight = bottomOfLine;
    730730
     
    737737        // a reasonable approximation of an appropriate y position.
    738738        if (r->m_object->isPositioned())
    739             r->m_box->setYPos(m_height);
     739            r->m_box->setYPos(height());
    740740
    741741        // Position is used to properly position both replaced elements and
     
    801801    m_overflowHeight = 0;
    802802       
    803     m_height = borderTop() + paddingTop();
     803    setHeight(borderTop() + paddingTop());
    804804    int toAdd = borderBottom() + paddingBottom() + horizontalScrollbarHeight();
    805805
     
    831831            o->invalidateVerticalPosition();
    832832            if (o->isReplaced() || o->isFloating() || o->isPositioned()) {
     833                RenderBox* box = toRenderBox(o);
     834               
    833835                if (relayoutChildren || o->style()->width().isPercent() || o->style()->height().isPercent())
    834836                    o->setChildNeedsLayout(true, false);
     
    839841           
    840842                if (o->isPositioned())
    841                     o->containingBlock()->insertPositionedObject(o);
     843                    o->containingBlock()->insertPositionedObject(box);
    842844                else {
    843845                    if (o->isFloating())
    844                         floats.append(FloatWithRect(o));
     846                        floats.append(FloatWithRect(box));
    845847                    else if (fullLayout || o->needsLayout()) // Replaced elements
    846848                        o->dirtyLineBoxes(fullLayout);
     
    896898        if (startLine) {
    897899            useRepaintBounds = true;
    898             repaintTop = m_height;
    899             repaintBottom = m_height;
     900            repaintTop = height();
     901            repaintBottom = height();
    900902            RenderArena* arena = renderArena();
    901903            RootInlineBox* box = startLine;
     
    930932        bool checkForEndLineMatch = endLine;
    931933        bool checkForFloatsFromLastLine = false;
    932         int lastHeight = m_height;
     934        int lastHeight = height();
    933935
    934936        while (!end.atEnd()) {
     
    10731075            }
    10741076
    1075             lastHeight = m_height;
     1077            lastHeight = height();
    10761078            sNumMidpoints = 0;
    10771079            sCurrMidpoint = 0;
     
    10821084            if (endLineMatched) {
    10831085                // Attach all the remaining lines, and then adjust their y-positions as needed.
    1084                 int delta = m_height - endLineYPos;
     1086                int delta = height() - endLineYPos;
    10851087                for (RootInlineBox* line = endLine; line; line = line->nextRootBox()) {
    10861088                    line->attachLine();
     
    10901092                        line->adjustPosition(0, delta);
    10911093                    }
    1092                     if (Vector<RenderObject*>* cleanLineFloats = line->floatsPtr()) {
    1093                         Vector<RenderObject*>::iterator end = cleanLineFloats->end();
    1094                         for (Vector<RenderObject*>::iterator f = cleanLineFloats->begin(); f != end; ++f) {
    1095                             int floatTop = (*f)->yPos() - (*f)->marginTop();
     1094                    if (Vector<RenderBox*>* cleanLineFloats = line->floatsPtr()) {
     1095                        Vector<RenderBox*>::iterator end = cleanLineFloats->end();
     1096                        for (Vector<RenderBox*>::iterator f = cleanLineFloats->begin(); f != end; ++f) {
     1097                            int floatTop = (*f)->y() - (*f)->marginTop();
    10961098                            insertFloatingObject(*f);
    1097                             m_height = floatTop + delta;
     1099                            setHeight(floatTop + delta);
    10981100                            positionNewFloats();
    10991101                        }
    11001102                    }
    11011103                }
    1102                 m_height = lastRootBox()->blockHeight();
     1104                setHeight(lastRootBox()->blockHeight());
    11031105            } else {
    11041106                // Delete all the remaining lines.
     
    11361138
    11371139    // Now add in the bottom border/padding.
    1138     m_height += toAdd;
     1140    setHeight(height() + toAdd);
    11391141
    11401142    // Always make sure this is at least our height.
    1141     m_overflowHeight = max(m_height, m_overflowHeight);
     1143    m_overflowHeight = max(height(), m_overflowHeight);
    11421144
    11431145    // See if any lines spill out of the block.  If so, we need to update our overflow width.
     
    11451147
    11461148    if (!firstLineBox() && hasLineIfEmpty())
    1147         m_height += lineHeight(true, true);
     1149        setHeight(height() + lineHeight(true, true));
    11481150
    11491151    // See if we have any lines that spill out of our block.  If we do, then we will possibly need to
     
    11621164        size_t floatIndex = 0;
    11631165        for (curr = firstRootBox(); curr && !curr->isDirty(); curr = curr->nextRootBox()) {
    1164             if (Vector<RenderObject*>* cleanLineFloats = curr->floatsPtr()) {
    1165                 Vector<RenderObject*>::iterator end = cleanLineFloats->end();
    1166                 for (Vector<RenderObject*>::iterator o = cleanLineFloats->begin(); o != end; ++o) {
    1167                     RenderObject* f = *o;
     1166            if (Vector<RenderBox*>* cleanLineFloats = curr->floatsPtr()) {
     1167                Vector<RenderBox*>::iterator end = cleanLineFloats->end();
     1168                for (Vector<RenderBox*>::iterator o = cleanLineFloats->begin(); o != end; ++o) {
     1169                    RenderBox* f = *o;
    11681170                    IntSize newSize(f->width() + f->marginLeft() +f->marginRight(), f->height() + f->marginTop() + f->marginBottom());
    11691171                    ASSERT(floatIndex < floats.size());
     
    12271229    numCleanFloats = 0;
    12281230    if (!floats.isEmpty()) {
    1229         int savedHeight = m_height;
     1231        int savedHeight = height();
    12301232        // Restore floats from clean lines.
    12311233        RootInlineBox* line = firstRootBox();
    12321234        while (line != curr) {
    1233             if (Vector<RenderObject*>* cleanLineFloats = line->floatsPtr()) {
    1234                 Vector<RenderObject*>::iterator end = cleanLineFloats->end();
    1235                 for (Vector<RenderObject*>::iterator f = cleanLineFloats->begin(); f != end; ++f) {
     1235            if (Vector<RenderBox*>* cleanLineFloats = line->floatsPtr()) {
     1236                Vector<RenderBox*>::iterator end = cleanLineFloats->end();
     1237                for (Vector<RenderBox*>::iterator f = cleanLineFloats->begin(); f != end; ++f) {
    12361238                    insertFloatingObject(*f);
    1237                     m_height = (*f)->yPos() - (*f)->marginTop();
     1239                    setHeight((*f)->y() - (*f)->marginTop());
    12381240                    positionNewFloats();
    12391241                    ASSERT(floats[numCleanFloats].object == *f);
     
    12431245            line = line->nextRootBox();
    12441246        }
    1245         m_height = savedHeight;
     1247        setHeight(savedHeight);
    12461248    }
    12471249
     
    12521254    int pos = 0;
    12531255    if (last) {
    1254         m_height = last->blockHeight();
     1256        setHeight(last->blockHeight());
    12551257        startObj = last->lineBreakObj();
    12561258        pos = last->lineBreakPos();
     
    13121314            return false;
    13131315
    1314         int delta = m_height - endYPos;
     1316        int delta = height() - endYPos;
    13151317        if (!delta || !m_floatingObjects)
    13161318            return true;
    13171319
    13181320        // See if any floats end in the range along which we want to shift the lines vertically.
    1319         int top = min(m_height, endYPos);
     1321        int top = min(height(), endYPos);
    13201322
    13211323        RootInlineBox* lastLine = endLine;
     
    13481350                endYPos = line->blockHeight();
    13491351
    1350             int delta = m_height - endYPos;
     1352            int delta = height() - endYPos;
    13511353            if (delta && m_floatingObjects) {
    13521354                // See if any floats end in the range along which we want to shift the lines vertically.
    1353                 int top = min(m_height, endYPos);
     1355                int top = min(height(), endYPos);
    13541356
    13551357                RootInlineBox* lastLine = endLine;
     
    14601462        RenderObject* object = iterator.obj;
    14611463        if (object->isFloating()) {
    1462             insertFloatingObject(object);
     1464            insertFloatingObject(toRenderBox(object));
    14631465        } else if (object->isPositioned()) {
    14641466            // FIXME: The math here is actually not really right.  It's a best-guess approximation that
     
    14691471                // position as though we were an inline.  Set |staticX| and |staticY| on the relative positioned
    14701472                // inline so that we can obtain the value later.
    1471                 c->setStaticX(style()->direction() == LTR ? leftOffset(m_height) : rightOffset(m_height));
    1472                 c->setStaticY(m_height);
     1473                c->setStaticX(style()->direction() == LTR ? leftOffset(height()) : rightOffset(height()));
     1474                c->setStaticY(height());
    14731475            }
    14741476   
    14751477            if (object->hasStaticX()) {
    14761478                if (object->style()->isOriginalDisplayInlineType())
    1477                     object->setStaticX(style()->direction() == LTR ? leftOffset(m_height) : width() - rightOffset(m_height));
     1479                    object->setStaticX(style()->direction() == LTR ? leftOffset(height()) : width() - rightOffset(height()));
    14781480                else
    14791481                    object->setStaticX(style()->direction() == LTR ? borderLeft() + paddingLeft() : borderRight() + paddingRight());
     
    14811483   
    14821484            if (object->hasStaticY())
    1483                 object->setStaticY(m_height);
     1485                object->setStaticY(height());
    14841486        }
    14851487        iterator.increment();
     
    14891491int RenderBlock::skipLeadingWhitespace(InlineBidiResolver& resolver)
    14901492{
    1491     int availableWidth = lineWidth(m_height);
     1493    int availableWidth = lineWidth(height());
    14921494    while (!resolver.position().atEnd() && !requiresLineBox(resolver.position())) {
    14931495        RenderObject* object = resolver.position().obj;
    14941496        if (object->isFloating()) {
    1495             insertFloatingObject(object);
     1497            insertFloatingObject(toRenderBox(object));
    14961498            positionNewFloats();
    1497             availableWidth = lineWidth(m_height);
     1499            availableWidth = lineWidth(height());
    14981500        } else if (object->isPositioned()) {
    14991501            // FIXME: The math here is actually not really right.  It's a best-guess approximation that
     
    15041506                // position as though we were an inline.  Set |staticX| and |staticY| on the relative positioned
    15051507                // inline so that we can obtain the value later.
    1506                 c->setStaticX(style()->direction() == LTR ? leftOffset(m_height) : rightOffset(m_height));
    1507                 c->setStaticY(m_height);
     1508                c->setStaticX(style()->direction() == LTR ? leftOffset(height()) : rightOffset(height()));
     1509                c->setStaticY(height());
    15081510            }
    15091511   
    15101512            if (object->hasStaticX()) {
    15111513                if (object->style()->isOriginalDisplayInlineType())
    1512                     object->setStaticX(style()->direction() == LTR ? leftOffset(m_height) : width() - rightOffset(m_height));
     1514                    object->setStaticX(style()->direction() == LTR ? leftOffset(height()) : width() - rightOffset(height()));
    15131515                else
    15141516                    object->setStaticX(style()->direction() == LTR ? borderLeft() + paddingLeft() : borderRight() + paddingRight());
     
    15161518   
    15171519            if (object->hasStaticY())
    1518                 object->setStaticY(m_height);
     1520                object->setStaticY(height());
    15191521        }
    15201522        resolver.increment();
     
    15461548
    15471549    int floatBottom;
    1548     int lastFloatBottom = m_height;
     1550    int lastFloatBottom = height();
    15491551    int newLineWidth = availableWidth;
    15501552    while (true) {
     
    15601562
    15611563    if (newLineWidth > availableWidth) {
    1562         m_height = lastFloatBottom;
     1564        setHeight(lastFloatBottom);
    15631565        availableWidth = newLineWidth;
    15641566    }
     
    16531655            // add to special objects...
    16541656            if (o->isFloating()) {
    1655                 insertFloatingObject(o);
     1657                RenderBox* floatBox = toRenderBox(o);
     1658                insertFloatingObject(floatBox);
    16561659                // check if it fits in the current line.
    16571660                // If it does, position it now, otherwise, position
    16581661                // it after moving to next line (in newLine() func)
    1659                 if (floatsFitOnLine && o->width() + o->marginLeft() + o->marginRight() + w + tmpW <= width) {
     1662                if (floatsFitOnLine && floatBox->width() + floatBox->marginLeft() + floatBox->marginRight() + w + tmpW <= width) {
    16601663                    positionNewFloats();
    1661                     width = lineWidth(m_height);
     1664                    width = lineWidth(height());
    16621665                } else
    16631666                    floatsFitOnLine = false;
     
    16781681                bool needToSetStaticY = o->hasStaticY();
    16791682                if (o->hasStaticY() && isInlineType) {
    1680                     o->setStaticY(m_height);
     1683                    o->setStaticY(height());
    16811684                    needToSetStaticY = false;
    16821685                }
     
    17271730                    o->marginRight() + o->borderRight() + o->paddingRight();
    17281731        } else if (o->isReplaced()) {
     1732            RenderBox* replacedBox = toRenderBox(o);
     1733
    17291734            // Break on replaced elements if either has normal white-space.
    17301735            if ((autoWrap || RenderStyle::autoWrap(lastWS)) && (!o->isImage() || allowImagesToBreak)) {
     
    17561761                }
    17571762            } else
    1758                 tmpW += o->width() + o->marginLeft() + o->marginRight() + inlineWidth(o);
     1763                tmpW += replacedBox->width() + replacedBox->marginLeft() + replacedBox->marginRight() + inlineWidth(o);
    17591764        } else if (o->isText()) {
    17601765            if (!pos)
     
    21732178void RenderBlock::checkLinesForOverflow()
    21742179{
    2175     m_overflowWidth = m_width;
     2180    m_overflowWidth = width();
    21762181    for (RootInlineBox* curr = firstRootBox(); curr; curr = curr->nextRootBox()) {
    21772182        m_overflowLeft = min(curr->leftOverflow(), m_overflowLeft);
  • trunk/WebCore/svg/SVGLength.cpp

    r40086 r40124  
    302302    } else if (context->parent() && !context->parent()->isSVGElement()) {
    303303        if (RenderObject* renderer = context->renderer()) {
    304             width = renderer->width();
    305             height = renderer->height();
     304            if (renderer->isBox()) {
     305                RenderBox* box = RenderBox::toRenderBox(renderer);
     306                width = box->width();
     307                height = box->height();
     308            }
    306309        }
    307310    }
  • trunk/WebCore/svg/graphics/SVGPaintServer.cpp

    r40086 r40124  
    22 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
    33 *               2007 Rob Buis <buis@kde.org>
     4 *               2008 Dirk Schulze <krit@webkit.org>
    45 *
    56 * Redistribution and use in source and binary forms, with or without
     
    159160}
    160161
     162void SVGPaintServer::draw(GraphicsContext*& context, const RenderObject* path, SVGPaintTargetType type) const
     163{
     164    if (!setup(context, path, type))
     165        return;
     166
     167    renderPath(context, path, type);
     168    teardown(context, path, type);
     169}
     170
     171void SVGPaintServer::renderPath(GraphicsContext*& context, const RenderObject* path, SVGPaintTargetType type) const
     172{
     173    const SVGRenderStyle* style = path ? path->style()->svgStyle() : 0;
     174
     175    if ((type & ApplyToFillTargetType) && (!style || style->hasFill()))
     176        context->fillPath();
     177
     178    if ((type & ApplyToStrokeTargetType) && (!style || style->hasStroke()))
     179        context->strokePath();
     180}
     181
     182void SVGPaintServer::teardown(GraphicsContext*&, const RenderObject*, SVGPaintTargetType, bool) const
     183{
     184#if PLATFORM(SKIA)
     185    // FIXME: Move this into the GraphicsContext
     186    // WebKit implicitly expects us to reset the path.
     187    // For example in fillAndStrokePath() of RenderPath.cpp the path is
     188    // added back to the context after filling. This is because internally it
     189    // calls CGContextFillPath() which closes the path.
     190    context->beginPath();
     191    context->platformContext()->setGradient(0);
     192    context->platformContext()->setPattern(0);
     193#endif
     194}
     195
    161196DashArray dashArrayFromRenderingStyle(const RenderStyle* style)
    162197{
  • trunk/WebCore/svg/graphics/SVGPaintServer.h

    r40086 r40124  
    7878
    7979    protected:
    80 #if PLATFORM(CG)
    81         void strokePath(CGContextRef, const RenderObject*) const;
    82         void fillPath(CGContextRef, const RenderObject*) const;
    83 #endif
    84 
    85     protected:
    8680        SVGPaintServer();       
    8781    };
  • trunk/WebCore/svg/graphics/SVGPaintServerGradient.cpp

    r40086 r40124  
    258258}
    259259
    260 void SVGPaintServerGradient::renderPath(GraphicsContext*& context, const RenderObject* path, SVGPaintTargetType type) const
    261 {
    262     const SVGRenderStyle* style = path->style()->svgStyle();
    263 
    264     if ((type & ApplyToFillTargetType) && style->hasFill())
    265         context->fillPath();
    266 
    267     if ((type & ApplyToStrokeTargetType) && style->hasStroke())
    268         context->strokePath();
    269 }
    270 
    271260void SVGPaintServerGradient::teardown(GraphicsContext*& context, const RenderObject* object, SVGPaintTargetType, bool isPaintingText) const
    272261{
  • trunk/WebCore/svg/graphics/SVGPaintServerGradient.h

    r40086 r40124  
    7272        virtual bool setup(GraphicsContext*&, const RenderObject*, SVGPaintTargetType, bool isPaintingText) const;
    7373        virtual void teardown(GraphicsContext*&, const RenderObject*, SVGPaintTargetType, bool isPaintingText) const;
    74         virtual void renderPath(GraphicsContext*&, const RenderObject*, SVGPaintTargetType) const;
    7574
    7675    protected:
  • trunk/WebCore/svg/graphics/SVGPaintServerPattern.cpp

    r40086 r40124  
    174174}
    175175
    176 void SVGPaintServerPattern::renderPath(GraphicsContext*& context, const RenderObject* path, SVGPaintTargetType type) const
    177 {
    178     const SVGRenderStyle* style = path->style()->svgStyle();
    179 
    180     if ((type & ApplyToFillTargetType) && style->hasFill())
    181         context->fillPath();
    182 
    183     if ((type & ApplyToStrokeTargetType) && style->hasStroke())
    184         context->strokePath();
    185 }
    186 
    187176void SVGPaintServerPattern::teardown(GraphicsContext*& context, const RenderObject*, SVGPaintTargetType, bool) const
    188177{
  • trunk/WebCore/svg/graphics/SVGPaintServerPattern.h

    r40086 r40124  
    6565
    6666        virtual bool setup(GraphicsContext*&, const RenderObject*, SVGPaintTargetType, bool isPaintingText) const;
    67         virtual void renderPath(GraphicsContext*&, const RenderObject*, SVGPaintTargetType) const;
    6867        virtual void teardown(GraphicsContext*&, const RenderObject*, SVGPaintTargetType, bool isPaintingText) const;
    6968
  • trunk/WebCore/svg/graphics/SVGPaintServerSolid.cpp

    r40086 r40124  
    8989}
    9090
    91 void SVGPaintServerSolid::renderPath(GraphicsContext*& context, const RenderObject* path, SVGPaintTargetType type) const
    92 {
    93     const SVGRenderStyle* svgStyle = path ? path->style()->svgStyle() : 0;
    94 
    95     if ((type & ApplyToFillTargetType) && (!svgStyle || svgStyle->hasFill()))
    96         context->fillPath();
    97 
    98     if ((type & ApplyToStrokeTargetType) && (!svgStyle || svgStyle->hasStroke()))
    99         context->strokePath();
    100 }
    101 
    10291} // namespace WebCore
    10392
  • trunk/WebCore/svg/graphics/SVGPaintServerSolid.h

    r40086 r40124  
    4747
    4848        virtual bool setup(GraphicsContext*&, const RenderObject*, SVGPaintTargetType, bool isPaintingText) const;
    49         virtual void renderPath(GraphicsContext*&, const RenderObject*, SVGPaintTargetType) const;
    5049
    5150    private:
  • trunk/WebCore/wml/WMLAElement.cpp

    r40086 r40124  
    105105    // or one of the continuations is non-empty, since this is a faster check and
    106106    // almost always returns true.
    107     for (RenderObject* r = renderer(); r; r = r->virtualContinuation())
     107    RenderBox* box = RenderBox::toRenderBox(renderer());
     108    if (box->width() > 0 && box->height() > 0)
     109        return true;
     110    for (RenderFlow* r = box->virtualContinuation(); r; r = r->continuation())
    108111        if (r->width() > 0 && r->height() > 0)
    109112            return true;
  • trunk/WebCore/wml/WMLInputElement.cpp

    r40086 r40124  
    5151static inline bool isInputFocusable(RenderObject* renderer)
    5252{
    53     if (!renderer)
     53    if (!renderer || !renderer->isBox())
    5454        return false;
    5555
    56     if (!renderer->width() || !renderer->height())
     56    if (RenderBox::toRenderBox(renderer)->size().isEmpty())
    5757        return false;
    5858
  • trunk/WebCore/xml/XMLHttpRequest.cpp

    r40086 r40124  
    2424
    2525#include "CString.h"
    26 #include "Console.h"
    2726#include "DOMImplementation.h"
    28 #include "DOMWindow.h"
     27#include "Document.h"
    2928#include "Event.h"
    3029#include "EventException.h"
     
    3231#include "EventNames.h"
    3332#include "File.h"
    34 #include "Frame.h"
    35 #include "FrameLoader.h"
    3633#include "HTTPParsers.h"
    37 #include "InspectorController.h"
    3834#include "KURL.h"
    3935#include "KURLHash.h"
    40 #include "Page.h"
     36#include "ResourceError.h"
     37#include "ResourceRequest.h"
     38#include "ScriptExecutionContext.h"
    4139#include "Settings.h"
    42 #include "SubresourceLoader.h"
     40#include "SystemTime.h"
    4341#include "TextResourceDecoder.h"
     42#include "ThreadableLoader.h"
    4443#include "XMLHttpRequestException.h"
    4544#include "XMLHttpRequestProgressEvent.h"
     
    324323    , m_includeCredentials(false)
    325324    , m_state(UNSENT)
    326     , m_identifier(std::numeric_limits<unsigned long>::max())
    327325    , m_responseText("")
    328326    , m_createdDocument(false)
     
    348346    return static_cast<Document*>(scriptExecutionContext());
    349347}
     348
     349#if ENABLE(DASHBOARD_SUPPORT)
     350bool XMLHttpRequest::usesDashboardBackwardCompatibilityMode() const
     351{
     352    if (scriptExecutionContext()->isWorkerContext())
     353        return false;
     354    Settings* settings = document()->settings();
     355    return settings && settings->usesDashboardBackwardCompatibilityMode();
     356}
     357#endif
    350358
    351359XMLHttpRequest::State XMLHttpRequest::readyState() const
     
    559567        if (contentType.isEmpty()) {
    560568#if ENABLE(DASHBOARD_SUPPORT)
    561             Settings* settings = document->settings();
    562             if (settings && settings->usesDashboardBackwardCompatibilityMode())
     569            if (usesDashboardBackwardCompatibilityMode())
    563570                setRequestHeaderInternal("Content-Type", "application/x-www-form-urlencoded");
    564571            else
     
    591598        if (contentType.isEmpty()) {
    592599#if ENABLE(DASHBOARD_SUPPORT)
    593             Settings* settings = document()->settings();
    594             if (settings && settings->usesDashboardBackwardCompatibilityMode())
     600            if (usesDashboardBackwardCompatibilityMode())
    595601                setRequestHeaderInternal("Content-Type", "application/x-www-form-urlencoded");
    596602            else
     
    806812    ResourceResponse response;
    807813
    808     if (document()->frame())
    809         m_identifier = document()->frame()->loader()->loadResourceSynchronously(request, error, response, data);
    810 
     814    unsigned long identifier = ThreadableLoader::loadResourceSynchronously(scriptExecutionContext(), request, error, response, data);
    811815    m_loader = 0;
    812816
     
    814818    // Also, if we have an HTTP response, then it wasn't a network error in fact.
    815819    if (error.isNull() || request.url().isLocalFile() || response.httpStatusCode() > 0) {
    816         processSyncLoadResults(data, response, ec);
     820        processSyncLoadResults(identifier, data, response, ec);
    817821        return;
    818822    }
     
    838842    // We need to keep content sniffing enabled for local files due to CFNetwork not providing a MIME type
    839843    // for local files otherwise, <rdar://problem/5671813>.
    840     bool sendResourceLoadCallbacks = !m_inPreflight;
    841     m_loader = SubresourceLoader::create(document()->frame(), this, request, false, sendResourceLoadCallbacks, request.url().isLocalFile());
     844    LoadCallbacks callbacks = m_inPreflight ? DoNotSendLoadCallbacks : SendLoadCallbacks;
     845    ContentSniff contentSniff =  request.url().isLocalFile() ? SniffContent : DoNotSniffContent;
     846    m_loader = ThreadableLoader::create(scriptExecutionContext(), this, request, callbacks, contentSniff);
    842847
    843848    if (m_loader) {
     
    979984    if (m_state != OPENED || m_loader) {
    980985#if ENABLE(DASHBOARD_SUPPORT)
    981         Settings* settings = document() ? document()->settings() : 0;
    982         if (settings && settings->usesDashboardBackwardCompatibilityMode())
     986        if (usesDashboardBackwardCompatibilityMode())
    983987            return;
    984988#endif
     
    11311135}
    11321136
    1133 void XMLHttpRequest::processSyncLoadResults(const Vector<char>& data, const ResourceResponse& response, ExceptionCode& ec)
     1137void XMLHttpRequest::processSyncLoadResults(unsigned long identifier, const Vector<char>& data, const ResourceResponse& response, ExceptionCode& ec)
    11341138{
    11351139    if (m_sameOriginRequest && !scriptExecutionContext()->securityOrigin()->canRequest(response.url())) {
     
    11381142    }
    11391143   
    1140     didReceiveResponse(0, response);
     1144    didReceiveResponse(response);
    11411145    changeState(HEADERS_RECEIVED);
    11421146
    11431147    const char* bytes = static_cast<const char*>(data.data());
    11441148    int len = static_cast<int>(data.size());
    1145     didReceiveData(0, bytes, len);
    1146 
    1147     didFinishLoading(0);
     1149    didReceiveData(bytes, len);
     1150
     1151    didFinishLoading(identifier);
    11481152    if (m_error)
    11491153        ec = XMLHttpRequestException::NETWORK_ERR;
    11501154}
    11511155
    1152 void XMLHttpRequest::didFail(SubresourceLoader*, const ResourceError& error)
     1156void XMLHttpRequest::didFail()
    11531157{
    11541158    // If we are already in an error state, for instance we called abort(), bail out early.
     
    11561160        return;
    11571161
    1158     if (error.isCancellation()) {
    1159         abortError();
    1160         return;
    1161     }
    1162 
     1162    internalAbort();
    11631163    networkError();
    1164     return;
    1165 }
    1166 
    1167 void XMLHttpRequest::didFinishLoading(SubresourceLoader* loader)
    1168 {
     1164}
     1165
     1166void XMLHttpRequest::didGetCancelled()
     1167{
     1168    // If we are already in an error state, for instance we called abort(), bail out early.
    11691169    if (m_error)
    11701170        return;
    11711171
     1172    abortError();
     1173}
     1174
     1175void XMLHttpRequest::didFinishLoading(unsigned long identifier)
     1176{
     1177    if (m_error)
     1178        return;
     1179
    11721180    if (m_inPreflight) {
    1173         didFinishLoadingPreflight(loader);
    1174         return;
    1175     }
    1176 
    1177     ASSERT(loader == m_loader);
     1181        didFinishLoadingPreflight();
     1182        return;
     1183    }
    11781184
    11791185    if (m_state < HEADERS_RECEIVED)
     
    11831189        m_responseText += m_decoder->flush();
    11841190
    1185     scriptExecutionContext()->resourceRetrievedByXMLHttpRequest(m_loader ? m_loader->identifier() : m_identifier, m_responseText);
     1191    scriptExecutionContext()->resourceRetrievedByXMLHttpRequest(identifier, m_responseText);
    11861192    scriptExecutionContext()->addMessage(InspectorControllerDestination, JSMessageSource, LogMessageLevel, "XHR finished loading: \"" + m_url + "\".", m_lastSendLineNumber, m_lastSendURL);
    11871193
     
    11961202}
    11971203
    1198 void XMLHttpRequest::didFinishLoadingPreflight(SubresourceLoader*)
     1204void XMLHttpRequest::didFinishLoadingPreflight()
    11991205{
    12001206    ASSERT(m_inPreflight);
     
    12091215}
    12101216
    1211 void XMLHttpRequest::willSendRequest(SubresourceLoader*, ResourceRequest& request, const ResourceResponse&)
    1212 {
    1213     // FIXME: This needs to be fixed to follow the redirect correctly even for cross-domain requests.
    1214     if (!scriptExecutionContext()->securityOrigin()->canRequest(request.url())) {
    1215         internalAbort();
    1216         networkError();
    1217     }
    1218 }
    1219 
    1220 void XMLHttpRequest::didSendData(SubresourceLoader*, unsigned long long bytesSent, unsigned long long totalBytesToBeSent)
     1217void XMLHttpRequest::didSendData(unsigned long long bytesSent, unsigned long long totalBytesToBeSent)
    12211218{
    12221219    if (!m_upload)
     
    12541251}
    12551252
    1256 void XMLHttpRequest::didReceiveResponse(SubresourceLoader* loader, const ResourceResponse& response)
     1253void XMLHttpRequest::didReceiveResponse(const ResourceResponse& response)
    12571254{
    12581255    if (m_inPreflight) {
    1259         didReceiveResponsePreflight(loader, response);
     1256        didReceiveResponsePreflight(response);
    12601257        return;
    12611258    }
     
    12741271}
    12751272
    1276 void XMLHttpRequest::didReceiveResponsePreflight(SubresourceLoader*, const ResourceResponse& response)
     1273void XMLHttpRequest::didReceiveResponsePreflight(const ResourceResponse& response)
    12771274{
    12781275    ASSERT(m_inPreflight);
     
    12851282
    12861283    OwnPtr<PreflightResultCacheItem> preflightResult(new PreflightResultCacheItem(m_includeCredentials));
    1287     if (!preflightResult->parse(response))  {
     1284    if (!preflightResult->parse(response)
     1285        || !preflightResult->allowsCrossSiteMethod(m_method)
     1286        || !preflightResult->allowsCrossSiteHeaders(m_requestHeaders)) {
    12881287        networkError();
    12891288        return;
    12901289    }
    12911290
    1292     if (!preflightResult->allowsCrossSiteMethod(m_method)) {
    1293         networkError();
    1294         return;
    1295     }
    1296 
    1297     if (!preflightResult->allowsCrossSiteHeaders(m_requestHeaders)) {
    1298         networkError();
    1299         return;
    1300     }
    1301 
    13021291    PreflightResultCache::shared().appendEntry(scriptExecutionContext()->securityOrigin()->toString(), m_url, preflightResult.release());
    13031292}
    13041293
    1305 void XMLHttpRequest::receivedCancellation(SubresourceLoader*, const AuthenticationChallenge& challenge)
    1306 {
    1307     m_response = challenge.failureResponse();
    1308 }
    1309 
    1310 void XMLHttpRequest::didReceiveData(SubresourceLoader*, const char* data, int len)
     1294void XMLHttpRequest::didReceiveAuthenticationCancellation(const ResourceResponse& failureResponse)
     1295{
     1296    m_response = failureResponse;
     1297}
     1298
     1299void XMLHttpRequest::didReceiveData(const char* data, int len)
    13111300{
    13121301    if (m_inPreflight)
     
    13271316            m_decoder = TextResourceDecoder::create("text/plain", "UTF-8");
    13281317    }
    1329     if (len == 0)
     1318    if (!len)
    13301319        return;
    13311320
  • trunk/WebCore/xml/XMLHttpRequest.h

    r40086 r40124  
    2727#include "FormData.h"
    2828#include "ResourceResponse.h"
    29 #include "SubresourceLoaderClient.h"
    3029#include "ScriptString.h"
     30#include "ThreadableLoaderClient.h"
    3131#include <wtf/OwnPtr.h>
    3232
     
    3535class Document;
    3636class File;
     37class ResourceRequest;
    3738class TextResourceDecoder;
    38 
    39 class XMLHttpRequest : public RefCounted<XMLHttpRequest>, public EventTarget, private SubresourceLoaderClient, public ActiveDOMObject {
     39class ThreadableLoader;
     40
     41class XMLHttpRequest : public RefCounted<XMLHttpRequest>, public EventTarget, private ThreadableLoaderClient, public ActiveDOMObject {
    4042public:
    4143    static PassRefPtr<XMLHttpRequest> create(ScriptExecutionContext* context) { return adoptRef(new XMLHttpRequest(context)); }
     
    120122    Document* document() const;
    121123
    122     virtual void willSendRequest(SubresourceLoader*, ResourceRequest& request, const ResourceResponse& redirectResponse);
    123     virtual void didSendData(SubresourceLoader*, unsigned long long bytesSent, unsigned long long totalBytesToBeSent);
    124     virtual void didReceiveResponse(SubresourceLoader*, const ResourceResponse&);
    125     virtual void didReceiveData(SubresourceLoader*, const char* data, int size);
    126     virtual void didFail(SubresourceLoader*, const ResourceError&);
    127     virtual void didFinishLoading(SubresourceLoader*);
    128     virtual void receivedCancellation(SubresourceLoader*, const AuthenticationChallenge&);
     124#if ENABLE(DASHBOARD_SUPPORT)
     125    bool usesDashboardBackwardCompatibilityMode() const;
     126#endif
     127
     128    virtual void didSendData(unsigned long long bytesSent, unsigned long long totalBytesToBeSent);
     129    virtual void didReceiveResponse(const ResourceResponse&);
     130    virtual void didReceiveData(const char* data, int lengthReceived);
     131    virtual void didFinishLoading(unsigned long identifier);
     132    virtual void didFail();
     133    virtual void didGetCancelled();
     134    virtual void didReceiveAuthenticationCancellation(const ResourceResponse&);
    129135
    130136    // Special versions for the preflight
    131     void didReceiveResponsePreflight(SubresourceLoader*, const ResourceResponse&);
    132     void didFinishLoadingPreflight(SubresourceLoader*);
    133 
    134     void processSyncLoadResults(const Vector<char>& data, const ResourceResponse&, ExceptionCode&);
     137    void didReceiveResponsePreflight(const ResourceResponse&);
     138    void didFinishLoadingPreflight();
     139
     140    void processSyncLoadResults(unsigned long identifier, const Vector<char>& data, const ResourceResponse&, ExceptionCode&);
    135141    void updateAndDispatchOnProgress(unsigned int len);
    136142
     
    199205    bool m_includeCredentials;
    200206
    201     RefPtr<SubresourceLoader> m_loader;
     207    RefPtr<ThreadableLoader> m_loader;
    202208    State m_state;
    203209
     
    206212
    207213    RefPtr<TextResourceDecoder> m_decoder;
    208     unsigned long m_identifier;
    209 
    210     // Unlike most strings in the DOM, we keep this as a JSC::UString, not a WebCore::String.
     214
     215    // Unlike most strings in the DOM, we keep this as a ScriptString, not a WebCore::String.
    211216    // That's because these strings can easily get huge (they are filled from the network with
    212217    // no parsing) and because JS can easily observe many intermediate states, so it's very useful
  • trunk/WebKit/mac/ChangeLog

    r40086 r40124  
     12009-01-21  David Hyatt  <hyatt@apple.com>
     2
     3        Devirtualize width/height/x/y on RenderObject and move the methods to RenderBox.
     4
     5        Reviewed by Eric Seidel and Darin Adler
     6
     7        * WebView/WebRenderNode.mm:
     8        (copyRenderNode):
     9
     102009-01-21  Anders Carlsson  <andersca@apple.com>
     11
     12        Reviewed by Sam Weinig.
     13
     14        More browser->plug-in scripting support.
     15       
     16        * Plugins/Hosted/NetscapePluginHostProxy.mm:
     17        (WKPCNPObjectHasPropertyReply):
     18        (WKPCNPObjectHasMethodReply):
     19        (WKPCNPObjectInvokeReply):
     20        MIG reply functions.
     21       
     22        (WKPCIdentifierInfo):
     23        Return information about an identifier given its 64-bit value.
     24       
     25        * Plugins/Hosted/NetscapePluginInstanceProxy.h:
     26        Add new reply structs.
     27       
     28        * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
     29        (WebKit::NetscapePluginInstanceProxy::addValueToArray):
     30        Split out code that adds values to the arrays from marshalValue.
     31       
     32        (WebKit::NetscapePluginInstanceProxy::marshalValue):
     33        Call addValueToArray.
     34   
     35        (WebKit::NetscapePluginInstanceProxy::marshalValues):
     36        Marshal a list of values.
     37       
     38        (WebKit::NetscapePluginInstanceProxy::createBindingsInstance):
     39        Actually create a proxy instance.
     40       
     41        * Plugins/Hosted/ProxyInstance.h:
     42        * Plugins/Hosted/ProxyInstance.mm:
     43        (WebKit::ProxyClass::methodsNamed):
     44        (WebKit::ProxyClass::fieldNamed):
     45        Add a proxy ProxyClass class that just forwards everything to the ProxyInstance class.
     46       
     47        (WebKit::proxyClass):
     48        Shared proxyClass getter.
     49       
     50        (WebKit::ProxyField::ProxyField):
     51        (WebKit::ProxyField::valueFromInstance):
     52        (WebKit::ProxyField::setValueToInstance):
     53        Add a proxy ProxyField class that just forwards everything to the ProxyInstance class.
     54       
     55        (WebKit::ProxyMethod::ProxyMethod):
     56        (WebKit::ProxyMethod::serverIdentifier):
     57        (WebKit::ProxyMethod::numParameters):
     58        Add a dummy ProxyMethod class.
     59       
     60        (WebKit::ProxyInstance::invokeMethod):
     61        Call _WKPHNPObjectInvoke.
     62       
     63        (WebKit::ProxyInstance::defaultValue):
     64        (WebKit::ProxyInstance::stringValue):
     65        (WebKit::ProxyInstance::numberValue):
     66        (WebKit::ProxyInstance::booleanValue):
     67        (WebKit::ProxyInstance::valueOf):
     68        Add dummy implementations (taken from CInstance).
     69       
     70        (WebKit::ProxyInstance::methodsNamed):
     71        Call _WKPHNPObjectHasMethod to determine whether a method with the given name exists.
     72       
     73        (WebKit::ProxyInstance::fieldNamed):
     74        Call _WKPHNPObjectHasProperty to determine whether a property with the given name exists.
     75       
     76        * Plugins/Hosted/WebKitPluginClient.defs:
     77        * Plugins/Hosted/WebKitPluginHost.defs:
     78        Add new MIG definitions.
     79
     802009-01-21  Mark Rowe  <mrowe@apple.com>
     81
     82        Reviewed by Tim Hatcher.
     83
     84        Clean up how we force invocations of API that happened on background threads over to the main thread.
     85
     86        This was previously accomplished in a somewhat ad-hoc manner using a mutable dictionary to pass arguments
     87        and return values back from the function.  The new approach is to use a proxy object that forwards an
     88        NSInvocation over to the main thread and applies it to the target object, which leads to a much cleaner
     89        call site.
     90
     91        * Misc/WebNSObjectExtras.h:
     92        * Misc/WebNSObjectExtras.mm:
     93        (-[WebMainThreadInvoker initWithTarget:]):
     94        (-[WebMainThreadInvoker forwardInvocation:]):
     95        (-[WebMainThreadInvoker methodSignatureForSelector:]):
     96        (-[WebMainThreadInvoker handleException:]):
     97        (-[NSInvocation _webkit_invokeAndHandleException:]): Execute the invocation and forward any exception that was
     98        raised back to the WebMainThreadInvoker.
     99        (-[NSObject _webkit_invokeOnMainThread]):
     100
     101        The following methods are updated to use the proxy object to forward methods to the main thread:
     102
     103        * WebView/WebArchive.mm:
     104        (-[WebArchive initWithMainResource:subresources:subframeArchives:]):
     105        (-[WebArchive mainResource]):
     106        (-[WebArchive subresources]):
     107        (-[WebArchive subframeArchives]):
     108        * WebView/WebResource.mm:
     109        (-[WebResource data]):
     110        (-[WebResource URL]):
     111        (-[WebResource MIMEType]):
     112        (-[WebResource textEncodingName]):
     113        (-[WebResource frameName]):
     114        (-[WebResource _ignoreWhenUnarchiving]):
     115        (-[WebResource _initWithData:URL:MIMEType:textEncodingName:frameName:response:copyData:]):
     116        (-[WebResource _initWithData:URL:response:]):
     117        (-[WebResource _suggestedFilename]):
     118        (-[WebResource _response]):
     119        (-[WebResource _stringValue]):
     120        * WebView/WebView.mm:
     121        (-[WebView initWithFrame:frameName:groupName:]):
     122        (-[WebView initWithCoder:]):
     123
    11242009-01-20  Nikolas Zimmermann  <nikolas.zimmermann@torchmobile.com>
    2125
  • trunk/WebKit/mac/Misc/WebNSObjectExtras.h

    r40086 r40124  
    5555
    5656@interface NSObject (WebNSObjectExtras)
    57 - (id)_webkit_performSelectorOnMainThread:(SEL)selector withObject:(id)object;
    58 - (id)_webkit_getPropertyOnMainThread:(SEL)selector;
     57- (id)_webkit_invokeOnMainThread;
    5958@end
  • trunk/WebKit/mac/Misc/WebNSObjectExtras.mm

    r40086 r40124  
    2929#import "WebNSObjectExtras.h"
    3030
    31 @implementation NSObject (WebNSObjectExtras)
    3231
    33 - (void)_webkit_performSelectorWithArguments:(NSMutableDictionary *)arguments
     32@interface WebMainThreadInvoker : NSProxy
    3433{
    35     SEL selector = static_cast<SEL>([[arguments objectForKey:@"selector"] pointerValue]);
    36     @try {
    37         id object = [arguments objectForKey:@"object"];
    38         id result = [self performSelector:selector withObject:object];
    39         if (result)
    40             [arguments setObject:result forKey:@"result"];
    41     } @catch(NSException *exception) {
    42         [arguments setObject:exception forKey:@"exception"];
     34    id target;
     35    id exception;
     36}
     37@end
     38
     39@implementation WebMainThreadInvoker
     40
     41- (id)initWithTarget:(id)theTarget
     42{
     43    target = theTarget;
     44    return self;
     45}
     46
     47- (void)forwardInvocation:(NSInvocation *)invocation
     48{
     49    [invocation setTarget:target];
     50    [invocation retainArguments];
     51    [invocation performSelectorOnMainThread:@selector(_webkit_invokeAndHandleException:) withObject:self waitUntilDone:YES];
     52    if (exception) {
     53        id exceptionToThrow = [exception autorelease];
     54        exception = nil;
     55        @throw exceptionToThrow;
    4356    }
    4457}
    4558
    46 - (id)_webkit_performSelectorOnMainThread:(SEL)selector withObject:(id)object
     59- (NSMethodSignature *)methodSignatureForSelector:(SEL)selector
    4760{
    48     NSMutableDictionary *arguments = [[NSMutableDictionary alloc] init];
    49     [arguments setObject:[NSValue valueWithPointer:selector] forKey:@"selector"];
    50     if (object)
    51         [arguments setObject:object forKey:@"object"];
    52 
    53     [self performSelectorOnMainThread:@selector(_webkit_performSelectorWithArguments:) withObject:arguments waitUntilDone:TRUE];
    54 
    55     NSException *exception = [[[arguments objectForKey:@"exception"] retain] autorelease];
    56     id value = [[[arguments objectForKey:@"result"] retain] autorelease];
    57     [arguments release];
    58 
    59     if (exception)
    60         [exception raise];
    61     return value;
     61    return [target methodSignatureForSelector:selector];
    6262}
    6363
    64 - (id)_webkit_getPropertyOnMainThread:(SEL)selector
     64- (void)handleException:(id)e
    6565{
    66     return [self _webkit_performSelectorOnMainThread:selector withObject:nil];
     66    exception = [e retain];
    6767}
    6868
    6969@end
     70
     71
     72@implementation NSInvocation (WebMainThreadInvoker)
     73
     74- (void)_webkit_invokeAndHandleException:(WebMainThreadInvoker *)exceptionHandler
     75{
     76    @try {
     77        [self invoke];
     78    } @catch (id e) {
     79        [exceptionHandler handleException:e];
     80    }
     81}
     82
     83@end
     84
     85
     86@implementation NSObject (WebNSObjectExtras)
     87
     88- (id)_webkit_invokeOnMainThread
     89{
     90    return [[[WebMainThreadInvoker alloc] initWithTarget:self] autorelease];
     91}
     92
     93@end
  • trunk/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm

    r40086 r40124  
    241241}
    242242
     243kern_return_t WKPCNPObjectHasPropertyReply(mach_port_t clientPort, uint32_t pluginID, boolean_t hasProperty)
     244{
     245    NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort);
     246    if (!hostProxy)
     247        return KERN_FAILURE;
     248   
     249    NetscapePluginInstanceProxy* instanceProxy = hostProxy->pluginInstance(pluginID);
     250    if (!instanceProxy)
     251        return KERN_FAILURE;
     252   
     253    instanceProxy->setCurrentReply(new NetscapePluginInstanceProxy::NPObjectHasPropertyReply(hasProperty));
     254    return KERN_SUCCESS;
     255}
     256
     257kern_return_t WKPCNPObjectHasMethodReply(mach_port_t clientPort, uint32_t pluginID, boolean_t hasMethod)
     258{
     259    NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort);
     260    if (!hostProxy)
     261        return KERN_FAILURE;
     262   
     263    NetscapePluginInstanceProxy* instanceProxy = hostProxy->pluginInstance(pluginID);
     264    if (!instanceProxy)
     265        return KERN_FAILURE;
     266   
     267    instanceProxy->setCurrentReply(new NetscapePluginInstanceProxy::NPObjectHasMethodReply(hasMethod));
     268    return KERN_SUCCESS;
     269}
     270
     271kern_return_t WKPCNPObjectInvokeReply(mach_port_t clientPort, uint32_t pluginID, boolean_t returnValue, data_t resultData, mach_msg_type_number_t resultLength)
     272{
     273    NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort);
     274    if (!hostProxy)
     275        return KERN_FAILURE;
     276   
     277    NetscapePluginInstanceProxy* instanceProxy = hostProxy->pluginInstance(pluginID);
     278    if (!instanceProxy)
     279        return KERN_FAILURE;
     280
     281    RetainPtr<CFDataRef> result = CFDataCreate(0, reinterpret_cast<UInt8*>(resultData), resultLength);
     282    instanceProxy->setCurrentReply(new NetscapePluginInstanceProxy::NPObjectInvokeReply(returnValue, result));
     283   
     284    return KERN_SUCCESS;
     285}
     286
    243287kern_return_t WKPCInstantiatePluginReply(mach_port_t clientPort, uint32_t pluginID, kern_return_t result, uint32_t renderContextID, boolean_t useSoftwareRenderer)
    244288{
     
    497541}
    498542
     543kern_return_t WKPCIdentifierInfo(mach_port_t clientPort, uint64_t serverIdentifier, data_t* infoData, mach_msg_type_number_t* infoLength)
     544{
     545    NPIdentifier identifier = reinterpret_cast<NPIdentifier>(serverIdentifier);
     546   
     547    id info;
     548    if (_NPN_IdentifierIsString(identifier)) {
     549        char* s = _NPN_UTF8FromIdentifier(identifier);
     550        info = [NSData dataWithBytesNoCopy:s length:strlen(s) freeWhenDone:NO];
     551    } else
     552        info = [NSNumber numberWithInt:_NPN_IntFromIdentifier(identifier)];
     553
     554    RetainPtr<NSData*> data = [NSPropertyListSerialization dataFromPropertyList:info format:NSPropertyListBinaryFormat_v1_0 errorDescription:0];
     555    ASSERT(data);
     556   
     557    *infoLength = [data.get() length];
     558    mig_allocate(reinterpret_cast<vm_address_t*>(infoData), *infoLength);
     559   
     560    memcpy(*infoData, [data.get() bytes], *infoLength);
     561   
     562    return KERN_SUCCESS;
     563}
     564
    499565#endif // USE(PLUGIN_HOST_PROCESS)
  • trunk/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h

    r40086 r40124  
    113113
    114114    PassRefPtr<JSC::Bindings::Instance> createBindingsInstance(PassRefPtr<JSC::Bindings::RootObject>);
    115    
     115    RetainPtr<NSData *> marshalValues(JSC::ExecState*, const JSC::ArgList& args);
     116    JSC::JSValuePtr demarshalValue(JSC::ExecState*, const char* valueData, mach_msg_type_number_t valueLength);
     117
    116118    // Reply structs
    117119    struct Reply {
    118120        enum Type {
    119121            InstantiatePlugin,
    120             GetScriptableNPObject
     122            GetScriptableNPObject,
     123            NPObjectHasProperty,
     124            NPObjectHasMethod,
     125            NPObjectInvoke
    121126        };
    122127       
     
    144149
    145150    struct GetScriptableNPObjectReply : public Reply {
    146         static const int ReplyType = GetScriptableNPObject;
     151        static const Reply::Type ReplyType = GetScriptableNPObject;
    147152       
    148153        GetScriptableNPObjectReply(uint32_t objectID)
    149             : Reply(GetScriptableNPObject)
     154            : Reply(ReplyType)
    150155            , m_objectID(objectID)
    151156        {
     
    153158           
    154159        uint32_t m_objectID;
     160    };
     161   
     162    struct NPObjectHasPropertyReply : public Reply {
     163        static const Reply::Type ReplyType = NPObjectHasProperty;
     164       
     165        NPObjectHasPropertyReply(boolean_t hasProperty)
     166            : Reply(ReplyType)
     167            , m_hasProperty(hasProperty)
     168        {
     169        }
     170       
     171        boolean_t m_hasProperty;
     172    };
     173
     174    struct NPObjectHasMethodReply : public Reply {
     175        static const Reply::Type ReplyType = NPObjectHasMethod;
     176       
     177        NPObjectHasMethodReply(boolean_t hasMethod)
     178            : Reply(ReplyType)
     179            , m_hasMethod(hasMethod)
     180        {
     181        }
     182       
     183        boolean_t m_hasMethod;
     184    };
     185
     186    struct NPObjectInvokeReply : public Reply {
     187        static const Reply::Type ReplyType = NPObjectInvoke;
     188       
     189        NPObjectInvokeReply(boolean_t returnValue, RetainPtr<CFDataRef> result)
     190            : Reply(ReplyType)
     191            , m_returnValue(returnValue)
     192            , m_result(result)
     193        {
     194        }
     195       
     196        boolean_t m_returnValue;
     197        RetainPtr<CFDataRef> m_result;
    155198    };
    156199   
     
    207250    // NPRuntime
    208251    uint32_t idForObject(JSC::JSObject*);
    209     void marshalValue(JSC::ExecState*, JSC::JSValuePtr value, data_t& resultData, mach_msg_type_number_t& resultLength);
     252   
     253    void marshalValue(JSC::ExecState*, JSC::JSValuePtr value, data_t& resultData, mach_msg_type_number_t& resultLength);   
     254    void addValueToArray(NSMutableArray *, JSC::ExecState* exec, JSC::JSValuePtr value);
     255   
    210256    bool demarshalValueFromArray(JSC::ExecState*, NSArray *array, NSUInteger& index, JSC::JSValuePtr& result);
    211257    void demarshalValues(JSC::ExecState*, data_t valuesData, mach_msg_type_number_t valuesLength, JSC::ArgList& result);
    212     JSC::JSValuePtr demarshalValue(JSC::ExecState*, data_t valueData, mach_msg_type_number_t valueLength);
    213258
    214259    uint32_t m_objectIDCounter;
  • trunk/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm

    r40086 r40124  
    4747#import <WebCore/FrameLoader.h>
    4848#import <WebCore/FrameTree.h>
     49#import <WebCore/runtime_object.h>
    4950#import <WebCore/ScriptController.h>
    5051#import <WebCore/ScriptValue.h>
     
    462463}
    463464   
    464 uint32_t NetscapePluginInstanceProxy::idForObject(JSC::JSObject* object)
     465uint32_t NetscapePluginInstanceProxy::idForObject(JSObject* object)
    465466{
    466467    uint32_t objectID = 0;
     
    611612}
    612613
    613 bool NetscapePluginInstanceProxy::getProperty(uint32_t objectID, const JSC::Identifier& propertyName, data_t &resultData, mach_msg_type_number_t& resultLength)
     614bool NetscapePluginInstanceProxy::getProperty(uint32_t objectID, const Identifier& propertyName, data_t& resultData, mach_msg_type_number_t& resultLength)
    614615{
    615616    JSObject* object = m_objects.get(objectID);
     
    630631}
    631632   
    632 bool NetscapePluginInstanceProxy::getProperty(uint32_t objectID, unsigned propertyName, data_t &resultData, mach_msg_type_number_t& resultLength)
     633bool NetscapePluginInstanceProxy::getProperty(uint32_t objectID, unsigned propertyName, data_t& resultData, mach_msg_type_number_t& resultLength)
    633634{
    634635    JSObject* object = m_objects.get(objectID);
     
    649650}
    650651
    651 bool NetscapePluginInstanceProxy::setProperty(uint32_t objectID, const JSC::Identifier& propertyName, data_t valueData, mach_msg_type_number_t valueLength)
     652bool NetscapePluginInstanceProxy::setProperty(uint32_t objectID, const Identifier& propertyName, data_t valueData, mach_msg_type_number_t valueLength)
    652653{
    653654    JSObject* object = m_objects.get(objectID);
     
    690691}
    691692
    692 bool NetscapePluginInstanceProxy::removeProperty(uint32_t objectID, const JSC::Identifier& propertyName)
     693bool NetscapePluginInstanceProxy::removeProperty(uint32_t objectID, const Identifier& propertyName)
    693694{
    694695    JSObject* object = m_objects.get(objectID);
     
    734735}
    735736
    736 bool NetscapePluginInstanceProxy::hasProperty(uint32_t objectID, const JSC::Identifier& propertyName)
     737bool NetscapePluginInstanceProxy::hasProperty(uint32_t objectID, const Identifier& propertyName)
    737738{
    738739    JSObject* object = m_objects.get(objectID);
     
    768769}
    769770   
    770 bool NetscapePluginInstanceProxy::hasMethod(uint32_t objectID, const JSC::Identifier& methodName)
     771bool NetscapePluginInstanceProxy::hasMethod(uint32_t objectID, const Identifier& methodName)
    771772{
    772773    JSObject* object = m_objects.get(objectID);
     
    785786}
    786787
     788void NetscapePluginInstanceProxy::addValueToArray(NSMutableArray *array, ExecState* exec, JSValuePtr value)
     789{
     790    JSLock lock(false);
     791
     792    if (value.isString()) {
     793        [array addObject:[NSNumber numberWithInt:StringValueType]];
     794        [array addObject:String(value.toString(exec))];
     795    } else if (value.isNumber()) {
     796        [array addObject:[NSNumber numberWithInt:DoubleValueType]];
     797        [array addObject:[NSNumber numberWithDouble:value.toNumber(exec)]];
     798    } else if (value.isBoolean()) {
     799        [array addObject:[NSNumber numberWithInt:BoolValueType]];
     800        [array addObject:[NSNumber numberWithDouble:value.toBoolean(exec)]];
     801    } else if (value.isNull())
     802        [array addObject:[NSNumber numberWithInt:NullValueType]];
     803    else if (value.isObject()) {
     804        JSObject* object = asObject(value);
     805        if (object->classInfo() == &RuntimeObjectImp::s_info) {
     806            // FIXME: Handle ProxyInstance objects.
     807            ASSERT_NOT_REACHED();
     808        } else {
     809            [array addObject:[NSNumber numberWithInt:ObjectValueType]];
     810            [array addObject:[NSNumber numberWithInt:idForObject(object)]];
     811        }
     812    } else
     813        [array addObject:[NSNumber numberWithInt:VoidValueType]];
     814}
     815
    787816void NetscapePluginInstanceProxy::marshalValue(ExecState* exec, JSValuePtr value, data_t& resultData, mach_msg_type_number_t& resultLength)
    788817{
    789818    RetainPtr<NSMutableArray*> array(AdoptNS, [[NSMutableArray alloc] init]);
    790819   
    791     JSLock lock(false);
    792 
    793     if (value.isString()) {
    794         [array.get() addObject:[NSNumber numberWithInt:StringValueType]];
    795         [array.get() addObject:String(value.toString(exec))];
    796     } else if (value.isNumber()) {
    797         [array.get() addObject:[NSNumber numberWithInt:DoubleValueType]];
    798         [array.get() addObject:[NSNumber numberWithDouble:value.toNumber(exec)]];
    799     } else if (value.isBoolean()) {
    800         [array.get() addObject:[NSNumber numberWithInt:BoolValueType]];
    801         [array.get() addObject:[NSNumber numberWithDouble:value.toBoolean(exec)]];
    802     } else if (value.isNull())
    803         [array.get() addObject:[NSNumber numberWithInt:NullValueType]];
    804     else if (value.isObject()) {
    805         [array.get() addObject:[NSNumber numberWithInt:ObjectValueType]];
    806         [array.get() addObject:[NSNumber numberWithInt:idForObject(asObject(value))]];
    807     } else
    808         [array.get() addObject:[NSNumber numberWithInt:VoidValueType]];
    809 
    810     RetainPtr<NSData*> data = [NSPropertyListSerialization dataFromPropertyList:array.get() format:NSPropertyListBinaryFormat_v1_0 errorDescription:0];
     820    addValueToArray(array.get(), exec, value);
     821
     822    RetainPtr<NSData *> data = [NSPropertyListSerialization dataFromPropertyList:array.get() format:NSPropertyListBinaryFormat_v1_0 errorDescription:0];
    811823    ASSERT(data);
    812824   
     
    816828    memcpy(resultData, [data.get() bytes], resultLength);
    817829}
     830
     831RetainPtr<NSData *> NetscapePluginInstanceProxy::marshalValues(ExecState* exec, const ArgList& args)
     832{
     833    RetainPtr<NSMutableArray*> array(AdoptNS, [[NSMutableArray alloc] init]);
     834
     835    for (unsigned i = 0; i < args.size(); i++)
     836        addValueToArray(array.get(), exec, args.at(exec, i));
     837
     838    RetainPtr<NSData *> data = [NSPropertyListSerialization dataFromPropertyList:array.get() format:NSPropertyListBinaryFormat_v1_0 errorDescription:0];
     839    ASSERT(data);
     840
     841    return data;
     842}   
    818843
    819844bool NetscapePluginInstanceProxy::demarshalValueFromArray(ExecState* exec, NSArray *array, NSUInteger& index, JSValuePtr& result)
     
    853878}
    854879
    855 JSValuePtr NetscapePluginInstanceProxy::demarshalValue(ExecState* exec, data_t valueData, mach_msg_type_number_t valueLength)
    856 {
    857     RetainPtr<NSData*> data(AdoptNS, [[NSData alloc] initWithBytesNoCopy:valueData length:valueLength freeWhenDone:NO]);
     880JSValuePtr NetscapePluginInstanceProxy::demarshalValue(ExecState* exec, const char* valueData, mach_msg_type_number_t valueLength)
     881{
     882    RetainPtr<NSData*> data(AdoptNS, [[NSData alloc] initWithBytesNoCopy:(void*)valueData length:valueLength freeWhenDone:NO]);
    858883
    859884    RetainPtr<NSArray*> array = [NSPropertyListSerialization propertyListFromData:data.get()
     
    883908}
    884909
    885 PassRefPtr<Instance> NetscapePluginInstanceProxy::createBindingsInstance(PassRefPtr<RootObject>)
     910PassRefPtr<Instance> NetscapePluginInstanceProxy::createBindingsInstance(PassRefPtr<RootObject> rootObject)
    886911{
    887912    if (_WKPHGetScriptableNPObject(m_pluginHostProxy->port(), m_pluginID) != KERN_SUCCESS)
     
    891916    if (!reply.get())
    892917        return 0;
    893    
    894     // FIXME: Implement
    895     return 0;
     918
     919    if (!reply->m_objectID)
     920        return 0;
     921
     922    return ProxyInstance::create(rootObject, this, reply->m_objectID);
    896923}
    897924
  • trunk/WebKit/mac/Plugins/Hosted/ProxyInstance.h

    r40086 r40124  
    3030
    3131#include <WebCore/runtime.h>
     32#include <WebCore/runtime_root.h>
     33#include <wtf/OwnPtr.h>
    3234
    3335namespace WebKit {
     36
     37class ProxyClass;
     38class NetscapePluginInstanceProxy;
     39   
     40class ProxyInstance : public JSC::Bindings::Instance {
     41public:
     42    static PassRefPtr<ProxyInstance> create(PassRefPtr<JSC::Bindings::RootObject> rootObject, NetscapePluginInstanceProxy* instanceProxy, uint32_t objectID)
     43    {
     44        return adoptRef(new ProxyInstance(rootObject, instanceProxy, objectID));
     45    }
     46    ~ProxyInstance();
     47
     48    JSC::Bindings::MethodList methodsNamed(const JSC::Identifier&);
     49    JSC::Bindings::Field* fieldNamed(const JSC::Identifier&);
     50
     51private:
     52    ProxyInstance(PassRefPtr<JSC::Bindings::RootObject>, NetscapePluginInstanceProxy*, uint32_t objectID);
     53   
     54    virtual JSC::Bindings::Class *getClass() const;
     55
     56    virtual JSC::JSValuePtr invokeMethod(JSC::ExecState*, const JSC::Bindings::MethodList&, const JSC::ArgList& args);
     57    virtual JSC::JSValuePtr defaultValue(JSC::ExecState*, JSC::PreferredPrimitiveType) const;
     58    virtual JSC::JSValuePtr valueOf(JSC::ExecState*) const;
     59   
     60    JSC::JSValuePtr stringValue(JSC::ExecState*) const;
     61    JSC::JSValuePtr numberValue(JSC::ExecState*) const;
     62    JSC::JSValuePtr booleanValue() const;
     63   
     64    NetscapePluginInstanceProxy* m_instanceProxy;
     65    uint32_t m_objectID;
     66    JSC::Bindings::FieldMap m_fields;
     67    JSC::Bindings::MethodMap m_methods;
     68};
     69   
    3470}
    3571
  • trunk/WebKit/mac/Plugins/Hosted/ProxyInstance.mm

    r40086 r40124  
    2828#import "ProxyInstance.h"
    2929
     30#import "NetscapePluginHostProxy.h"
     31#import "NetscapePluginInstanceProxy.h"
     32#import <WebCore/npruntime_impl.h>
     33
     34extern "C" {
     35#import "WebKitPluginHost.h"
     36}
     37
     38using namespace JSC;
     39using namespace JSC::Bindings;
     40using namespace std;
     41
    3042namespace WebKit {
    3143
     44class ProxyClass : public JSC::Bindings::Class {
     45private:
     46    virtual MethodList methodsNamed(const Identifier&, Instance*) const;
     47    virtual Field* fieldNamed(const Identifier&, Instance*) const;
     48};
     49
     50MethodList ProxyClass::methodsNamed(const Identifier& identifier, Instance* instance) const
     51{
     52    return static_cast<ProxyInstance*>(instance)->methodsNamed(identifier);
     53}
     54
     55Field* ProxyClass::fieldNamed(const Identifier& identifier, Instance* instance) const
     56{
     57    return static_cast<ProxyInstance*>(instance)->fieldNamed(identifier);
     58}
     59
     60ProxyClass* proxyClass()
     61{
     62    DEFINE_STATIC_LOCAL(ProxyClass, proxyClass, ());
     63    return &proxyClass;
     64}
     65   
     66class ProxyField : public JSC::Bindings::Field {
     67public:
     68    ProxyField(uint64_t serverIdentifier)
     69        : m_serverIdentifier(serverIdentifier)
     70    {
     71    }
     72   
     73private:
     74    virtual JSValuePtr valueFromInstance(ExecState*, const Instance*) const;
     75    virtual void setValueToInstance(ExecState*, const Instance*, JSValuePtr) const;
     76   
     77    uint64_t m_serverIdentifier;
     78};
     79
     80JSValuePtr ProxyField::valueFromInstance(ExecState*, const Instance*) const
     81{
     82    ASSERT_NOT_REACHED();
     83    return JSValuePtr();
     84}
     85   
     86void ProxyField::setValueToInstance(ExecState*, const Instance*, JSValuePtr) const
     87{
     88    ASSERT_NOT_REACHED();
     89}
     90
     91class ProxyMethod : public JSC::Bindings::Method {
     92public:
     93    ProxyMethod(uint64_t serverIdentifier)
     94        : m_serverIdentifier(serverIdentifier)
     95    {
     96    }
     97
     98    uint64_t serverIdentifier() const { return m_serverIdentifier; }
     99
     100private:
     101    virtual int numParameters() const { return 0; }
     102
     103    uint64_t m_serverIdentifier;
     104};
     105
     106ProxyInstance::ProxyInstance(PassRefPtr<RootObject> rootObject, NetscapePluginInstanceProxy* instanceProxy, uint32_t objectID)
     107    : Instance(rootObject)
     108    , m_instanceProxy(instanceProxy)
     109    , m_objectID(objectID)
     110{
     111}
     112
     113ProxyInstance::~ProxyInstance()
     114{
     115    deleteAllValues(m_fields);
     116    deleteAllValues(m_methods);
     117   
     118    // FIXME: Tell the host that we're no longer interested in this object.
     119}
     120   
     121JSC::Bindings::Class *ProxyInstance::getClass() const
     122{
     123    return proxyClass();
     124}
     125
     126JSValuePtr ProxyInstance::invokeMethod(ExecState* exec, const MethodList& methodList, const ArgList& args)
     127{
     128    ASSERT(methodList.size() == 1);
     129
     130    ProxyMethod* method = static_cast<ProxyMethod*>(methodList[0]);
     131
     132    RetainPtr<NSData*> arguments(m_instanceProxy->marshalValues(exec, args));
     133   
     134    if (_WKPHNPObjectInvoke(m_instanceProxy->hostProxy()->port(), m_instanceProxy->pluginID(), m_objectID,
     135                            method->serverIdentifier(), (char*)[arguments.get() bytes], [arguments.get() length]) != KERN_SUCCESS)
     136        return jsUndefined();
     137   
     138    auto_ptr<NetscapePluginInstanceProxy::NPObjectInvokeReply> reply = m_instanceProxy->waitForReply<NetscapePluginInstanceProxy::NPObjectInvokeReply>();
     139    if (!reply.get())
     140        return jsUndefined();
     141   
     142    return m_instanceProxy->demarshalValue(exec, (char*)CFDataGetBytePtr(reply->m_result.get()), CFDataGetLength(reply->m_result.get()));
     143}
     144   
     145JSValuePtr ProxyInstance::defaultValue(ExecState* exec, PreferredPrimitiveType hint) const
     146{
     147    if (hint == PreferString)
     148        return stringValue(exec);
     149    if (hint == PreferNumber)
     150        return numberValue(exec);
     151    return valueOf(exec);
     152}
     153
     154JSValuePtr ProxyInstance::stringValue(ExecState* exec) const
     155{
     156    // FIXME: Implement something sensible.
     157    return jsString(exec, "");
     158}
     159
     160JSValuePtr ProxyInstance::numberValue(ExecState* exec) const
     161{
     162    // FIXME: Implement something sensible.
     163    return jsNumber(exec, 0);
     164}
     165
     166JSValuePtr ProxyInstance::booleanValue() const
     167{
     168    // FIXME: Implement something sensible.
     169    return jsBoolean(false);
     170}
     171
     172JSValuePtr ProxyInstance::valueOf(ExecState* exec) const
     173{
     174    return stringValue(exec);
     175}
     176
     177MethodList ProxyInstance::methodsNamed(const Identifier& identifier)
     178{
     179    if (Method* method = m_methods.get(identifier.ustring().rep())) {
     180        MethodList methodList;
     181        methodList.append(method);
     182        return methodList;
     183    }
     184
     185    uint64_t methodName = reinterpret_cast<uint64_t>(_NPN_GetStringIdentifier(identifier.ascii()));
     186    if (_WKPHNPObjectHasMethod(m_instanceProxy->hostProxy()->port(),
     187                               m_instanceProxy->pluginID(),
     188                               m_objectID, methodName) != KERN_SUCCESS)
     189        return MethodList();
     190   
     191    auto_ptr<NetscapePluginInstanceProxy::NPObjectHasMethodReply> reply = m_instanceProxy->waitForReply<NetscapePluginInstanceProxy::NPObjectHasMethodReply>();
     192    if (reply.get() && reply->m_hasMethod) {
     193        Method* method = new ProxyMethod(methodName);
     194       
     195        m_methods.set(identifier.ustring().rep(), method);
     196   
     197        MethodList methodList;
     198        methodList.append(method);
     199        return methodList;
     200    }
     201
     202    return MethodList();
     203}
     204
     205Field* ProxyInstance::fieldNamed(const Identifier& identifier)
     206{
     207    if (Field* field = m_fields.get(identifier.ustring().rep()))
     208        return field;
     209   
     210    uint64_t propertyName = reinterpret_cast<uint64_t>(_NPN_GetStringIdentifier(identifier.ascii()));
     211    if (_WKPHNPObjectHasProperty(m_instanceProxy->hostProxy()->port(),
     212                                 m_instanceProxy->pluginID(),
     213                                 m_objectID, propertyName) != KERN_SUCCESS)
     214        return 0;
     215       
     216    auto_ptr<NetscapePluginInstanceProxy::NPObjectHasPropertyReply> reply = m_instanceProxy->waitForReply<NetscapePluginInstanceProxy::NPObjectHasPropertyReply>();
     217    if (reply.get() && reply->m_hasProperty) {
     218        Field* field = new ProxyField(propertyName);
     219       
     220        m_fields.set(identifier.ustring().rep(), field);
     221   
     222        return field;
     223    }
     224   
     225    return 0;
     226}
     227
    32228} // namespace WebKit
    33229
  • trunk/WebKit/mac/Plugins/Hosted/WebKitPluginClient.defs

    r40086 r40124  
    134134                    out returnValue :boolean_t);
    135135
     136routine IdentifierInfo(clientPort :mach_port_t;
     137                       identifier :uint64_t;
     138                       out info :data_t, dealloc);
     139
    136140// Replies
    137141simpleroutine InstantiatePluginReply(clientPort :mach_port_t;
     
    145149                                         objectID :uint32_t);
    146150
     151simpleroutine NPObjectHasPropertyReply(clientPort :mach_port_t;
     152                                       pluginID :uint32_t;
     153                                       hasProperty :boolean_t);
     154
     155simpleroutine NPObjectHasMethodReply(clientPort :mach_port_t;
     156                                     pluginID :uint32_t;
     157                                     hasMethod :boolean_t);
     158
     159simpleroutine NPObjectInvokeReply(clientPort :mach_port_t;
     160                                  pluginID :uint32_t;
     161                                  returnValue :boolean_t;
     162                                  result :data_t); 
    147163
    148164
  • trunk/WebKit/mac/Plugins/Hosted/WebKitPluginHost.defs

    r40086 r40124  
    125125                                    pluginID :uint32_t);
    126126
     127simpleroutine NPObjectHasProperty(pluginHostPort :mach_port_t;
     128                                  pluginID :uint32_t;
     129                                  objectID :uint32_t;
     130                                  propertyName :uint64_t);
     131
     132simpleroutine NPObjectHasMethod(pluginHostPort :mach_port_t;
     133                                pluginID :uint32_t;
     134                                objectID :uint32_t;
     135                                methodName :uint64_t);
     136
     137simpleroutine NPObjectInvoke(pluginHostPort :mach_port_t;
     138                             pluginID :uint32_t;
     139                             objectID :uint32_t;
     140                             methodName :uint64_t;
     141                             arguments :data_t);
     142
    127143// Replies
    128144
  • trunk/WebKit/mac/WebView/WebArchive.mm

    r40086 r40124  
    160160{
    161161#ifdef MAIL_THREAD_WORKAROUND
    162     if (needMailThreadWorkaround()) {
    163         // Maybe this could be done more cleanly with NSInvocation.
    164         NSMutableDictionary *arguments = [[NSMutableDictionary alloc] init];
    165         if (mainResource)
    166             [arguments setObject:mainResource forKey:@"mainResource"];
    167         if (subresources)
    168             [arguments setObject:subresources forKey:@"subresources"];
    169         if (subframeArchives)
    170             [arguments setObject:subframeArchives forKey:@"subframeArchives"];
    171 
    172         self = [self _webkit_performSelectorOnMainThread:@selector(_initWithArguments:) withObject:arguments];
    173         [arguments release];
    174         return self;
    175     }
     162    if (needMailThreadWorkaround())
     163        return [[self _webkit_invokeOnMainThread] initWithMainResource:mainResource subresources:subresources subframeArchives:subframeArchives];
    176164#endif
    177165
     
    297285#ifdef MAIL_THREAD_WORKAROUND
    298286    if (needMailThreadWorkaround())
    299         return [self _webkit_getPropertyOnMainThread:_cmd];
     287        return [[self _webkit_invokeOnMainThread] mainResource];
    300288#endif
    301289
     
    317305#ifdef MAIL_THREAD_WORKAROUND
    318306    if (needMailThreadWorkaround())
    319         return [self _webkit_getPropertyOnMainThread:_cmd];
     307        return [[self _webkit_invokeOnMainThread] subresources];
    320308#endif
    321309
     
    349337#ifdef MAIL_THREAD_WORKAROUND
    350338    if (needMailThreadWorkaround())
    351         return [self _webkit_getPropertyOnMainThread:_cmd];
     339        return [[self _webkit_invokeOnMainThread] subframeArchives];
    352340#endif
    353341
     
    423411
    424412@end
    425 
    426 #ifdef MAIL_THREAD_WORKAROUND
    427 
    428 @implementation WebArchive (WebMailThreadWorkaround)
    429 
    430 - (id)_initWithArguments:(NSDictionary *)arguments
    431 {
    432     WebResource *mainResource = [arguments objectForKey:@"mainResource"];
    433     NSArray *subresources = [arguments objectForKey:@"subresources"];
    434     NSArray *subframeArchives = [arguments objectForKey:@"subframeArchives"];
    435     return [self initWithMainResource:mainResource subresources:subresources subframeArchives:subframeArchives];
    436 }
    437 
    438 @end
    439 
    440 #endif
  • trunk/WebKit/mac/WebView/WebRenderNode.mm

    r40086 r40124  
    3333#import "WebHTMLView.h"
    3434#import <WebCore/Frame.h>
     35#import <WebCore/RenderText.h>
    3536#import <WebCore/RenderWidget.h>
    3637#import <WebCore/RenderView.h>
     
    8990    // FIXME: broken with transforms
    9091    FloatPoint absPos = node->localToAbsolute(FloatPoint());
     92    int x = 0;
     93    int y = 0;
     94    int width = 0;
     95    int height = 0;
     96    if (node->isBox()) {
     97        RenderBox* box = static_cast<RenderBox*>(node);
     98        x = box->x();
     99        y = box->y();
     100        width = box->width();
     101        height = box->height();
     102    } else if (node->isText()) {
     103        // FIXME: Preserve old behavior even though it's strange.
     104        RenderText* text = static_cast<RenderText*>(node);
     105        x = text->firstRunX();
     106        y = text->firstRunY();
     107        width = text->boundingBoxWidth();
     108        height = text->boundingBoxHeight();
     109    }
     110   
    91111    WebRenderNode *result = [[WebRenderNode alloc] initWithName:name
    92         position:absPos rect:NSMakeRect(node->xPos(), node->yPos(), node->width(), node->height())
     112        position:absPos rect:NSMakeRect(x, y, width, height)
    93113        view:view children:children];
    94114
  • trunk/WebKit/mac/WebView/WebResource.mm

    r40086 r40124  
    203203#ifdef MAIL_THREAD_WORKAROUND
    204204    if (needMailThreadWorkaround())
    205         return [self _webkit_getPropertyOnMainThread:_cmd];
     205        return [[self _webkit_invokeOnMainThread] data];
    206206#endif
    207207
     
    219219#ifdef MAIL_THREAD_WORKAROUND
    220220    if (needMailThreadWorkaround())
    221         return [self _webkit_getPropertyOnMainThread:_cmd];
     221        return [[self _webkit_invokeOnMainThread] URL];
    222222#endif
    223223
     
    234234#ifdef MAIL_THREAD_WORKAROUND
    235235    if (needMailThreadWorkaround())
    236         return [self _webkit_getPropertyOnMainThread:_cmd];
     236        return [[self _webkit_invokeOnMainThread] MIMEType];
    237237#endif
    238238
     
    249249#ifdef MAIL_THREAD_WORKAROUND
    250250    if (needMailThreadWorkaround())
    251         return [self _webkit_getPropertyOnMainThread:_cmd];
     251        return [[self _webkit_invokeOnMainThread] textEncodingName];
    252252#endif
    253253
     
    264264#ifdef MAIL_THREAD_WORKAROUND
    265265    if (needMailThreadWorkaround())
    266         return [self _webkit_getPropertyOnMainThread:_cmd];
     266        return [[self _webkit_invokeOnMainThread] frameName];
    267267#endif
    268268
     
    319319#ifdef MAIL_THREAD_WORKAROUND
    320320    if (needMailThreadWorkaround()) {
    321         [self performSelectorOnMainThread:_cmd withObject:nil waitUntilDone:TRUE];
     321        [[self _webkit_invokeOnMainThread] _ignoreWhenUnarchiving];
    322322        return;
    323323    }
     
    340340{
    341341#ifdef MAIL_THREAD_WORKAROUND
    342     if (needMailThreadWorkaround()) {
    343         // Maybe this could be done more cleanly with NSInvocation.
    344         NSMutableDictionary *arguments = [[NSMutableDictionary alloc] init];
    345         if (data)
    346             [arguments setObject:data forKey:@"data"];
    347         if (URL)
    348             [arguments setObject:URL forKey:@"URL"];
    349         if (MIMEType)
    350             [arguments setObject:MIMEType forKey:@"MIMEType"];
    351         if (textEncodingName)
    352             [arguments setObject:textEncodingName forKey:@"textEncodingName"];
    353         if (frameName)
    354             [arguments setObject:frameName forKey:@"frameName"];
    355         if (response)
    356             [arguments setObject:response forKey:@"response"];
    357         if (copyData)
    358             [arguments setObject:[NSNumber numberWithBool:YES] forKey:@"copyData"];
    359 
    360         self = [self _webkit_performSelectorOnMainThread:@selector(_initWithArguments:) withObject:arguments];
    361         [arguments release];
    362 
    363         return self;
    364     }
     342    if (needMailThreadWorkaround())
     343        return [[self _webkit_invokeOnMainThread] _initWithData:data URL:URL MIMEType:MIMEType textEncodingName:textEncodingName frameName:frameName response:response copyData:copyData];
    365344#endif
    366345
     
    375354        return nil;
    376355    }
    377            
     356
    378357    _private = [[WebResourcePrivate alloc] initWithCoreResource:ArchiveResource::create(SharedBuffer::wrapNSData(copyData ? [[data copy] autorelease] : data), URL, MIMEType, textEncodingName, frameName, response)];
    379            
     358
    380359    return self;
    381360}
     
    391370                     frameName:nil
    392371                      response:response
    393                       copyData:NO];   
     372                      copyData:NO];
    394373}
    395374
     
    398377#ifdef MAIL_THREAD_WORKAROUND
    399378    if (needMailThreadWorkaround())
    400         return [self _webkit_getPropertyOnMainThread:_cmd];
     379        return [[self _webkit_invokeOnMainThread] _suggestedFilename];
    401380#endif
    402381
     
    423402#ifdef MAIL_THREAD_WORKAROUND
    424403    if (needMailThreadWorkaround())
    425         return [self _webkit_getPropertyOnMainThread:_cmd];
     404        return [[self _webkit_invokeOnMainThread] _response];
    426405#endif
    427406
     
    438417#ifdef MAIL_THREAD_WORKAROUND
    439418    if (needMailThreadWorkaround())
    440         return [self _webkit_getPropertyOnMainThread:_cmd];
     419        return [[self _webkit_invokeOnMainThread] _stringValue];
    441420#endif
    442421
     
    466445}
    467446
    468 - (id)_initWithArguments:(NSDictionary *)arguments
    469 {
    470     NSData *data = [arguments objectForKey:@"data"];
    471     NSURL *URL = [arguments objectForKey:@"URL"];
    472     NSString *MIMEType = [arguments objectForKey:@"MIMEType"];
    473     NSString *textEncodingName = [arguments objectForKey:@"textEncodingName"];
    474     NSString *frameName = [arguments objectForKey:@"frameName"];
    475     NSURLResponse *response = [arguments objectForKey:@"response"];
    476     BOOL copyData = [[arguments objectForKey:@"copyData"] boolValue];
    477     return [self _initWithData:data URL:URL MIMEType:MIMEType textEncodingName:textEncodingName frameName:frameName response:response copyData:copyData];
    478 }
    479 
    480 @end
    481 
    482 #endif
     447@end
     448
     449#endif
  • trunk/WebKit/mac/WebView/WebView.mm

    r40086 r40124  
    22802280- (id)initWithFrame:(NSRect)f frameName:(NSString *)frameName groupName:(NSString *)groupName
    22812281{
    2282     if (needsWebViewInitThreadWorkaround()) {
    2283         NSMutableDictionary *arguments = [[NSMutableDictionary alloc] initWithCapacity:3];
    2284         [arguments setObject:[NSValue valueWithRect:f] forKey:@"frame"];
    2285         if (frameName)
    2286             [arguments setObject:frameName forKey:@"frameName"];
    2287         if (groupName)
    2288             [arguments setObject:groupName forKey:@"groupName"];
    2289 
    2290         self = [self _webkit_performSelectorOnMainThread:@selector(_initWithArguments:) withObject:arguments];
    2291         [arguments release];
    2292         return self;
    2293     }
     2282    if (needsWebViewInitThreadWorkaround())
     2283        return [[self _webkit_invokeOnMainThread] initWithFrame:f frameName:frameName groupName:groupName];
    22942284
    22952285    WebCoreThreadViolationCheck();
     
    22992289- (id)initWithCoder:(NSCoder *)decoder
    23002290{
    2301     if (needsWebViewInitThreadWorkaround()) {
    2302         NSDictionary *arguments = [[NSDictionary alloc] initWithObjectsAndKeys:decoder, @"decoder", nil];
    2303         self = [self _webkit_performSelectorOnMainThread:@selector(_initWithArguments:) withObject:arguments];
    2304         [arguments release];
    2305         return self;
    2306     }
     2291    if (needsWebViewInitThreadWorkaround())
     2292        return [[self _webkit_invokeOnMainThread] initWithCoder:decoder];
    23072293
    23082294    WebCoreThreadViolationCheck();
  • trunk/WebKitTools/ChangeLog

    r40086 r40124  
     12009-01-21  Pierre-Olivier Latour  <pol@apple.com>
     2
     3        Tweaked earlier fix to only print a warning when Perian is installed,
     4        and fail completely only if attempting to generate new pixel test results.
     5
     6        https://bugs.webkit.org/show_bug.cgi?id=23392
     7
     8        * Scripts/run-webkit-tests:
     9
    1102009-01-20  Darin Adler  <darin@apple.com>
    211
  • trunk/WebKitTools/Scripts/run-webkit-tests

    r40086 r40124  
    307307die "can't find executable $imageDiffTool (looked in $productDir)\n" if $pixelTests && !-x $imageDiffTool;
    308308
    309 die "You can't run pixel tests if Perian's QuickTime component is installed as it affects the results\n\thttps://bugs.webkit.org/show_bug.cgi?id=22615\n" if $pixelTests && isPerianInstalled();
     309die "You can't generate new pixel test results if Perian's QuickTime component is installed as it may affect the results\n\thttps://bugs.webkit.org/show_bug.cgi?id=22615\n" if $resetResults && $pixelTests && isPerianInstalled();
     310print "WARNING: Perian's QuickTime component is installed and this may affect pixel test results!!!\n\thttps://bugs.webkit.org/show_bug.cgi?id=22615\n" if $pixelTests && isPerianInstalled();
    310311
    311312checkFrameworks() unless isCygwin();
Note: See TracChangeset for help on using the changeset viewer.