#include "CSSStyleSelector.h"
#include "Chrome.h"
#include "Console.h"
+#include "Crypto.h"
#include "DOMApplicationCache.h"
#include "DOMSelection.h"
#include "DOMSettableTokenList.h"
window.setHeight(min(max(100.0f, window.height()), screen.height()));
// Constrain the window position to the screen.
- window.setX(max(screen.x(), min(window.x(), screen.right() - window.width())));
- window.setY(max(screen.y(), min(window.y(), screen.bottom() - window.height())));
+ window.setX(max(screen.x(), min(window.x(), screen.maxX() - window.width())));
+ window.setY(max(screen.y(), min(window.y(), screen.maxY() - window.height())));
}
// FIXME: We can remove this function once V8 showModalDialog is changed to use DOMWindow.
m_history->disconnectFrame();
m_history = 0;
+ m_crypto = 0;
+
if (m_locationbar)
m_locationbar->disconnectFrame();
m_locationbar = 0;
return m_history.get();
}
+Crypto* DOMWindow::crypto() const
+{
+ if (!m_crypto)
+ m_crypto = Crypto::create();
+ return m_crypto.get();
+}
+
BarInfo* DOMWindow::locationbar() const
{
if (!m_locationbar)
return String();
}
-static bool isSafeToConvertCharList(const String& string)
-{
- for (unsigned i = 0; i < string.length(); i++) {
- if (string[i] > 0xFF)
- return false;
- }
-
- return true;
-}
-
String DOMWindow::btoa(const String& stringToEncode, ExceptionCode& ec)
{
if (stringToEncode.isNull())
return String();
- if (!isSafeToConvertCharList(stringToEncode)) {
+ if (!stringToEncode.containsOnlyLatin1()) {
ec = INVALID_CHARACTER_ERR;
return String();
}
- Vector<char> in;
- in.append(stringToEncode.characters(), stringToEncode.length());
- Vector<char> out;
-
- base64Encode(in, out);
-
- return String(out.data(), out.size());
+ return base64Encode(stringToEncode.latin1());
}
String DOMWindow::atob(const String& encodedString, ExceptionCode& ec)
if (encodedString.isNull())
return String();
- if (!isSafeToConvertCharList(encodedString)) {
+ if (!encodedString.containsOnlyLatin1()) {
ec = INVALID_CHARACTER_ERR;
return String();
}
ownerElement->dispatchGenericEvent(ownerEvent.release());
}
- InspectorInstrumentation::mainResourceFiredLoadEvent(frame(), url());
+ InspectorInstrumentation::loadEventFired(frame(), url());
}
bool DOMWindow::dispatchEvent(PassRefPtr<Event> prpEvent, PassRefPtr<EventTarget> prpTarget)
*startTime = currentTime();
dispatchEvent(event, target);
*endTime = currentTime();
- ASSERT(*endTime >= *startTime);
}
void DOMWindow::removeAllEventListeners()