2010-08-30 Maciej Stachowiak <mjs@apple.com>
authormjs@apple.com <mjs@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Sep 2010 11:08:08 +0000 (11:08 +0000)
committermjs@apple.com <mjs@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Sep 2010 11:08:08 +0000 (11:08 +0000)
commitd3a360f622518aceedff02fc855658efc19b5bb4
tree5a9aac568b09cc75eebca9bb6c17dee45cce863b
parent2ee80f1e9a25c1afc0892c8070d1e9ce7ede42a4
2010-08-30  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin Adler.

        Handle MediaQueryExp memory management exclusively with smart pointers
        https://bugs.webkit.org/show_bug.cgi?id=44874

        Implemented a non-copying sort function to make it possible to sort a Vector
        of OwnPtrs (which cannot be copied). This is required for the above.

        * wtf/NonCopyingSort.h: Added.
        (WTF::nonCopyingSort): It's secretly heapsort.
        (WTF::heapSort): heapsort implementation.
        (WTF::siftDown): Helper function for heapsort.
        (WTF::heapify): ditto

        Adjust build systems.

        * GNUmakefile.am:
        * JavaScriptCore.gypi:
        * JavaScriptCore.vcproj/WTF/WTF.vcproj:
        * JavaScriptCore.xcodeproj/project.pbxproj:
2010-08-30  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin Adler.

        Handle MediaQueryExp memory management exclusively with smart pointers
        https://bugs.webkit.org/show_bug.cgi?id=44874

        Gace MediaQueryExp a create function, made the constructor private, and followed
        the implications. The one tricky bit was using a non-copying sort to sort
        the Vector<OwnPtr<MediaQueryExp> > in the MediaQuery constructor.

        * ForwardingHeaders/wtf/NonCopyingSort.h: Added.
        * css/CSSGrammar.y:
        * css/CSSParser.cpp:
        (WebCore::CSSParser::~CSSParser):
        (WebCore::CSSParser::createFloatingMediaQueryExp):
        (WebCore::CSSParser::createFloatingMediaQueryExpList):
        (WebCore::CSSParser::sinkFloatingMediaQueryExpList):
        (WebCore::CSSParser::createFloatingMediaQuery):
        * css/CSSParser.h:
        * css/MediaList.cpp:
        * css/MediaQuery.cpp:
        (WebCore::expressionCompare):
        (WebCore::MediaQuery::MediaQuery):
        (WebCore::MediaQuery::~MediaQuery):
        * css/MediaQuery.h:
        (WebCore::MediaQuery::expressions):
        * css/MediaQueryEvaluator.cpp:
        (WebCore::MediaQueryEvaluator::eval):
        * css/MediaQueryExp.h:
        (WebCore::MediaQueryExp::create):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66968 268f45cc-cd09-0410-ab3c-d52691b4dbfc
17 files changed:
JavaScriptCore/ChangeLog
JavaScriptCore/GNUmakefile.am
JavaScriptCore/JavaScriptCore.gypi
JavaScriptCore/JavaScriptCore.vcproj/WTF/WTF.vcproj
JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
JavaScriptCore/wtf/NonCopyingSort.h [new file with mode: 0644]
WebCore/ChangeLog
WebCore/ForwardingHeaders/wtf/NonCopyingSort.h [new file with mode: 0644]
WebCore/css/CSSGrammar.y
WebCore/css/CSSParser.cpp
WebCore/css/CSSParser.h
WebCore/css/MediaList.cpp
WebCore/css/MediaQuery.cpp
WebCore/css/MediaQuery.h
WebCore/css/MediaQueryEvaluator.cpp
WebCore/css/MediaQueryExp.cpp
WebCore/css/MediaQueryExp.h