From 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Tue, 27 Jun 2017 06:07:23 +0000 Subject: webkitgtk-2.16.5 --- Source/WebCore/page/WindowFeatures.h | 71 ++++++++++++------------------------ 1 file changed, 23 insertions(+), 48 deletions(-) (limited to 'Source/WebCore/page/WindowFeatures.h') diff --git a/Source/WebCore/page/WindowFeatures.h b/Source/WebCore/page/WindowFeatures.h index 43a0b1ba2..d46a75a02 100644 --- a/Source/WebCore/page/WindowFeatures.h +++ b/Source/WebCore/page/WindowFeatures.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003, 2007, 2010 Apple Inc. All rights reserved. + * Copyright (C) 2003, 2007, 2010, 2016 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -10,7 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of + * 3. Neither the name of Apple Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * @@ -26,10 +26,11 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef WindowFeatures_h -#define WindowFeatures_h +#pragma once -#include +#include +#include +#include #include namespace WebCore { @@ -37,53 +38,27 @@ namespace WebCore { class FloatRect; struct WindowFeatures { - WindowFeatures() - : xSet(false) - , ySet(false) - , widthSet(false) - , heightSet(false) - , menuBarVisible(true) - , statusBarVisible(true) - , toolBarVisible(true) - , locationBarVisible(true) - , scrollbarsVisible(true) - , resizable(true) - , fullscreen(false) - , dialog(false) - { - } - explicit WindowFeatures(const String& windowFeaturesString); - WindowFeatures(const String& dialogFeaturesString, const FloatRect& screenAvailableRect); + std::optional x; + std::optional y; + std::optional width; + std::optional height; - float x; - bool xSet; - float y; - bool ySet; - float width; - bool widthSet; - float height; - bool heightSet; + bool menuBarVisible { true }; + bool statusBarVisible { true }; + bool toolBarVisible { true }; + bool locationBarVisible { true }; + bool scrollbarsVisible { true }; + bool resizable { true }; - bool menuBarVisible; - bool statusBarVisible; - bool toolBarVisible; - bool locationBarVisible; - bool scrollbarsVisible; - bool resizable; - - bool fullscreen; - bool dialog; + bool fullscreen { false }; + bool dialog { false }; Vector additionalFeatures; - -private: - typedef HashMap DialogFeaturesMap; - static void parseDialogFeatures(const String&, HashMap&); - static bool boolFeature(const DialogFeaturesMap&, const char* key, bool defaultValue = false); - static float floatFeature(const DialogFeaturesMap&, const char* key, float min, float max, float defaultValue); - void setWindowFeature(const String& keyString, const String& valueString); }; -} // namespace WebCore +WindowFeatures parseWindowFeatures(StringView windowFeaturesString); +WindowFeatures parseDialogFeatures(const String& dialogFeaturesString, const FloatRect& screenAvailableRect); -#endif // WindowFeatures_h +void processFeaturesString(StringView features, std::function callback); + +} // namespace WebCore -- cgit v1.2.1