bool WebVTTParser::parseFloatPercentageValuePair(VTTScanner& valueScanner, char delimiter, FloatPoint& valuePair) { float firstCoord; if (!parseFloatPercentageValue(valueScanner, firstCoord)) return false; if (!valueScanner.scan(delimiter)) return false; float secondCoord; if (!parseFloatPercentageValue(valueScanner, secondCoord)) return false; valuePair = FloatPoint(firstCoord, secondCoord); return true; }
VTTCue::CueSetting VTTCue::settingName(VTTScanner& input) { CueSetting parsedSetting = None; if (input.scan("vertical")) parsedSetting = Vertical; else if (input.scan("line")) parsedSetting = Line; else if (input.scan("position")) parsedSetting = Position; else if (input.scan("size")) parsedSetting = Size; else if (input.scan("align")) parsedSetting = Align; else if (RuntimeEnabledFeatures::webVTTRegionsEnabled() && input.scan("region")) parsedSetting = RegionId; // Verify that a ':' follows. if (parsedSetting != None && input.scan(':')) return parsedSetting; return None; }
VTTRegion::RegionSetting VTTRegion::scanSettingName(VTTScanner& input) { if (input.scan("id")) return Id; if (input.scan("height")) return Height; if (input.scan("width")) return Width; if (input.scan("viewportanchor")) return ViewportAnchor; if (input.scan("regionanchor")) return RegionAnchor; if (input.scan("scroll")) return Scroll; return None; }
VTTCue::CueSetting VTTCue::settingName(VTTScanner& input) { CueSetting parsedSetting = None; if (input.scan("vertical")) parsedSetting = Vertical; else if (input.scan("line")) parsedSetting = Line; else if (input.scan("position")) parsedSetting = Position; else if (input.scan("size")) parsedSetting = Size; else if (input.scan("align")) parsedSetting = Align; #if ENABLE(WEBVTT_REGIONS) else if (input.scan("region")) parsedSetting = RegionId; #endif // Verify that a ':' follows. if (parsedSetting != None && input.scan(':')) return parsedSetting; return None; }