hexsha
stringlengths
40
40
size
int64
5
1.05M
ext
stringclasses
98 values
lang
stringclasses
21 values
max_stars_repo_path
stringlengths
3
945
max_stars_repo_name
stringlengths
4
118
max_stars_repo_head_hexsha
stringlengths
40
78
max_stars_repo_licenses
listlengths
1
10
max_stars_count
int64
1
368k
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
max_issues_repo_path
stringlengths
3
945
max_issues_repo_name
stringlengths
4
118
max_issues_repo_head_hexsha
stringlengths
40
78
max_issues_repo_licenses
listlengths
1
10
max_issues_count
int64
1
134k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
3
945
max_forks_repo_name
stringlengths
4
135
max_forks_repo_head_hexsha
stringlengths
40
78
max_forks_repo_licenses
listlengths
1
10
max_forks_count
int64
1
105k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
content
stringlengths
5
1.05M
avg_line_length
float64
1
1.03M
max_line_length
int64
2
1.03M
alphanum_fraction
float64
0
1
f57acf59aa0126fed78aaafaba74cf3c06794307
32,564
cpp
C++
src/CaptureClient/ApiEventProcessorTest.cpp
guruantree/orbit
c59eea66e4dc8313fecef9524850bf58c8ba8c30
[ "BSD-2-Clause" ]
null
null
null
src/CaptureClient/ApiEventProcessorTest.cpp
guruantree/orbit
c59eea66e4dc8313fecef9524850bf58c8ba8c30
[ "BSD-2-Clause" ]
null
null
null
src/CaptureClient/ApiEventProcessorTest.cpp
guruantree/orbit
c59eea66e4dc8313fecef9524850bf58c8ba8c30
[ "BSD-2-Clause" ]
null
null
null
// Copyright (c) 2020 The Orbit Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include <gmock/gmock.h> #include <google/protobuf/util/message_differencer.h> #include <gtest/gtest.h> #include <algorithm> #include <vector> #include "ApiUtils/EncodedString.h" #include "CaptureClient/ApiEventProcessor.h" #include "CaptureClient/CaptureEventProcessor.h" #include "CaptureClient/CaptureListener.h" #include "OrbitBase/Profiling.h" #include "OrbitBase/ThreadUtils.h" #include "capture.pb.h" namespace orbit_capture_client { using orbit_client_protos::CallstackInfo; using orbit_client_protos::TimerInfo; using google::protobuf::util::MessageDifferencer; using ::testing::Invoke; using ::testing::SaveArg; using orbit_grpc_protos::ApiEvent; using orbit_grpc_protos::ClientCaptureEvent; namespace { class MockCaptureListener : public CaptureListener { public: MOCK_METHOD(void, OnCaptureStarted, (const orbit_grpc_protos::CaptureStarted&, std::optional<std::filesystem::path>, absl::flat_hash_set<uint64_t>), (override)); MOCK_METHOD(void, OnCaptureFinished, (const orbit_grpc_protos::CaptureFinished&), (override)); MOCK_METHOD(void, OnTimer, (const TimerInfo&), (override)); MOCK_METHOD(void, OnKeyAndString, (uint64_t /*key*/, std::string), (override)); MOCK_METHOD(void, OnUniqueCallstack, (uint64_t /*callstack_id*/, CallstackInfo /*callstack*/), (override)); MOCK_METHOD(void, OnCallstackEvent, (orbit_client_protos::CallstackEvent), (override)); MOCK_METHOD(void, OnThreadName, (uint32_t /*thread_id*/, std::string /*thread_name*/), (override)); MOCK_METHOD(void, OnThreadStateSlice, (orbit_client_protos::ThreadStateSliceInfo), (override)); MOCK_METHOD(void, OnAddressInfo, (orbit_client_protos::LinuxAddressInfo), (override)); MOCK_METHOD(void, OnUniqueTracepointInfo, (uint64_t /*key*/, orbit_grpc_protos::TracepointInfo /*tracepoint_info*/), (override)); MOCK_METHOD(void, OnTracepointEvent, (orbit_client_protos::TracepointEventInfo), (override)); MOCK_METHOD(void, OnModuleUpdate, (uint64_t /*timestamp_ns*/, orbit_grpc_protos::ModuleInfo /*module_info*/), (override)); MOCK_METHOD(void, OnModulesSnapshot, (uint64_t /*timestamp_ns*/, std::vector<orbit_grpc_protos::ModuleInfo> /*module_infos*/), (override)); MOCK_METHOD(void, OnApiStringEvent, (const orbit_client_protos::ApiStringEvent&), (override)); MOCK_METHOD(void, OnApiTrackValue, (const orbit_client_protos::ApiTrackValue&), (override)); MOCK_METHOD(void, OnWarningEvent, (orbit_grpc_protos::WarningEvent /*warning_event*/), (override)); MOCK_METHOD(void, OnClockResolutionEvent, (orbit_grpc_protos::ClockResolutionEvent /*clock_resolution_event*/), (override)); MOCK_METHOD( void, OnErrorsWithPerfEventOpenEvent, (orbit_grpc_protos::ErrorsWithPerfEventOpenEvent /*errors_with_perf_event_open_event*/), (override)); MOCK_METHOD(void, OnErrorEnablingOrbitApiEvent, (orbit_grpc_protos::ErrorEnablingOrbitApiEvent /*error_enabling_orbit_api_event*/), (override)); MOCK_METHOD(void, OnErrorEnablingUserSpaceInstrumentationEvent, (orbit_grpc_protos::ErrorEnablingUserSpaceInstrumentationEvent /*error_event*/), (override)); MOCK_METHOD( void, OnWarningInstrumentingWithUserSpaceInstrumentationEvent, (orbit_grpc_protos::WarningInstrumentingWithUserSpaceInstrumentationEvent /*warning_event*/), (override)); MOCK_METHOD(void, OnLostPerfRecordsEvent, (orbit_grpc_protos::LostPerfRecordsEvent /*lost_perf_records_event*/), (override)); MOCK_METHOD( void, OnOutOfOrderEventsDiscardedEvent, (orbit_grpc_protos::OutOfOrderEventsDiscardedEvent /*out_of_order_events_discarded_event*/), (override)); }; class ApiEventProcessorTest : public ::testing::Test { public: ApiEventProcessorTest() : api_event_processor_{&capture_listener_} {} protected: void SetUp() override {} void TearDown() override {} static orbit_grpc_protos::ApiScopeStart CreateStartScope( const char* name, uint64_t timestamp_ns, int32_t process_id, int32_t thread_id, uint64_t group_id, uint64_t address_in_function, orbit_api_color color = kOrbitColorAuto) { orbit_grpc_protos::ApiScopeStart result; result.set_timestamp_ns(timestamp_ns); result.set_pid(process_id); result.set_tid(thread_id); result.set_color_rgba(color); result.set_group_id(group_id); result.set_address_in_function(address_in_function); orbit_api::EncodeString(name, &result); return result; } static orbit_grpc_protos::ApiScopeStop CreateStopScope(uint64_t timestamp_ns, int32_t process_id, int32_t thread_id) { orbit_grpc_protos::ApiScopeStop result; result.set_timestamp_ns(timestamp_ns); result.set_pid(process_id); result.set_tid(thread_id); return result; } static orbit_grpc_protos::ApiScopeStartAsync CreateStartScopeAsync( const char* name, uint64_t timestamp_ns, int32_t process_id, int32_t thread_id, uint64_t id, uint64_t address_in_function, orbit_api_color color = kOrbitColorAuto) { orbit_grpc_protos::ApiScopeStartAsync result; result.set_timestamp_ns(timestamp_ns); result.set_pid(process_id); result.set_tid(thread_id); result.set_color_rgba(color); result.set_id(id); result.set_address_in_function(address_in_function); orbit_api::EncodeString(name, &result); return result; } static orbit_grpc_protos::ApiScopeStopAsync CreateStopScopeAsync(uint64_t timestamp_ns, int32_t process_id, int32_t thread_id, uint64_t id) { orbit_grpc_protos::ApiScopeStopAsync result; result.set_timestamp_ns(timestamp_ns); result.set_pid(process_id); result.set_tid(thread_id); result.set_id(id); return result; } static orbit_grpc_protos::ApiStringEvent CreateStringEvent(uint64_t timestamp_ns, int32_t process_id, int32_t thread_id, uint64_t id, const char* name) { orbit_grpc_protos::ApiStringEvent result; result.set_timestamp_ns(timestamp_ns); result.set_pid(process_id); result.set_tid(thread_id); result.set_id(id); orbit_api::EncodeString(name, &result); return result; } static orbit_client_protos::ApiStringEvent CreateClientStringEvent(uint64_t timestamp_ns, int32_t process_id, int32_t thread_id, uint64_t id, const char* name) { orbit_client_protos::ApiStringEvent result; result.set_timestamp_ns(timestamp_ns); result.set_process_id(process_id); result.set_thread_id(thread_id); result.set_async_scope_id(id); result.set_name(name); return result; } template <typename DataType, typename ProtoType> static ProtoType CreateTrackValue(uint64_t timestamp_ns, int32_t process_id, int32_t thread_id, const char* name, DataType data) { ProtoType result; result.set_timestamp_ns(timestamp_ns); result.set_pid(process_id); result.set_tid(thread_id); result.set_data(data); orbit_api::EncodeString(name, &result); return result; } template <typename DataType> static orbit_client_protos::ApiTrackValue CreateClientTrackValue( uint64_t timestamp_ns, int32_t process_id, int32_t thread_id, const char* name, void (orbit_client_protos::ApiTrackValue::*set_data)(DataType), DataType data) { orbit_client_protos::ApiTrackValue result; result.set_timestamp_ns(timestamp_ns); result.set_process_id(process_id); result.set_thread_id(thread_id); result.set_name(name); (result.*set_data)(data); return result; } [[deprecated]] static orbit_grpc_protos::ApiEvent CreateApiEventLegacy( int32_t pid, int32_t tid, uint64_t timestamp_ns, orbit_api::EventType type, const char* name = nullptr, uint64_t data = 0, orbit_api_color color = kOrbitColorAuto) { orbit_api::EncodedEvent encoded_event(type, name, data, color); ApiEvent api_event; api_event.set_timestamp_ns(timestamp_ns); api_event.set_pid(pid); api_event.set_tid(tid); api_event.set_r0(encoded_event.args[0]); api_event.set_r1(encoded_event.args[1]); api_event.set_r2(encoded_event.args[2]); api_event.set_r3(encoded_event.args[3]); api_event.set_r4(encoded_event.args[4]); api_event.set_r5(encoded_event.args[5]); return api_event; } static orbit_client_protos::TimerInfo CreateTimerInfo(uint64_t start, uint64_t end, int32_t process_id, int32_t thread_id, const char* name, uint32_t depth, uint64_t group_id, uint64_t async_scope_id, uint64_t address_in_function, TimerInfo::Type type) { orbit_client_protos::TimerInfo timer; timer.set_start(start); timer.set_end(end); timer.set_process_id(process_id); timer.set_thread_id(thread_id); timer.set_api_scope_name(name); timer.set_type(type); timer.set_group_id(group_id); timer.set_api_async_scope_id(async_scope_id); timer.set_address_in_function(address_in_function); timer.set_depth(depth); return timer; } MockCaptureListener capture_listener_; ApiEventProcessor api_event_processor_; static constexpr int32_t kProcessId = 42; static constexpr int32_t kThreadId1 = 12; static constexpr int32_t kThreadId2 = 13; static constexpr uint64_t kGroupId = 77; static constexpr uint64_t kId1 = 89; static constexpr uint64_t kId2 = 99; static constexpr uint64_t kId3 = 109; static constexpr uint64_t kAddressInFunction = 111; }; } // namespace TEST_F(ApiEventProcessorTest, ScopesFromSameThread) { auto start_0 = CreateStartScope("Scope0", 1, kProcessId, kThreadId1, kGroupId, kAddressInFunction); auto start_1 = CreateStartScope("Scope1", 2, kProcessId, kThreadId1, kGroupId, kAddressInFunction); auto start_2 = CreateStartScope("Scope2", 3, kProcessId, kThreadId1, kGroupId, kAddressInFunction); auto stop_2 = CreateStopScope(4, kProcessId, kThreadId1); auto stop_1 = CreateStopScope(5, kProcessId, kThreadId1); auto stop_0 = CreateStopScope(6, kProcessId, kThreadId1); EXPECT_CALL(capture_listener_, OnTimer).Times(0); api_event_processor_.ProcessApiScopeStart(start_0); api_event_processor_.ProcessApiScopeStart(start_1); api_event_processor_.ProcessApiScopeStart(start_2); ::testing::Mock::VerifyAndClearExpectations(&capture_listener_); std::vector<orbit_client_protos::TimerInfo> actual_timers; EXPECT_CALL(capture_listener_, OnTimer) .Times(3) .WillRepeatedly( Invoke([&actual_timers](const TimerInfo& timer) { actual_timers.push_back(timer); })); api_event_processor_.ProcessApiScopeStop(stop_2); api_event_processor_.ProcessApiScopeStop(stop_1); api_event_processor_.ProcessApiScopeStop(stop_0); auto expected_timer_2 = CreateTimerInfo(3, 4, kProcessId, kThreadId1, "Scope2", 2, kGroupId, 0, kAddressInFunction, TimerInfo::kApiScope); auto expected_timer_1 = CreateTimerInfo(2, 5, kProcessId, kThreadId1, "Scope1", 1, kGroupId, 0, kAddressInFunction, TimerInfo::kApiScope); auto expected_timer_0 = CreateTimerInfo(1, 6, kProcessId, kThreadId1, "Scope0", 0, kGroupId, 0, kAddressInFunction, TimerInfo::kApiScope); ASSERT_THAT(actual_timers.size(), 3); EXPECT_TRUE(MessageDifferencer::Equivalent(expected_timer_2, actual_timers[0])); EXPECT_TRUE(MessageDifferencer::Equivalent(expected_timer_1, actual_timers[1])); EXPECT_TRUE(MessageDifferencer::Equivalent(expected_timer_0, actual_timers[2])); } TEST_F(ApiEventProcessorTest, ScopesFromDifferentThreads) { auto start_0 = CreateStartScope("Scope0", 1, kProcessId, kThreadId1, kGroupId, kAddressInFunction); auto start_1 = CreateStartScope("Scope1", 2, kProcessId, kThreadId2, kGroupId, kAddressInFunction); auto stop_2 = CreateStopScope(4, kProcessId, kThreadId1); auto stop_1 = CreateStopScope(5, kProcessId, kThreadId2); EXPECT_CALL(capture_listener_, OnTimer).Times(0); api_event_processor_.ProcessApiScopeStart(start_0); api_event_processor_.ProcessApiScopeStart(start_1); ::testing::Mock::VerifyAndClearExpectations(&capture_listener_); std::vector<orbit_client_protos::TimerInfo> actual_timers; EXPECT_CALL(capture_listener_, OnTimer) .Times(2) .WillRepeatedly( Invoke([&actual_timers](const TimerInfo& timer) { actual_timers.push_back(timer); })); api_event_processor_.ProcessApiScopeStop(stop_2); api_event_processor_.ProcessApiScopeStop(stop_1); auto expected_timer_0 = CreateTimerInfo(1, 4, kProcessId, kThreadId1, "Scope0", 0, kGroupId, 0, kAddressInFunction, TimerInfo::kApiScope); auto expected_timer_1 = CreateTimerInfo(2, 5, kProcessId, kThreadId2, "Scope1", 0, kGroupId, 0, kAddressInFunction, TimerInfo::kApiScope); ASSERT_THAT(actual_timers.size(), 2); EXPECT_TRUE(MessageDifferencer::Equivalent(expected_timer_0, actual_timers[0])); EXPECT_TRUE(MessageDifferencer::Equivalent(expected_timer_1, actual_timers[1])); } TEST_F(ApiEventProcessorTest, AsyncScopes) { auto start_0 = CreateStartScopeAsync("AsyncScope0", 1, kProcessId, kThreadId1, kId1, kAddressInFunction); auto start_1 = CreateStartScopeAsync("AsyncScope1", 2, kProcessId, kThreadId1, kId2, kAddressInFunction); auto start_2 = CreateStartScopeAsync("AsyncScope2", 3, kProcessId, kThreadId1, kId3, kAddressInFunction); auto stop_2 = CreateStopScopeAsync(4, kProcessId, kThreadId1, kId3); auto stop_1 = CreateStopScopeAsync(5, kProcessId, kThreadId1, kId2); auto stop_0 = CreateStopScopeAsync(6, kProcessId, kThreadId1, kId1); EXPECT_CALL(capture_listener_, OnTimer).Times(0); api_event_processor_.ProcessApiScopeStartAsync(start_0); api_event_processor_.ProcessApiScopeStartAsync(start_1); api_event_processor_.ProcessApiScopeStartAsync(start_2); ::testing::Mock::VerifyAndClearExpectations(&capture_listener_); std::vector<orbit_client_protos::TimerInfo> actual_timers; EXPECT_CALL(capture_listener_, OnTimer) .Times(3) .WillRepeatedly( Invoke([&actual_timers](const TimerInfo& timer) { actual_timers.push_back(timer); })); api_event_processor_.ProcessApiScopeStopAsync(stop_2); api_event_processor_.ProcessApiScopeStopAsync(stop_1); api_event_processor_.ProcessApiScopeStopAsync(stop_0); auto expected_timer_2 = CreateTimerInfo(3, 4, kProcessId, kThreadId1, "AsyncScope2", 0, 0, kId3, kAddressInFunction, TimerInfo::kApiScopeAsync); auto expected_timer_1 = CreateTimerInfo(2, 5, kProcessId, kThreadId1, "AsyncScope1", 0, 0, kId2, kAddressInFunction, TimerInfo::kApiScopeAsync); auto expected_timer_0 = CreateTimerInfo(1, 6, kProcessId, kThreadId1, "AsyncScope0", 0, 0, kId1, kAddressInFunction, TimerInfo::kApiScopeAsync); ASSERT_THAT(actual_timers.size(), 3); EXPECT_TRUE(MessageDifferencer::Equivalent(expected_timer_2, actual_timers[0])); EXPECT_TRUE(MessageDifferencer::Equivalent(expected_timer_1, actual_timers[1])); EXPECT_TRUE(MessageDifferencer::Equivalent(expected_timer_0, actual_timers[2])); } TEST_F(ApiEventProcessorTest, StringEvent) { auto string_event = CreateStringEvent(1, kProcessId, kThreadId1, kId1, "Some string for this id"); auto expected_string_event = CreateClientStringEvent(1, kProcessId, kThreadId1, kId1, "Some string for this id"); orbit_client_protos::ApiStringEvent actual_string_event; EXPECT_CALL(capture_listener_, OnApiStringEvent) .Times(1) .WillOnce(SaveArg<0>(&actual_string_event)); api_event_processor_.ProcessApiStringEvent(string_event); EXPECT_TRUE(MessageDifferencer::Equivalent(expected_string_event, actual_string_event)); } TEST_F(ApiEventProcessorTest, TrackDouble) { auto track_double = CreateTrackValue<double, orbit_grpc_protos::ApiTrackDouble>( 1, kProcessId, kThreadId1, "Some name", 3.14); auto expected_track_value = CreateClientTrackValue<double>(1, kProcessId, kThreadId1, "Some name", &orbit_client_protos::ApiTrackValue::set_data_double, 3.14); orbit_client_protos::ApiTrackValue actual_track_value; EXPECT_CALL(capture_listener_, OnApiTrackValue) .Times(1) .WillOnce(SaveArg<0>(&actual_track_value)); api_event_processor_.ProcessApiTrackDouble(track_double); EXPECT_TRUE(MessageDifferencer::Equivalent(expected_track_value, actual_track_value)); } TEST_F(ApiEventProcessorTest, TrackFloat) { auto track_float = CreateTrackValue<float, orbit_grpc_protos::ApiTrackFloat>( 1, kProcessId, kThreadId1, "Some name", 3.14f); auto expected_track_value = CreateClientTrackValue<float>(1, kProcessId, kThreadId1, "Some name", &orbit_client_protos::ApiTrackValue::set_data_float, 3.14f); orbit_client_protos::ApiTrackValue actual_track_value; EXPECT_CALL(capture_listener_, OnApiTrackValue) .Times(1) .WillOnce(SaveArg<0>(&actual_track_value)); api_event_processor_.ProcessApiTrackFloat(track_float); EXPECT_TRUE(MessageDifferencer::Equivalent(expected_track_value, actual_track_value)); } TEST_F(ApiEventProcessorTest, TrackInt) { auto track_int = CreateTrackValue<int32_t, orbit_grpc_protos::ApiTrackInt>( 1, kProcessId, kThreadId1, "Some name", 3); auto expected_track_value = CreateClientTrackValue<int32_t>( 1, kProcessId, kThreadId1, "Some name", &orbit_client_protos::ApiTrackValue::set_data_int, 3); orbit_client_protos::ApiTrackValue actual_track_value; EXPECT_CALL(capture_listener_, OnApiTrackValue) .Times(1) .WillOnce(SaveArg<0>(&actual_track_value)); api_event_processor_.ProcessApiTrackInt(track_int); EXPECT_TRUE(MessageDifferencer::Equivalent(expected_track_value, actual_track_value)); } TEST_F(ApiEventProcessorTest, TrackInt64) { auto track_int64 = CreateTrackValue<int64_t, orbit_grpc_protos::ApiTrackInt64>( 1, kProcessId, kThreadId1, "Some name", 3); auto expected_track_value = CreateClientTrackValue<int64_t>(1, kProcessId, kThreadId1, "Some name", &orbit_client_protos::ApiTrackValue::set_data_int64, 3); orbit_client_protos::ApiTrackValue actual_track_value; EXPECT_CALL(capture_listener_, OnApiTrackValue) .Times(1) .WillOnce(SaveArg<0>(&actual_track_value)); api_event_processor_.ProcessApiTrackInt64(track_int64); EXPECT_TRUE(MessageDifferencer::Equivalent(expected_track_value, actual_track_value)); } TEST_F(ApiEventProcessorTest, TrackUint) { auto track_uint = CreateTrackValue<uint32_t, orbit_grpc_protos::ApiTrackUint>( 1, kProcessId, kThreadId1, "Some name", 3); auto expected_track_value = CreateClientTrackValue<uint32_t>(1, kProcessId, kThreadId1, "Some name", &orbit_client_protos::ApiTrackValue::set_data_uint, 3); orbit_client_protos::ApiTrackValue actual_track_value; EXPECT_CALL(capture_listener_, OnApiTrackValue) .Times(1) .WillOnce(SaveArg<0>(&actual_track_value)); api_event_processor_.ProcessApiTrackUint(track_uint); EXPECT_TRUE(MessageDifferencer::Equivalent(expected_track_value, actual_track_value)); } TEST_F(ApiEventProcessorTest, TrackUint64) { auto track_uint64 = CreateTrackValue<uint64_t, orbit_grpc_protos::ApiTrackUint64>( 1, kProcessId, kThreadId1, "Some name", 3); auto expected_track_value = CreateClientTrackValue<uint64_t>(1, kProcessId, kThreadId1, "Some name", &orbit_client_protos::ApiTrackValue::set_data_uint64, 3); orbit_client_protos::ApiTrackValue actual_track_value; EXPECT_CALL(capture_listener_, OnApiTrackValue) .Times(1) .WillOnce(SaveArg<0>(&actual_track_value)); api_event_processor_.ProcessApiTrackUint64(track_uint64); EXPECT_TRUE(MessageDifferencer::Equivalent(expected_track_value, actual_track_value)); } TEST_F(ApiEventProcessorTest, ScopesFromSameThreadLegacy) { ApiEvent start_0 = CreateApiEventLegacy(kProcessId, kThreadId1, 1, orbit_api::EventType::kScopeStart, "Scope0"); ApiEvent start_1 = CreateApiEventLegacy(kProcessId, kThreadId1, 2, orbit_api::EventType::kScopeStart, "Scope1"); ApiEvent start_2 = CreateApiEventLegacy(kProcessId, kThreadId1, 3, orbit_api::EventType::kScopeStart, "Scope2"); ApiEvent stop_2 = CreateApiEventLegacy(kProcessId, kThreadId1, 4, orbit_api::EventType::kScopeStop); ApiEvent stop_1 = CreateApiEventLegacy(kProcessId, kThreadId1, 5, orbit_api::EventType::kScopeStop); ApiEvent stop_0 = CreateApiEventLegacy(kProcessId, kThreadId1, 6, orbit_api::EventType::kScopeStop); EXPECT_CALL(capture_listener_, OnTimer).Times(0); api_event_processor_.ProcessApiEventLegacy(start_0); api_event_processor_.ProcessApiEventLegacy(start_1); api_event_processor_.ProcessApiEventLegacy(start_2); ::testing::Mock::VerifyAndClearExpectations(&capture_listener_); std::vector<orbit_client_protos::TimerInfo> actual_timers; EXPECT_CALL(capture_listener_, OnTimer) .Times(3) .WillRepeatedly( Invoke([&actual_timers](const TimerInfo& timer) { actual_timers.push_back(timer); })); api_event_processor_.ProcessApiEventLegacy(stop_2); api_event_processor_.ProcessApiEventLegacy(stop_1); api_event_processor_.ProcessApiEventLegacy(stop_0); auto expected_timer_2 = CreateTimerInfo(3, 4, kProcessId, kThreadId1, "Scope2", 2, 0, 0, 0, TimerInfo::kApiScope); auto expected_timer_1 = CreateTimerInfo(2, 5, kProcessId, kThreadId1, "Scope1", 1, 0, 0, 0, TimerInfo::kApiScope); auto expected_timer_0 = CreateTimerInfo(1, 6, kProcessId, kThreadId1, "Scope0", 0, 0, 0, 0, TimerInfo::kApiScope); ASSERT_THAT(actual_timers.size(), 3); EXPECT_TRUE(MessageDifferencer::Equivalent(expected_timer_2, actual_timers[0])); EXPECT_TRUE(MessageDifferencer::Equivalent(expected_timer_1, actual_timers[1])); EXPECT_TRUE(MessageDifferencer::Equivalent(expected_timer_0, actual_timers[2])); } TEST_F(ApiEventProcessorTest, ScopesFromDifferentThreadsLegacy) { auto start_0 = CreateApiEventLegacy(kProcessId, kThreadId1, 1, orbit_api::EventType::kScopeStart, "Scope0"); auto start_1 = CreateApiEventLegacy(kProcessId, kThreadId2, 2, orbit_api::EventType::kScopeStart, "Scope1"); auto stop_0 = CreateApiEventLegacy(kProcessId, kThreadId1, 4, orbit_api::EventType::kScopeStop); auto stop_1 = CreateApiEventLegacy(kProcessId, kThreadId2, 5, orbit_api::EventType::kScopeStop); EXPECT_CALL(capture_listener_, OnTimer).Times(0); api_event_processor_.ProcessApiEventLegacy(start_0); api_event_processor_.ProcessApiEventLegacy(start_1); ::testing::Mock::VerifyAndClearExpectations(&capture_listener_); std::vector<orbit_client_protos::TimerInfo> actual_timers; EXPECT_CALL(capture_listener_, OnTimer) .Times(2) .WillRepeatedly( Invoke([&actual_timers](const TimerInfo& timer) { actual_timers.push_back(timer); })); api_event_processor_.ProcessApiEventLegacy(stop_0); api_event_processor_.ProcessApiEventLegacy(stop_1); auto expected_timer_0 = CreateTimerInfo(1, 4, kProcessId, kThreadId1, "Scope0", 0, 0, 0, 0, TimerInfo::kApiScope); auto expected_timer_1 = CreateTimerInfo(2, 5, kProcessId, kThreadId2, "Scope1", 0, 0, 0, 0, TimerInfo::kApiScope); ASSERT_THAT(actual_timers.size(), 2); EXPECT_TRUE(MessageDifferencer::Equivalent(expected_timer_0, actual_timers[0])); EXPECT_TRUE(MessageDifferencer::Equivalent(expected_timer_1, actual_timers[1])); } TEST_F(ApiEventProcessorTest, AsyncScopesLegacy) { auto start_0 = CreateApiEventLegacy(kProcessId, kThreadId1, 1, orbit_api::EventType::kScopeStartAsync, "AsyncScope0", kId1); auto start_1 = CreateApiEventLegacy(kProcessId, kThreadId1, 2, orbit_api::EventType::kScopeStartAsync, "AsyncScope1", kId2); auto start_2 = CreateApiEventLegacy(kProcessId, kThreadId1, 3, orbit_api::EventType::kScopeStartAsync, "AsyncScope2", kId3); auto stop_2 = CreateApiEventLegacy(kProcessId, kThreadId1, 4, orbit_api::EventType::kScopeStopAsync, nullptr, kId3); auto stop_1 = CreateApiEventLegacy(kProcessId, kThreadId1, 5, orbit_api::EventType::kScopeStopAsync, nullptr, kId2); auto stop_0 = CreateApiEventLegacy(kProcessId, kThreadId1, 6, orbit_api::EventType::kScopeStopAsync, nullptr, kId1); EXPECT_CALL(capture_listener_, OnTimer).Times(0); api_event_processor_.ProcessApiEventLegacy(start_0); api_event_processor_.ProcessApiEventLegacy(start_1); api_event_processor_.ProcessApiEventLegacy(start_2); ::testing::Mock::VerifyAndClearExpectations(&capture_listener_); std::vector<orbit_client_protos::TimerInfo> actual_timers; EXPECT_CALL(capture_listener_, OnTimer) .Times(3) .WillRepeatedly( Invoke([&actual_timers](const TimerInfo& timer) { actual_timers.push_back(timer); })); api_event_processor_.ProcessApiEventLegacy(stop_2); api_event_processor_.ProcessApiEventLegacy(stop_1); api_event_processor_.ProcessApiEventLegacy(stop_0); auto expected_timer_2 = CreateTimerInfo(3, 4, kProcessId, kThreadId1, "AsyncScope2", 0, 0, kId3, 0, TimerInfo::kApiScopeAsync); auto expected_timer_1 = CreateTimerInfo(2, 5, kProcessId, kThreadId1, "AsyncScope1", 0, 0, kId2, 0, TimerInfo::kApiScopeAsync); auto expected_timer_0 = CreateTimerInfo(1, 6, kProcessId, kThreadId1, "AsyncScope0", 0, 0, kId1, 0, TimerInfo::kApiScopeAsync); ASSERT_THAT(actual_timers.size(), 3); EXPECT_TRUE(MessageDifferencer::Equivalent(expected_timer_2, actual_timers[0])); EXPECT_TRUE(MessageDifferencer::Equivalent(expected_timer_1, actual_timers[1])); EXPECT_TRUE(MessageDifferencer::Equivalent(expected_timer_0, actual_timers[2])); } TEST_F(ApiEventProcessorTest, StringEventLegacy) { auto string_event = CreateApiEventLegacy(kProcessId, kThreadId1, 1, orbit_api::EventType::kString, "Some string for this id", kId1); auto expected_string_event = CreateClientStringEvent(1, kProcessId, kThreadId1, kId1, "Some string for this id"); orbit_client_protos::ApiStringEvent actual_string_event; EXPECT_CALL(capture_listener_, OnApiStringEvent) .Times(1) .WillOnce(SaveArg<0>(&actual_string_event)); api_event_processor_.ProcessApiEventLegacy(string_event); EXPECT_TRUE(MessageDifferencer::Equivalent(expected_string_event, actual_string_event)); } TEST_F(ApiEventProcessorTest, TrackDoubleLegacy) { auto track_double = CreateApiEventLegacy(kProcessId, kThreadId1, 1, orbit_api::EventType::kTrackDouble, "Some name", orbit_api::Encode<uint64_t>(3.14)); auto expected_track_value = CreateClientTrackValue<double>(1, kProcessId, kThreadId1, "Some name", &orbit_client_protos::ApiTrackValue::set_data_double, 3.14); orbit_client_protos::ApiTrackValue actual_track_value; EXPECT_CALL(capture_listener_, OnApiTrackValue) .Times(1) .WillOnce(SaveArg<0>(&actual_track_value)); api_event_processor_.ProcessApiEventLegacy(track_double); EXPECT_TRUE(MessageDifferencer::Equivalent(expected_track_value, actual_track_value)); } TEST_F(ApiEventProcessorTest, TrackFloatLegacy) { auto track_float = CreateApiEventLegacy(kProcessId, kThreadId1, 1, orbit_api::EventType::kTrackFloat, "Some name", orbit_api::Encode<uint64_t>(3.14f)); auto expected_track_value = CreateClientTrackValue<float>(1, kProcessId, kThreadId1, "Some name", &orbit_client_protos::ApiTrackValue::set_data_float, 3.14f); orbit_client_protos::ApiTrackValue actual_track_value; EXPECT_CALL(capture_listener_, OnApiTrackValue) .Times(1) .WillOnce(SaveArg<0>(&actual_track_value)); api_event_processor_.ProcessApiEventLegacy(track_float); EXPECT_TRUE(MessageDifferencer::Equivalent(expected_track_value, actual_track_value)); } TEST_F(ApiEventProcessorTest, TrackIntLegacy) { auto track_int = CreateApiEventLegacy(kProcessId, kThreadId1, 1, orbit_api::EventType::kTrackInt, "Some name", orbit_api::Encode<uint64_t>(3)); auto expected_track_value = CreateClientTrackValue<int32_t>( 1, kProcessId, kThreadId1, "Some name", &orbit_client_protos::ApiTrackValue::set_data_int, 3); orbit_client_protos::ApiTrackValue actual_track_value; EXPECT_CALL(capture_listener_, OnApiTrackValue) .Times(1) .WillOnce(SaveArg<0>(&actual_track_value)); api_event_processor_.ProcessApiEventLegacy(track_int); EXPECT_TRUE(MessageDifferencer::Equivalent(expected_track_value, actual_track_value)); } TEST_F(ApiEventProcessorTest, TrackInt64Legacy) { auto track_int64 = CreateApiEventLegacy(kProcessId, kThreadId1, 1, orbit_api::EventType::kTrackInt64, "Some name", orbit_api::Encode<uint64_t>(3)); auto expected_track_value = CreateClientTrackValue<int64_t>(1, kProcessId, kThreadId1, "Some name", &orbit_client_protos::ApiTrackValue::set_data_int64, 3); orbit_client_protos::ApiTrackValue actual_track_value; EXPECT_CALL(capture_listener_, OnApiTrackValue) .Times(1) .WillOnce(SaveArg<0>(&actual_track_value)); api_event_processor_.ProcessApiEventLegacy(track_int64); EXPECT_TRUE(MessageDifferencer::Equivalent(expected_track_value, actual_track_value)); } TEST_F(ApiEventProcessorTest, TrackUintLegacy) { auto track_uint = CreateApiEventLegacy(kProcessId, kThreadId1, 1, orbit_api::EventType::kTrackUint, "Some name", orbit_api::Encode<uint64_t>(3)); auto expected_track_value = CreateClientTrackValue<uint32_t>(1, kProcessId, kThreadId1, "Some name", &orbit_client_protos::ApiTrackValue::set_data_uint, 3); orbit_client_protos::ApiTrackValue actual_track_value; EXPECT_CALL(capture_listener_, OnApiTrackValue) .Times(1) .WillOnce(SaveArg<0>(&actual_track_value)); api_event_processor_.ProcessApiEventLegacy(track_uint); EXPECT_TRUE(MessageDifferencer::Equivalent(expected_track_value, actual_track_value)); } TEST_F(ApiEventProcessorTest, TrackUint64Legacy) { auto track_uint64 = CreateApiEventLegacy(kProcessId, kThreadId1, 1, orbit_api::EventType::kTrackUint64, "Some name", orbit_api::Encode<uint64_t>(3)); auto expected_track_value = CreateClientTrackValue<uint64_t>(1, kProcessId, kThreadId1, "Some name", &orbit_client_protos::ApiTrackValue::set_data_uint64, 3); orbit_client_protos::ApiTrackValue actual_track_value; EXPECT_CALL(capture_listener_, OnApiTrackValue) .Times(1) .WillOnce(SaveArg<0>(&actual_track_value)); api_event_processor_.ProcessApiEventLegacy(track_uint64); EXPECT_TRUE(MessageDifferencer::Equivalent(expected_track_value, actual_track_value)); } } // namespace orbit_capture_client
42.678899
100
0.722239
04d40f9e787b564f642642ee7994d11a5d03a4e8
9,674
java
Java
springboot/springboot-jdbc-druid/src/main/java/com/example/springbootdruid/config/MultiDataSourceRegister.java
offline7LY/demo
c6b8f21a305a5e5f21730549eff3056026acba69
[ "Apache-2.0" ]
null
null
null
springboot/springboot-jdbc-druid/src/main/java/com/example/springbootdruid/config/MultiDataSourceRegister.java
offline7LY/demo
c6b8f21a305a5e5f21730549eff3056026acba69
[ "Apache-2.0" ]
null
null
null
springboot/springboot-jdbc-druid/src/main/java/com/example/springbootdruid/config/MultiDataSourceRegister.java
offline7LY/demo
c6b8f21a305a5e5f21730549eff3056026acba69
[ "Apache-2.0" ]
null
null
null
package com.example.springbootdruid.config; import com.alibaba.druid.filter.Filter; import com.alibaba.druid.pool.DruidDataSource; import com.example.springbootdruid.filter.DispatchPartitionFilter; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.MutablePropertyValues; import org.springframework.beans.factory.support.BeanDefinitionRegistry; import org.springframework.beans.factory.support.GenericBeanDefinition; import org.springframework.boot.context.properties.bind.Bindable; import org.springframework.boot.context.properties.bind.Binder; import org.springframework.boot.context.properties.source.ConfigurationPropertyName; import org.springframework.boot.context.properties.source.ConfigurationPropertyNameAliases; import org.springframework.boot.context.properties.source.ConfigurationPropertySource; import org.springframework.boot.context.properties.source.MapConfigurationPropertySource; import org.springframework.context.EnvironmentAware; import org.springframework.context.annotation.ImportBeanDefinitionRegistrar; import org.springframework.core.env.Environment; import org.springframework.core.type.AnnotationMetadata; import org.springframework.util.StringUtils; import javax.sql.DataSource; import java.sql.SQLException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; /** * @Title: MultiDataSourceRegister * @Package com/example/springbootdruid/config/MultiDataSourceRegister.java * @Description: 多数据源支持, 自定义方式注入到spring容器中, 使用时根据key动态使用 * {@see org.springframework.boot.jdbc.DataSourceBuilder} * * <dependency> * <groupId>com.baomidou</groupId> * <artifactId>dynamic-datasource-spring-boot-starter</artifactId> * <version>3.3.1</version> * </dependency> * 上述pom开源处理1主多从, 可以参考 * @author zhaozhiwei * @date 2021/7/5 下午9:35 * @version V1.0 */ public class MultiDataSourceRegister implements EnvironmentAware, ImportBeanDefinitionRegistrar { private static final Logger logger = LoggerFactory.getLogger(MultiDataSourceRegister.class); //别名 private final static ConfigurationPropertyNameAliases aliases = new ConfigurationPropertyNameAliases(); static { //由于部分数据源配置不同,所以在此处添加别名,避免切换数据源出现某些参数无法注入的情况 aliases.addAliases("url", new String[]{"jdbc-url"}); aliases.addAliases("username", new String[]{"user"}); } /** * 配置上下文(也可以理解为配置文件的获取工具) */ private Environment evn; /** * 数据源列表 */ private Map<String, DataSource> customDataSources; /** * 参数绑定工具 */ private Binder binder; private boolean isSuportJTA() { boolean suportJta = binder.bind("spring.datasource.jta", Boolean.class).get(); return suportJta; } /** * ImportBeanDefinitionRegistrar接口的实现方法,通过该方法可以按照自己的方式注册bean * * @param annotationMetadata * @param beanDefinitionRegistry * {@see com.lx.demo.config.DataSourceConfigDynamic#dataSource} */ @Override public void registerBeanDefinitions(AnnotationMetadata annotationMetadata, BeanDefinitionRegistry beanDefinitionRegistry) { logger.info("注册默认数据源开始"); if (!binder.bind("spring.datasource", Map.class).isBound()) { return; } //获取所有数据源配置 Map config, properties, defaultConfig, atomikosConfig = null; defaultConfig = binder.bind("spring.datasource", Map.class).get(); defaultConfig.put("type", "com.alibaba.druid.pool.DruidDataSource"); customDataSources = new HashMap<>(); //默认配置 properties = defaultConfig; //默认数据源类型 String typeStr = (String) properties.get("type"); String defaultTargetKey = "default"; //获取数据源类型 Class<? extends DataSource> clazz = getDataSourceType(typeStr); //绑定默认数据源参数 DataSource consumerDatasource, defaultDatasource = bind(clazz, properties); addFilters(defaultDatasource); boolean openMulti = binder.bind("spring.datasource.openmulti", Boolean.class).get(); logger.info("注册默认数据源{}成功",defaultTargetKey); if(openMulti && binder.bind("spring.datasource.multi", Map.class).isBound()) { //获取其他数据源配置 List<Map> configs = binder.bind("spring.datasource.multi", Bindable.listOf(Map.class)).get(); //遍历生成其他数据源 for (Map map : configs) { config = map; //获取extend字段,未定义或为true则为继承状态 if ((boolean) config.getOrDefault("extend", Boolean.TRUE)) { //继承默认数据源配置 properties = new HashMap(defaultConfig); //添加数据源参数 properties.putAll(config); } else { //不继承默认配置 properties = config; } //绑定参数 if (properties.containsKey("type")) { Class<? extends DataSource> clazz1 = getDataSourceType((String) properties.get("type")); consumerDatasource = bind(clazz1, properties); } else { consumerDatasource = bind(clazz, properties); } // 获取数据源的key,以便通过该key可以定位到数据源 String key = properties.get("key").toString(); //获取数据源的key,以便通过该key可以定位到数据源 addFilters(consumerDatasource); customDataSources.put(key, consumerDatasource); logger.info("注册数据源{}成功", key); } } //bean定义类 GenericBeanDefinition define = new GenericBeanDefinition(); //设置bean的类型,此处MultiDataSource是继承AbstractRoutingDataSource的实现类 define.setBeanClass(MultiDataSource.class); //需要注入的参数,类似spring配置文件中的<property/> MutablePropertyValues mpv = define.getPropertyValues(); //添加默认数据源,避免key不存在的情况没有数据源可用 mpv.add("defaultTargetDataSource", defaultDatasource); //添加其他数据源, 可以增加多个从数据源, 利用反射直接塞到父类 // com.example.springbootdruid.config.MultiDataSource // | // | // \/ //org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource mpv.add("targetDataSources", customDataSources); //将该bean注册为datasource,不使用springboot自动生成的datasource beanDefinitionRegistry.registerBeanDefinition("datasource", define); // BeanDefinitionRegistry registry = ((BeanDefinitionRegistry) ((DefaultListableBeanFactory) beanDefinitionRegistry).getParentBeanFactory()); // registry.registerBeanDefinition("datasource", define); logger.info("注册数据源成功,一共注册{}个数据源", customDataSources.keySet().size() + 1); } /** * 通过字符串获取数据源class对象 * * @param typeStr * @return */ private Class<? extends DataSource> getDataSourceType(String typeStr) { Class<? extends DataSource> type; try { //字符串不为空则通过反射获取class对象 if (StringUtils.hasLength(typeStr)) { type = (Class<? extends DataSource>) Class.forName(typeStr); } else { //默认为hikariCP数据源,与springboot默认数据源保持一致 type = DruidDataSource.class; } return type; } catch (Exception e) { //无法通过反射获取class对象的情况则抛出异常,该情况一般是写错了,所以此次抛出一个runtimeexception throw new IllegalArgumentException("can not resolve class with type: " + typeStr); } } /** * 绑定参数,以下三个方法都是参考DataSourceBuilder的bind方法实现的,目的是尽量保证我们自己添加的数据源构造过程与springboot保持一致 * * @param result * @param properties */ private void bind(DataSource result, Map properties) { ConfigurationPropertySource source = new MapConfigurationPropertySource(properties); Binder binder = new Binder(new ConfigurationPropertySource[]{source.withAliases(aliases)}); //将参数绑定到对象 binder.bind(ConfigurationPropertyName.EMPTY, Bindable.ofInstance(result)); } private <T extends DataSource> T bind(Class<T> clazz, Map properties) { ConfigurationPropertySource source = new MapConfigurationPropertySource(properties); Binder binder = new Binder(new ConfigurationPropertySource[]{source.withAliases(aliases)}); //通过类型绑定参数并获得实例对象 return binder.bind(ConfigurationPropertyName.EMPTY, Bindable.of(clazz)).get(); } /** * @param clazz * @param sourcePath 参数路径,对应配置文件中的值,如: spring.datasource * @param <T> * @return */ private <T extends DataSource> T bind(Class<T> clazz, String sourcePath) { Map properties = binder.bind(sourcePath, Map.class).get(); return bind(clazz, properties); } private void addFilters(DataSource dataSource) { if (dataSource instanceof DruidDataSource) { DruidDataSource druidDataSource = (DruidDataSource) dataSource; List<Filter> filters = new ArrayList<Filter>(); // if(DbTypeUtil.DB_TYPE_POLARDB.equals(DbTypeUtil.getPhysicsDbType())) { // 增加数据源过滤器,处理特殊业务 filters.add(new DispatchPartitionFilter()); // } druidDataSource.setProxyFilters(filters); try { druidDataSource.addFilters("config"); } catch (SQLException e) { e.printStackTrace(); } } } /** * EnvironmentAware接口的实现方法,通过aware的方式注入,此处是environment对象 * * @param environment */ @Override public void setEnvironment(Environment environment) { this.evn = environment; //绑定配置器 binder = Binder.get(evn); } }
38.851406
148
0.657329
e8e8b8176423c6bd8c7379484511cbc12b862f8a
3,568
hpp
C++
include/defs.hpp
Josh-MB/Information-Theory-Potts-Model
74e4c61d2f1bdbc345431fb1d4bade2b5b08f055
[ "MIT" ]
null
null
null
include/defs.hpp
Josh-MB/Information-Theory-Potts-Model
74e4c61d2f1bdbc345431fb1d4bade2b5b08f055
[ "MIT" ]
null
null
null
include/defs.hpp
Josh-MB/Information-Theory-Potts-Model
74e4c61d2f1bdbc345431fb1d4bade2b5b08f055
[ "MIT" ]
null
null
null
#pragma once #include <random> #include <cmath> #include <algorithm> #include <functional> #include <vector> #include <iostream> #include <numeric> using u8 = char; //Set to 5 since we are only using the 5-state model u8 constexpr numStates = 5; int constexpr CURRENT_DOS_FILE_VER = 3; int constexpr CURRENT_GTE_FILE_VER = 4; int constexpr numNeighbourhoods = 9; // Used for aggregating neighbours in GTE reduced int constexpr numSiteEnergy = 5; // Number of possible energy values for a given site (-4, -3, -2, -1, 0) constexpr int neighbour_sites = 4; using Hist = std::vector<size_t>; //Helper macros for wrapping lattice coordinates inline size_t wrap_minus(size_t u, size_t L1) {return (u == 0) ? L1 : u - 1; }; // -1 with lattice wrap inline size_t wrap_plus(size_t u, size_t L1) {return (u == L1) ? 0 : u + 1; }; // +1 with lattice wrap //Helper functions for accumulating and clearing histograms template <class T> inline void clear_and_resize_vec(std::vector<T> & v) {auto sz = v.size(); v.clear(); v.resize(sz, 0); }; inline void acc_hist(Hist& source, Hist& dest) {std::transform(source.begin(), source.end(), dest.begin(), dest.begin(), std::plus<size_t>()); }; inline void acc_thread_hists(std::vector<Hist>& threadHists, Hist& dest) { for (auto& v : threadHists) { std::transform(v.begin(), v.end(), dest.begin(), dest.begin(), std::plus<size_t>()); clear_and_resize_vec(v); } } inline int sgn(int const val) { return (0 < val) - (val < 0); } inline int make_idx(int const x, const int y, const int L) { return y * L + x; } // Wraps x in boundaries of L. i.e returns // 0 if x == L, L-1 if x==-1 or x otherwise inline int wrap(int const x, int const L) { return x + ((x == L)*-L) + ((x == -1)*L); } //Works out the wrapped difference inline int unwrap(int const x, int const L) { if(x == L - 1) return -1; else if(x == 1 - L) return 1; else return x; } //Helpers for write data to binary file #define BIN_WRITE(var, type, num, file) if(fwrite(&var, sizeof(type), num, file) != num) {PEEXIT("write failed");} #define BIN_WRITE_PTR(var, type, num, file) if(fwrite(var, sizeof(type), num, file) != num) {PEEXIT("write failed");} #define BIN_READ(var, type, num, file) if(fread(&var, sizeof(type), num, file) != num) {PEEXIT("read failed");} #define BIN_READ_PTR(var, type, num, file) if(fread(var, sizeof(type), num, file) != num) {PEEXIT("read failed");} #define CHECK_VAL(var, expected, flag) if(var != expected) { std::cout << "vars not equal " << #var << ":" << var << ", " << #expected << ":" << expected << "\n"; flag = false;} struct DoSFile { int fileVersion{ -1 }; size_t L{ 0 }; size_t U{ 0 }; size_t seed{ 0 }; u8 numStates{ 0 }; double factor{ 0.0 }; size_t iteration{ 0 }; // logG with all elements where count=0 is removed std::vector<double> logG_compressed; std::vector<double> logG; Hist hist; std::vector<size_t> indices; std::vector<u8> lattice; }; void read_dos_file(char const*const dosFile, std::vector<double> &g, std::vector<int> &e, size_t& dosL); // Read DoS data from file. If rand_engine is not nullptr, will update with the saved state DoSFile read_dos_file(char const* const dosFile, std::mt19937_64* rand_engine = nullptr); template <typename T> std::vector<size_t> sort_indexes(const std::vector<T> &v) { // initialize original index locations std::vector<size_t> idx(v.size()); std::iota(idx.begin(), idx.end(), 0); // sort indexes based on comparing values in v std::sort(idx.begin(), idx.end(), [&v](size_t i1, size_t i2) {return v[i1] > v[i2]; }); return idx; }
34.307692
177
0.672926
e90135a4209fc885d81c6e8f8663d6765a727fdc
1,148
cpp
C++
data_structures/Stack/C++/StackUsingArrays.cpp
JD235/algorithms
71346a498720dc3da064b3e61de0b369cf7eb76a
[ "MIT" ]
44
2017-12-11T11:13:07.000Z
2022-03-15T02:59:43.000Z
data_structures/Stack/C++/StackUsingArrays.cpp
JD235/algorithms
71346a498720dc3da064b3e61de0b369cf7eb76a
[ "MIT" ]
23
2018-10-06T06:17:21.000Z
2021-03-08T17:13:53.000Z
data_structures/Stack/C++/StackUsingArrays.cpp
JD235/algorithms
71346a498720dc3da064b3e61de0b369cf7eb76a
[ "MIT" ]
113
2017-12-12T06:46:04.000Z
2021-11-15T17:33:11.000Z
#include <iostream> using namespace std; #define MAX 10000 // defined a class stack class Stack { //top variable which represents the top of the stack int top; public: //declared an array of MAX size to store the elements of the stack int arr[MAX]; //top is intialised to -1 when stack is created Stack() { top = -1; } // function to push elements into the stack bool push(int num) { //maximum size of the stack if (top >= MAX) { cout << "Stack OverFlow" << endl; return false; } else { arr[++top] = num; cout << num << " is pushed into the stack" << endl; return true; } } bool pop() { //minimum size of the stack if (top <= -1) { cout << "Stack UnderFlow"; return false; } else { int x = arr[top--]; cout << x << " is popped out of the stack" << endl; return true; } } bool isEmpty() { //checking if stack is empty or not. if (top <= -1) { return true; } else return false; } }; int main() { Stack s; if (s.isEmpty()) cout << "Stack is empty" << endl; s.push(10); s.push(20); if (!s.isEmpty()) cout << "Stack is not empty" << endl; s.pop(); s.pop(); return 0; }
20.140351
67
0.599303
16e9e12eabd44d38000c7b19985d90a8f69a6cc3
996
kt
Kotlin
src/main/kotlin/org/monsim/api/accounting/CashAccounter.kt
jimdmorgan/monsim
0c97854234c874a6e5fa4b649ec0ca7719d77c21
[ "MIT" ]
null
null
null
src/main/kotlin/org/monsim/api/accounting/CashAccounter.kt
jimdmorgan/monsim
0c97854234c874a6e5fa4b649ec0ca7719d77c21
[ "MIT" ]
null
null
null
src/main/kotlin/org/monsim/api/accounting/CashAccounter.kt
jimdmorgan/monsim
0c97854234c874a6e5fa4b649ec0ca7719d77c21
[ "MIT" ]
null
null
null
package org.monsim.api.accounting import org.monsim.bean.Bill import org.monsim.bean.domain.Game interface CashAccounter { /** * Applies a bill (which contains a debitor, a creditor, and an amount). * All the debitor's available cash is immediately taken and given to the creditor. * So if the bill is for $200 and the debtor's available cash is $50, and the creditor's current cash is $1000, * then the creditor's new cash is set to $1050, the debtor's cash is set to $-150. * * As the debtor acquires more cash (say by mortgaging property), the cash is immediately turned over to the creditor. * So let's say the debtor gets $40 by mortgaging a property, then the debtor's new cash is -$110, and then creditor's cash * becomes $1090. * * The bank never goes into debt, so if the debtor is the bank, then the bill is always paid in full and the creditor * receives the full amount. */ fun applyBill(bill: Bill, game: Game) }
45.272727
127
0.696787
ab05f1fbca6c18565888a8ce36ab8844361c03d7
2,939
cs
C#
src/AdventOfCode/Puzzles/Y2015/Day12.cs
martincostello/adventofcode
380af433b11b6fdbe6c6b998fd24e72e33a9210f
[ "Apache-2.0" ]
5
2015-12-01T14:13:32.000Z
2022-03-25T13:14:44.000Z
src/AdventOfCode/Puzzles/Y2015/Day12.cs
martincostello/adventofcode
380af433b11b6fdbe6c6b998fd24e72e33a9210f
[ "Apache-2.0" ]
35
2016-11-03T12:58:42.000Z
2022-03-28T06:14:36.000Z
src/AdventOfCode/Puzzles/Y2015/Day12.cs
martincostello/adventofcode
380af433b11b6fdbe6c6b998fd24e72e33a9210f
[ "Apache-2.0" ]
null
null
null
// Copyright (c) Martin Costello, 2015. All rights reserved. // Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information. using System.Text.Json; namespace MartinCostello.AdventOfCode.Puzzles.Y2015; /// <summary> /// A class representing the puzzle for <c>https://adventofcode.com/2015/day/12</c>. This class cannot be inherited. /// </summary> [Puzzle(2015, 12, "JSAbacusFramework.io", RequiresData = true)] public sealed class Day12 : Puzzle { /// <summary> /// Gets the sum of the integers in the JSON document. /// </summary> internal long Sum { get; private set; } /// <summary> /// Sums the integer values in the specified JSON element, ignoring any values from /// child elements that contain the specified string value, if specified. /// </summary> /// <param name="element">The JSON element.</param> /// <param name="valueToIgnore">The elements to ignore if they contain this value.</param> /// <returns>The sum of the elements in <paramref name="element"/>.</returns> internal static long SumIntegerValues(JsonElement element, string valueToIgnore) { long sum = 0; if (element.ValueKind == JsonValueKind.Number) { sum = element.GetInt64(); } else if (element.ValueKind == JsonValueKind.Array) { foreach (JsonElement child in element.EnumerateArray()) { sum += SumIntegerValues(child, valueToIgnore); } } else if (element.ValueKind == JsonValueKind.Object) { foreach (JsonProperty child in element.EnumerateObject()) { if (child.Value.ValueKind == JsonValueKind.String && child.Value.GetString() == valueToIgnore) { return 0; } sum += SumIntegerValues(child.Value, valueToIgnore); } } return sum; } /// <inheritdoc /> protected override async Task<PuzzleResult> SolveCoreAsync(string[] args, CancellationToken cancellationToken) { Stream resource = Resource ?? ReadResource(); try { using var document = await JsonDocument.ParseAsync(resource, cancellationToken: cancellationToken); string keyToIgnore = args.Length > 0 ? args[0] : string.Empty; Sum = SumIntegerValues(document.RootElement, keyToIgnore); if (Verbose) { Logger.WriteLine("The sum of the integers in the JSON document is {0:N0}.", Sum); } } finally { if (Resource is null) { await resource.DisposeAsync(); } } return PuzzleResult.Create(Sum); } }
34.174419
117
0.576046
33319c7108f2f54f95e8dca0a5199386d7358140
2,760
py
Python
cfgs/config.py
Pandinosaurus/yolo2-pytorch
f046769ea157e6d57579c67dcef62fdd3b71111e
[ "MIT" ]
1,663
2017-02-25T02:09:58.000Z
2022-03-31T07:18:30.000Z
cfgs/config.py
Guroto/yolo2-pytorch
17056ca69f097a07884135d9031c53d4ef217a6a
[ "MIT" ]
115
2017-03-04T12:26:49.000Z
2022-01-06T04:02:44.000Z
cfgs/config.py
Guroto/yolo2-pytorch
17056ca69f097a07884135d9031c53d4ef217a6a
[ "MIT" ]
492
2017-02-28T20:09:14.000Z
2022-03-18T21:25:10.000Z
import os from .config_voc import * # noqa from .exps.darknet19_exp1 import * # noqa def mkdir(path, max_depth=3): parent, child = os.path.split(path) if not os.path.exists(parent) and max_depth > 1: mkdir(parent, max_depth-1) if not os.path.exists(path): os.mkdir(path) # input and output size ############################ multi_scale_inp_size = [np.array([320, 320], dtype=np.int), np.array([352, 352], dtype=np.int), np.array([384, 384], dtype=np.int), np.array([416, 416], dtype=np.int), np.array([448, 448], dtype=np.int), np.array([480, 480], dtype=np.int), np.array([512, 512], dtype=np.int), np.array([544, 544], dtype=np.int), np.array([576, 576], dtype=np.int), # np.array([608, 608], dtype=np.int), ] # w, h multi_scale_out_size = [multi_scale_inp_size[0] / 32, multi_scale_inp_size[1] / 32, multi_scale_inp_size[2] / 32, multi_scale_inp_size[3] / 32, multi_scale_inp_size[4] / 32, multi_scale_inp_size[5] / 32, multi_scale_inp_size[6] / 32, multi_scale_inp_size[7] / 32, multi_scale_inp_size[8] / 32, # multi_scale_inp_size[9] / 32, ] # w, h inp_size = np.array([416, 416], dtype=np.int) # w, h out_size = inp_size / 32 # for display ############################ def _to_color(indx, base): """ return (b, r, g) tuple""" base2 = base * base b = 2 - indx / base2 r = 2 - (indx % base2) / base g = 2 - (indx % base2) % base return b * 127, r * 127, g * 127 base = int(np.ceil(pow(num_classes, 1. / 3))) colors = [_to_color(x, base) for x in range(num_classes)] # detection config ############################ thresh = 0.3 # dir config ############################ ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) DATA_DIR = os.path.join(ROOT_DIR, 'data') MODEL_DIR = os.path.join(ROOT_DIR, 'models') TRAIN_DIR = os.path.join(MODEL_DIR, 'training') TEST_DIR = os.path.join(MODEL_DIR, 'testing') trained_model = os.path.join(MODEL_DIR, h5_fname) pretrained_model = os.path.join(MODEL_DIR, pretrained_fname) train_output_dir = os.path.join(TRAIN_DIR, exp_name) test_output_dir = os.path.join(TEST_DIR, imdb_test, h5_fname) mkdir(train_output_dir, max_depth=3) mkdir(test_output_dir, max_depth=4) rand_seed = 1024 use_tensorboard = True log_interval = 50 disp_interval = 10
33.253012
73
0.537681
d2606496c1dbb6e49b167cb3861ce264ec93d3db
2,211
php
PHP
_src/Chapter 07/1625OS_09_Code/student-portal/controllers/students.php
paullewallencom/php-978-1-7839-8162-5
abf288978f803ab913775df7841a883e2986a604
[ "Apache-2.0" ]
null
null
null
_src/Chapter 07/1625OS_09_Code/student-portal/controllers/students.php
paullewallencom/php-978-1-7839-8162-5
abf288978f803ab913775df7841a883e2986a604
[ "Apache-2.0" ]
null
null
null
_src/Chapter 07/1625OS_09_Code/student-portal/controllers/students.php
paullewallencom/php-978-1-7839-8162-5
abf288978f803ab913775df7841a883e2986a604
[ "Apache-2.0" ]
null
null
null
<?php class Students extends Base_Controller{ public function __construct(){ parent::__construct(); $this->loadModel("students"); } public function add(){ if(isset($_POST['submit'])){ unset($_POST['submit']); $this->view->id = $this->model->addStudent($_POST); } $this->view->render('students/add'); } public function get($id=null){ $this->logger->info("get action been requested"); $this->view->message = isset($_GET['message']) ? $_GET['message'] : ''; if(isset($_GET['message']) && $_GET['message']=='importSuccess'){ $this->view->message = 'Import is successful'; } $student_data = $this->cache->get('student_data'); if(!$student_data){ $student_data = $this->model->getStudents(); $this->cache->set('student_data', $student_data); } $this->view->student_data = $student_data; $this->view->render('students/get'); } public function import(){ if(isset($_POST['submit'])){ if($_FILES['file']['error']==0){ if (($handle = fopen($_FILES['file']['tmp_name'], 'r')) !== FALSE) { while (($data = fgetcsv($handle, 1000, ',')) !== FALSE) { $student['first_name'] = $data[0]; $student['last_name'] = $data[1]; $student['address'] = $data[2]; $student['city'] = $data[3]; $student['state'] = $data[4]; $student['zip_code'] = $data[5]; $student['username'] = $data[6]; $student['password'] = $data[7]; $this->model->addStudent($student); } } header('Location:'.BASE_URL.'students/get?message=importSuccess'); } } } public function export(){ $data = $this->model->getStudents(); $handle = fopen(ROOT_DIR.'/assets/files/students.csv', 'w+'); foreach ($data as $student) { fputcsv($handle, array($student['student_id'], $student['first_name'], $student['last_name'],$student['address'],$student['city'],$student['state'])); } fclose($handle); header('Content-Disposition: attachment; filename="students.csv"'); header('Content-Type:application/csv'); readfile(ROOT_DIR.'/assets/files/students.csv'); error_log('Students.csv has been successfully exported'); //$this->logger->info("Students.csv has been successfully exported"); } } ?>
27.987342
153
0.616915
fba7f8102a1445834f68c97fa58dc30d92c9a126
10,541
java
Java
distributed/src/test/java/com/orientechnologies/orient/server/distributed/scenariotest/WWConflictAndNodeInDeadlockScenarioTest.java
AlexOreshkevich/orientdb
1db47be6f1780e5d00db1883c80e489f5991bd33
[ "Apache-2.0" ]
1
2016-07-18T21:23:06.000Z
2016-07-18T21:23:06.000Z
distributed/src/test/java/com/orientechnologies/orient/server/distributed/scenariotest/WWConflictAndNodeInDeadlockScenarioTest.java
e-d/orientdb
ae492591dcb2a962ed0728ff788bb97fb8526216
[ "Apache-2.0" ]
null
null
null
distributed/src/test/java/com/orientechnologies/orient/server/distributed/scenariotest/WWConflictAndNodeInDeadlockScenarioTest.java
e-d/orientdb
ae492591dcb2a962ed0728ff788bb97fb8526216
[ "Apache-2.0" ]
null
null
null
/* * Copyright 2015 OrientDB LTD (info--at--orientdb.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.orientechnologies.orient.server.distributed.scenariotest; import com.orientechnologies.orient.core.db.ODatabaseRecordThreadLocal; import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; import com.orientechnologies.orient.core.record.impl.ODocument; import com.orientechnologies.orient.server.distributed.ODistributedConfiguration; import com.orientechnologies.orient.server.distributed.ServerRun; import com.orientechnologies.orient.server.hazelcast.OHazelcastPlugin; import com.tinkerpop.blueprints.impls.orient.OrientGraphFactory; import com.tinkerpop.blueprints.impls.orient.OrientGraphNoTx; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.util.LinkedList; import java.util.List; import java.util.Timer; import java.util.concurrent.Callable; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; /** * It checks the consistency in the cluster with the following scenario: * - 3 server (quorum=1) * - deadlock on server3 * - record r1 inserted on server1 * - record r1 (version x) is present in full replica on all the servers * - client c1 (connected to server1) updates r1 with the value v1, meanwhile client c2 (connected to server2) updates r1 with value v2 * - end of deadlock on server3 * - check consistency on the nodes: * - r1 has the same value on all the servers * - r1 has version x+1 on all the servers */ public class WWConflictAndNodeInDeadlockScenarioTest extends UpdateConflictFixTaskScenarioTest { protected Timer timer = new Timer(true); volatile int serverStarted = 0; volatile boolean backupInProgress = false; private volatile boolean server3inDeadlock = false; @Ignore @Test public void test() throws Exception { maxRetries = 10; init(SERVERS); prepare(false); // execute writes only on server3 executeWritesOnServers.addAll(serverInstance); execute(); } @Override public void executeTest() throws Exception { /* * Test with quorum = 1 */ banner("Test with quorum = 1"); ODatabaseDocumentTx dbServer1 = poolFactory.get(getDatabaseURL(serverInstance.get(0)), "admin", "admin").acquire(); ODatabaseDocumentTx dbServer2 = poolFactory.get(getDatabaseURL(serverInstance.get(1)), "admin", "admin").acquire(); ODatabaseDocumentTx dbServer3 = poolFactory.get(getDatabaseURL(serverInstance.get(2)), "admin", "admin").acquire(); // changing configuration: writeQuorum=1, autoDeploy=false System.out.print("\nChanging configuration (writeQuorum=1, autoDeploy=false)..."); ODocument cfg = null; ServerRun server = serverInstance.get(2); OHazelcastPlugin manager = (OHazelcastPlugin) server.getServerInstance().getDistributedManager(); ODistributedConfiguration databaseConfiguration = manager.getDatabaseConfiguration("distributed-inserttxha"); cfg = databaseConfiguration.serialize(); cfg.field("writeQuorum", 1); cfg.field("failureAvailableNodesLessQuorum", true); cfg.field("version", (Integer) cfg.field("version") + 1); manager.updateCachedDatabaseConfiguration("distributed-inserttxha", cfg, true, true); System.out.println("\nConfiguration updated."); // deadlock on server3 this.server3inDeadlock = true; Thread.sleep(200); // waiting for deadlock // inserting record r1 and checking consistency on server1 and server2 System.out.print("Inserting record r1 and checking consistency..."); ODocument r1onServer1 = new ODocument("Person").fields("id", "R001", "firstName", "Han", "lastName", "Solo"); r1onServer1.save(); Thread.sleep(200); ODocument r1onServer2 = retrieveRecord(getDatabaseURL(serverInstance.get(1)), "R001"); assertEquals(r1onServer1.field("@version"), r1onServer2.field("@version")); assertEquals(r1onServer1.field("id"), r1onServer2.field("id")); assertEquals(r1onServer1.field("firstName"), r1onServer2.field("firstName")); assertEquals(r1onServer1.field("lastName"), r1onServer2.field("lastName")); System.out.println("\tDone."); // initial version of the record r1 int initialVersion = r1onServer1.field("@version"); // creating and executing two clients c1 and c2 (updating r1) System.out.print("Building client c1 and client c2..."); List<Callable<Void>> clients = new LinkedList<Callable<Void>>(); clients.add(new ClientWriter(getDatabaseURL(serverInstance.get(0)), "R001", "Luke", "Skywalker")); clients.add(new ClientWriter(getDatabaseURL(serverInstance.get(1)), "R001", "Darth", "Vader")); System.out.println("\tDone."); ExecutorService executor = Executors.newCachedThreadPool(); System.out.println("Concurrent update:"); List<Future<Void>> futures = executor.invokeAll(clients); try { for (Future f : futures) { f.get(); } assertTrue("Concurrent update NOT detected!", false); } catch (Exception e) { e.printStackTrace(); assertTrue(true); System.out.println("Concurrent update detected!"); } // wait for propagation Thread.sleep(500); // end of deadlock on server3 this.server3inDeadlock = false; Thread.sleep(1000); // waiting for sync of server3 // check consistency r1onServer1 = retrieveRecord(getDatabaseURL(serverInstance.get(0)), "R001"); r1onServer2 = retrieveRecord(getDatabaseURL(serverInstance.get(1)), "R001"); ODocument r1onServer3 = retrieveRecord(getDatabaseURL(serverInstance.get(2)), "R001"); ODatabaseRecordThreadLocal.INSTANCE.set(dbServer1); r1onServer1.reload(); ODatabaseRecordThreadLocal.INSTANCE.set(dbServer2); r1onServer2.reload(); ODatabaseRecordThreadLocal.INSTANCE.set(dbServer3); r1onServer3.reload(); if( (r1onServer1.field("firstName").equals("Luke") && r1onServer1.field("lastName").equals("Skywalker")) || r1onServer1.field("firstName").equals("Darth") && r1onServer1.field("lastName").equals("Vader")) { assertTrue("The record has been updated by a client!", true); } else { assertTrue("The record has not been updated by any client!", false); } System.out.printf("Checking consistency among servers..."); assertEquals(r1onServer1.field("@version"), r1onServer2.field("@version")); assertEquals(r1onServer1.field("id"), r1onServer2.field("id")); assertEquals(r1onServer1.field("firstName"), r1onServer2.field("firstName")); assertEquals(r1onServer1.field("lastName"), r1onServer2.field("lastName")); assertEquals(r1onServer2.field("@version"), r1onServer3.field("@version")); assertEquals(r1onServer2.field("id"), r1onServer3.field("id")); assertEquals(r1onServer2.field("firstName"), r1onServer3.field("firstName")); assertEquals(r1onServer2.field("lastName"), r1onServer3.field("lastName")); System.out.println("The records are consistent in the cluster."); // final version of the record r1 System.out.print("Checking versioning..."); int finalVersion = r1onServer1.field("@version"); assertEquals(finalVersion, initialVersion +1); System.out.println("\tDone."); } @Override protected void onServerStarted(ServerRun server) { super.onServerStarted(server); if (serverStarted++ == (2)) { startQueueMonitorTask(); startCountMonitorTask("Person"); // BACKUP LAST SERVER, RUN ASYNCHRONOUSLY new Thread(new Runnable() { @Override public void run() { try { // CRASH LAST SERVER try { executeWhen(new Callable<Boolean>() { // CONDITION @Override public Boolean call() throws Exception { return server3inDeadlock; } }, // ACTION new Callable() { @Override public Object call() throws Exception { banner("STARTING BACKUP SERVER " + (2)); OrientGraphFactory factory = new OrientGraphFactory( "plocal:target/server2/databases/" + getDatabaseName()); OrientGraphNoTx g = factory.getNoTx(); backupInProgress = true; File file = null; try { file = File.createTempFile("orientdb_test_backup", ".zip"); if (file.exists()) Assert.assertTrue(file.delete()); g.getRawGraph().backup(new FileOutputStream(file), null, new Callable<Object>() { @Override public Object call() throws Exception { // SIMULATE LONG BACKUP UNTIL SPECIFIED BY VARIABLE 'server3inDeadlock' while (server3inDeadlock) { Thread.sleep(1000); } return null; } }, null, 9, 1000000); } catch (IOException e) { e.printStackTrace(); } finally { banner("COMPLETED BACKUP SERVER " + (2)); backupInProgress = false; g.shutdown(); if (file != null) file.delete(); } return null; } }); } catch (Exception e) { e.printStackTrace(); Assert.fail("Error on execution flow"); } } }).start(); } } }
38.753676
135
0.653828
0455c0504245a29d97beaba836e65f2498ffcf86
10,862
java
Java
app/src/main/java/com/converter/MainActivity.java
jose-barata/android-currency-converter
3a7f02a5739d29a9f12d1e864c4483ce5521c16d
[ "MIT" ]
null
null
null
app/src/main/java/com/converter/MainActivity.java
jose-barata/android-currency-converter
3a7f02a5739d29a9f12d1e864c4483ce5521c16d
[ "MIT" ]
null
null
null
app/src/main/java/com/converter/MainActivity.java
jose-barata/android-currency-converter
3a7f02a5739d29a9f12d1e864c4483ce5521c16d
[ "MIT" ]
null
null
null
package com.converter; import androidx.appcompat.app.AppCompatActivity; import android.content.Context; import android.content.SharedPreferences; import android.os.Bundle; import android.view.View; import android.widget.EditText; import android.widget.TextView; import com.android.volley.Request; import com.android.volley.Response; import com.android.volley.VolleyError; import com.android.volley.toolbox.JsonObjectRequest; import org.json.JSONException; import org.json.JSONObject; import java.text.DecimalFormat; import java.text.SimpleDateFormat; import java.util.Date; public class MainActivity extends AppCompatActivity { private String API_URL = "http://data.fixer.io/api/latest?access_key=< ! Insert fixer api access key here ! >=1&symbols=EUR,GBP,HKD,NZD,AUD"; private TextView updatedInfo; private EditText editEUR; private EditText editGBP; private EditText editHKD; private EditText editNZD; private EditText editAUD; private float rateEUR; private float rateGBP; private float rateHKD; private float rateNZD; private float rateAUD; private final DecimalFormat decimalFormat = new DecimalFormat("##.00"); private final SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); SharedPreferences mPrefs = MainActivity.this.getSharedPreferences("theme", Context.MODE_PRIVATE); setTheme(mPrefs.getInt("theme", android.R.style.Theme_Material_Light_NoActionBar)); setContentView(R.layout.activity_main); updatedInfo = (TextView) findViewById(R.id.updatedInfo); editEUR = (EditText) findViewById(R.id.editEUR); editGBP = (EditText) findViewById(R.id.editGBP); editHKD = (EditText) findViewById(R.id.editHKD); editNZD = (EditText) findViewById(R.id.editNZD); editAUD = (EditText) findViewById(R.id.editAUD); editEUR.requestFocus(); initRates(); initButtons(); } private void initRates() { SharedPreferences mPrefs = MainActivity.this.getSharedPreferences("rateEUR", Context.MODE_PRIVATE); rateEUR = mPrefs.getFloat("rateEUR", 1f); mPrefs = MainActivity.this.getSharedPreferences("rateGBP", Context.MODE_PRIVATE); rateGBP = mPrefs.getFloat("rateGBP", 1f); mPrefs = MainActivity.this.getSharedPreferences("rateHKD", Context.MODE_PRIVATE); rateHKD = mPrefs.getFloat("rateHKD", 1f); mPrefs = MainActivity.this.getSharedPreferences("rateNZD", Context.MODE_PRIVATE); rateNZD = mPrefs.getFloat("rateNZD", 1f); mPrefs = MainActivity.this.getSharedPreferences("rateAUD", Context.MODE_PRIVATE); rateAUD = mPrefs.getFloat("rateAUD", 1f); } private void initButtons() { View.OnClickListener clearButtonListener = new View.OnClickListener() { public void onClick(View v) { clearAllInputs(); } }; findViewById(R.id.btnClearEUR).setOnClickListener(clearButtonListener); findViewById(R.id.btnClearGBP).setOnClickListener(clearButtonListener); findViewById(R.id.btnClearHKD).setOnClickListener(clearButtonListener); findViewById(R.id.btnClearNZD).setOnClickListener(clearButtonListener); findViewById(R.id.btnClearAUD).setOnClickListener(clearButtonListener); findViewById(R.id.btnOkEUR).setOnClickListener(new View.OnClickListener() { public void onClick(View v) { float eurInputValue = Float.parseFloat(editEUR.getText().toString()); editGBP.setText(decimalFormat.format(eurInputValue * rateGBP / rateEUR)); editHKD.setText(decimalFormat.format(eurInputValue * rateHKD / rateEUR)); editNZD.setText(decimalFormat.format(eurInputValue * rateNZD / rateEUR)); editAUD.setText(decimalFormat.format(eurInputValue * rateAUD / rateEUR)); } }); findViewById(R.id.btnOkGBP).setOnClickListener(new View.OnClickListener() { public void onClick(View v) { float gbpInputValue = Float.parseFloat(editGBP.getText().toString()); editEUR.setText(decimalFormat.format(gbpInputValue * rateEUR / rateGBP)); editHKD.setText(decimalFormat.format(gbpInputValue * rateHKD / rateGBP)); editNZD.setText(decimalFormat.format(gbpInputValue * rateNZD / rateGBP)); editAUD.setText(decimalFormat.format(gbpInputValue * rateAUD / rateGBP)); } }); findViewById(R.id.btnOkHKD).setOnClickListener(new View.OnClickListener() { public void onClick(View v) { float hkdInputValue = Float.parseFloat(editHKD.getText().toString()); editEUR.setText(decimalFormat.format(hkdInputValue * rateEUR / rateHKD)); editGBP.setText(decimalFormat.format(hkdInputValue * rateGBP / rateHKD)); editNZD.setText(decimalFormat.format(hkdInputValue * rateNZD / rateHKD)); editAUD.setText(decimalFormat.format(hkdInputValue * rateAUD / rateHKD)); } }); findViewById(R.id.btnOkNZD).setOnClickListener(new View.OnClickListener() { public void onClick(View v) { float nzdInputValue = Float.parseFloat(editNZD.getText().toString()); editEUR.setText(decimalFormat.format(nzdInputValue * rateEUR / rateNZD)); editGBP.setText(decimalFormat.format(nzdInputValue * rateGBP / rateNZD)); editHKD.setText(decimalFormat.format(nzdInputValue * rateHKD / rateNZD)); editAUD.setText(decimalFormat.format(nzdInputValue * rateAUD / rateNZD)); } }); findViewById(R.id.btnOkAUD).setOnClickListener(new View.OnClickListener() { public void onClick(View v) { float audInputValue = Float.parseFloat(editAUD.getText().toString()); editEUR.setText(decimalFormat.format(audInputValue * rateEUR / rateAUD)); editGBP.setText(decimalFormat.format(audInputValue * rateGBP / rateAUD)); editHKD.setText(decimalFormat.format(audInputValue * rateHKD / rateAUD)); editNZD.setText(decimalFormat.format(audInputValue * rateNZD / rateAUD)); } }); findViewById(R.id.btnUpdateRates).setOnClickListener(new View.OnClickListener() { public void onClick(View v) { updateRates(); } }); findViewById(R.id.btnTheme).setOnClickListener(new View.OnClickListener() { public void onClick(View v) { SharedPreferences mPrefs = MainActivity.this.getSharedPreferences("theme", Context.MODE_PRIVATE); SharedPreferences.Editor editor = mPrefs.edit(); int theme = mPrefs.getInt("theme", android.R.style.Theme_Material_Light_NoActionBar); switch (theme) { case android.R.style.Theme_Material_Light_NoActionBar: editor.putInt("theme", android.R.style.Theme_Material_NoActionBar); break; case android.R.style.Theme_Material_NoActionBar: editor.putInt("theme", android.R.style.Theme_Material_Light_NoActionBar); break; } if (editor.commit()) { recreate(); } } }); } private void updateRates() { String url = API_URL; JsonObjectRequest jsonObjectRequest = new JsonObjectRequest (Request.Method.GET, url, null, new Response.Listener<JSONObject>() { @Override public void onResponse(JSONObject response) { try { if (response.has("rates")) { JSONObject rates = response.getJSONObject("rates"); rateEUR = (float) rates.getDouble("EUR"); rateGBP = (float) rates.getDouble("GBP"); rateHKD = (float) rates.getDouble("HKD"); rateNZD = (float) rates.getDouble("NZD"); rateAUD = (float) rates.getDouble("AUD"); SharedPreferences mPrefs = MainActivity.this.getSharedPreferences("rateEUR", Context.MODE_PRIVATE); SharedPreferences.Editor editor = mPrefs.edit(); editor.putFloat("rateEUR", rateEUR); editor.commit(); mPrefs = MainActivity.this.getSharedPreferences("rateGBP", Context.MODE_PRIVATE); editor = mPrefs.edit(); editor.putFloat("rateGBP", rateGBP); editor.commit(); mPrefs = MainActivity.this.getSharedPreferences("rateHKD", Context.MODE_PRIVATE); editor = mPrefs.edit(); editor.putFloat("rateHKD", rateHKD); editor.commit(); mPrefs = MainActivity.this.getSharedPreferences("rateNZD", Context.MODE_PRIVATE); editor = mPrefs.edit(); editor.putFloat("rateNZD", rateNZD); editor.commit(); mPrefs = MainActivity.this.getSharedPreferences("rateAUD", Context.MODE_PRIVATE); editor = mPrefs.edit(); editor.putFloat("rateAUD", rateAUD); editor.commit(); } } catch (JSONException exception) { updatedInfo.setText("Unable to get rates: " + exception.getMessage()); } updatedInfo.setText("Updated at " + simpleDateFormat.format(new Date())); } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { updatedInfo.setText("Unable to get rates: " + error.getMessage()); } }); RequestQueueSingleton.getInstance(this).addToRequestQueue(jsonObjectRequest); } private void clearAllInputs() { editEUR.setText("0"); editGBP.setText("0"); editHKD.setText("0"); editNZD.setText("0"); editAUD.setText("0"); } }
46.221277
145
0.59989
24dd918c3947df0f644e99044e4981da7bc4ef58
4,316
dart
Dart
lib/src/pinch_zoom_image.dart
Paulabn/pinch_zoom_image_last
a4d24aa60eb9bd65c822f655cd4cd8ebd7d48c00
[ "ISC" ]
null
null
null
lib/src/pinch_zoom_image.dart
Paulabn/pinch_zoom_image_last
a4d24aa60eb9bd65c822f655cd4cd8ebd7d48c00
[ "ISC" ]
null
null
null
lib/src/pinch_zoom_image.dart
Paulabn/pinch_zoom_image_last
a4d24aa60eb9bd65c822f655cd4cd8ebd7d48c00
[ "ISC" ]
1
2022-03-18T16:57:18.000Z
2022-03-18T16:57:18.000Z
import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:pinch_zoom_image_last/src/pinch_zoom_overlay_image.dart'; class PinchZoomImage extends StatefulWidget { final Widget image; final Color zoomedBackgroundColor; final bool hideStatusBarWhileZooming; final Function? onZoomStart; final Function? onZoomEnd; PinchZoomImage({ required this.image, this.zoomedBackgroundColor = Colors.transparent, this.hideStatusBarWhileZooming = false, this.onZoomStart, this.onZoomEnd, }); @override _PinchZoomImageState createState() => _PinchZoomImageState(); } class _PinchZoomImageState extends State<PinchZoomImage> { static const channel = const MethodChannel('pinch_zoom_image'); OverlayEntry? overlayEntry; Offset? scaleStartPosition; Offset? origin; int numPointers = 0; bool zooming = false; bool reversing = false; GlobalKey<PinchZoomOverlayImageState> overlayKey = GlobalKey(); @override Widget build(BuildContext context) { return Listener( onPointerDown: (_) => numPointers++, onPointerUp: (_) => numPointers--, onPointerCancel: (_) => numPointers = 0, child: RawGestureDetector( gestures: { _AllowMultipleGestureRecognizer: GestureRecognizerFactoryWithHandlers< _AllowMultipleGestureRecognizer>( () => _AllowMultipleGestureRecognizer(), //constructor (_AllowMultipleGestureRecognizer instance) { //initializer instance.onStart = _handleScaleStart; instance.onUpdate = _handleScaleUpdate; instance.onEnd = _handleScaleEnd; }, ) }, child: Stack( clipBehavior: Clip.none, children: <Widget>[ Opacity( opacity: zooming ? 0.0 : 1.0, child: widget.image, ), Positioned( top: 0.0, left: 0.0, right: 0.0, bottom: 0.0, child: Container( color: zooming ? widget.zoomedBackgroundColor : Colors.transparent, ), ), ], ), ), ); } void _handleScaleStart(ScaleStartDetails details) { //print("Handle scale start => pointers : $numPointers"); if (overlayEntry != null || reversing || numPointers < 2) return; setState(() { zooming = true; }); if (widget.hideStatusBarWhileZooming) channel.invokeMethod('hideStatusBar'); if (widget.onZoomStart != null) widget.onZoomStart!(); OverlayState overlayState = Overlay.of(context)!; double width = context.size!.width; double height = context.size!.height; origin = (context.findRenderObject() as RenderBox) .localToGlobal(Offset(0.0, 0.0)); scaleStartPosition = details.focalPoint; overlayEntry = OverlayEntry( maintainState: true, builder: (BuildContext context) { return PinchZoomOverlayImage( key: overlayKey, height: height, width: width, origin: origin!, image: widget.image, ); }, ); overlayState.insert(overlayEntry!); } void _handleScaleUpdate(ScaleUpdateDetails details) { //print("Handle scale UPDATE => pointers : $numPointers"); if (reversing || numPointers < 2) return; overlayKey.currentState ?.updatePosition(origin! - (scaleStartPosition! - details.focalPoint)); if (details.scale >= 1.0) overlayKey.currentState?.updateScale(details.scale); } void _handleScaleEnd(ScaleEndDetails details) async { //print("Handle scale END"); if (reversing || !zooming) return; reversing = true; if (widget.hideStatusBarWhileZooming) channel.invokeMethod('showStatusBar'); if (widget.onZoomEnd != null) widget.onZoomEnd!(); await overlayKey.currentState?.reverse(); overlayEntry?.remove(); overlayEntry = null; origin = null; scaleStartPosition = null; reversing = false; setState(() { zooming = false; }); } } class _AllowMultipleGestureRecognizer extends ScaleGestureRecognizer { @override void rejectGesture(int pointer) { acceptGesture(pointer); } }
30.609929
80
0.641566
9d1ca7475c5535816e797eaeee55c4bae4e2e8b1
21,473
html
HTML
src/tab.html
thanhtungweb/dashboard-master
60bba115bcb2a57b21bf200b3db67eddd0159ead
[ "MIT" ]
1
2021-01-21T08:15:53.000Z
2021-01-21T08:15:53.000Z
src/tab.html
thanhtungweb/ttweb-dashboard-master
60bba115bcb2a57b21bf200b3db67eddd0159ead
[ "MIT" ]
null
null
null
src/tab.html
thanhtungweb/ttweb-dashboard-master
60bba115bcb2a57b21bf200b3db67eddd0159ead
[ "MIT" ]
null
null
null
--- layout: default title: "Buttons - TTWeb Admin Dashboard Template" parent: "components" sub_parent: "components" activePage: "tab" plugins: [] --- <div class="breadcrumb-wrapper"> <h1>Tab</h1> {% include breadcrumb.htm %} </div> <!-- First Row --> <div class="row"> <div class="col-lg-6"> <div class="card card-default"> <div class="card-header card-header-border-bottom"> <h2>Default Tabs </h2> </div> <div class="card-body"> <p class="mb-5">Takes the basic nav and adds the <code>.nav-tabs</code> class to generate a tabbed interface. Use them to create tabbable regions with our tab <a href="http://getbootstrap.com/docs/4.1/components/navs/#javascript-behavior" target="_blank">JavaScript plugin.</a></p> <ul class="nav nav-tabs" id="myTab" role="tablist"> <li class="nav-item"> <a class="nav-link active" id="home-tab" data-toggle="tab" href="#home" role="tab" aria-controls="home" aria-selected="true">Home</a> </li> <li class="nav-item"> <a class="nav-link" id="profile-tab" data-toggle="tab" href="#profile" role="tab" aria-controls="profile" aria-selected="false">Profile</a> </li> <li class="nav-item"> <a class="nav-link" id="contact-tab" data-toggle="tab" href="#contact" role="tab" aria-controls="contact" aria-selected="false">Contact</a> </li> <li class="nav-item"> <a class="nav-link disabled" href="javascript:void(0)">Disabled</a> </li> </ul> <div class="tab-content" id="myTabContent1"> <div class="tab-pane pt-3 fade show active" id="home" role="tabpanel" aria-labelledby="home-tab"> Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </div> <div class="tab-pane pt-3 fade" id="profile" role="tabpanel" aria-labelledby="profile-tab"> Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </div> <div class="tab-pane pt-3 fade" id="contact" role="tabpanel" aria-labelledby="contact-tab"> Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </div> </div> </div> </div> </div> <div class="col-lg-6"> <div class="card card-default"> <div class="card-header card-header-border-bottom"> <h2>Pill Tabs </h2> </div> <div class="card-body"> <p class="mb-5">Take that same HTML, but use <code>.nav-pills</code> instead: Read Bootstrap Documention <a href="http://getbootstrap.com/docs/4.1/components/navs/#javascript-behavior" target="_blank">more details.</a></p> <ul class="nav nav-pills mb-3" id="pills-tab" role="tablist"> <li class="nav-item"> <a class="nav-link active" id="pills-home-tab" data-toggle="pill" href="#pills-home" role="tab" aria-controls="pills-home" aria-selected="true">Home</a> </li> <li class="nav-item"> <a class="nav-link" id="pills-profile-tab" data-toggle="pill" href="#pills-profile" role="tab" aria-controls="pills-profile" aria-selected="false">Profile</a> </li> <li class="nav-item"> <a class="nav-link" id="pills-contact-tab" data-toggle="pill" href="#pills-contact" role="tab" aria-controls="pills-contact" aria-selected="false">Contact</a> </li> <li class="nav-item"> <a class="nav-link disabled" href="javascript:void(0)">Disabled</a> </li> </ul> <div class="tab-content" id="pills-tabContent"> <div class="tab-pane fade show active" id="pills-home" role="tabpanel" aria-labelledby="pills-home-tab"> Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </div> <div class="tab-pane fade" id="pills-profile" role="tabpanel" aria-labelledby="pills-profile-tab"> Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </div> <div class="tab-pane fade" id="pills-contact" role="tabpanel" aria-labelledby="pills-contact-tab"> Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </div> </div> </div> </div> </div> <div class="col-lg-6"> <div class="card card-default"> <div class="card-header card-header-border-bottom"> <h2>Tabs with Icon</h2> </div> <div class="card-body"> <ul class="nav nav-tabs" id="myTab" role="tablist"> <li class="nav-item"> <a class="nav-link active" id="icon-home-tab" data-toggle="tab" href="#icon-home" role="tab" aria-controls="icon-home" aria-selected="true"> <i class="mdi mdi-star mr-1"></i> Home</a> </li> <li class="nav-item"> <a class="nav-link" id="icon-profile-tab" data-toggle="tab" href="#icon-profile" role="tab" aria-controls="icon-profile" aria-selected="false"> <i class="mdi mdi-account mr-1"></i> Profile</a> </li> <li class="nav-item"> <a class="nav-link" id="icon-contact-tab" data-toggle="tab" href="#icon-contact" role="tab" aria-controls="icon-contact" aria-selected="false"> <i class="mdi mdi-phone mr-1"></i> Contact</a> </li> </ul> <div class="tab-content" id="myTabContent2"> <div class="tab-pane pt-3 fade show active" id="icon-home" role="tabpanel" aria-labelledby="icon-home-tab"> Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </div> <div class="tab-pane pt-3 fade" id="icon-profile" role="tabpanel" aria-labelledby="icon-profile-tab"> Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </div> <div class="tab-pane pt-3 fade" id="icon-contact" role="tabpanel" aria-labelledby="icon-contact-tab"> Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </div> </div> </div> </div> </div> <div class="col-lg-6"> <div class="card card-default"> <div class="card-header card-header-border-bottom"> <h2>Pill Tabs with Icon </h2> </div> <div class="card-body"> <ul class="nav nav-pills mb-3" id="pills-tab" role="tablist"> <li class="nav-item"> <a class="nav-link active" id="ipills-home-tab" data-toggle="pill" href="#ipills-home" role="tab" aria-controls="ipills-home" aria-selected="true"> <i class="mdi mdi-star mr-1"></i> Home</a> </li> <li class="nav-item"> <a class="nav-link" id="ipills-profile-tab" data-toggle="pill" href="#ipills-profile" role="tab" aria-controls="ipills-profile" aria-selected="false"> <i class="mdi mdi-account mr-1"></i> Profile</a> </li> <li class="nav-item"> <a class="nav-link" id="ipills-contact-tab" data-toggle="pill" href="#ipills-contact" role="tab" aria-controls="ipills-contact" aria-selected="false"> <i class="mdi mdi-phone mr-1"></i> Contact</a> </li> </ul> <div class="tab-content" id="pills-tabContent"> <div class="tab-pane fade show active" id="ipills-home" role="tabpanel" aria-labelledby="ipills-home-tab"> Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </div> <div class="tab-pane fade" id="ipills-profile" role="tabpanel" aria-labelledby="ipills-profile-tab"> Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </div> <div class="tab-pane fade" id="ipills-contact" role="tabpanel" aria-labelledby="ipills-contact-tab"> Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </div> </div> </div> </div> </div> <div class="col-lg-6"> <div class="card card-default"> <div class="card-header card-header-border-bottom"> <h2>Custom List Tabs</h2> </div> <div class="card-body"> <ul class="nav nav-tabs nav-style-border pl-0 justify-content-between justify-content-xl-start" id="myTab" role="tablist"> <li class="nav-item"> <a class="nav-link active" id="home2-tab" data-toggle="tab" href="#home2" role="tab" aria-controls="home2" aria-selected="true">Home</a> </li> <li class="nav-item"> <a class="nav-link" id="profile2-tab" data-toggle="tab" href="#profile2" role="tab" aria-controls="profile2" aria-selected="false">Profile</a> </li> <li class="nav-item"> <a class="nav-link" id="contact2-tab" data-toggle="tab" href="#contact2" role="tab" aria-controls="contact2" aria-selected="false">Contact</a> </li> </ul> <div class="tab-content" id="myTabContent3"> <div class="tab-pane pt-3 fade show active" id="home2" role="tabpanel" aria-labelledby="home2-tab"> Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </div> <div class="tab-pane pt-3 fade" id="profile2" role="tabpanel" aria-labelledby="profile2-tab"> Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </div> <div class="tab-pane pt-3 fade" id="contact2" role="tabpanel" aria-labelledby="contact2-tab"> Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </div> </div> </div> </div> </div> <div class="col-lg-6"> <div class="card card-default"> <div class="card-header card-header-border-bottom"> <h2>Custom List Tabs</h2> </div> <div class="card-body"> <ul class="nav nav-pills nav-justified nav-style-fill" id="myTab" role="tablist"> <li class="nav-item"> <a class="nav-link active" id="home3-tab" data-toggle="tab" href="#home3" role="tab" aria-controls="home3" aria-selected="true">Home</a> </li> <li class="nav-item"> <a class="nav-link" id="profile3-tab" data-toggle="tab" href="#profile3" role="tab" aria-controls="profile3" aria-selected="false">Profile</a> </li> </ul> <div class="tab-content" id="myTabContent4"> <div class="tab-pane pt-3 fade show active" id="home3" role="tabpanel" aria-labelledby="home3-tab"> Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </div> <div class="tab-pane pt-3 fade" id="profile3" role="tabpanel" aria-labelledby="profile3-tab"> Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </div> </div> </div> </div> </div> <div class="col-lg-6"> <div class="card card-default"> <div class="card-header card-header-border-bottom"> <h2>Vertical Tabs</h2> </div> <div class="card-body"> <div class="row "> <div class="col-sm-4"> <ul class="nav nav-tabs nav-stacked flex-column"> <li class="nav-item"> <a href="#vtab1" class="nav-link active" data-toggle="tab" aria-expanded="true"> <i class="mdi mdi-home"></i> Home</a> </li> <li class="nav-item"> <a href="#vtab2" class="nav-link" data-toggle="tab" aria-expanded="false"> <i class="mdi mdi-account"></i> Profile</a> </li> <li class="nav-item"> <a href="#vtab3" class="nav-link" data-toggle="tab"> <i class="mdi mdi-phone"></i> Contact</a> </li> </ul> </div> <div class="tab-content col-sm-8 "> <div class="tab-pane fade active show" id="vtab1" aria-expanded="true"> Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </div> <div class="tab-pane fade" id="vtab2" aria-expanded="false"> Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </div> <div class="tab-pane fade" id="vtab3" aria-expanded="false"> Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </div> </div> </div> </div> </div> </div> <div class="col-lg-6"> <div class="card card-default"> <div class="card-header card-header-border-bottom"> <h2>Vertical Fill Tabs</h2> </div> <div class="card-body"> <div class="row "> <div class="col-sm-4"> <ul class="nav nav-pills nav-stacked flex-column"> <li class="nav-item"> <a href="#vtab4" class="nav-link active" data-toggle="tab" aria-expanded="true"> <i class="mr-1 fa fa-home"></i> Home</a> </li> <li class="nav-item"> <a href="#vtab5" class="nav-link" data-toggle="tab" aria-expanded="false"> <i class="mr-1 fa fa-user"></i> Profile</a> </li> <li class="nav-item"> <a href="#vtab6" class="nav-link" data-toggle="tab"> <i class="mr-1 fa fa-phone"></i> Contact</a> </li> </ul> </div> <div class="tab-content col-sm-8 "> <div class="tab-pane fade active show" id="vtab4" aria-expanded="true"> Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </div> <div class="tab-pane fade" id="vtab5" aria-expanded="false"> Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </div> <div class="tab-pane fade" id="vtab6" aria-expanded="false"> Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </div> </div> </div> </div> </div> </div> </div>
61.881844
249
0.611792
92e39dffbed6e009a4b5eaed4ea6f7e826156b3b
3,780
c
C
cmds/copy.c
gerard5/plo
d9d621d6ea6a166c88aebc7a815f9a2e5598eb2d
[ "BSD-3-Clause" ]
null
null
null
cmds/copy.c
gerard5/plo
d9d621d6ea6a166c88aebc7a815f9a2e5598eb2d
[ "BSD-3-Clause" ]
44
2020-08-30T12:07:00.000Z
2022-03-24T18:10:58.000Z
cmds/copy.c
gerard5/plo
d9d621d6ea6a166c88aebc7a815f9a2e5598eb2d
[ "BSD-3-Clause" ]
12
2019-01-10T20:10:27.000Z
2022-02-01T21:57:08.000Z
/* * Phoenix-RTOS * * Operating system loader * * Copy data between devices * * Copyright 2021 Phoenix Systems * Author: Hubert Buczynski * * This file is part of Phoenix-RTOS. * * %LICENSE% */ #include "cmd.h" #include <hal/hal.h> #include <lib/lib.h> #include <phfs/phfs.h> static void cmd_copyInfo(void) { lib_printf("copies data between devices, usage:\n"); lib_printf("%17s%s", "", "copy <src dev> <file/offs size> <dst dev> <file/offs size>"); } static ssize_t cmd_cpphfs2phfs(handler_t srcHandler, addr_t srcAddr, size_t srcSz, handler_t dstHandler, addr_t dstAddr, size_t dstSz) { ssize_t res; u8 buff[SIZE_MSG_BUFF]; size_t chunk, rsz = 0, wsz = 0; /* Size is not defined, copy the whole file */ if (srcSz == 0 && dstSz == 0) srcSz = -1; /* Size is defined, use smaller one to copy piece of memory */ else if (srcSz != 0 && dstSz != 0) srcSz = (srcSz < dstSz) ? srcSz : dstSz; /* One of the size is not defined, use the defined one */ else srcSz = (srcSz > dstSz) ? srcSz : dstSz; do { chunk = ((srcSz - rsz) > sizeof(buff)) ? sizeof(buff) : (srcSz - rsz); if ((res = phfs_read(srcHandler, srcAddr + rsz, buff, chunk)) < 0) { log_error("\nCan't read data\n"); return res; } rsz += res; chunk = res; while (chunk) { if ((res = phfs_write(dstHandler, dstAddr + wsz, buff, chunk)) < 0) { log_error("\nCan't write data to address: 0x%x\n", dstAddr + wsz); return res; } chunk -= res; wsz += res; } } while ((srcSz - rsz) > 0 && res > 0); return wsz; } static int cmd_parseDev(handler_t *h, addr_t *offs, size_t *sz, unsigned int argc, char *argv[], unsigned int *argvID, const char **file) { int res; const char *alias; char *endptr; if (h == NULL || offs == NULL || sz == NULL || argv == NULL || argvID == NULL) return -EINVAL; alias = argv[(*argvID)++]; if (*argvID >= argc) { log_error("\n%s: Wrong argument count", argv[0]); return -EINVAL; } *offs = lib_strtoul(argv[*argvID], &endptr, 0); /* Open device using alias to file */ if (*endptr) { *offs = 0; *sz = 0; *file = argv[*argvID]; if ((res = phfs_open(alias, argv[*argvID], 0, h)) < 0) { log_error("\nCan't open file '%s' on %s", argv[*argvID], alias); return res; } (*argvID)++; } /* Open device using direct access to memory */ else { *sz = lib_strtoul(argv[++(*argvID)], &endptr, 0); *file = NULL; if (*endptr) { log_error("\nWrong size value: %s, for %s with offs 0x%x", argv[(*argvID)], alias, *offs); return -EINVAL; } if ((res = phfs_open(alias, NULL, 0, h)) < 0) { log_error("\nCan't open file '%s' with offset 0x%x", alias, *offs); return res; } } return EOK; } static int cmd_copy(int argc, char *argv[]) { size_t sz[2]; ssize_t res; addr_t offs[2]; handler_t h[2]; const char *file[2]; unsigned int argvID = 1; /* Parse all comand's arguments */ if (argc < 5) { log_error("\n%s: Wrong argument count", argv[0]); return -EINVAL; } if ((res = cmd_parseDev(&h[0], &offs[0], &sz[0], argc, argv, &argvID, &file[0])) < 0) return res; if ((res = cmd_parseDev(&h[1], &offs[1], &sz[1], argc, argv, &argvID, &file[1])) < 0) return res; /* Copy data between devices */ log_info("\nCopying data, please wait..."); res = cmd_cpphfs2phfs(h[0], offs[0], sz[0], h[1], offs[1], sz[1]); phfs_close(h[0]); phfs_close(h[1]); if (res < 0) { log_error("\nCopying failed"); return res; } log_info("\nFinished copying"); if ((res = phfs_regFile((file[1] == NULL) ? file[0] : file[1], offs[1], res)) < 0) return res; return EOK; } __attribute__((constructor)) static void cmd_copyReg(void) { const static cmd_t app_cmd = { .name = "copy", .run = cmd_copy, .info = cmd_copyInfo }; cmd_reg(&app_cmd); }
22.771084
137
0.607672
7097f1417e87d6b42a00c914eaca5b8499e9fa0f
287
dart
Dart
lib/app_widget.dart
WashingtonlGarcia/flutter-nasa-clean-arch
85468f2464db2b255549ccc6a8c88ff3684c1e8b
[ "MIT" ]
null
null
null
lib/app_widget.dart
WashingtonlGarcia/flutter-nasa-clean-arch
85468f2464db2b255549ccc6a8c88ff3684c1e8b
[ "MIT" ]
null
null
null
lib/app_widget.dart
WashingtonlGarcia/flutter-nasa-clean-arch
85468f2464db2b255549ccc6a8c88ff3684c1e8b
[ "MIT" ]
null
null
null
import 'package:flutter/material.dart'; import 'features/presenter/pages/home/home_page.dart'; class AppWidget extends StatelessWidget { const AppWidget({Key? key}) : super(key: key); @override Widget build(BuildContext context) { return MaterialApp(home: HomePage()); } }
23.916667
54
0.735192
6e29e97cd9e672090ef8a81e7f431990533fdfef
6,567
html
HTML
contact.html
someshwarmale/epic6
2a2af01bbb9fd9da94d6c109aaa6dd30f0a354ca
[ "CC-BY-3.0" ]
null
null
null
contact.html
someshwarmale/epic6
2a2af01bbb9fd9da94d6c109aaa6dd30f0a354ca
[ "CC-BY-3.0" ]
1
2020-01-19T17:31:59.000Z
2020-01-19T17:32:07.000Z
contact.html
someshwarmale/epic6
2a2af01bbb9fd9da94d6c109aaa6dd30f0a354ca
[ "CC-BY-3.0" ]
1
2020-01-18T14:14:49.000Z
2020-01-18T14:14:49.000Z
<!DOCTYPE html> <html> <head> <title>Nature Lovers Pune</title> <meta name=viewport content="width=device-width, initial-scale=1"> <meta http-equiv=Cache-control content=public> <meta http-equiv=Content-Type content="text/html; charset=utf-8" /> <meta http-equiv=Cache-Control content="no-cache" /> <meta http-equiv=Cache-Control content="max-age=120" /> <meta http-equiv=Content-Disposition content="inline; filename=spreadsheet.xls" /> <meta http-equiv=Content-Type content="application/xhtml+xml;charset=UTF-8" /> <meta http-equiv=X-UA-Compatible content="IE=8" /> <meta http-equiv=X-UA-Compatible content="IE=edge" /> <meta name=keywords content="epic, the epic show india, epic show india, epic show, epic 2019, nature lovers, nature lovers pune, NGO, helping people, disability, disaled" /> <script type=application/x-javascript> addEventListener("load", function() { setTimeout(hideURLbar, 0) }, false); function hideURLbar() { window.scrollTo(0, 1) } </script> <link href=css/bootstrap.css rel=stylesheet type=text/css /> <link href=css/style.css rel=stylesheet type=text/css /> <script src=js/jquery.min.js></script> <script type=text/javascript src=js/move-top.js></script> <script type=text/javascript src=js/easing.js></script> <script type=text/javascript> jQuery(document).ready(function(a) { a(".scroll").click(function(b) { b.preventDefault(); a("html,body").animate({ scrollTop: a(this.hash).offset().top }, 1000) }) }); </script> <link rel=stylesheet type=text/css href=https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css> <link rel=stylesheet type=text/css href=https://www.w3schools.com/w3css/4/w3.css> </head> <body> <div class=head id=home> <div class=container> <div class=head-top> <div class="col-md-6 h-left"> <p></p> </div> <div class="col-md-6 h-right"> <ul> <li><a href=https://www.facebook.com/epicshowindia/><i class="fa fa-facebook" style=font-size:24px;color:white></i></a> </li> <li><a href="https://twitter.com/FoundationEpic?s=08"><i class="fa fa-twitter" style=font-size:24px;color:white></i></a></li> <li><a href=https://www.youtube.com/channel/UCYGC3V8JQK_bmyUpwVBeHzw><i class="fa fa-youtube" style=font-size:24px;color:white></i></a></li> <li><a href="https://www.instagram.com/epicshowindia/?utm_source=ig_profile_share&igshid=132f9k8fbr5ta"><i class="fa fa-instagram" style=font-size:24px;color:white></i></a></li> <li><a href="https://www.linkedin.com/in/epic-foundation-949368199"><i class="fa fa-linkedin" style=font-size:24px;color:white></i></a></li> </ul> </div> <div class=clearfix></div> </div> </div> </div> <div class=header> <div class=container> <div class=header-main> <div class=logo> <a href=index.html><h1>CONTACT US</h1></a> </div> <div class=head-right> <div class=top-nav> <span class=menu><img src=images/nav-icon.png alt> </span> <ul> <li><a href=index.html><span class="glyphicon glyphicon-home"></span>Home</a></li> <li><a href=about.html><span class="glyphicon glyphicon-info-sign"></span>About EPiC</a></li> <li><a href=typo.html><span class="glyphicon glyphicon-certificate"></span>What we do.</a></li> <li><a href=about2.html><span class="glyphicon glyphicon-tree-deciduous"></span>Nature lovers</a></li> <li><a href=gallery.html><span class="glyphicon glyphicon-picture"></span>Gallery</a></li> <li><a href=https://goo.gl/forms/jdyEWYqh0JxntQjb2><span class="glyphicon glyphicon-tags"></span>Passes</a></li> <li><a href=contact.html class=active><span class="glyphicon glyphicon-envelope"></span>Contact</a></li> <div class=clearfix> </div> </ul> <script> $("span.menu").click(function() { $(".top-nav ul").slideToggle(500, function() {}) }); </script> </div> </div> <div class=clearfix> </div> </div> </div> </div> <div class=contact> <div class=container> <div class="contact-top heading"> <h2>Contact Us</h2> </div> </div> </div> <div class=address> <div class=container> <div class=address-top> <div class="col-md-4 add-left"> <span class="glyphicon glyphicon-map-marker" aria-hidden=true></span> <p> <label>Address.</label> Kanchan Galli,Law College Road, Pune-411004</p> </div> <div class="col-md-4 add-left"> <span class="glyphicon glyphicon-earphone" aria-hidden=true></span> <p>+91 9529749773 <br>+91 9765926339</p> </div> <div class="col-md-4 add-left"> <span class="glyphicon glyphicon-envelope" aria-hidden=true></span> <p><a href=mailto:epicfoundationpune@gmail.com>epicfoundationpune@gmail.com</a> <br><a href=mailto:epicshowindia@gmail.com>epicshowindia@gmail.com</a></p> </div> <div class=clearfix></div> </div> </div> </div> <div class=footer> <div class=container> <div class=footer-top> <a href=index.html><h3>EPIC FOUNDATION, PUNE</h3></a> <p>© 2018 EPIC FOUNDATION PUNE. All Rights Reserved </p> <a href=#home class=scroll><img src=images/top-arrow.png alt /></a> </div> </div> </div> </body> </html>
48.286765
201
0.525049
6b1d821b32de014ded3506133421d22ca405554c
995
kt
Kotlin
rpglib/src/main/kotlin/com/naosim/rpglib/model/script/MessageScriptLooper.kt
naosim/RPGSample
a26dd7ff3da98dd82eabbff50bd2098974743655
[ "MIT" ]
null
null
null
rpglib/src/main/kotlin/com/naosim/rpglib/model/script/MessageScriptLooper.kt
naosim/RPGSample
a26dd7ff3da98dd82eabbff50bd2098974743655
[ "MIT" ]
null
null
null
rpglib/src/main/kotlin/com/naosim/rpglib/model/script/MessageScriptLooper.kt
naosim/RPGSample
a26dd7ff3da98dd82eabbff50bd2098974743655
[ "MIT" ]
null
null
null
package com.naosim.rpglib.model.script import com.naosim.rpglib.model.viewmodel.MessageViewModel import com.naosim.rpglib.model.viewmodel.OnNextListener class MessageScriptLooper( val messageViewModel: MessageViewModel, val scriptSet: ScriptSet ): OnNextListener { var count = 0; fun start() { next() } fun next() { if(count >= scriptSet.messageScriptList.size) { messageViewModel.dismiss() scriptSet.onEnd.invoke() return } val script = scriptSet.messageScriptList.get(count) if(script is SimpleMessageScript) { messageViewModel.clear() messageViewModel.appendText(script.message, { waitNext() }) } count++ } var isWaitingNext = false; fun waitNext() { isWaitingNext = true; } override fun onNext() { if(!isWaitingNext) { return } next() isWaitingNext = false } }
23.139535
71
0.59799
4c2400a1d759e29fce86f13fd8d047d577eb5f06
320
php
PHP
tests/Unit/DisabledExposeGlobalFieldsInGraphQLSchemaFixtureQueryExecutionGraphQLServerTest.php
getpop/graphql
5eb9468dcc809ce8481e00df03ec7c52611352c0
[ "MIT" ]
2
2020-01-11T06:32:47.000Z
2020-01-21T10:06:16.000Z
tests/Unit/DisabledExposeGlobalFieldsInGraphQLSchemaFixtureQueryExecutionGraphQLServerTest.php
getpop/graphql
5eb9468dcc809ce8481e00df03ec7c52611352c0
[ "MIT" ]
null
null
null
tests/Unit/DisabledExposeGlobalFieldsInGraphQLSchemaFixtureQueryExecutionGraphQLServerTest.php
getpop/graphql
5eb9468dcc809ce8481e00df03ec7c52611352c0
[ "MIT" ]
1
2020-03-30T14:59:34.000Z
2020-03-30T14:59:34.000Z
<?php declare(strict_types=1); namespace GraphQLByPoP\GraphQLServer\Unit; class DisabledExposeGlobalFieldsInGraphQLSchemaFixtureQueryExecutionGraphQLServerTest extends AbstractExposeGlobalFieldsInGraphQLSchemaFixtureQueryExecutionGraphQLServerTest { use DisabledFixtureQueryExecutionGraphQLServerTestCaseTrait; }
29.090909
173
0.903125
4711a36b5c0960661cae1523777f4a9bc3346a4e
1,047
swift
Swift
MobileUI/UIFont.swift
velvetroom/Waverley
e600ce75f7d037a1124c16c03c75ee307c09a7cd
[ "MIT" ]
null
null
null
MobileUI/UIFont.swift
velvetroom/Waverley
e600ce75f7d037a1124c16c03c75ee307c09a7cd
[ "MIT" ]
null
null
null
MobileUI/UIFont.swift
velvetroom/Waverley
e600ce75f7d037a1124c16c03c75ee307c09a7cd
[ "MIT" ]
null
null
null
import UIKit extension UIFont { class func editorLight(_ size:CGFloat) -> UIFont { return UIFont(name:"SourceCodeRoman-Light", size:size)! } class func editorBold(_ size:CGFloat) -> UIFont { return UIFont(name:"SourceCodeRoman-Bold", size:size)! } class func printLight(_ size:CGFloat) -> UIFont { return .systemFont(ofSize:size, weight:.light) } class func printBold(_ size:CGFloat) -> UIFont { return .systemFont(ofSize:size, weight:.bold) } class func printLightItalic(_ size:CGFloat) -> UIFont { return UIFont(descriptor:UIFontDescriptor(name:UIFont.systemFont(ofSize:size, weight:.light).familyName, size:size).withSymbolicTraits(.traitItalic)!, size:size) } class func printBoldItalic(_ size:CGFloat) -> UIFont { return UIFont(descriptor:UIFontDescriptor(name:UIFont.systemFont(ofSize:size, weight:.bold).familyName, size:size).withSymbolicTraits([.traitItalic, .traitBold])!, size:size) } }
61.588235
120
0.663801
801b3390ef55fea96111970bab6bffea28033e30
677
dart
Dart
packages/flame/lib/src/experimental/world.dart
anderlli0053/flame
fa2eabad65e06d09128439be4adfe435e12ac168
[ "MIT" ]
null
null
null
packages/flame/lib/src/experimental/world.dart
anderlli0053/flame
fa2eabad65e06d09128439be4adfe435e12ac168
[ "MIT" ]
null
null
null
packages/flame/lib/src/experimental/world.dart
anderlli0053/flame
fa2eabad65e06d09128439be4adfe435e12ac168
[ "MIT" ]
null
null
null
import 'dart:ui'; import 'package:meta/meta.dart'; import '../components/component.dart'; import 'camera_component.dart'; /// The root component for all game world elements. /// /// The primary feature of this component is that it disables regular rendering, /// and allows itself to be rendered through a [CameraComponent] only. The /// updates proceed through the world tree normally. class World extends Component { @override void renderTree(Canvas canvas) {} /// Internal rendering method invoked by the [CameraComponent]. @internal void renderFromCamera(Canvas canvas) { assert(CameraComponent.currentCamera != null); super.renderTree(canvas); } }
28.208333
80
0.741507
11f312671a7e5d095f97486955df6cde9e072a66
531
cpp
C++
01_decisions/dna_hamming.cpp
acc-cosc-1337-spring-2019/midterm-spring-2019-artgonzalezacc
00393b43a56224709ef5d98a7c41dfe7e6aa385e
[ "MIT" ]
null
null
null
01_decisions/dna_hamming.cpp
acc-cosc-1337-spring-2019/midterm-spring-2019-artgonzalezacc
00393b43a56224709ef5d98a7c41dfe7e6aa385e
[ "MIT" ]
null
null
null
01_decisions/dna_hamming.cpp
acc-cosc-1337-spring-2019/midterm-spring-2019-artgonzalezacc
00393b43a56224709ef5d98a7c41dfe7e6aa385e
[ "MIT" ]
null
null
null
/* Write code for value-return function get_dna_hamming_distance with two const string reference parameters that returns an int. Problem Figure 2. The Hamming distance between these two strings is 7. Mismatched symbols are colored red. Given two strings s and t of equal length, the Hamming distance between s and t, denoted dH(s,t), is the number ofcorresponding symbols that differ in s and t. Sample for function call int distance = get_dna_hamming_distance("GAGCCTACTAACGGGAT", "CATCGTAATGACGGCCT"); distance will be 7 */
35.4
87
0.798493
b2efa45aafbdbf20dc2a3beb6bb3e66667896bb3
414
py
Python
DNN_Experiments/MaskRCNN/convert.py
wmjpillow/FlameDetectionAPP
c3761c9e15adccbd084b17cd6b6f63c561c7f856
[ "MIT" ]
2
2019-12-28T21:46:18.000Z
2020-01-10T03:41:03.000Z
DNN_Experiments/MaskRCNN/convert.py
wmjpillow/FlameDetectionAPP
c3761c9e15adccbd084b17cd6b6f63c561c7f856
[ "MIT" ]
10
2019-12-28T21:31:19.000Z
2020-04-12T20:01:58.000Z
DNN_Experiments/MaskRCNN/convert.py
wmjpillow/FlameDetectionAPP
c3761c9e15adccbd084b17cd6b6f63c561c7f856
[ "MIT" ]
null
null
null
#!/usr/bin/env python # convert jpg tp png from glob import glob import cv2 pngs = glob('./*.jpg') for j in pngs: img = cv2.imread(j) cv2.imwrite(j[:-3] + 'png', img) # delete jpg files import glob import os dir = "/Users/wangmeijie/ALLImportantProjects/FlameDetectionAPP/Models/MaskRCNN/02_26_2020/Mask_RCNN/dataset/train" for jpgpath in glob.iglob(os.path.join(dir, '*.jpg')): os.remove(jpgpath)
21.789474
115
0.707729
39df36c8feaf4a550c561665ced173847db30517
3,017
java
Java
src/main/java/com/tuin/business/service/mapping/EntidadrolServiceMapper.java
appecapps/tuinstrflt
c525c491c84cc496e02c01967e40463dd0be5672
[ "MIT" ]
null
null
null
src/main/java/com/tuin/business/service/mapping/EntidadrolServiceMapper.java
appecapps/tuinstrflt
c525c491c84cc496e02c01967e40463dd0be5672
[ "MIT" ]
null
null
null
src/main/java/com/tuin/business/service/mapping/EntidadrolServiceMapper.java
appecapps/tuinstrflt
c525c491c84cc496e02c01967e40463dd0be5672
[ "MIT" ]
null
null
null
/* * Created on 28 ago 2017 ( Time 17:51:15 ) * Generated by Telosys Tools Generator ( version 2.1.1 ) */ package com.tuin.business.service.mapping; import org.modelmapper.ModelMapper; import org.modelmapper.convention.MatchingStrategies; import org.springframework.stereotype.Component; import com.tuin.bean.Entidadrol; import com.tuin.bean.jpa.EntidadrolEntity; import com.tuin.bean.jpa.RolEntity; import com.tuin.bean.jpa.EntidadEntity; /** * Mapping between entity beans and display beans. */ @Component public class EntidadrolServiceMapper extends AbstractServiceMapper { /** * ModelMapper : bean to bean mapping library. */ private ModelMapper modelMapper; /** * Constructor. */ public EntidadrolServiceMapper() { modelMapper = new ModelMapper(); modelMapper.getConfiguration().setMatchingStrategy(MatchingStrategies.STRICT); } /** * Mapping from 'EntidadrolEntity' to 'Entidadrol' * @param entidadrolEntity */ public Entidadrol mapEntidadrolEntityToEntidadrol(EntidadrolEntity entidadrolEntity) { if(entidadrolEntity == null) { return null; } //--- Generic mapping Entidadrol entidadrol = map(entidadrolEntity, Entidadrol.class); //--- Link mapping ( link to Rol ) if(entidadrolEntity.getRol() != null) { entidadrol.setRolid(entidadrolEntity.getRol().getId()); } //--- Link mapping ( link to Entidad ) if(entidadrolEntity.getEntidad() != null) { entidadrol.setEntidadid(entidadrolEntity.getEntidad().getId()); } return entidadrol; } /** * Mapping from 'Entidadrol' to 'EntidadrolEntity' * @param entidadrol * @param entidadrolEntity */ public void mapEntidadrolToEntidadrolEntity(Entidadrol entidadrol, EntidadrolEntity entidadrolEntity) { if(entidadrol == null) { return; } //--- Generic mapping map(entidadrol, entidadrolEntity); //--- Link mapping ( link : entidadrol ) if( hasLinkToRol(entidadrol) ) { RolEntity rol1 = new RolEntity(); rol1.setId( entidadrol.getRolid() ); entidadrolEntity.setRol( rol1 ); } else { entidadrolEntity.setRol( null ); } //--- Link mapping ( link : entidadrol ) if( hasLinkToEntidad(entidadrol) ) { EntidadEntity entidad2 = new EntidadEntity(); entidad2.setId( entidadrol.getEntidadid() ); entidadrolEntity.setEntidad( entidad2 ); } else { entidadrolEntity.setEntidad( null ); } } /** * Verify that Rol id is valid. * @param Rol Rol * @return boolean */ private boolean hasLinkToRol(Entidadrol entidadrol) { if(entidadrol.getRolid() != null) { return true; } return false; } /** * Verify that Entidad id is valid. * @param Entidad Entidad * @return boolean */ private boolean hasLinkToEntidad(Entidadrol entidadrol) { if(entidadrol.getEntidadid() != null) { return true; } return false; } /** * {@inheritDoc} */ @Override protected ModelMapper getModelMapper() { return modelMapper; } protected void setModelMapper(ModelMapper modelMapper) { this.modelMapper = modelMapper; } }
23.944444
104
0.709645
6b4302e516ea526056902ab28e913ad155bc8bee
1,769
html
HTML
doc/device-modeling-guidelines/topic21.html
qiyancos/Simics-3.0.31
9bd52d5abad023ee87a37306382a338abf7885f1
[ "BSD-4-Clause", "FSFAP" ]
1
2020-06-15T10:41:18.000Z
2020-06-15T10:41:18.000Z
doc/device-modeling-guidelines/topic21.html
qiyancos/Simics-3.0.31
9bd52d5abad023ee87a37306382a338abf7885f1
[ "BSD-4-Clause", "FSFAP" ]
null
null
null
doc/device-modeling-guidelines/topic21.html
qiyancos/Simics-3.0.31
9bd52d5abad023ee87a37306382a338abf7885f1
[ "BSD-4-Clause", "FSFAP" ]
3
2020-08-10T10:25:02.000Z
2021-09-12T01:12:09.000Z
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Device Model Style</title> <style>@import url(style.css);</style> </head> <body class="jdocu_main"> <script type="text/javascript"> parent.frames['toc'].d.openTo(35, true); </script> <a name="label63"></a><p class="jdocu_navbarp"><span class="jdocu_navbar">VIRTUTECH CONFIDENTIAL&nbsp;&nbsp;&nbsp;&nbsp;<a class="jdocu" href="topic20.html">Previous</a> - <a class="jdocu" href="topic20.html">Up</a> - <a class="jdocu" href="topic22.html">Next</a></span></p> <h3 class="jdocu">9.1&nbsp;&nbsp;&nbsp;Device Model Style</h3 class="jdocu"> <a name="label64"></a> <p> The user interface of a Simics module consists of three parts: its attributes, its interfaces, and the commands it adds to the Simics command-line interface. You should try to make the user interface of your model similar in style to that of existing Simics models. <p> Every model should have an <b><a name="label65">info</a></b> command, giving static information about the device, and a <b><a name="label66">status</a></b> command, that gives dynamic information. See the <em>Simics Programming Guide</em> for more information. <p> Look at the interfaces of similar devices to see what other commands may be useful, and try to use the same names for similar commands and parameters. Use existing API functionality where appropriate, rather than inventing your own. <p> <p class="jdocu_navbarp"><span class="jdocu_navbar">VIRTUTECH CONFIDENTIAL&nbsp;&nbsp;&nbsp;&nbsp;<a class="jdocu" href="topic20.html">Previous</a> - <a class="jdocu" href="topic20.html">Up</a> - <a class="jdocu" href="topic22.html">Next</a></span></p> </body> </html>
46.552632
274
0.705483
fb2a32c6fc72141acc58c07f568023620ba873be
340
go
Go
6_Control_Flow/5_if_statments/main.go
BarSnir/Golang-Studies
1efe13573c54486acd64edd5a033636443d3a269
[ "MIT" ]
null
null
null
6_Control_Flow/5_if_statments/main.go
BarSnir/Golang-Studies
1efe13573c54486acd64edd5a033636443d3a269
[ "MIT" ]
null
null
null
6_Control_Flow/5_if_statments/main.go
BarSnir/Golang-Studies
1efe13573c54486acd64edd5a033636443d3a269
[ "MIT" ]
null
null
null
package main import ( "fmt" ) func main() { if true { fmt.Println("True-A") } if false { fmt.Println("True-B") } if !true { fmt.Println("True-C") } if !false { fmt.Println("True-D") } if !(2 == 2) { fmt.Println("True-E") } if !(2 != 2) { fmt.Println("True-F") } if x := 2; x == 2 { fmt.Println("True-G") } }
10.967742
23
0.508824
c5e59ff2ddeb04d50bce666dd4f035bfa3d56a6f
7,844
cc
C++
Code/Components/Services/ingest/current/apps/tMSSink.cc
steve-ord/askapsoft
21b9df1b393b973ec312591efad7ee2b8c974811
[ "BSL-1.0", "Apache-2.0", "OpenSSL" ]
1
2020-06-18T08:37:43.000Z
2020-06-18T08:37:43.000Z
Code/Components/Services/ingest/current/apps/tMSSink.cc
ATNF/askapsoft
d839c052d5c62ad8a511e58cd4b6548491a6006f
[ "BSL-1.0", "Apache-2.0", "OpenSSL" ]
null
null
null
Code/Components/Services/ingest/current/apps/tMSSink.cc
ATNF/askapsoft
d839c052d5c62ad8a511e58cd4b6548491a6006f
[ "BSL-1.0", "Apache-2.0", "OpenSSL" ]
null
null
null
/// @file tMSSink.cc /// @details /// This application runs MSSink task with mock up data. This is handy /// for performance testing. /// /// @copyright (c) 2010 CSIRO /// Australia Telescope National Facility (ATNF) /// Commonwealth Scientific and Industrial Research Organisation (CSIRO) /// PO Box 76, Epping NSW 1710, Australia /// atnf-enquiries@csiro.au /// /// This file is part of the ASKAP software distribution. /// /// The ASKAP software distribution is free software: you can redistribute it /// and/or modify it under the terms of the GNU General Public License as /// published by the Free Software Foundation; either version 2 of the License, /// or (at your option) any later version. /// /// This program is distributed in the hope that it will be useful, /// but WITHOUT ANY WARRANTY; without even the implied warranty of /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the /// GNU General Public License for more details. /// /// You should have received a copy of the GNU General Public License /// along with this program; if not, write to the Free Software /// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA /// /// @author Max Voronkov <maxim.voronkov@csiro.au> // System includes #include <iostream> #include <iomanip> #include <string> // Include package level header file #include "askap_cpingest.h" // casa #include "casacore/casa/OS/Timer.h" // ASKAPsoft includes #include "cpcommon/ParallelCPApplication.h" #include "askap/AskapLogging.h" #include "askap/AskapError.h" #include "boost/shared_ptr.hpp" #include "cpcommon/VisDatagram.h" // Local package includes #include "monitoring/MonitoringSingleton.h" #include "ingestpipeline/mssink/MSSink.h" #include "ingestpipeline/sourcetask/VisConverterADE.h" #include "configuration/Configuration.h" // Includes all configuration attributes too #include "cpcommon/VisChunk.h" // I am not very happy to have MPI includes here, we may abstract this interaction // eventually. This task is specific for the parallel case, so there is no reason to // hide MPI for now. #include <mpi.h> // Using using namespace askap; using namespace askap::cp; using namespace askap::cp::ingest; ASKAP_LOGGER(logger, "tMSSink"); class MSSinkTestApp : public askap::cp::common::ParallelCPApplication { public: virtual void run() { //ASKAPCHECK(!isStandAlone() && numProcs() > 1, "This test application is specific to parallel multi-rank case and can't be used in stand-alone mode"); int count = config().getInt32("count", 10); ASKAPCHECK(count > 0, "Expect positive number of timestamps to receive, you have = "<<count); uint32_t expectedCount = static_cast<uint32_t>(count); const bool doSync = numProcs() > 1 ? config().getBool("syncranks", false) : false; if (doSync) { ASKAPLOG_INFO_STR(logger, "Ranks will be synchronised and same timestamps will be written on all ranks for all cycles"); } Configuration cfg(config(), rank(), numProcs()); // setup monitoring, if necessary if (!cfg.monitoringConfig().registryHost().empty()) { MonitoringSingleton::init(cfg); } // a number of generic monitoring points just in case they're useful // This code is similar to what ingest is doing, but pass altered string // for SoftwareVersion, this will help to identify tMSSink as opposed to // normal ingest MonitoringSingleton::update<int32_t>("NumberOfRanks",cfg.nprocs()); MonitoringSingleton::update<int32_t>("ReceiverId",cfg.receiverId()); MonitoringSingleton::update<int32_t>("nReceivers",cfg.nReceivingProcs()); MonitoringSingleton::update<std::string>("NodeName",cfg.nodeName()); const std::string versionStr = getAskapPackageVersion_cpingest(); const size_t pos = versionStr.find("ingest; "); if (pos != std::string::npos) { ASKAPDEBUGASSERT(versionStr.size() >= pos + 8); MonitoringSingleton::update<std::string>("SoftwareVersion","tMSSink; " + versionStr.substr(pos+8)); } else { MonitoringSingleton::update<std::string>("SoftwareVersion","tMSSink; " + versionStr); } ASKAPLOG_INFO_STR(logger, "Setting up mock up data structure for rank="<<rank()); VisConverter<VisDatagramADE> conv(config(), cfg); const CorrelatorMode &corrMode = cfg.lookupCorrelatorMode("standard"); conv.initVisChunk(4976749386006000ul, corrMode); const float corrInterval = static_cast<float>(corrMode.interval()) / 1e6; // in seconds boost::shared_ptr<common::VisChunk> chunk = conv.visChunk(); ASKAPASSERT(chunk); // populate beam offsets from static configuration cfg.feed().fillMatrix(chunk->beamOffsets()); // // unflag samples to avoid possible confusion due to large reported number of flagged visibilities chunk->flag().set(false); casa::Timer timer; float processingTime = 0.; float totalSyncTime = 0.; size_t actualCount = 0; ASKAPLOG_INFO_STR(logger, "Initialising MSSink constructor for rank="<<rank()); timer.mark(); MSSink sink(config(), cfg); const float initTime = timer.real(); ASKAPLOG_INFO_STR(logger, "MSSink initialisation time: "<<initTime<<" seconds"); ASKAPLOG_INFO_STR(logger, "Running the test for rank="<<rank()); for (uint32_t count = 0; count < expectedCount; ++count) { timer.mark(); if (doSync) { ASKAPDEBUGASSERT(numProcs() > 1); double timeRecvBuf[2]; if (rank() == 0) { timeRecvBuf[0] = chunk->time().getDay(); timeRecvBuf[1] = chunk->time().getDayFraction(); } const int response = MPI_Bcast(timeRecvBuf, 2, MPI_DOUBLE, 0, MPI_COMM_WORLD); ASKAPCHECK(response == MPI_SUCCESS, "Error gathering times, response from MPI_Bcast = "<<response); if (rank() != 0) { const casa::MVEpoch receivedTime(timeRecvBuf[0], timeRecvBuf[1]); chunk->time() = receivedTime; } } const float syncTime = timer.real(); totalSyncTime += syncTime; //uncomment this to trigger FEED table update every cycle (with junk values) //chunk->beamOffsets().set(float(count)/180.*casa::C::pi); ASKAPLOG_INFO_STR(logger, "Received "<<count + 1<<" integration(s) for rank="<<rank()); timer.mark(); sink.process(chunk); const float runTime = timer.real(); ASKAPLOG_INFO_STR(logger, " - mssink took "<<runTime<<" seconds"); processingTime += runTime; ++actualCount; if (rank() == 0 || !doSync) { chunk->time() += casa::Quantity(corrInterval > 0 ? corrInterval : 5.,"s"); if (runTime + syncTime < corrInterval) { sleep(corrInterval - runTime - syncTime); } else { if (corrInterval > 0) { ASKAPLOG_INFO_STR(logger, "Not keeping up! interval = "<<corrInterval<<" seconds, but needed "<<runTime+syncTime<<" seconds this cycle"); } } } } if (actualCount > 0) { ASKAPLOG_INFO_STR(logger, "Average running time per cycle: "<<processingTime / actualCount<< " seconds, "<<actualCount<<" iteratons averaged"); if (doSync) { ASKAPLOG_INFO_STR(logger, "Average synchronisation time per cycle: "<<totalSyncTime / actualCount<< " seconds, "<<actualCount<<" iteratons averaged"); } } } private: }; int main(int argc, char *argv[]) { MSSinkTestApp app; return app.main(argc, argv); }
41.723404
160
0.645589
e8ec845a92cf55d2d913198734d9f2f9a641e12b
3,322
cpp
C++
graph-source-code/231-E/4312917.cpp
AmrARaouf/algorithm-detection
59f3028d2298804870b32729415d71eec6116557
[ "MIT" ]
null
null
null
graph-source-code/231-E/4312917.cpp
AmrARaouf/algorithm-detection
59f3028d2298804870b32729415d71eec6116557
[ "MIT" ]
null
null
null
graph-source-code/231-E/4312917.cpp
AmrARaouf/algorithm-detection
59f3028d2298804870b32729415d71eec6116557
[ "MIT" ]
null
null
null
//Language: GNU C++0x #include <iostream> #include <cstdio> #include <cstring> #include <cstdlib> #include <cmath> #include <vector> #include <algorithm> #include <functional> #include <stack> #include <queue> #include <deque> #include <string> #include <sstream> #include <map> #include <set> #include <cassert> #ifdef LOCAL #define ATHFILE(f) freopen(f ".in", "r", stdin), freopen(f ".my", "w", stdout) #else #define ATHFILE(f) #endif #define DEBUGT(t) if (_t == t) _asm int 3 typedef long long LL; typedef long double LD; inline int RD() { int x; scanf("%d", &x); return x; } inline char RDA() { char ch; while ((ch = getchar()) && !isalpha(ch)); return ch; } #define Rush for (int tests = RD(), _t = 1; _t <= tests; ++_t) #define ZMV(x, v) memset((x), (v), sizeof(x)) #define ZM(x) memset((x), 0, sizeof(x)) #define SZ(v) (int)(v.size()) #define ALL(v) v.begin(), v.end() const int maxint = 0x7f7f7f7f; const int mod = 1000000007; const double eps = 1e-10, pi = acos(-1.0); using namespace std; const int maxn = 100001; int n, m, dfn[maxn], low[maxn], ind, color, block[maxn], size[maxn]; vector<int> edge[maxn], tree[maxn]; stack<int> sk; void tarjan(int u, int pa = -1) { int v; dfn[u] = low[u] = ++ind; sk.push(u); for (auto it = edge[u].begin(); it != edge[u].end(); ++it) { v = *it; if (v == pa) continue; if (!dfn[v]) { tarjan(v, u); low[u] = min(low[u], low[v]); } else low[u] = min(low[u], dfn[v]); } if (dfn[u] == low[u]) { ++color; do { v = sk.top(); block[v] = color; ++size[color]; sk.pop(); } while (u != v); } } const int logn = 26; int parent[maxn], lca[logn][maxn], depth[maxn], cnt[maxn]; void dfs(int u, int pa = -1) { cnt[u] = (pa == -1 ? 0 : cnt[pa]) + (size[u] > 1 ? 1 : 0); for (auto it = tree[u].begin(); it != tree[u].end(); ++it) { if (*it != pa) { parent[*it] = u; depth[*it] = depth[u] + 1; dfs(*it, u); } } } void initLCA(int n) { dfs(1); for (int i = 1; i <= n; ++i) lca[0][i] = parent[i]; for (int j = 1; j < logn; ++j) { for (int i = 1; i <= n; ++i) { lca[j][i] = lca[j - 1][lca[j - 1][i]]; } } } int LCA(int x, int y) { if (depth[x] < depth[y]) swap(x, y); for (int i = logn - 1; i >= 0; --i) { if (depth[x] - (1 << i) >= depth[y]) x = lca[i][x]; } if (x == y) return x; for (int i = logn - 1; i >= 0; --i) { if (lca[i][x] != lca[i][y]) { x = lca[i][x], y = lca[i][y]; } } return lca[0][x]; } int two[maxn]; int main() { two[0] = 1; for (int i = 1; i < maxn; ++i) two[i] = two[i - 1] * 2 % mod; n = RD(); m = RD(); while (m--) { int u = RD(), v = RD(); edge[u].push_back(v); edge[v].push_back(u); } tarjan(1); for (int i = 1; i <= n; ++i) { for (auto it = edge[i].begin(); it != edge[i].end(); ++it) { int j = *it; if (block[i] != block[j]) tree[block[i]].push_back(block[j]); } } for (int i = 1; i <= color; ++i) { sort(ALL(tree[i])); tree[i].erase(unique(ALL(tree[i])), tree[i].end()); } initLCA(color); int q = RD(); while (q--) { int u = RD(), v = RD(), l; u = block[u], v = block[v]; l = LCA(u, v); int ans = cnt[u] + cnt[v] - 2 * cnt[l]; if (size[l] > 1) ++ans; printf("%d\n", two[ans]); } return 0; }
23.394366
84
0.504515
cb334e4a93cfc4a6a369f8923f70704b66f315f4
2,325
go
Go
day02/day02.go
jaredpar/advent2021
bcbb3eb1817c3018ffe87457b643d8a04b10db63
[ "MIT" ]
3
2021-12-01T16:16:07.000Z
2021-12-07T20:48:10.000Z
day02/day02.go
jaredpar/advent2021
bcbb3eb1817c3018ffe87457b643d8a04b10db63
[ "MIT" ]
null
null
null
day02/day02.go
jaredpar/advent2021
bcbb3eb1817c3018ffe87457b643d8a04b10db63
[ "MIT" ]
null
null
null
package day02 import ( "embed" "errors" "fmt" "strconv" "strings" "advent2021.com/util" ) //go:embed *.txt var f embed.FS type direction int type movement struct { direction direction value int } const ( DirectionUp direction = iota DirectionDown DirectionForward ) func parseDirection(value string) (direction, error) { switch value { case "up": return DirectionUp, nil case "down": return DirectionDown, nil case "forward": return DirectionForward, nil default: return DirectionUp, nil } } func readMovements(fileName string) ([]movement, error) { lines, err := util.ReadLines(f, fileName) if err != nil { return nil, err } movements := make([]movement, len(lines)) for _, line := range lines { parts := strings.Split(line, " ") if len(parts) != 2 { message := fmt.Sprintf("Input misformed: %s", line) return nil, errors.New(message) } direction, err := parseDirection(parts[0]) if err != nil { message := fmt.Sprintf("Invalid direction: %s", parts[0]) return nil, errors.New(message) } value, err := strconv.Atoi(parts[1]) if err != nil { return nil, err } movement := movement{direction: direction, value: value} movements = append(movements, movement) } return movements, nil } func calcPosition(fileName string) int { movements, err := readMovements(fileName) if err != nil { panic(err) } position := 0 depth := 0 for _, movement := range movements { switch movement.direction { case DirectionUp: depth -= movement.value case DirectionDown: depth += movement.value case DirectionForward: position += movement.value default: panic("bad enum") } } return position * depth } func calcPositionWithAim(fileName string) (position int, depth int, aim int) { movements, err := readMovements(fileName) if err != nil { panic(err) } for _, movement := range movements { switch movement.direction { case DirectionUp: aim -= movement.value case DirectionDown: aim += movement.value case DirectionForward: position += movement.value depth += aim * movement.value default: panic("bad enum") } } return } func CalcPart1() int { return calcPosition("input.txt") } func CalcPart2() int { position, depth, _ := calcPositionWithAim("input.txt") return position * depth }
18.023256
78
0.677419
99529731b7c5ea57a6e044a76c8d116fcce3588a
1,663
h
C
include/ssmis.h
rgrumbine/mmablib
107ba1b1026c3cfed97346233c9a76d3d170d544
[ "Apache-2.0" ]
null
null
null
include/ssmis.h
rgrumbine/mmablib
107ba1b1026c3cfed97346233c9a76d3d170d544
[ "Apache-2.0" ]
null
null
null
include/ssmis.h
rgrumbine/mmablib
107ba1b1026c3cfed97346233c9a76d3d170d544
[ "Apache-2.0" ]
null
null
null
#ifndef SSMIS_INCLUDE #define SSMIS_INCLUDE /* Robert Grumbine 2008 -- present */ /* Set up data types/classes as appropriate for the AVHRR instruments on */ /* NOAA-17, 18, and METOP-A */ /* Translate to AMSR-suitable 10 April 2009 */ /* Translate to SSMI-S 15 October 2010 */ /* Frequencies are . 19.35, 22.235, 37, 91.655, 150 GHz */ /* horizontal, then vertical, polarization except 22 and 150 which */ /* are H only */ /* Note that we are ignoring the sounding channels */ typedef struct { float tmbr; /* to 0.01 K, note no channel number or latinfo here. Simpler system */ } ssmisu_spots; typedef struct { short int satid; short int year; unsigned char month, day, hour, minute, second; double clat, clon; ssmisu_spots obs[8]; } ssmisupt; /* Note that these indices refer to the ssmisupt, rather than the */ /* ice spot values I'll be using later */ #define SSMIS_T150H 0 #define SSMIS_T19H 1 #define SSMIS_T19V 2 #define SSMIS_T22V 3 #define SSMIS_T37H 4 #define SSMIS_T37V 5 #define SSMIS_T92V 6 #define SSMIS_T92H 7 /* RG: Look this up -- currently copying ssmi value */ #ifndef SSMIS_MAX_LATITUDE #define SSMIS_MAX_LATITUDE 88.5 #endif #define NSPOTS 1000 /* Structures which relate to bufr decoding */ typedef struct { ssmisupt full[NSPOTS]; } scan_points; extern int process_bufr(ssmisupt *b); extern int check_bufr(ssmisupt *b); extern void zero_bufr(ssmisupt *b); #endif
27.716667
75
0.61816
90a57025bf40b479c7e55d79d9c1170e8f6187ac
2,705
swift
Swift
Tests/LeetcodeTests/UnitTests/Cases/API Calls/Favorite List/DeleteFavoriteListTest.swift
yaroslav-zhurakovskiy/LeetcodeSwift
a5c0ad38513641dc954961ca05bf6f273957928a
[ "MIT" ]
null
null
null
Tests/LeetcodeTests/UnitTests/Cases/API Calls/Favorite List/DeleteFavoriteListTest.swift
yaroslav-zhurakovskiy/LeetcodeSwift
a5c0ad38513641dc954961ca05bf6f273957928a
[ "MIT" ]
null
null
null
Tests/LeetcodeTests/UnitTests/Cases/API Calls/Favorite List/DeleteFavoriteListTest.swift
yaroslav-zhurakovskiy/LeetcodeSwift
a5c0ad38513641dc954961ca05bf6f273957928a
[ "MIT" ]
null
null
null
// // Created by Yaroslav Zhurakovskiy // Copyright © 2019-2020 Yaroslav Zhurakovskiy. All rights reserved. // import XCTest @testable import Leetcode import Foundation class DeleteFavoriteListTests: LeetcodeTestCase { func testStatus204() throws { try urlSessionSpy.setSuccessResult(bodyStub: .empty, statusCode: 204) var result: Result<Void, Error>! leetcode.deleteFavoriteList(byHashID: .any) { result = $0 } assertCorrectRequest(usingID: .any) XCTAssertNotNil(result) assertSuccess(result) } func testStatusNot204() { let data = Data.test let response = HTTPURLResponse(statusCode: 1_000) urlSessionSpy.setResult(.success((data: data, response: response))) var result: Result<Void, Error>! leetcode.deleteFavoriteList(byHashID: .any) { result = $0 } assertCorrectRequest(usingID: .any) XCTAssertNotNil(result) assertFailure(result) let error = retreiveError(fromResult: result, as: LeetcodeHTTPError.self) XCTAssertTrue(error.response === response) XCTAssertEqual(error.responseBody, data) } func testFailure() { let testError = TestError.shared urlSessionSpy.setFailureResult(error: testError) var result: Result<Void, Error>! leetcode.deleteFavoriteList(byHashID: .any) { result = $0 } assertCorrectRequest(usingID: .any) XCTAssertNotNil(result) assertFailure(result) let error = retreiveError(fromResult: result, as: TestError.self) XCTAssertTrue(error === testError) } private func assertCorrectRequest(usingID id: String, line: UInt = #line) { XCTAssertEqual(urlSessionSpy.requests.count, 1, line: line) let request = urlSessionSpy.requests[0] assertURL(of: request, isEqualToLeetcodePath: "/list/api/\(id)", line: line) assertMethod(of: request, isEqualTo: "DELETE", line: line) assertOrigin(of: request, isEqualToLeetcodePath: "/list/", line: line) assertReferer(of: request, isEqualToLeetcodePath: "/list/", line: line) } } extension Int { static var any: Int { return 0 } } extension Data { static var test: Data { return "*TEST-DATA*".data(using: .utf8)! } } extension String { static var any: String { return "ANY" } } extension HTTPURLResponse { convenience init(statusCode: Int, file: String = #file) { self.init( url: URL(fileURLWithPath: file), statusCode: statusCode, httpVersion: nil, headerFields: nil )! } }
30.738636
84
0.636969
eabbcfb9bc0799c1e3ebdbf3e932324e53a019cf
2,936
sql
SQL
Dump20171218.sql
Tuch1312/Rubrica
4fe2c28a1cace8058a9a23e12eca295a52b5e86c
[ "MIT" ]
null
null
null
Dump20171218.sql
Tuch1312/Rubrica
4fe2c28a1cace8058a9a23e12eca295a52b5e86c
[ "MIT" ]
null
null
null
Dump20171218.sql
Tuch1312/Rubrica
4fe2c28a1cace8058a9a23e12eca295a52b5e86c
[ "MIT" ]
null
null
null
CREATE DATABASE IF NOT EXISTS `contattiDB` /*!40100 DEFAULT CHARACTER SET latin1 */; USE `contattiDB`; -- MySQL dump 10.13 Distrib 5.7.17, for macos10.12 (x86_64) -- -- Host: localhost Database: contattiDB -- ------------------------------------------------------ -- Server version 5.5.5-10.1.28-MariaDB /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `contatti` -- DROP TABLE IF EXISTS `contatti`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `contatti` ( `id` int(11) NOT NULL AUTO_INCREMENT, `nome` varchar(45) DEFAULT NULL, `cognome` varchar(45) DEFAULT NULL, `mail` varchar(45) DEFAULT NULL, `numeroTelefono` varchar(45) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `contatti` -- LOCK TABLES `contatti` WRITE; /*!40000 ALTER TABLE `contatti` DISABLE KEYS */; INSERT INTO `contatti` VALUES (2,'arcibaldo','nuzzolo','arci@mail','131213124'),(3,'luca','gialli','gialli.l@mail.com','8882933521'),(4,'francesco','blu','francesco@mail.com','7543785748'),(5,'franco','rosa','francorosa@mail.com','8475834744'),(6,'giovanni','rossi','giovarssi@libero.it','0342342344'),(8,'lucia','due','luica@mail','0432959434'),(9,'beatrice','tre','beatrice@mail','4458345458'),(10,'christian','quattro','chri@mail','4584357834'),(12,'amhed','abdhulla','amhedmail','4548579454'),(13,'abdul','jamali','abdul@mail','4647848376'),(14,'gabriele','bonzi','mail@lele','72632763256'),(16,'mattia','acab','acab@mail','37376376376'),(17,'matta','null','null','4343434343'),(18,'mattia','acab','acab@mail','6374377'); /*!40000 ALTER TABLE `contatti` ENABLE KEYS */; UNLOCK TABLES; -- -- Dumping events for database 'contattiDB' -- -- -- Dumping routines for database 'contattiDB' -- /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2017-12-18 14:30:27
45.169231
725
0.702316
3171232ffc67b6cbdd4ea632a320bdc786e9b9b1
908
sql
SQL
CSharp DB Fundamentals MSSQL/TableRelations/TableRelations/05.OnlineStoreDatabase.sql
MiroslavKisov/Software-University
4bf99b6c66c7eedfb682ce398224382a5ebf02a3
[ "MIT" ]
null
null
null
CSharp DB Fundamentals MSSQL/TableRelations/TableRelations/05.OnlineStoreDatabase.sql
MiroslavKisov/Software-University
4bf99b6c66c7eedfb682ce398224382a5ebf02a3
[ "MIT" ]
null
null
null
CSharp DB Fundamentals MSSQL/TableRelations/TableRelations/05.OnlineStoreDatabase.sql
MiroslavKisov/Software-University
4bf99b6c66c7eedfb682ce398224382a5ebf02a3
[ "MIT" ]
null
null
null
USE TableRelations --START CREATE TABLE Cities( CityID INT PRIMARY KEY NOT NULL, Name NVARCHAR(50) NOT NULL ) CREATE TABLE Customers( CustomerID INT PRIMARY KEY NOT NULL, Name NVARCHAR(50) NOT NULL, Birthday DATE NOT NULL, CityID INT FOREIGN KEY REFERENCES Cities(CityID) ) CREATE TABLE Orders( OrderID INT PRIMARY KEY NOT NULL, CustomerID INT FOREIGN KEY REFERENCES Customers(CustomerID) ) CREATE TABLE ItemTypes( ItemTypeID INT PRIMARY KEY NOT NULL, Name NVARCHAR(50) ) CREATE TABLE Items( ItemID INT PRIMARY KEY NOT NULL, Name NVARCHAR(50) NOT NULL, ItemTypeID INT FOREIGN KEY REFERENCES ItemTypes(ItemTypeID) ) CREATE TABLE OrderItems( OrderID INT, ItemID INT, CONSTRAINT PK_OrderID_ItemID PRIMARY KEY (OrderID, ItemID), CONSTRAINT FK_OrderID FOREIGN KEY (OrderID) REFERENCES Orders(OrderID), CONSTRAINT FK_ItemID FOREIGN KEY (ItemID) REFERENCES Items(ItemID) )
15.929825
60
0.768722
72fa23c5f19443593be5271a6e7844ed8c834567
383
html
HTML
changes/index.html
wikimatze/padrinorb-website
296c359e21f8889058a1fb4b33da0005f7e2b0fa
[ "Apache-2.0" ]
null
null
null
changes/index.html
wikimatze/padrinorb-website
296c359e21f8889058a1fb4b33da0005f7e2b0fa
[ "Apache-2.0" ]
null
null
null
changes/index.html
wikimatze/padrinorb-website
296c359e21f8889058a1fb4b33da0005f7e2b0fa
[ "Apache-2.0" ]
null
null
null
--- layout: page title: Changes text: The changelog for Padrino. --- {% capture current %}Changes{% endcapture %} {% include header_navigation.html %} {% include headline.html %} <div class="container"> <div class="row"> <div class="col-lg-12"> {% capture changes %}{% include changes.md %}{% endcapture %} {{ changes | markdownify }} </div> </div> </div>
19.15
67
0.616188
1280d6f73340c6e5a7b6858447253cf37bf4faee
172
h
C
system/include/stdio.h
Qs315490/QuickSwift_OS
b14ab9a78cf8c0397f7c04cdd0d8da2b15cf12d3
[ "Apache-2.0" ]
null
null
null
system/include/stdio.h
Qs315490/QuickSwift_OS
b14ab9a78cf8c0397f7c04cdd0d8da2b15cf12d3
[ "Apache-2.0" ]
null
null
null
system/include/stdio.h
Qs315490/QuickSwift_OS
b14ab9a78cf8c0397f7c04cdd0d8da2b15cf12d3
[ "Apache-2.0" ]
null
null
null
// // Created by Qs315490 on 2021/2/9. // #ifndef QUICKSWIFTOS_STDIO_H #define QUICKSWIFTOS_STDIO_H //控制台标准输出 int printf(const char*,...); #endif //QUICKSWIFTOS_STDIO_H
14.333333
35
0.738372
291f735f51e01122ff3f1ba4fe0ace6dc03366e5
3,552
py
Python
cli_stats/clean_stats/team_standings_clean.py
timoudas/premier_league_api
2b850466ed1c910ee901c68e660706d55f53df61
[ "MIT" ]
2
2020-02-13T12:30:47.000Z
2020-03-21T16:32:47.000Z
cli_stats/clean_stats/team_standings_clean.py
timoudas/premier_league_api
2b850466ed1c910ee901c68e660706d55f53df61
[ "MIT" ]
2
2021-04-06T18:27:57.000Z
2021-06-02T03:51:47.000Z
cli_stats/clean_stats/team_standings_clean.py
timoudas/premier_league_api
2b850466ed1c910ee901c68e660706d55f53df61
[ "MIT" ]
null
null
null
from .load_files import deep_get from .load_files import load_team_standings def read_team_standings_stats(data): info_all = [] try: for d in data: stats_temp = {} comp = d['season'] standing = d['standing'] team = d['team'] for fixtures in standing: if fixtures: player_fixtures = fixtures['fixtures'] stats_temp = \ {'team' : deep_get(team, 'name'), 'team_id' : deep_get(team, 'club.id'), 'team_shortName' : deep_get(team, 'club.shortName'), 'competition' : deep_get(comp, 'competition.description'), 'competition_abbr' : deep_get(comp, 'competition.abbreviation'), 'competition_id' : deep_get(comp, 'competition.id'), 'seasonLabel': deep_get(d, 'season.label'), 'seasonId': deep_get(d, 'season.id'), 'fixtures' : [], 'played' : fixtures['played'], 'points' : fixtures['points'], 'position' : fixtures['position']} for fixture in player_fixtures: fixture_temp = {} fixture_temp = \ {'home_team' : fixture['teams'][0]['team']['name'], 'home_team_id' : fixture['teams'][0]['team']['club']['id'], 'home_team_shortName' : fixture['teams'][0]['team']['shortName'], 'home_team_score' : fixture['teams'][0]['score'], 'away_team' : fixture['teams'][1]['team']['name'], 'away_team_id' : fixture['teams'][1]['team']['club']['id'], 'away_team_shortName' : fixture['teams'][1]['team']['shortName'], 'away_team_score' : fixture['teams'][1]['score'], 'ground' : fixture['ground']['name'], 'grounds_id' : fixture['ground']['id'], 'city' : fixture['ground']['city'], 'fixtureType' : fixture['fixtureType'], 'extraTime' : fixture['extraTime'], 'shootout' : fixture['shootout'], 'f_id' : fixture['id'], 'clock_label' : fixture['clock']['label'], 'clock_secs' : fixture['clock']['secs'], 'gameweekId': fixture['gameweek']['id'], 'gameweek': fixture['gameweek']['gameweek'], 'kickoffLabel': fixture['kickoff']['label'], 'kickoffMillis': fixture['kickoff']['millis'] } stats_temp.update({ 'gameweek': fixture['gameweek']['gameweek'], 'gameweekId': fixture['gameweek']['id'], }) stats_temp['fixtures'].append(fixture_temp) info_all.append(stats_temp) except KeyError as e: pass return info_all def team_standings(league, year): """Returns team standings""" stats = read_team_standings_stats(load_team_standings(league, year)) return stats
48
93
0.434685
d09fe97cd439196c55be776fefabdba2c0126615
2,957
css
CSS
main/style.css
okanuregen/University-Database-System
5204243e835d80ef225a466a8a6daa853ed71303
[ "MIT" ]
1
2021-06-16T16:21:55.000Z
2021-06-16T16:21:55.000Z
main/style.css
ozdemirmrtcn/University-Database-System
018b445b70189d6e2ddec2a4af4c47f077259cc2
[ "MIT" ]
1
2020-06-14T11:56:46.000Z
2020-06-14T14:46:16.000Z
main/style.css
ozdemirmrtcn/University-Database-System
018b445b70189d6e2ddec2a4af4c47f077259cc2
[ "MIT" ]
1
2021-06-16T16:05:01.000Z
2021-06-16T16:05:01.000Z
* { padding: 0; margin: 0; } a { text-decoration: none; font-style: none; color: black; } .d-block { display: block; } .d-none { display: none; } .inline-block { display: inline-block; } .ml-3 { margin-left: 3rem; } .mr-3 { margin-right: 3rem; } .mr-5 { margin-right: 5rem; } .upper-case { text-transform: uppercase; } .text-capitalize { text-transform: capitalize; } .text-success { color: #5cb85c; } .text-danger { color: #d9534f; } .text-sm { font-size: 0.8rem; } .f-left { float: left; } .f-right { float: right; } .warning { background-color: #ff9501; margin: 5px; border-radius: 15px; padding-left: 18px; padding-top: 25px; padding-bottom: 25px; font-size: 20px; } /*Nav Bar*/ nav { display: block; background: #d8ddff; padding: 20px 15px; padding-left: 80px; } nav span { display: inline-block; font-size: 1.2rem; text-transform: uppercase; padding-right: 20px; } nav span:nth-child(1) { font-size: 2rem; text-transform: uppercase; padding-right: 20px; } nav span a { transition: all 0.4s; } nav span a:hover { font-size: 1.4rem; color: #1f2fad; } .container { width: 98%; margin: 20px; margin-right: auto; margin-left: auto; } /*Form*/ .lesson-form { padding-bottom: 5px; margin-left: 50px; } .select-lesson { border-radius: 3px; padding: 10px; padding-right: 15px; } .show-hours { padding-left: 50px; padding-right: 50px; } /*Table*/ .table-box { margin-bottom: 40px; padding: 10px; } .table-name { display: block; font-size: 1.5rem; font-family: 'Nanum Gothic', sans-serif; color: #1f2fad; margin-bottom: 10px; } table { max-width: 800px; border-radius: 8px; } table tr:first-child { background: #6c79e0; color: aliceblue; } table tr:first-child:hover { background: #6c79e0; color: aliceblue; } th { padding-right: 20px; padding-left: 20px; padding-bottom: 18px; padding-top: 18px; font-weight: 100; } th:first-child { border-top-left-radius: 8px; } th:last-child { border-top-right-radius: 8px; } td { border-bottom: 1px solid #f2f2f2; text-align: center; padding: 10px; } tr:hover { background-color: #f2f2f2; } .see-more { cursor: pointer; width: 80px; padding: 12px 0px; color: white; border-radius: 5px; border: 1px solid #6c79e0; background-color: #6c79e0; transition: background 0.3s; } .see-more:hover { border: 1px solid #6c79e0; background-color: transparent; color: #6c79e0; } /* Short-Table*/ .table { margin-left: 10px; } .short-table tr td { border-radius: 5px; text-align: left; background-color: white; color: black; padding: 20px 10px; } .short-table td:nth-child(odd) { background: #6c79e0; color: aliceblue; }
13.200893
44
0.597565
cce14ade27c79ab79d52d32e33f444bedd14e567
134
sql
SQL
oci-test/tests/oci_mysql_configuration/test-list-query.sql
turbot/steampipe-plugin-oci
cd534d4992835eb1c756ea93d54ed1a653f7874a
[ "Apache-2.0" ]
14
2021-04-08T08:15:06.000Z
2022-03-23T16:07:49.000Z
oci-test/tests/oci_mysql_configuration/test-list-query.sql
turbot/steampipe-plugin-oci
cd534d4992835eb1c756ea93d54ed1a653f7874a
[ "Apache-2.0" ]
235
2021-04-02T14:39:36.000Z
2022-03-30T12:44:35.000Z
oci-test/tests/oci_mysql_configuration/test-list-query.sql
turbot/steampipe-plugin-oci
cd534d4992835eb1c756ea93d54ed1a653f7874a
[ "Apache-2.0" ]
null
null
null
select display_name, id, lifecycle_state, shape_name, type from oci.oci_mysql_configuration where display_name = '{{ resourceName }}';
44.666667
58
0.80597
46c3ef2dac5054473dc70529e961310452e59091
4,609
cs
C#
Assets/Scripts/Managers/NetworkManager.cs
tarikisildar/Judgement-Day
0e124be81fa33238471cde3519b8feb27e677afd
[ "MIT" ]
4
2021-06-09T14:23:11.000Z
2021-06-13T17:31:07.000Z
Assets/Scripts/Managers/NetworkManager.cs
alperenaydas/Judgement-Day
0e124be81fa33238471cde3519b8feb27e677afd
[ "MIT" ]
null
null
null
Assets/Scripts/Managers/NetworkManager.cs
alperenaydas/Judgement-Day
0e124be81fa33238471cde3519b8feb27e677afd
[ "MIT" ]
1
2021-06-09T14:30:26.000Z
2021-06-09T14:30:26.000Z
using System.Collections; using System.Collections.Generic; using UnityEngine; using Photon.Pun; using Photon.Realtime; using Managers; using Photon.Pun.UtilityScripts; using UI; public class NetworkManager : MonoBehaviourPunCallbacks { public static bool gameReady = false; public static List<GameObject> players = new List<GameObject>(); private SearchRoomPopup searchRoomPopup; void Start() { if(PlayerPrefs.HasKey(Constants.UserNameKey)) { SetUpName(); } searchRoomPopup = CanvasManager.Instance.GetPopUpCanvas().GetSearchRoomPopUp(); } public static void FindRoom() { if(PhotonNetwork.IsConnected) { ExitGames.Client.Photon.Hashtable customPropreties = new ExitGames.Client.Photon.Hashtable(); customPropreties["Map"] = PlayerPrefs.GetInt(Constants.MapKey, 0); PhotonNetwork.JoinRandomRoom(customPropreties,0); } else { PhotonNetwork.GameVersion = Constants.GameVersion; PhotonNetwork.ConnectUsingSettings(); } } public static void LeaveRoom() { PhotonNetwork.LeaveRoom(); } public static void Connect() { PhotonNetwork.GameVersion = Constants.GameVersion; PhotonNetwork.ConnectUsingSettings(); } public void SetUpName() { if(!PlayerPrefs.HasKey(Constants.UserNameKey)) { return; } string playerName = PlayerPrefs.GetString(Constants.UserNameKey); PhotonNetwork.NickName = playerName; } public override void OnConnectedToMaster() { Debug.Log("Connected to master server."); CanvasManager.Instance.GetPopUpCanvas().HideConnectingPopUp(); } public override void OnDisconnected(DisconnectCause cause) { Debug.Log($"Disconnected from server. Photon log: {cause}"); CanvasManager.Instance.ShowPopUpCanvas(); CanvasManager.Instance.GetPopUpCanvas().ShowConnectingPopUp(); } public override void OnJoinRandomFailed(short returnCode, string message) { Debug.Log("No room found, creating a new room."); searchRoomPopup.WaitingPlayers(); searchRoomPopup.SetUserNames(); // PhotonNetwork.CreateRoom(null, new RoomOptions { MaxPlayers = (byte)Constants.MaxPlayersPerRoom }); ExitGames.Client.Photon.Hashtable customPropreties = new ExitGames.Client.Photon.Hashtable(); customPropreties["Map"] = PlayerPrefs.GetInt(Constants.MapKey, 0); RoomOptions roomOptions = new RoomOptions() {CustomRoomProperties = customPropreties, IsVisible = true, IsOpen = true, MaxPlayers = (byte)Constants.MaxPlayersPerRoom}; roomOptions.CustomRoomPropertiesForLobby = new string[] { "Map", }; PhotonNetwork.CreateRoom("Room" + Random.Range(0, 1000), roomOptions); } public override void OnJoinedRoom() { Debug.Log("Client successfully joined a room."); searchRoomPopup.WaitingPlayers(); searchRoomPopup.SetUserNames(); int playerCount = PhotonNetwork.CurrentRoom.PlayerCount; if(playerCount != Constants.MaxPlayersPerRoom) { Debug.Log("Waiting for opponents."); } else { Debug.Log("Match is ready to begin."); gameReady = true; StartGame(); } } public override void OnPlayerEnteredRoom(Player newPlayer) { searchRoomPopup.SetUserNames(); if(PhotonNetwork.CurrentRoom.PlayerCount == Constants.MaxPlayersPerRoom) { PhotonNetwork.CurrentRoom.IsOpen = false; Debug.Log("Match is ready to begin."); gameReady = true; StartGame(); } } public override void OnPlayerLeftRoom(Player otherPlayer) { base.OnPlayerLeftRoom(otherPlayer); searchRoomPopup.SetUserNames(); } public static void Disconnect() { PhotonNetwork.DestroyAll(); PhotonNetwork.LeaveRoom(); PhotonNetwork.Disconnect(); } void StartGame() { searchRoomPopup.Starting(); StartCoroutine(CountDown()); } IEnumerator CountDown() { Debug.Log("3"); yield return new WaitForSeconds(1f); Debug.Log("2"); yield return new WaitForSeconds(1f); Debug.Log("1"); yield return new WaitForSeconds(1f); CanvasManager.Instance.GetPopUpCanvas().HideSearchRoomPopUp(); GameManager.Instance.StartGame(); } }
28.276074
175
0.641571
9bd341c857c8370e20c5b1dd9ce243af93eb9eb8
2,906
js
JavaScript
src/mixins/pdf-utils.js
BAG-ERA/covid-n-go
6a04da6634c88585a77d9a41d6cef036b0fa7149
[ "MIT" ]
null
null
null
src/mixins/pdf-utils.js
BAG-ERA/covid-n-go
6a04da6634c88585a77d9a41d6cef036b0fa7149
[ "MIT" ]
null
null
null
src/mixins/pdf-utils.js
BAG-ERA/covid-n-go
6a04da6634c88585a77d9a41d6cef036b0fa7149
[ "MIT" ]
null
null
null
/* eslint-disable no-alert */ import { PDFDocument, StandardFonts } from 'pdf-lib'; const ys = { travail: 488, achats: 417, sante: 370, famille: 350, handicap: 315, sport_animaux: 294, convocation: 208, missions: 178, enfants: 157, }; function getIdealFontSize(font, text, maxWidth, minSize, defaultSize) { let currentSize = defaultSize; let textWidth = font.widthOfTextAtSize(text, defaultSize); while (textWidth > maxWidth && currentSize > minSize) { // eslint-disable-next-line no-plusplus textWidth = font.widthOfTextAtSize(text, --currentSize); } return textWidth > maxWidth ? null : currentSize; } async function generatePdf(profile, reasons, pdfBase, qrcode, qrdata) { const { lastname, firstname, birthday, placeofbirth, address, zipcode, city, } = profile; const existingPdfBytes = await fetch(pdfBase).then((res) => res.arrayBuffer()); const pdfDoc = await PDFDocument.load(existingPdfBytes); // set pdf metadata pdfDoc.setTitle('COVID-19 - Déclaration de déplacement'); pdfDoc.setSubject('Attestation de déplacement dérogatoire'); pdfDoc.setKeywords([ 'covid19', 'covid-19', 'attestation', 'déclaration', 'déplacement', 'officielle', 'gouvernement', ]); pdfDoc.setProducer('DNUM/SDIT'); pdfDoc.setCreator(''); pdfDoc.setAuthor("Ministère de l'intérieur"); const page1 = pdfDoc.getPages()[0]; const font = await pdfDoc.embedFont(StandardFonts.Helvetica); const drawText = (text, x, y, size = 11) => { page1.drawText(text, { x, y, size, font, }); }; drawText(`${firstname} ${lastname}`, 107, 657); drawText(birthday, 107, 627); drawText(placeofbirth, 240, 627); drawText(`${address} ${zipcode} ${city}`, 124, 596); reasons.forEach((reason) => { drawText('x', 59, ys[reason], 18); }); let locationSize = getIdealFontSize(font, city, 83, 7, 11); if (!locationSize) { alert( 'Le nom de la ville risque de ne pas être affiché correctement en raison de sa longueur. ' + 'Essayez d\'utiliser des abréviations ("Saint" en "St." par exemple) quand cela est possible.', ); locationSize = 7; } drawText(profile.city, 93, 122, locationSize); drawText(`${profile.datesortie}`, 76, 92, 11); drawText(`${profile.heuresortie}`, 246, 92, 11); // Date création drawText('Date de création:', 479, 120, 6); drawText(qrdata[0], 470, 124, 6); const qrImage = await pdfDoc.embedPng(qrcode); page1.drawImage(qrImage, { x: page1.getWidth() - 133, y: 38, width: 105, height: 105, }); pdfDoc.addPage(); const page2 = pdfDoc.getPages()[1]; page2.drawImage(qrImage, { x: 50, y: page2.getHeight() - 390, width: 300, height: 300, }); const pdfBytes = await pdfDoc.save(); return new Blob([pdfBytes], { type: 'application/pdf' }); } export default generatePdf;
25.051724
105
0.652443
3d871f80e3643e72e78f5d4ace29f729c144cc50
683
rs
Rust
zinc-bytecode/src/instructions/memory/load_sequence_global.rs
sunny-g/zinc
302a9ea570ba34e980fdeb313426e7c404c1cf4e
[ "MIT" ]
null
null
null
zinc-bytecode/src/instructions/memory/load_sequence_global.rs
sunny-g/zinc
302a9ea570ba34e980fdeb313426e7c404c1cf4e
[ "MIT" ]
4
2021-03-01T18:58:06.000Z
2021-09-28T13:14:13.000Z
zinc-bytecode/src/instructions/memory/load_sequence_global.rs
ingzkp/zinc
1f03631c7136f37e7d59379b7d1e606ef0563f31
[ "MIT" ]
null
null
null
use crate::{Instruction, InstructionInfo}; use serde_derive::{Deserialize, Serialize}; /// Loads several values from data stack and pushes them onto evaluation stack. #[derive(Debug, PartialEq, Clone, Serialize, Deserialize)] pub struct LoadSequenceGlobal { pub address: usize, pub len: usize, } impl LoadSequenceGlobal { pub fn new(address: usize, len: usize) -> Self { Self { address, len } } } impl InstructionInfo for LoadSequenceGlobal { fn to_assembly(&self) -> String { format!("load_array_global {} {}", self.address, self.len) } fn wrap(&self) -> Instruction { Instruction::LoadSequenceGlobal((*self).clone()) } }
26.269231
79
0.674963
f0614ad5a01fc0ee5d8e001a482a5e25e09fde22
419
ps1
PowerShell
examples/hyperflex/Remove-IntersightHyperflexSoftwareDistributionComponent.ps1
CiscoDevNet/intersight-powershell
01e565eab5586e4bc4b9eecde73067e1c3497e6c
[ "Apache-2.0" ]
6
2021-03-24T15:21:12.000Z
2022-02-22T09:47:16.000Z
examples/hyperflex/Remove-IntersightHyperflexSoftwareDistributionComponent.ps1
CiscoDevNet/intersight-powershell
01e565eab5586e4bc4b9eecde73067e1c3497e6c
[ "Apache-2.0" ]
18
2020-08-27T20:54:38.000Z
2022-03-31T05:53:57.000Z
examples/hyperflex/Remove-IntersightHyperflexSoftwareDistributionComponent.ps1
CiscoDevNet/intersight-powershell
01e565eab5586e4bc4b9eecde73067e1c3497e6c
[ "Apache-2.0" ]
3
2020-07-07T14:59:28.000Z
2021-03-27T14:41:50.000Z
#Get the HyperflexSoftwareDistributionComponent to delete $HyperflexSoftwareDistributionComponent = Remove-IntersightHyperflexSoftwareDistributionComponent -Name HyperflexSoftwareDistributionComponentName $HyperflexSoftwareDistributionComponent | Remove-IntersightHyperflexSoftwareDistributionComponent #Remove the server profile by Moid. Remove-IntersightHyperflexSoftwareDistributionComponent -Moid 123bc2222287wee
52.375
146
0.914081
6c930784dd361663d8ecd5fb8f6dbb3103e181a0
633
go
Go
demo_test/channel_test03.go
Vicky-w/go_base_test
8a8ca54d4af391b9ed9df7dc8595f44fa92ee419
[ "Apache-2.0" ]
null
null
null
demo_test/channel_test03.go
Vicky-w/go_base_test
8a8ca54d4af391b9ed9df7dc8595f44fa92ee419
[ "Apache-2.0" ]
null
null
null
demo_test/channel_test03.go
Vicky-w/go_base_test
8a8ca54d4af391b9ed9df7dc8595f44fa92ee419
[ "Apache-2.0" ]
null
null
null
package main import ( "fmt" "runtime" ) func main() { runtime.GOMAXPROCS(runtime.NumCPU()) //c:=make(chan bool) //for i :=0 ; i<10 ; i++{ // go Go(c,i) //} //<- c c := make(chan bool, 10) for i := 0; i < 10; i++ { go Go(c, i) } for i := 0; i < 10; i++ { v := <-c fmt.Println(v) } } //func Go(c chan bool, index int) { // a := 1 // for i := 0; i < 10000000; i++ { // a += i // } // fmt.Println(index, a) // if index == 9 { 多CUP不能使用尾部index来判断 // c <- true // } // //} func Go(c chan bool, index int) { //只保证了输出数量 不保证顺序 a := 1 for i := 0; i < 10000000; i++ { a += i } fmt.Println(index, a) c <- true }
14.066667
50
0.491311
16d911eca7460b341174dd68a4f083ca7edea59b
128
ts
TypeScript
apps/concord/src/validation/IValidator.ts
vassourita/agree
31760114c3407f7ab0fbd2364605c48d1a5187d9
[ "MIT" ]
14
2020-08-18T23:29:48.000Z
2022-02-06T04:04:47.000Z
apps/concord/src/validation/IValidator.ts
vassourita/agree
31760114c3407f7ab0fbd2364605c48d1a5187d9
[ "MIT" ]
10
2021-05-05T00:48:02.000Z
2022-02-27T16:38:45.000Z
apps/concord/src/validation/IValidator.ts
vassourita/agree
31760114c3407f7ab0fbd2364605c48d1a5187d9
[ "MIT" ]
1
2021-12-10T03:03:23.000Z
2021-12-10T03:03:23.000Z
import { ValidationError } from 'yup' export interface IValidator<T> { validate(input: T): Promise<null | ValidationError> }
21.333333
53
0.734375
b4c6639a4ae41f7b16b64cd8783ccf5ca5ffce87
186
sql
SQL
evo-X-Scriptdev2/sql/Updates/0.0.4/r1463_mangos.sql
Gigelf-evo-X/evo-X
d0e68294d8cacfc7fb3aed5572f51d09a47136b9
[ "OpenSSL" ]
1
2019-01-19T06:35:40.000Z
2019-01-19T06:35:40.000Z
src/bindings/Scriptdev2/sql/Updates/0.0.4/r1463_mangos.sql
mfooo/wow
3e5fad4cfdf0fd1c0a2fd7c9844e6f140a1bb32d
[ "OpenSSL" ]
null
null
null
src/bindings/Scriptdev2/sql/Updates/0.0.4/r1463_mangos.sql
mfooo/wow
3e5fad4cfdf0fd1c0a2fd7c9844e6f140a1bb32d
[ "OpenSSL" ]
null
null
null
DELETE FROM areatrigger_scripts WHERE entry=5140; INSERT INTO areatrigger_scripts VALUES (5140,'at_svala_intro'); UPDATE instance_template SET script='instance_pinnacle' WHERE map=575;
37.2
70
0.83871
a37c9a41c4a46cead9d857e81da0143ffebd7e33
29,680
dart
Dart
lib/src/page/form_feedback/flutter_feedback_plugin_page.dart
nusanet/flutter-feedback-plugin
8887f4f992fbcb1fe8bef097b65600be1b08ae4e
[ "MIT" ]
1
2021-04-21T03:27:29.000Z
2021-04-21T03:27:29.000Z
lib/src/page/form_feedback/flutter_feedback_plugin_page.dart
nusanet/flutter-feedback-plugin
8887f4f992fbcb1fe8bef097b65600be1b08ae4e
[ "MIT" ]
null
null
null
lib/src/page/form_feedback/flutter_feedback_plugin_page.dart
nusanet/flutter-feedback-plugin
8887f4f992fbcb1fe8bef097b65600be1b08ae4e
[ "MIT" ]
null
null
null
import 'dart:io'; import 'package:coderjava_image_editor_pro/coderjava_image_editor_pro.dart'; import 'package:device_info_plus/device_info_plus.dart'; import 'package:dotted_border/dotted_border.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_feedback/localization/en_message.dart'; import 'package:flutter_feedback/localization/id_message.dart'; import 'package:flutter_feedback/localization/lookup_message.dart'; import 'package:flutter_feedback/src/data/model/device_logs/device_logs.dart'; import 'package:flutter_feedback/src/widget/widget_dialog.dart'; import 'package:flutter_feedback/src/widget/widget_edit_device_logs.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:image_picker/image_picker.dart'; import '../preview_image/flutter_feedback_preview_image_page.dart'; /// Listener untuk menampilkan loading atau tidak final _valueListenableLoading = ValueNotifier<bool>(false); /// Warna primary dari identitas app Anda late Color _colorPrimary; /// Callback function ketika respon kode dari API adalah 401 Function()? _onDialog401Showing; /// Localization untuk bahasa yang digunakan di halaman ini late LookupMessage _locale; /// Alias function ketika button `SEND` ditekan typedef _OnSubmitFeedback = void Function( List<String> listScreenshots, String category, String description, DeviceLogs deviceLogs, ); /// Halaman ini berfungsi untuk menampilkan form feedback. class FormFeedbackController { void submitFeedback() { _valueListenableLoading.value = true; } /// Action ketika gagal kirim feedback void failureFeedback(BuildContext context, String errorMessage) { _valueListenableLoading.value = false; if (errorMessage.contains('401')) { _showDialog401(context); return; } _showSnackBar(context, errorMessage); } /// Action ketika berhasil kirim feedback void successFeedback(BuildContext context) { _valueListenableLoading.value = false; _showDialogSuccess(context); } } class FlutterFeedbackPluginPage extends StatefulWidget { /// Hasil file screenshot final File fileScreenshot; /// Callback ketika button `SEND` ditekan final _OnSubmitFeedback onSubmitFeedback; /// Email user yang sedang login final String email; /// Nilai version name dari app final String appVersion; /// Warna primary dari identitas app Anda. final Color colorPrimary; /// Warna secondary dari identitas app Anda. final Color colorSecondary; /// Warna dari widget [AppBar]. Nilai default-nya [Colors.blue] final Color colorAppBar; /// Warna dari tulisan didalam widget [AppBar]. Nilai default-nya adalah [Colors.grey.shade700] final Color? colorTitleAppBar; /// Function yang dijalankan ketika respon kode dari API 401. final Function()? onDialog401Showing; /// Bahasa yang dipakai di halaman ini. Untuk saat ini support `en` dan `id`. final String locale; FlutterFeedbackPluginPage({ required this.fileScreenshot, required this.onSubmitFeedback, required this.email, required this.appVersion, this.colorPrimary = Colors.blue, this.colorSecondary = Colors.white, this.colorAppBar = Colors.blue, this.colorTitleAppBar, this.onDialog401Showing, this.locale = 'en', }) { _colorPrimary = this.colorPrimary; _onDialog401Showing = this.onDialog401Showing; } @override _FlutterFeedbackPluginPageState createState() => _FlutterFeedbackPluginPageState(); } class _FlutterFeedbackPluginPageState extends State<FlutterFeedbackPluginPage> { final formState = GlobalKey<FormState>(); final controllerFeedback = TextEditingController(); final listAttachments = <String>[]; var indexSelectedCategory = -1; var selectedCategory = ''; var paddingBottom = 0.0; var paddingTop = 0.0; var heightScreen = 0.0; var platform = ''; var osVersion = ''; var brand = ''; var isCheckEmail = true; var isCheckAppVersion = true; var isCheckPlatform = true; var isCheckOsVersion = true; var isCheckBrand = true; @override void initState() { listAttachments.add(widget.fileScreenshot.path); listAttachments.add(''); _initLocale(); WidgetsBinding.instance?.addPostFrameCallback((_) async { final deviceInfoPlugin = DeviceInfoPlugin(); if (Platform.isAndroid) { final androidInfo = await deviceInfoPlugin.androidInfo; platform = 'Android'; osVersion = androidInfo.version.sdkInt.toString(); brand = (androidInfo.brand ?? '') + ' ' + (androidInfo.model ?? ''); if (brand.trim().isEmpty) { brand = '-'; } } else if (Platform.isIOS) { final iosInfo = await deviceInfoPlugin.iosInfo; platform = 'IOS'; osVersion = iosInfo.systemVersion ?? '-'; brand = (iosInfo.model ?? '-') + ' (' + (iosInfo.name ?? '-') + ')'; } }); super.initState(); } @override Widget build(BuildContext context) { final mediaQueryData = MediaQuery.of(context); paddingBottom = mediaQueryData.padding.bottom; paddingTop = mediaQueryData.padding.top; heightScreen = mediaQueryData.size.height; return Scaffold( backgroundColor: Colors.white, appBar: AppBar( title: Text( _locale.feedback(), style: TextStyle( color: widget.colorTitleAppBar ?? Colors.grey[700], ), ), backgroundColor: widget.colorAppBar, iconTheme: IconThemeData(color: widget.colorTitleAppBar ?? Colors.grey[700]), ), body: Stack( children: [ _buildWidgetForm(), _buildWidgetLoading(), ], ), ); } Widget _buildWidgetForm() { return Container( width: double.infinity, padding: EdgeInsets.fromLTRB( 16, 16, 16, paddingBottom > 0 ? paddingBottom : 16, ), child: Column( children: [ Expanded( child: ListView( padding: EdgeInsets.zero, children: [ Text( _locale.weWouldLikeYourFeedback(), textAlign: TextAlign.center, ), SizedBox(height: 8), Text( _locale.whatIsYourOpinionOfThisPage(), textAlign: TextAlign.center, ), SizedBox(height: 8), Container( decoration: BoxDecoration( border: Border.all( width: 1, ), borderRadius: BorderRadius.all( Radius.circular(8), ), ), width: double.infinity, height: 128, child: ListView.builder( scrollDirection: Axis.horizontal, itemCount: listAttachments.length, itemBuilder: (context, index) { final pathImage = listAttachments[index]; return pathImage.isEmpty ? Padding( padding: const EdgeInsets.all(8), child: GestureDetector( onTap: () async { final pickedImageGallery = await ImagePicker().pickImage( source: ImageSource.gallery, imageQuality: 30, ); if (pickedImageGallery != null) { listAttachments.removeLast(); listAttachments.add(pickedImageGallery.path); listAttachments.add(''); if (listAttachments.length > 3) { listAttachments.removeLast(); } setState(() {}); } }, child: Center( child: DottedBorder( color: Colors.grey, child: Container( width: 48, height: 48, decoration: BoxDecoration( borderRadius: BorderRadius.circular(4), ), child: Center( child: Icon( Icons.add, color: Colors.grey, size: 24, ), ), ), ), ), ), ) : Stack( children: [ Padding( padding: const EdgeInsets.all(8), child: GestureDetector( onTap: () { _doTapImage(index, pathImage); }, child: Container( height: 128, decoration: BoxDecoration( border: Border.all( color: Colors.grey, ), borderRadius: BorderRadius.circular(8), ), child: ClipRRect( borderRadius: BorderRadius.circular(8), child: Image.file( File(pathImage), ), ), ), ), ), Positioned( top: 2, right: 2, child: GestureDetector( onTap: () async { _doTapImage(index, pathImage); }, child: Container( decoration: BoxDecoration( color: Colors.red, shape: BoxShape.circle, border: Border.all( color: Colors.white, ), ), padding: const EdgeInsets.all(4), child: Icon( Icons.edit, color: Colors.white, size: 10, ), ), ), ), ], ); }, ), ), SizedBox(height: 8), InkWell( onTap: () async { var editDeviceLogs = await showModalBottomSheet<DeviceLogs>( context: context, enableDrag: false, isDismissible: false, shape: RoundedRectangleBorder( borderRadius: BorderRadius.only( topLeft: Radius.circular(16), topRight: Radius.circular(16), ), ), builder: (context) { return WidgetEditDeviceLogs( locale: _locale, paddingBottom: paddingBottom, deviceLogs: DeviceLogs( email: widget.email, isCheckEmail: isCheckEmail, appVersion: widget.appVersion, isCheckAppVersion: isCheckAppVersion, platform: platform, isCheckPlatform: isCheckPlatform, osVersion: osVersion, isCheckOsVersion: isCheckOsVersion, brand: brand, isCheckBrand: isCheckBrand, ), colorPrimary: widget.colorPrimary, ); }); if (editDeviceLogs != null) { setState(() { isCheckEmail = editDeviceLogs.isCheckEmail; isCheckAppVersion = editDeviceLogs.isCheckAppVersion; isCheckPlatform = editDeviceLogs.isCheckPlatform; isCheckOsVersion = editDeviceLogs.isCheckOsVersion; isCheckBrand = editDeviceLogs.isCheckBrand; }); } }, child: Container( decoration: BoxDecoration( border: Border.all( width: 1, ), borderRadius: BorderRadius.all( Radius.circular(8), ), ), width: double.infinity, padding: const EdgeInsets.all(8), child: Row( children: [ Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ Text( _locale.deviceLogs(), style: Theme.of(context).textTheme.subtitle2, ), Text( _setDataDeviceLogs(), style: Theme.of(context).textTheme.bodyText2?.copyWith( color: Colors.grey, ), maxLines: 2, overflow: TextOverflow.ellipsis, ), Text( _locale.edit(), style: Theme.of(context).textTheme.bodyText2?.copyWith( color: widget.colorPrimary, ), ), ], ), ), Icon( FontAwesomeIcons.fileAlt, color: Colors.grey[700], ), ], ), ), ), SizedBox(height: 16), Text( _locale.pleaseSelectYourFeedbackCategoryBelow(), textAlign: TextAlign.center, ), SizedBox(height: 8), Wrap( alignment: WrapAlignment.center, spacing: 8, runSpacing: 8, children: [ _buildWidgetChoiceChip(_locale.suggestion()), _buildWidgetChoiceChip(_locale.appreciation()), _buildWidgetChoiceChip(_locale.complain()), ], ), SizedBox(height: 8), Text( _locale.pleaseLeaveYourFeedback(), textAlign: TextAlign.center, ), SizedBox(height: 8), Form( key: formState, child: TextFormField( controller: controllerFeedback, decoration: InputDecoration( focusedBorder: OutlineInputBorder( borderRadius: BorderRadius.all( Radius.circular(8), ), ), border: OutlineInputBorder( borderRadius: BorderRadius.all( Radius.circular(8), ), ), enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.all( Radius.circular(8), ), ), hintText: _locale.typeMessageHere(), isDense: true, ), maxLines: 3, keyboardType: TextInputType.text, validator: (value) { return value == null || value.isEmpty ? _locale.enterYourFeedback() : null; }, ), ), ], ), ), SizedBox( width: double.infinity, child: ElevatedButton( onPressed: () { if (listAttachments.length == 1 && listAttachments.first.isEmpty) { _showSnackBar(context, _locale.pleaseUploadScreenshot()); return; } else if (selectedCategory.isEmpty) { _showSnackBar(context, _locale.pleaseSelectFeedbackCategory()); return; } else if (formState.currentState!.validate()) { widget.onSubmitFeedback.call( listAttachments, selectedCategory, controllerFeedback.text.trim(), DeviceLogs( email: widget.email, isCheckEmail: isCheckEmail, appVersion: widget.appVersion, isCheckAppVersion: isCheckAppVersion, platform: platform, isCheckPlatform: isCheckPlatform, osVersion: osVersion, isCheckOsVersion: isCheckOsVersion, brand: brand, isCheckBrand: isCheckBrand, ), ); } }, style: ElevatedButton.styleFrom( primary: widget.colorPrimary, onPrimary: Colors.white, shape: RoundedRectangleBorder( borderRadius: BorderRadius.all( Radius.circular(4), ), ), ), child: Text( _locale.send().toUpperCase(), style: TextStyle( color: Colors.white, ), ), ), ), ], ), ); } String _setDataDeviceLogs() { final listDeviceLogs = <String>[]; var strDeviceLogs = ''; if (isCheckEmail) { listDeviceLogs.add(_locale.email()); } if (isCheckAppVersion) { listDeviceLogs.add(_locale.appVersion()); } if (isCheckPlatform) { listDeviceLogs.add(_locale.platform()); } if (isCheckOsVersion) { listDeviceLogs.add(_locale.osVersion()); } if (isCheckBrand) { listDeviceLogs.add(_locale.brand()); } if (listDeviceLogs.isEmpty) { strDeviceLogs = _locale.noLogData(); return strDeviceLogs; } else if (listDeviceLogs.length == 1) { strDeviceLogs = listDeviceLogs.first; return strDeviceLogs; } else if (listDeviceLogs.length == 2) { strDeviceLogs = listDeviceLogs.join(' ' + _locale.and() + ' '); return strDeviceLogs; } listDeviceLogs.insert(listDeviceLogs.length - 1, _locale.and()); strDeviceLogs = listDeviceLogs.join(', ').replaceAll(_locale.and() + ',', _locale.and()); return strDeviceLogs; } void _doTapImage(int index, String pathImage) async { var actionAttachment; if (Platform.isIOS) { actionAttachment = await showCupertinoModalPopup<String>( context: context, builder: (context) { return CupertinoActionSheet( actions: [ CupertinoActionSheetAction( child: Text( _locale.viewScreenshot(), style: TextStyle(color: Colors.blue), ), onPressed: () => Navigator.pop(context, 'view'), ), CupertinoActionSheetAction( child: Text( _locale.editScreenshot(), style: TextStyle(color: Colors.blue), ), onPressed: () => Navigator.pop(context, 'edit'), ), CupertinoActionSheetAction( child: Text( _locale.deleteScreenshot(), style: TextStyle(color: Colors.red), ), isDestructiveAction: true, onPressed: () => Navigator.pop(context, 'delete'), ), ], ); }); } else { actionAttachment = await showModalBottomSheet<String>( context: context, enableDrag: false, builder: (context) { return _buildWidgetMenuActionAttachment(pathImage); }, shape: RoundedRectangleBorder( borderRadius: BorderRadius.only( topLeft: Radius.circular(16), topRight: Radius.circular(16), ), ), ); } if (actionAttachment != null) { if (actionAttachment == 'edit') { _doEditImage(index); } else if (actionAttachment == 'delete') { listAttachments.removeAt(index); if (listAttachments.last.isNotEmpty) { listAttachments.add(''); } setState(() {}); } else if (actionAttachment == 'view') { Navigator.push( context, MaterialPageRoute( builder: (context) => FlutterFeedbackPreviewImagePage(pathImage), ), ); } } } Widget _buildWidgetLoading() { return ValueListenableBuilder( valueListenable: _valueListenableLoading, builder: (BuildContext context, bool isLoading, Widget? child) { if (isLoading) { return Container( width: double.infinity, height: double.infinity, color: Colors.black.withOpacity(0.5), child: Center( child: Platform.isIOS ? Container( decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(8), ), padding: const EdgeInsets.all(16), child: Column( mainAxisAlignment: MainAxisAlignment.center, mainAxisSize: MainAxisSize.min, children: [ CupertinoActivityIndicator(), SizedBox(height: 8), Text( _locale.loading(), textAlign: TextAlign.center, ), ], ), ) : CircularProgressIndicator(), ), ); } else { return Container(); } }, ); } Widget _buildWidgetMenuActionAttachment(String pathImage) { return Padding( padding: EdgeInsets.only( top: 8, bottom: paddingBottom > 0 ? paddingBottom : 8, ), child: Column( mainAxisSize: MainAxisSize.min, children: [ Container( width: 24, height: 2, decoration: BoxDecoration( color: Colors.grey, borderRadius: BorderRadius.circular(999), ), ), SizedBox(height: 8), Text( _locale.screenshots(), style: Theme.of(context).textTheme.subtitle2, ), ListTile( leading: Icon( Icons.photo, color: Colors.grey[700], ), title: Text(_locale.viewScreenshot()), onTap: () { Navigator.pop(context, 'view'); }, ), ListTile( leading: Icon( Icons.brush, color: Colors.grey[700], ), title: Text(_locale.editScreenshot()), onTap: () { Navigator.pop(context, 'edit'); }, ), ListTile( leading: Icon( Icons.delete, color: Colors.grey[700], ), title: Text(_locale.deleteScreenshot()), onTap: () { Navigator.pop(context, 'delete'); }, ), ], ), ); } Widget _buildWidgetChoiceChip(String label) { final isSelected = label == selectedCategory; return ChoiceChip( label: Text(label), labelStyle: Theme.of(context).textTheme.bodyText2?.copyWith( color: isSelected ? widget.colorPrimary : Colors.grey, ), selected: isSelected, onSelected: (_) => setState(() => selectedCategory = label), backgroundColor: Colors.white, selectedColor: Colors.white, shape: StadiumBorder( side: BorderSide( color: isSelected ? widget.colorPrimary : Colors.grey, ), ), ); } void _doEditImage(int index) async { final resultEditImage = await Navigator.push( context, MaterialPageRoute( builder: (context) => CoderJavaImageEditorPro( appBarColor: Colors.black87, bottomBarColor: Colors.black87, defaultPathImage: listAttachments[index], isShowingChooseImage: false, isShowingFlip: false, isShowingRotate: false, isShowingBlur: false, isShowingFilter: false, isShowingEmoji: false, ), ), ) as File?; if (resultEditImage != null) { setState(() => listAttachments[index] = resultEditImage.path); } } void _initLocale() { if (widget.locale.toLowerCase() == 'en') { _locale = EnMessage(); } else if (widget.locale.toLowerCase() == 'id') { _locale = IdMessage(); } else { _locale = EnMessage(); } } } void _showDialog401(BuildContext context) { showDialog( context: context, barrierDismissible: false, builder: (context) { return WidgetDialog( title: _locale.info(), content: _locale.refreshTokenExpired(), actionsAlertDialog: <Widget>[ TextButton( child: Text( _locale.login().toUpperCase(), style: Theme.of(context).textTheme.button?.copyWith(color: _colorPrimary), ), onPressed: () async { if (_onDialog401Showing != null) { _onDialog401Showing?.call(); } }, ), ], actionsCupertinoDialog: <Widget>[ CupertinoDialogAction( child: Text( _locale.login(), ), isDefaultAction: true, onPressed: () async { if (_onDialog401Showing != null) { _onDialog401Showing?.call(); } }, ), ], ); }, ); } void _showSnackBar(BuildContext context, String text) { ScaffoldMessenger.of(context).showSnackBar( SnackBar( content: Text(text), ), ); } void _showDialogSuccess(BuildContext context) async { final result = await showDialog( context: context, barrierDismissible: false, builder: (context) { return WidgetDialog( title: _locale.info(), content: _locale.thankYouForTheFeedback(), actionsAlertDialog: [ TextButton( child: Text(_locale.ok().toUpperCase()), onPressed: () => Navigator.pop(context, true), ), ], actionsCupertinoDialog: [ CupertinoDialogAction( child: Text(_locale.ok()), onPressed: () => Navigator.pop(context, true), ), ], ); }); if (result != null) { Navigator.pop(context); } }
35.417661
97
0.461253
456ff497e49a3514afa7ca15d4a75fa810fbcd78
738
sql
SQL
sql/dim_sneakers/extract.sql
gagejustins/snql-airflow
4b59c9da6fcd5ab8b926d4777c60138c8700edc5
[ "Apache-2.0" ]
null
null
null
sql/dim_sneakers/extract.sql
gagejustins/snql-airflow
4b59c9da6fcd5ab8b926d4777c60138c8700edc5
[ "Apache-2.0" ]
1
2019-10-10T16:41:43.000Z
2019-10-10T16:41:43.000Z
sql/dim_sneakers/extract.sql
gagejustins/snql-airflow
4b59c9da6fcd5ab8b926d4777c60138c8700edc5
[ "Apache-2.0" ]
null
null
null
with events as ( select sneaker_id, sum(case when event_type = 'wear' then 1 else 0 end) as count_wears, sum(case when event_type = 'clean' then 1 else 0 end) as count_cleans, sum(case when event_type = 'walk' then 1 else 0 end) as count_walks from sneaker_events group by 1 ) select s.id as sneaker_id, s.sneaker_name, s.color, s.created_at, case when coalesce(s.sold_at, s.trashed_at, s.given_at) is null then TRUE else FALSE end as is_owned, s.sold_at, s.trashed_at, s.given_at, m.manufacturer_name, m.collaborator_name, e.count_wears, e.count_cleans, e.count_walks, DATE('{{ ds }}') as updated_at from sneakers s left join manufacturers m on s.manufacturer_id = m.id left join events e on s.id = e.sneaker_id
27.333333
102
0.739837
88355dc0c5df2d72434488289a7829c0fd1b4f9b
49,752
cpp
C++
system/mp/test/mptest.cpp
lucasmauro/HPCC-Platform
6df37c79a97bfb02f068c44d2635ffffc5b090c0
[ "Apache-2.0" ]
null
null
null
system/mp/test/mptest.cpp
lucasmauro/HPCC-Platform
6df37c79a97bfb02f068c44d2635ffffc5b090c0
[ "Apache-2.0" ]
null
null
null
system/mp/test/mptest.cpp
lucasmauro/HPCC-Platform
6df37c79a97bfb02f068c44d2635ffffc5b090c0
[ "Apache-2.0" ]
1
2019-10-26T22:05:26.000Z
2019-10-26T22:05:26.000Z
// CSocketSelectThread error 10038 #include <platform.h> #include <jlib.hpp> #include <jthread.hpp> #include <jmisc.hpp> #include <jcrc.hpp> #include <mpbase.hpp> #include <mpcomm.hpp> #include <algorithm> #include <queue> #include <string> using namespace std; #define MPPORT 8888 //#define GPF #define TEST_AlltoAll "AlltoAll" #define TEST_STREAM "Stream" #define TEST_MULTI "Multi" #define TEST_RING "Ring" #define TEST_RANK "PrintRank" #define TEST_SELFSEND "SelfSend" #define TEST_SINGLE_SEND "SingleSend" #define TEST_RIGHT_SHIFT "RightShift" #define TEST_RECV_FROM_ANY "RecvFromAny" #define TEST_SEND_TO_ALL "SendToAll" #define TEST_MULTI_MT "MTMultiSendRecv" #define TEST_NXN "NxN" // #define aWhile 100000 #define aWhile 10 class CSectionTimer { HiresTimer hrt[1000]; unsigned tids[1000]; const char *name; static CriticalSection findsect; double total; double max; unsigned count; unsigned idx() { CriticalBlock block(findsect); unsigned tid = (unsigned)(memsize_t)GetCurrentThreadId(); unsigned i; for (i=0;i<999;i++) { if (tids[i]==tid) break; if (tids[i]==0) { tids[i] = tid; break; } } return i; } public: CSectionTimer(const char *_name) { name = (const char *)strdup(_name); total = 0; max = 0; memset(tids,0,sizeof(tids)); count = 0; } ~CSectionTimer() { free((void *)name); } void begin() { hrt[idx()].reset(); } void end() { double v = hrt[idx()].get(); total += v; if (max<v) max = v; count++; } void print() { if (count) PROGLOG("TIME: %s(%u): max=%.6f, avg=%.6f, tot=%.6f",name,count,max,(double)total/count,total); } }; CriticalSection CSectionTimer::findsect; class TimedBlock { CSectionTimer &stim; public: TimedBlock(CSectionTimer &_stim) : stim(_stim) { stim.begin(); } ~TimedBlock() { stim.end(); } }; class TimedCriticalBlock { CriticalSection &crit; public: TimedCriticalBlock(CriticalSection &c,CSectionTimer &stim) : crit(c) { TimedBlock block(stim); crit.enter(); } ~TimedCriticalBlock() { crit.leave(); } }; static CSectionTimer STsend("send"); static CSectionTimer STrecv("recv"); //#define NITER 100 #define NITER 40 #define BLOCKSIZE (0x100000*10) //#define BLOCKSIZE (0x1000*10) #define WRITEDELAY 100 #define READDELAY 5000 void StreamTest(IGroup *group,ICommunicator *comm) { CMessageBuffer mb; for (unsigned i=0;i<NITER;i++) { if (group->rank() == 1) { mb.clear(); StringBuffer header; header.append("Test Block #").append(i); mb.append(header.str()).reserve(BLOCKSIZE-mb.length()); PROGLOG("MPTEST: StreamTest sending '%s' length %u",header.str(),mb.length()); { TimedBlock block(STsend); comm->send(mb,0,MPTAG_TEST,MP_ASYNC_SEND); } PROGLOG("MPTEST: StreamTest sent"); //Sleep(WRITEDELAY); } else if (group->rank() == 0) { rank_t r; comm->recv(mb,RANK_ALL,MPTAG_TEST,&r); StringAttr str; PROGLOG("MPTEST: StreamTest receiving"); { TimedBlock block(STrecv); mb.read(str); } PROGLOG("MPTEST: StreamTest received(%u) '%s' length %u",r,str.get(),mb.length()); } else { PROGLOG("MPTEST: StreamTest skipping extra rank %u", group->rank()); break; } } comm->barrier(); STsend.print(); STrecv.print(); } void Test1(IGroup *group,ICommunicator *comm) { PROGLOG("test1"); CMessageBuffer mb; if (group->rank()==0) { mb.append("Hello - Test1"); comm->send(mb,1,MPTAG_TEST); } else if (group->rank()==1) { rank_t r; comm->recv(mb,0,MPTAG_TEST,&r); StringAttr str; mb.read(str); PROGLOG("(1) Received '%s' from rank %u",str.get(),r); } comm->barrier(); } void Test2(IGroup *group,ICommunicator *comm) { PROGLOG("test2"); CMessageBuffer mb; if (group->rank()==0) { mb.append("Hello - Test2"); comm->send(mb,RANK_ALL,MPTAG_TEST); } else if (group->rank()==1) { #ifdef GPF PROGLOG("GPFING"); Sleep(aWhile); byte *p = NULL; *p = 1; #endif rank_t r; comm->recv(mb,RANK_ALL,MPTAG_TEST,&r); StringAttr str; mb.read(str); PROGLOG("(2) Received '%s' from rank %u",str.get(),r); } comm->barrier(); } void Test3(IGroup *group,ICommunicator *comm) { PROGLOG("test3"); CMessageBuffer mb; if (group->rank()==0) { mb.append("Hello - Test3"); comm->send(mb,1,MPTAG_TEST); } else if (group->rank()==1) { rank_t r; comm->recv(mb,RANK_ALL,MPTAG_TEST,&r); StringAttr str; mb.read(str); PROGLOG("(3) Received '%s' from rank %u",str.get(),r); } comm->barrier(); } void Test4(IGroup *group,ICommunicator *comm) { PROGLOG("test4"); CMessageBuffer mb; if (group->rank()==0) { INode *singlenode=&group->queryNode(1); IGroup *singlegroup = createIGroup(1,&singlenode); ICommunicator * singlecomm = createCommunicator(singlegroup); mb.append("Hello - Test4"); singlecomm->send(mb,0,MPTAG_TEST); singlecomm->Release(); singlegroup->Release(); } else if (group->rank()==1) { rank_t r; comm->recv(mb,RANK_ALL,MPTAG_TEST,&r); StringAttr str; mb.read(str); PROGLOG("(4) Received '%s' from rank %u",str.get(),r); } comm->barrier(); } void Test5(IGroup *group,ICommunicator *comm) { PROGLOG("test5"); rank_t rank = group->rank(); INode *singlenode=&group->queryNode(1); IGroup *singlegroup = createIGroup(1,&singlenode); ICommunicator * singlecomm = createCommunicator(singlegroup); CMessageBuffer mb; if (rank==0) { mb.append("Hello - Test5"); singlecomm->send(mb,0,MPTAG_TEST); } else if (rank==1) { rank_t r; singlecomm->recv(mb,RANK_ALL,MPTAG_TEST,&r); StringAttr str; mb.read(str); PROGLOG("(5) Received '%s' from rank %u (unknown)",str.get(),r); } comm->barrier(); singlecomm->Release(); singlegroup->Release(); } void Test6(IGroup *group,ICommunicator *comm) { PROGLOG("test6"); //DebugBreak(); CMessageBuffer mb; StringAttr str; if (group->rank()==1) { mb.append("Test"); bool cancelled = comm->sendRecv(mb,0,MPTAG_TEST); StringAttr str; mb.read(str); StringBuffer url; PROGLOG("(6) Received '%s' from %s",str.get(),mb.getSender().getUrlStr(url).str()); } else if (group->rank()==0) { rank_t r; comm->recv(mb,RANK_ALL,MPTAG_TEST,&r); mb.read(str); PROGLOG("(6) - str = <%s>", str.get()); assertex(strcmp(str.get(),"Test")==0); mb.clear(); mb.append("Hello - Test6"); printf("crash now!"); Sleep(1); comm->reply(mb); } comm->barrier(); } void Test7(IGroup *group,ICommunicator *comm) { PROGLOG("test7"); CMessageBuffer mb; if (group->rank()==0) { mb.append("Hello - Test7"); mb.reserve(150*1024); comm->send(mb,1,MPTAG_TEST); } else if (group->rank()==1) { rank_t r; comm->recv(mb,(mptag_t) TAG_ALL,MPTAG_TEST,&r); StringAttr str; mb.read(str); PROGLOG("Received '%s' from rank %u",str.get(),r); } comm->barrier(); } // #define MAXBUFFERSIZE 0x100000 #define MAXBUFFERSIZE 0x10000 struct CRandomBuffer { size32_t size; char buffer[MAXBUFFERSIZE]; unsigned crc; void fill() { size = getRandom()%MAXBUFFERSIZE; // size = 100000; if (size) { char c = (char)getRandom(); #if 0 for (unsigned i=0;i<size;i++) { buffer[i] = c; c += (c*16); c += 113; } #endif for (unsigned i=0;i<size;i++) { buffer[i] = 'a' + i%26; } } crc = crc32(&buffer[0],size,0); } bool check() { int errs = 50; if (crc!=crc32(buffer,size,0)) { PROGLOG("**** Error: CRC check failed"); PROGLOG("size = %u",size); char c = buffer[0]; for (unsigned i=1;i<size;i++) { c += (c*16); c += 113; if (buffer[i] != c) { PROGLOG("Failed at %u, expected %02x found %02x %02x %02x %02x %02x %02x %02x %02x",i,(int)(byte)c,(int)(byte)buffer[i],(int)(byte)buffer[i+1],(int)(byte)buffer[i+2],(int)(byte)buffer[i+3],(int)(byte)buffer[i+4],(int)(byte)buffer[i+5],(int)(byte)buffer[i+6],(int)(byte)buffer[i+7]); if (errs--==0) break; } } return false; } return true; } void serialize(MemoryBuffer &mb) { // PROGLOG("1serialize: size = %u, length = %u", size, mb.length()); mb.append(size).append(size,buffer).append(crc); // PROGLOG("2serialize: size = %u, length = %u", size, mb.length()); } void deserialize(MemoryBuffer &mb) { // PROGLOG("1de-serialize: size = %u, length = %u", size, mb.length()); mb.read(size); // PROGLOG("2de-serialize: size = %u, length = %u", size, mb.length()); mb.read(size,buffer).read(crc); } }; void printtrc(char c) { static CriticalSection crit; CriticalBlock block(crit); printf("%c",c); } // #define N 100 #define N 20 void MultiTest(ICommunicator *_comm) { class Server: public Thread { public: Owned<ICommunicator> comm; Server(ICommunicator *_comm) { comm.set(_comm); } int run() { unsigned n=(comm->queryGroup().ordinality()-1)*N; CMessageBuffer mb; CRandomBuffer *buff = new CRandomBuffer(); PROGLOG("MPTEST: MultiTest server started, myrank = %u", comm->queryGroup().rank()); try { while(n--) { mb.clear(); rank_t rr; if (!comm->recv(mb,RANK_ALL,MPTAG_TEST,&rr)) break; PROGLOG("MPTEST: MultiTest server Received from %u, len = %u",rr, mb.length()); StringBuffer str; comm->queryGroup().queryNode(rr).endpoint().getUrlStr(str); // PROGLOG("MPTEST: MultiTest server Received from %s",str.str()); buff->deserialize(mb); #ifdef DO_CRC_CHECK if (!buff->check()) PROGLOG("MPTEST: MultiTest server Received from %s",str.str()); #endif mb.clear().append(buff->crc); int delay = getRandom() % 20; Sleep(delay); comm->reply(mb); } } catch (IException *e) { pexception("Server Exception",e); e->Release(); } comm->barrier(); PROGLOG("MPTEST: MultiTest server stopped"); delete buff; return 0; } } server(_comm); Owned<ICommunicator> comm; comm.set(_comm); server.start(); CMessageBuffer mb; CRandomBuffer *buff = new CRandomBuffer(); unsigned nr = comm->queryGroup().ordinality(); unsigned n=(nr-1)*N; rank_t r = comm->queryGroup().rank(); rank_t *targets = new rank_t[n]; rank_t *t = targets; rank_t i; for (i=0;i<nr;i++) if (i!=r) for (unsigned j=0;j<N;j++) *(t++) = i; unsigned k=n; while (k>1) { i = getRandom()%k; // NB n is correct here k--; unsigned t = targets[i]; targets[i] = targets[k]; targets[k] = t; } PROGLOG("MPTEST: Multitest client started, myrank = %u", comm->queryGroup().rank()); try { while (n--) { buff->fill(); buff->serialize(mb.clear()); #if 0 StringBuffer str; comm->queryGroup().queryNode(targets[n]).endpoint().getUrlStr(str); PROGLOG("MPTEST: Multitest client Sending to %s, length=%u",str.str(), mb.length()); #endif PROGLOG("MPTEST: Multitest client Sending to %u, length=%u", targets[n], mb.length()); if (!comm->sendRecv(mb,targets[n],MPTAG_TEST)) break; // Sleep((n+1)*2000); // PROGLOG("MPTEST: Multitest client Sent to %s",str.str()); unsigned crc; mb.read(crc); assertex(crc==buff->crc); } } catch (IException *e) { pexception("Client Exception",e); e->Release(); } PROGLOG("MPTEST: MultiTest client finished"); server.join(); delete [] targets; delete buff; } void MPRing(IGroup *group, ICommunicator *mpicomm, unsigned iters=0) { CMessageBuffer smb; CMessageBuffer rmb; rank_t myrank = group->rank(); rank_t numranks = group->ordinality(); if (numranks < 2) throw MakeStringException(-1, "MPTEST: MPRing Error, numranks (%u) must be > 1", numranks); if (iters == 0) iters = 1000; unsigned pintvl = iters/10; if (pintvl < 1) pintvl = 1; PROGLOG("MPTEST: MPRing myrank=%u numranks=%u iters=%u", myrank, numranks, iters); unsigned next = myrank; unsigned prev = myrank; unsigned k = 0; do { next = (next+1) % numranks; prev = prev > 0 ? prev-1 : numranks-1; // skip self if ( (next == prev) && (next == myrank) ) continue; smb.clear(); smb.append(k); if ((k%pintvl) == 0) PROGLOG("MPTEST: MPRing %u send to rank %u", myrank, next); bool oksend = mpicomm->send(smb, next, MPTAG_TEST); if (!oksend) throw MakeStringException(-1, "MPTEST: MPRing %u send() to rank %u failed", myrank, next); rmb.clear(); if ((k%pintvl) == 0) PROGLOG("MPTEST: MPRing %u recv from rank %u", myrank, prev); bool okrecv = mpicomm->recv(rmb, prev, MPTAG_TEST); if (!okrecv) throw MakeStringException(-1, "MPTEST: MPRing %u recv() from rank %u failed", myrank, prev); rmb.read(k); k++; if ((k%pintvl) == 0) PROGLOG("MPTEST: MPRing %u iteration %u complete", myrank, k); if (k == iters) break; } while (true); PROGLOG("MPTEST: MPRing complete"); mpicomm->barrier(); } #define MSGLEN 1048576 void MPAlltoAll(IGroup *group, ICommunicator *mpicomm, size32_t buffsize=0, unsigned iters=0) { rank_t myrank = group->rank(); rank_t numranks = group->ordinality(); if (numranks < 2) throw MakeStringException(-1, "MPAlltoAll: MPRing Error, numranks (%u) must be > 1", numranks); if (buffsize == 0) buffsize = MSGLEN; if (iters == 0) iters = 1000; PROGLOG("MPTEST: MPAlltoAll myrank=%u numranks=%u buffsize=%u iters=%u", myrank, numranks, buffsize, iters); // --------- class Sender : public Thread { public: Linked<ICommunicator> mpicomm; rank_t numranks; rank_t myrank; size32_t buffsize; unsigned iters; Sender(ICommunicator *_mpicomm, rank_t _numranks, rank_t _myrank, size32_t _buffsize, unsigned _iters) : mpicomm(_mpicomm), numranks(_numranks), myrank(_myrank), buffsize(_buffsize), iters(_iters) { } int run() { PROGLOG("MPTEST: MPAlltoAll sender started, myrank = %u", myrank); int pintvl = iters/10; if (pintvl < 1) pintvl = 1; CMessageBuffer smb; smb.appendBytes('a', buffsize); for (unsigned k=1;k<=iters;k++) { bool oksend = mpicomm->send(smb, RANK_ALL_OTHER, MPTAG_TEST); if (!oksend) throw MakeStringException(-1, "MPTEST: MPAlltoAll %u send() failed", myrank); if ((k%pintvl) == 0) PROGLOG("MPTEST: MPAlltoAll sender %u iteration %u complete", myrank, k); } mpicomm->barrier(); PROGLOG("MPTEST: MPAlltoAll sender stopped"); return 0; } } sender(mpicomm, numranks, myrank, buffsize, iters); unsigned startTime = msTick(); sender.start(); // --------- PROGLOG("MPTEST: MPAlltoAll receiver started, myrank = %u", myrank); int pintvl = iters/10; if (pintvl < 1) pintvl = 1; CMessageBuffer rmb(buffsize); for (unsigned k=1;k<=iters;k++) { for (rank_t i=1;i<numranks;i++) { // rmb.clear(); bool okrecv = mpicomm->recv(rmb, RANK_ALL, MPTAG_TEST); if (!okrecv) throw MakeStringException(-1, "MPTEST: MPAlltoAll %u recv() failed", myrank); if (i==1 && (k%pintvl) == 0) PROGLOG("MPTEST: MPAlltoAll receiver rank %u iteration %u complete", myrank, k); } } mpicomm->barrier(); PROGLOG("MPTEST: MPAlltoAll receiver finished"); // --------- sender.join(); unsigned endTime = msTick(); double msgRateMB = (2.0*(double)buffsize*(double)iters*(double)(numranks-1)) / ((endTime-startTime)*1000.0); PROGLOG("MPTEST: MPAlltoAll complete %g MB/s", msgRateMB); return; } void MPTest2(IGroup *group, ICommunicator *mpicomm) { rank_t myrank = group->rank(); rank_t numranks = group->ordinality(); PROGLOG("MPTEST: MPTest2: myrank=%u numranks=%u", myrank, numranks); mpicomm->barrier(); return; } void testIPnodeHash() { setNodeCaching(true); class casyncfor: public CAsyncFor { public: casyncfor() { } void Do(unsigned i) { StringBuffer ips; ips.appendf("%d.%d.%d.%d",i/256,1,2,getRandom()%10); SocketEndpoint ep(ips.str()); try { Owned<INode> node = createINode(ep); } catch (IException *e) { EXCLOG(e,"failed"); } } } afor; afor.For(100000,10); } //-----------Utility classes and global variables---------------// CriticalSection sendCriticalSec; CriticalSection recvCriticalSec; CriticalSection validateCriticalSec; bool* validate; int getNextCount(CriticalSection &sect, int &count) { CriticalBlock block(sect); if (count) return count--; else return 0; } //validate that numbers from 1 to maxCounter are received only once void setValidate(int i, int maxCounter) { CriticalBlock block(validateCriticalSec); assertex(i>0); assertex(i<=maxCounter); assertex(validate[i-1] == false); validate[i-1] = true; } //-------------------------------------------------------------// /** * Test sending a message to its self */ void MPSelfSend(ICommunicator *mpcomm) { CMessageBuffer mb; int sendMessage = 1234; int receivedMessage; rank_t myrank = mpcomm->getGroup()->rank(); mb.append(sendMessage); mpcomm->send(mb, myrank, MPTAG_TEST); mb.clear(); mpcomm->recv(mb, myrank, MPTAG_TEST); mb.read(receivedMessage); assertex(sendMessage == receivedMessage); PROGLOG("MPTEST: %s: Message sent from %d to %d", TEST_SELFSEND, myrank, myrank); } /** * Test sending message to next (wrap-around) processor */ void MPRightShift(ICommunicator* comm) { IGroup* group = comm->getGroup(); rank_t p = group->ordinality(); rank_t rank = group->rank(); rank_t source_rank = (rank - 1 + p) % p; rank_t destination_rank = (rank + 1) % p; CMessageBuffer sendMsg; sendMsg.append(rank); comm->send(sendMsg, destination_rank, MPTAG_TEST); CMessageBuffer recvMsg; int received_msg; comm->recv(recvMsg, source_rank, MPTAG_TEST); recvMsg.read(received_msg); assertex(source_rank == received_msg); PROGLOG("Message received from node %d to node %d.", source_rank, rank); } /** * Test receiving message from an unknown node */ void MPReceiveFromAny(ICommunicator* comm) { IGroup* group = comm->getGroup(); rank_t nodeRank = group->rank(); rank_t p = group->ordinality(); rank_t rank = group->rank(); rank_t destinationRank = (p-1); double expectedValue = 1234.0; PROGLOG("nodeRank=%u", nodeRank); if (rank == nodeRank) { CMessageBuffer sendMsg; sendMsg.append(expectedValue); comm->send(sendMsg, destinationRank, MPTAG_TEST); PROGLOG("Message sent by node %d to node %d.", rank, destinationRank); } if (rank == destinationRank) { CMessageBuffer recvMsg; bool success = comm->recv(recvMsg, RANK_ALL, MPTAG_TEST); assertex(success); double receivedValue; recvMsg.read(receivedValue); PROGLOG("rank=%u, nodeRank=%u", comm->getGroup()->rank(recvMsg.getSender()), nodeRank); assertex(nodeRank == comm->getGroup()->rank(recvMsg.getSender())); assertex(expectedValue == receivedValue); PROGLOG("Message successfully received from node %d to node %d.", comm->getGroup()->rank(recvMsg.getSender()), rank); } } /** * Test one node sending a message to all nodes */ void MPSendToAll(ICommunicator* comm) { IGroup* group = comm->getGroup(); rank_t nodeRank = group->rank(); rank_t p = group->ordinality(); rank_t rank = group->rank(); double expectedValue = 1234.0; double receivedValue; if (rank == nodeRank) { CMessageBuffer sendMsg; sendMsg.append(expectedValue); comm->send(sendMsg, RANK_ALL, MPTAG_TEST); } CMessageBuffer recvMsg; comm->recv(recvMsg, nodeRank, MPTAG_TEST, NULL); recvMsg.read(receivedValue); assertex(expectedValue == receivedValue); PROGLOG("Message received from node %d to node %d.", nodeRank, rank); } /** * Test multiple threads calling send and recv functions */ void MPMultiMTSendRecv(ICommunicator* comm, int counter) { assertex(comm->getGroup()->ordinality()>1); counter = (counter? counter: 100); int SEND_THREADS, RECV_THREADS; SEND_THREADS = RECV_THREADS = 8; rank_t rank = comm->getGroup()->rank(); // nodes ranked 0 and 1 will be conducting this test if (rank<2) { validate = new bool[counter]; for(int i=0; i<counter; i++) validate[i] = false; class SWorker: public Thread { private: ICommunicator* comm; int* counter; public: SWorker(ICommunicator* _comm, int* _counter):comm(_comm), counter(_counter){} int run() { IGroup *group = comm->getGroup(); rank_t p = group->ordinality(); rank_t rank = group->rank(); rank_t destination_rank = 1 - rank; CMessageBuffer sendMsg; int served = 0; while(true) { sendMsg.clear(); int v = getNextCount(sendCriticalSec, *counter); if (v > 0) { sendMsg.append(v); comm->send(sendMsg, destination_rank, MPTAG_TEST); served++; } else { break; } } PROGLOG("This thread sent %d", served); return 0; } }; class RWorker: public Thread { private: ICommunicator* comm; int* counter; int maxCounter; public: RWorker(ICommunicator* _comm, int* _counter):comm(_comm), counter(_counter), maxCounter(*_counter){} int run() { IGroup *group = comm->getGroup(); rank_t p = group->ordinality(); rank_t rank = group->rank(); rank_t source_rank = 1 - rank; int served = 0; CMessageBuffer recvMsg; int received_msg; while (*counter) { recvMsg.clear(); if (comm->recv(recvMsg, source_rank, MPTAG_TEST, NULL, 100)) { recvMsg.read(received_msg); setValidate(received_msg, maxCounter); getNextCount(recvCriticalSec, *counter); served++; } } PROGLOG("This thread received %d", served); return 0; } }; std::vector<Thread*> workers; int s_counter, r_counter; s_counter = r_counter = counter; PROGLOG("counter=%d", counter); for(int i=0;i<SEND_THREADS; i++) { workers.push_back(new SWorker(comm, &s_counter)); } for(int i=0;i<RECV_THREADS; i++) { workers.push_back(new RWorker(comm, &r_counter)); } for(int i=0;i<workers.size(); i++) { workers[i]->start(); } for(int i=0;i<workers.size(); i++) { workers[i]->join(); } for(int i=0;i<workers.size(); i++) { delete workers[i]; } assertex(s_counter == 0); assertex(r_counter == 0); PROGLOG("Rank %d sent %d messages", rank, (counter-s_counter)); PROGLOG("Rank %d received %d messages", rank, (counter-r_counter)); delete [] validate; } comm->barrier(); } void MPNxN(ICommunicator *comm, unsigned numStreams, size32_t perStreamMBSize, size32_t msgSize, bool async) { // defaults if (0 == numStreams) numStreams = 8; if (0 == perStreamMBSize) perStreamMBSize = 100; if (0 == msgSize) msgSize = 1024*1024; unsigned grpSize = comm->queryGroup().ordinality(); rank_t myRank = comm->queryGroup().rank(); PROGLOG("MPNxN: myrank=%u, numStreams=%u, perStreamMBSize=%u, msgSize(bytes)=%u", myRank=(unsigned)myRank, numStreams, perStreamMBSize, msgSize); class CSendStream : public CInterfaceOf<IInterface>, implements IThreaded { CThreaded threaded; ICommunicator *comm = nullptr; rank_t myRank; unsigned grpSize; mptag_t mpTag, replyTag; unsigned __int64 totalSendSize; size32_t msgSize; StringBuffer resultMsg; bool passed = false; std::vector<rank_t> tgtRanks; StringBuffer tgtRanksStr; bool async = false; // used if async class CAckThread : implements IThreaded { CThreaded threaded; CSendStream &owner; mptag_t mpTag; CriticalSection cs; Owned<IException> exception; std::vector<std::queue<unsigned>> expectedHashes; unsigned getNextExpectedHash(unsigned sender) { std::queue<unsigned> &queue = expectedHashes[sender]; CriticalBlock b(cs); assertex(queue.size()); unsigned hash = queue.front(); expectedHashes[sender].pop(); return hash; } public: CAckThread(CSendStream &_owner, mptag_t _mpTag) : owner(_owner), mpTag(_mpTag), threaded("CAckThread", this) { expectedHashes.resize(owner.grpSize); } void addHash(unsigned tgt, unsigned hash) { CriticalBlock b(cs); expectedHashes[tgt].push(hash); } void start() { threaded.start(); } void join() { threaded.join(); if (exception) throw exception.getClear(); } // IThredaed virtual void threadmain() override { try { CMessageBuffer msg; rank_t sender; unsigned finalAcks = 0; while (true) { unsigned receivedHash; if (!owner.receiveAck(msg, sender, receivedHash)) // empty message indicates end by client { finalAcks++; if (finalAcks == owner.grpSize) break; // all done } else { unsigned expectedHash = getNextExpectedHash(sender); owner.verifyAck(receivedHash, expectedHash); } } } catch (IException *e) { exception.setown(e); } } } ackThread; unsigned fillData(void *data, size32_t sz, unsigned hash) { byte *pData = (byte *)data; do { if (sz<sizeof(hash)) { memset(pData, 0, sz); break; } hash = hashc((unsigned char *)&hash, sizeof(hash), hash); memcpy(pData, &hash, sizeof(hash)); sz -= sizeof(hash); pData += sizeof(hash); } while (true); return hash; } bool receiveAck(CMessageBuffer &msg, rank_t &sender, unsigned &ack) { while (!comm->recv(msg, RANK_ALL, replyTag, &sender, 60000)) WARNLOG("Waiting for receive ack"); if (0 == msg.length()) return false; // final empty message indicated complete if (std::find(tgtRanks.begin(), tgtRanks.end(), sender) == tgtRanks.end()) throwStringExceptionV(0, "Received reply from rank(%u) this stream did not send to", (unsigned)sender); msg.read(ack); msg.clear(); return true; } void verifyAck(unsigned receivedHash, unsigned expectedHash) { if (receivedHash != expectedHash) throwStringExceptionV(0, "Checksums mismatch: %u sent vs %u received", expectedHash, receivedHash); } public: CSendStream(ICommunicator *_comm, rank_t _myRank, unsigned _grpSize, mptag_t _mpTag, unsigned __int64 _totalSendSize, size32_t _msgSize, bool _async) : threaded("CSendStream", this), comm(_comm), myRank(_myRank), grpSize(_grpSize), mpTag(_mpTag), totalSendSize(_totalSendSize), msgSize(_msgSize), ackThread(*this, _mpTag), async(_async) { if (1 == grpSize) // group only contains self, so target self tgtRanks.push_back(0); else { unsigned pc=25; // % // add 'pc'% targets, starting from myRank+1 unsigned num = grpSize*pc/100; if (0 == num) num = 1; unsigned step = grpSize / num; unsigned t = myRank+1; if (t == grpSize) t = 0; while (true) { tgtRanks.push_back(t); --num; if (0 == num) break; t += step; if (t >= grpSize) t -= grpSize; } } auto iter = tgtRanks.begin(); while (true) { tgtRanksStr.append(*iter); iter++; if (iter == tgtRanks.end()) break; tgtRanksStr.append(","); } replyTag = createReplyTag(); if (async) ackThread.start(); threaded.start(); } ~CSendStream() { threaded.join(); } bool waitResult(StringBuffer &resultMessage) { threaded.join(); return passed; } const char *queryTgtRanks() { return tgtRanksStr; } virtual void threadmain() override { passed = false; try { CMessageBuffer msg, recvMsg; msg.setReplyTag(replyTag); void *data = msg.reserveTruncate(msgSize); unsigned hash = (unsigned)mpTag; VStringBuffer logMsg("NxN: mpTag=%u, dstRank(s) [%s]", (unsigned)mpTag, tgtRanksStr.str()); PROGLOG("%s", logMsg.str()); unsigned __int64 remaining = totalSendSize; CCycleTimer timer; while (true) { size32_t sz; if (remaining >= msgSize) { sz = msgSize; remaining -= msgSize; } else { sz = remaining; msg.setLength(sz); remaining = 0; } hash = fillData(data, sz, hash); for (rank_t t: tgtRanks) { if (async) ackThread.addHash(t, hash); if (!comm->send(msg, t, mpTag)) throwUnexpected(); } if (!async) { rank_t sender; for (int t: tgtRanks) { rank_t sender; unsigned receivedHash; assertex(receiveAck(recvMsg, sender, receivedHash)); verifyAck(hash, receivedHash); } } if (!remaining) break; } msg.clear(); // send blank msg to all to signal end to receivers. if (!comm->send(msg, RANK_ALL, mpTag)) throwUnexpected(); if (async) ackThread.join(); else { rank_t sender; for (unsigned r=0; r<grpSize; r++) { while (!comm->recv(msg, r, replyTag, &sender, 60000)) WARNLOG("Waiting for final ack"); assertex(sender == r); assertex(0 == msg.length()); } } float ms = timer.elapsedMs(); float mbPerSec = (totalSendSize/ms*1000)/0x100000; PROGLOG("Stream stats: time taken = %.2f seconds, total sent=%u MB, throughput = %.2f MB/s", ms/1000, (unsigned)(totalSendSize/0x100000), mbPerSec); } catch (IException *e) { e->errorMessage(resultMsg); EXCLOG(e, "FAIL"); e->Release(); return; } passed = true; } }; class CRecvServer : public CInterfaceOf<IInterface>, implements IThreaded { CThreaded threaded; ICommunicator *comm; rank_t myRank; unsigned grpSize; mptag_t mpTag; unsigned numStreams; unsigned checkData(MemoryBuffer &mb, unsigned hash) { size32_t len = mb.remaining(); const byte *p = (const byte *)mb.readDirect(len); while (len >= sizeof(hash)) { hash = hashc((unsigned char *)&hash, sizeof(hash), hash); if (0 != memcmp(p, &hash, sizeof(hash))) return 0; p += sizeof(hash); len -= sizeof(hash); } return hash; } public: CRecvServer(ICommunicator *_comm, rank_t _myRank, unsigned _grpSize, mptag_t _mpTag, unsigned _numStreams) : threaded("CSendStream", this), comm(_comm), myRank(_myRank), grpSize(_grpSize), mpTag(_mpTag), numStreams(_numStreams) { threaded.start(); } ~CRecvServer() { threaded.join(); } void join() { threaded.join(); } void stop() { comm->cancel(RANK_ALL, mpTag); join(); } virtual void threadmain() override { unsigned __int64 szRecvd = 0; std::vector<rank_t> endReplyTags; try { unsigned hash = (unsigned)mpTag; unsigned clients = grpSize; endReplyTags.resize(clients); CMessageBuffer msg; do { rank_t sender; while (!comm->recv(msg, RANK_ALL, mpTag, &sender, 60000)) PROGLOG("Waiting for data on %u", (unsigned)mpTag); if (!msg.length()) { /* each client sends a zero length buffer when done. * When all received, receiver can stop, and replies to indicate finished. * */ endReplyTags[(unsigned)sender] = msg.getReplyTag(); --clients; if (0 == clients) { for (unsigned r=0; r<endReplyTags.size(); r++) { if (!comm->send(msg, r, (mptag_t)endReplyTags[r])) throwUnexpected(); } break; } } else { szRecvd += msg.length(); // read 1st hash, then use to calculate and check incoming data. msg.read(hash); hash = checkData(msg, hash); msg.clear(); msg.append(hash); // this should match what client calculated presend. if (!comm->reply(msg)) throwUnexpected(); } } while (true); } catch (IException *e) { EXCLOG(e, "CRecvServer"); e->Release(); } PROGLOG("NxN:Receiver[tag=%u] szRecvd=%" I64F "u finished", (unsigned)mpTag, szRecvd); } }; mptag_t mpTag = (mptag_t)0x20000; std::vector<Owned<CRecvServer>> receivers; std::vector<Owned<CSendStream>> senders; for (unsigned s=0; s<numStreams; s++) { receivers.push_back(new CRecvServer(comm, myRank, grpSize, mpTag, numStreams)); senders.push_back(new CSendStream(comm, myRank, grpSize, mpTag, ((unsigned __int64)perStreamMBSize)*0x100000, msgSize, async)); mpTag = (mptag_t)((unsigned)mpTag+1); } bool allSuccess = true; for (unsigned senderN=0; senderN<senders.size(); senderN++) { const auto &sender = senders[senderN]; StringBuffer resultMsg; bool res = sender->waitResult(resultMsg); VStringBuffer logMsg("Stream[%u] from rank %u -> rank(s) [%s] result: ", senderN, (unsigned)myRank, sender->queryTgtRanks()); if (res) logMsg.append("PASSED"); else { logMsg.append("FAILED - ").append(resultMsg.str()); allSuccess = false; } PROGLOG("%s", logMsg.str()); } for (const auto &receiver: receivers) { if (allSuccess) receiver->join(); else receiver->stop(); } } // various test use some of these configurable parameters static size32_t buffsize = 0; static unsigned numiters = 0; static unsigned numStreams = 0; static unsigned perStreamMBSize = 0; static bool async = false; void runTest(const char *caption, const char *testname, IGroup* group, ICommunicator* comm) { if (group->rank()==0) { printf("\n\n"); PROGLOG("%s %s", caption, testname); PROGLOG("========================"); } comm->barrier(); if (strieq(testname, TEST_STREAM)) StreamTest(group, comm); else if (strieq(testname, TEST_MULTI)) MultiTest(comm); else if (strieq(testname, TEST_RING)) MPRing(group, comm, numiters); else if (strieq(testname, TEST_AlltoAll)) MPAlltoAll(group, comm, buffsize, numiters); else if (strieq(testname, TEST_RANK)) MPTest2(group, comm); else if (strieq(testname, TEST_SELFSEND)) MPSelfSend(comm); else if (strieq(testname, TEST_SINGLE_SEND)) Test1(group, comm); else if (strieq(testname, TEST_RIGHT_SHIFT)) MPRightShift(comm); else if (strieq(testname, TEST_RECV_FROM_ANY)) MPReceiveFromAny(comm); else if (strieq(testname, TEST_SEND_TO_ALL)) MPSendToAll(comm); else if (strieq(testname, TEST_MULTI_MT)) MPMultiMTSendRecv(comm, numiters); else if (strieq(testname, TEST_NXN)) MPNxN(comm, numStreams, perStreamMBSize, buffsize, async); else PROGLOG("MPTEST: Error, invalid testname specified (-t %s)", testname); comm->barrier(); } bool createNodeList(IArrayOf<INode> &nodes, const char* hostfile, int my_port, rank_t max_ranks) { unsigned i = 1; char hoststr[256] = { "" }; FILE* fp = fopen(hostfile, "r"); if (fp == NULL) { PROGLOG("MPTest: Error, cannot open hostfile <%s>", hostfile); return false; } char line[256] = { "" }; while (fgets(line, 255, fp) != NULL) { if ((max_ranks > 0) && ((i - 1) >= max_ranks)) break; int srtn = sscanf(line, "%s", hoststr); if (srtn == 1 && line[0] != '#') { INode* newNode = createINode(hoststr, my_port); nodes.append(*newNode); i++; } } fclose(fp); return true; } void printHelp(char* executableName) { printf("\nMPTEST: Usage: %s <myport> [-f <hostfile> [-t <testname> -b <buffsize> -i <iters> -r <rank> -n <numprocs> -d] | <ip:port> <ip:port>] [-mpi] [-mp]\n\n",executableName); std::vector<std::string> tests = { TEST_RANK, TEST_SELFSEND, TEST_MULTI, TEST_STREAM, TEST_RING, TEST_AlltoAll, TEST_SINGLE_SEND, TEST_RIGHT_SHIFT, TEST_RECV_FROM_ANY, TEST_SEND_TO_ALL, TEST_MULTI_MT, TEST_NXN }; printf("\t <testname>"); for (auto &testName: tests) printf("\t%s\n\t\t", testName.c_str()); printf("\n"); } int main(int argc, char* argv[]) { int mpi_debug = 0; const char * testname = ""; rank_t max_ranks = 0; unsigned startupDelay = 0; InitModuleObjects(); EnableSEHtoExceptionMapping(); // startMPServer(9123); // testIPnodeHash(); // stopMPServer(); // return 0; /* mp hostfile format: * ------------------- * <IP0>:port0 * <IP1>:port1 * <IP2>:port2 * ... * * run script: * ----------- * # NOTE: because mptest will stop if its cmdline port and native IP do not match * # corresponding entry in hostfile - the same cmdline can be repeated on all hosts ... * mptest port0 -f hostfile [-t testname] [-b buffsize] [-i iters] [-n numprocs] [-d] & * mptest port1 -f hostfile ... & * ... * [wait] * * Test names (-t): * ----------- * MPRing (default) * StreamTest * MultiTest * MPAlltoAll * MPTest2 * MPNxN [-b <msgSiz>] [-s <numStreams>] [-m <perStreamMBSize>] [-a] * * Options: (available with -f hostfile arg) * -------- * -b buffsize (bytes) for MPAlltoAll and MPNxN tests * -i iterations for MPRing and MPAlltoAll tests * -n numprocs for when wanting to test a subset of ranks from hostfile/script * -d for some additional debug output * -s number of streams for MPNxN test * -m total MB's to send per stream for MPNxN test * -a async for NxN test */ int argSize = argc; char** argL = argv; if (argSize<3) { printHelp(argv[0]); return 0; } try { EnableSEHtoExceptionMapping(); StringBuffer lf; rank_t tot_ranks = 0; int my_port = atoi(argv[1]); char logfile[256] = { "" }; sprintf(logfile,"mptest-%d.log",my_port); openLogFile(lf, logfile); IArrayOf<INode> nodes; const char * hostfile = nullptr; if (argSize > 3) { if (strcmp(argL[2], "-f") == 0) hostfile = argL[3]; } if (hostfile) { int j = 4; while (j < argSize) { if (streq(argL[j], "-t")) { if ((j+1) < argSize) { testname = argL[j+1]; j++; } } else if (streq(argL[j], "-d")) { mpi_debug++; } else if (streq(argL[j], "-b")) { if ((j+1) < argSize) { buffsize = atoi(argL[j+1]); j++; } } else if (streq(argL[j], "-i")) { if ((j+1) < argSize) { numiters = atoi(argL[j+1]); j++; } } else if ( streq(argL[j], "-n") || streq(argL[j], "-np") ) { if ((j+1) < argSize) { max_ranks = atoi(argL[j+1]); j++; } } else if (streq(argv[j], "-s")) { if ((j+1) < argc) { numStreams = atoi(argv[j+1]); j++; } } else if (streq(argv[j], "-m")) { if ((j+1) < argc) { perStreamMBSize = atoi(argv[j+1]); j++; } } else if (streq(argv[j], "-a")) async = true; else if (streq(argv[j], "-delay")) { if ((j+1) < argc) { startupDelay = atoi(argv[j+1]); j++; } } j++; } if (!createNodeList(nodes, hostfile, my_port, max_ranks)) return 1; } else { unsigned i = 1; while (i+1 < argSize) { PROGLOG("MPTEST: adding node %u, port = <%s>", i-1, argL[i+1]); INode *newNode = createINode(argL[i+1], my_port); nodes.append(*newNode); i++; } } tot_ranks = nodes.length(); if (startupDelay) { PROGLOG("Pausing for startupDelay = %u second(s)", startupDelay); MilliSleep(startupDelay * 1000); PROGLOG("Resuming"); } Owned<IGroup> group = createIGroup(tot_ranks, nodes.getArray()); // stop if not meant for this host ... IpAddress myIp; GetHostIp(myIp); SocketEndpoint myEp(my_port, myIp); bool die = true; for (rank_t k=0;k<tot_ranks;k++) { if (nodes.item(k).endpoint().equals(myEp)) die = false; } if (die) return 0; PROGLOG("MPTEST: Starting, port = %d tot ranks = %u", my_port, tot_ranks); startMPServer(my_port); if (mpi_debug) { for (rank_t k=0;k<tot_ranks;k++) { StringBuffer urlStr; nodes.item(k).endpoint().getUrlStr(urlStr); PROGLOG("MPTEST: adding node %u, %s", k, urlStr.str()); } } Owned<ICommunicator> comm = createCommunicator(group); runTest("MPTEST: Running MP Test:", testname, group, comm); stopMPServer(); } catch (IException *e) { pexception("Exception",e); e->Release(); } PROGLOG("MPTEST: bye"); return 0; }
29.077732
302
0.497086
867b91089c5e8aa3d5c05895f0beafc5161bae0f
531
asm
Assembly
oeis/245/A245245.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/245/A245245.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/245/A245245.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A245245: a(n) = C(3*n^2, n^2). ; Submitted by Christian Krause ; 1,3,495,4686825,2254848913647,52588547141148893628,58152371703925106867047535565,3012179439602547459232394950891834843500,7255167425905233148164780983569428433097979870294255,808718755397067598640202627155266231883064669446721506930287016061,4158251463258564744783383526326405580280466005743648708663033657304756328324008620,983944431992885247886528744781914765780055310889986542226990820250469418230392153367541438162630800 pow $0,2 mov $1,$0 mul $0,3 bin $0,$1
59
426
0.892655
9bc302866ef6107af4908ea1eea850153c1214ef
2,435
swift
Swift
Sample/buttonSample/ViewController.swift
sun54907/IconButtonView
968b9b917e9cffa9005298d95a938d5cf90ee43f
[ "MIT" ]
4
2017-11-28T10:35:43.000Z
2018-06-20T13:41:08.000Z
Sample/buttonSample/ViewController.swift
umikawa-k/IconButtonView
968b9b917e9cffa9005298d95a938d5cf90ee43f
[ "MIT" ]
null
null
null
Sample/buttonSample/ViewController.swift
umikawa-k/IconButtonView
968b9b917e9cffa9005298d95a938d5cf90ee43f
[ "MIT" ]
null
null
null
// // ViewController.swift // buttonSample // // Created by kazuya umikawa on 2017/12/03. // Copyright © 2017年 sun54907. All rights reserved. // import UIKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() let stackView = UIStackView() stackView.axis = .vertical stackView.alignment = .center stackView.distribution = .equalCentering self.view.addSubview(stackView) stackView.translatesAutoresizingMaskIntoConstraints = false stackView.backgroundColor = UIColor.init(white: 0.3, alpha: 0.5) if #available(iOS 11.0, *) { stackView.topAnchor.constraint(equalTo: self.view.safeAreaLayoutGuide.topAnchor).isActive = true stackView.bottomAnchor.constraint(equalTo: self.view.safeAreaLayoutGuide.bottomAnchor).isActive = true stackView.leadingAnchor.constraint(equalTo: self.view.safeAreaLayoutGuide.leadingAnchor).isActive = true stackView.trailingAnchor.constraint(equalTo: self.view.safeAreaLayoutGuide.trailingAnchor).isActive = true } else { stackView.topAnchor.constraint(equalTo: self.view.topAnchor).isActive = true stackView.bottomAnchor.constraint(equalTo: self.view.bottomAnchor).isActive = true stackView.leadingAnchor.constraint(equalTo: self.view.leadingAnchor).isActive = true stackView.trailingAnchor.constraint(equalTo: self.view.trailingAnchor).isActive = true } let iconButtonView = IconButtonView.create(data: .init(title: "クリック"), style: .medium(.wrapContent), colorType: .primary) stackView.addArrangedSubview(iconButtonView) let iconButtonView2 = IconButtonView.create(data: .init(title: "クリック", leftImage: #imageLiteral(resourceName: "camera")), style: .large(.wrapContent), colorType: .secondary) stackView.addArrangedSubview(iconButtonView2) let iconButtonView3 = IconButtonView.create(data: .init(title: "クリック", leftImage: #imageLiteral(resourceName: "camera"), rightImage: #imageLiteral(resourceName: "mail")), style: .large(.wrapContent), colorType: .primaryBorder) stackView.addArrangedSubview(iconButtonView3) let iconButtonView4 = IconButtonView.create(data: .init(title: "クリック"), style: .small(.wrapContent), colorType: .normal) stackView.addArrangedSubview(iconButtonView4) } }
48.7
234
0.712936
64faaa8f7c76722664556a2d424e842a27c0294c
1,410
java
Java
src/main/java/cn/edu/hust/engine/api/Field.java
xinyuyu/javap-web
0d999070fba9b96a289860e9aa540ab8fbc7fb1a
[ "MIT" ]
null
null
null
src/main/java/cn/edu/hust/engine/api/Field.java
xinyuyu/javap-web
0d999070fba9b96a289860e9aa540ab8fbc7fb1a
[ "MIT" ]
null
null
null
src/main/java/cn/edu/hust/engine/api/Field.java
xinyuyu/javap-web
0d999070fba9b96a289860e9aa540ab8fbc7fb1a
[ "MIT" ]
null
null
null
/* * 定义ClassFile的Field类 * * 1.public String getAccessFlags(): 字符串格式的access_flags * 2.public String getFieldSignature(): 字段签名 * * Copyright (c) 2014.2.21, All rights reserved. */ package cn.edu.hust.engine.api; import java.util.Map; /** * field_info { * u2 access_flags; * u2 name_index; * u2 descriptor_index; * u2 attributes_count; * attribute_info attributes[attributes_count]; * } */ public class Field extends FieldBase { public Field( byte[] data, int[] pool, int offset) { super(data, pool, offset); } /** * @return 字符串格式的access_flags */ public String getAccessFlags() { return ClassFile.getAccessFlagSet(access_flags, Flags.fieldAccessFlags); } /** * @return 字段签名(访问信息 类型 名字 = 值) */ public String getFieldSignature() { String descriptor = getDescriptor(); String fieldSignature = getAccessFlags() + " " + descriptor + " " + getName(); Map<String, Attribute> attributeMap = getAttributeMap(); if (attributeMap.containsKey("ConstantValue")) { ConstantValue constantValue = (ConstantValue)attributeMap.get("ConstantValue"); String v = constantValue.getConstantValue(); if (descriptor.equals("char")) v = "'" + (char)Short.parseShort(v) + "'"; else if (descriptor.equals("boolean")) { if (v.equals("1")) v = "true"; else { v = "false"; } } fieldSignature += " = " + v; } return fieldSignature + ";"; } }
24.310345
82
0.660284
e73064789317534ef829e06807429a8ccced2a83
113
js
JavaScript
src/index.js
gvergnaud/evolui
c99a83e18ae9f76ac8ae731e8c8d243d733b9611
[ "MIT" ]
45
2018-02-11T19:28:43.000Z
2021-02-02T09:22:27.000Z
src/index.js
gvergnaud/evolui
c99a83e18ae9f76ac8ae731e8c8d243d733b9611
[ "MIT" ]
null
null
null
src/index.js
gvergnaud/evolui
c99a83e18ae9f76ac8ae731e8c8d243d733b9611
[ "MIT" ]
2
2018-02-14T17:58:13.000Z
2021-01-12T22:13:47.000Z
import { html, render } from './html' import { text } from './text' export default html export { text, render }
18.833333
37
0.663717
0a616f844b98fdf6eae57dceddc690a65d111f80
389
sql
SQL
database/schema/dbDROP.sql
kanalumaddela/ub-course-registration
483dd2cb88afb34225311b87d056262ddfa46210
[ "MIT" ]
null
null
null
database/schema/dbDROP.sql
kanalumaddela/ub-course-registration
483dd2cb88afb34225311b87d056262ddfa46210
[ "MIT" ]
null
null
null
database/schema/dbDROP.sql
kanalumaddela/ub-course-registration
483dd2cb88afb34225311b87d056262ddfa46210
[ "MIT" ]
null
null
null
DROP TABLE IF EXISTS locations; DROP TABLE IF EXISTS student_registrations; DROP TABLE IF EXISTS department_advisors; DROP TABLE IF EXISTS messages; DROP TABLE IF EXISTS course_section_schedules; DROP TABLE IF EXISTS course_sections; DROP TABLE IF EXISTS catalogs; DROP TABLE IF EXISTS courses; DROP TABLE IF EXISTS departments; DROP TABLE IF EXISTS users; DROP TABLE IF EXISTS buildings;
32.416667
46
0.830334
98823baf7c469c90a391dd5a038d32e12dfdb902
2,648
kt
Kotlin
test/leetcode/WordSearch.kt
andrej-dyck/coding-challenges
da395484b3d483fbf5eaae9f30064672ad014f0d
[ "MIT" ]
null
null
null
test/leetcode/WordSearch.kt
andrej-dyck/coding-challenges
da395484b3d483fbf5eaae9f30064672ad014f0d
[ "MIT" ]
null
null
null
test/leetcode/WordSearch.kt
andrej-dyck/coding-challenges
da395484b3d483fbf5eaae9f30064672ad014f0d
[ "MIT" ]
null
null
null
package leetcode import lib.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.* import org.junit.jupiter.params.* import org.junit.jupiter.params.converter.* import org.junit.jupiter.params.provider.* /** * https://leetcode.com/problems/word-search/ * * 79. Word Search * [Medium] * * Given an m x n board and a word, find if the word exists in the grid. * * The word can be constructed from letters of sequentially adjacent cells, * where "adjacent" cells are horizontally or vertically neighboring. * The same letter cell may not be used more than once. * * Constraints: * - m == board.length * - n = board[i].length * - 1 <= m, n <= 200 * - 1 <= word.length <= 10^3 * - board and word consists only of lowercase and uppercase English letters. */ typealias Board = Array<String> typealias Coordinates = Sequence<XY> typealias Path = Coordinates fun findWordsOnBoard(board: Board, words: List<String>) = words.filter { boardContainsWord(board, it) } fun boardContainsWord(board: Board, word: String) = board.findPath(word).any() // for leetcode fun Board.findPath(word: String, xys: Coordinates = xys(), path: Path = emptySequence()): Path = if (word.isEmpty()) path else xys .filter { word.first() == maybeValue(it) && it !in path } .map { findPath(word.drop(1), it.neighbors(), path + it) } .find { it.any() } .orEmpty() private fun Board.xys() = asSequence().flatMapIndexed { y, r -> r.mapIndexed { x, _ -> XY(x, y) } } private fun Board.maybeValue(xy: XY) = getOrNull(xy.y)?.getOrNull(xy.x) data class XY(val x: Int, val y: Int) { fun neighbors() = sequenceOf(right(), down(), up(), left()) fun up() = copy(y = y - 1) fun right() = copy(x = x + 1) fun down() = copy(y = y + 1) fun left() = copy(x = x - 1) } /** * Unit tests */ class WordsInsideARectangleTest { @ParameterizedTest @CsvSource( "[KOTE, NULE, AFIN]; [Kotlin, fun, file, line, null]; [KOTLIN, FUN, FILE, LINE]", "[ABCE, SFCS, ADEE]; [ABCCED, SEE, ABCB]; [ABCCED, SEE]", // ABCB can only be found by visiting a cell twice delimiter = ';' ) fun `finds words on board by finding a path of adjacent cells starting anywhere`( @ConvertWith(StringArrayArg::class) board: Array<String>, @ConvertWith(StringArrayArg::class) words: Array<String>, @ConvertWith(StringArrayArg::class) expectedWords: Array<String> ) { assertThat( findWordsOnBoard(board, words.map { it.uppercase() }) ).containsExactlyElementsOf( expectedWords.toList() ) } }
31.903614
116
0.645015
290a1776184d8caeef4900f9245b7dc90371ba58
736
py
Python
plotly/validators/choropleth/_marker.py
faezs/plotly.py
6009b5b9c746e5d2a2849ad255a4eb234b551ed7
[ "MIT" ]
1
2018-07-16T01:51:47.000Z
2018-07-16T01:51:47.000Z
plotly/validators/choropleth/_marker.py
faezs/plotly.py
6009b5b9c746e5d2a2849ad255a4eb234b551ed7
[ "MIT" ]
null
null
null
plotly/validators/choropleth/_marker.py
faezs/plotly.py
6009b5b9c746e5d2a2849ad255a4eb234b551ed7
[ "MIT" ]
1
2019-02-18T04:12:56.000Z
2019-02-18T04:12:56.000Z
import _plotly_utils.basevalidators class MarkerValidator(_plotly_utils.basevalidators.CompoundValidator): def __init__( self, plotly_name='marker', parent_name='choropleth', **kwargs ): super(MarkerValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, data_class_str='Marker', data_docs=""" line plotly.graph_objs.choropleth.marker.Line instance or dict with compatible properties opacity Sets the opacity of the locations. opacitysrc Sets the source reference on plot.ly for opacity .""", **kwargs )
30.666667
70
0.584239
5083ed123705edf4aa4d7ccc1f6babef7e2848a4
300
html
HTML
AngularApp/projects/app-service-diagnostics/src/app/availability/detector-view/detectors/page-operations-detector/page-operations-detector.component.html
khaled-zayed/Azure-AppServices-Diagnostics-Portal
eef71d4ae91ccb38b51cb33183d22c50c9bfb051
[ "MIT" ]
40
2018-10-14T15:13:04.000Z
2022-03-25T02:27:28.000Z
AngularApp/projects/app-service-diagnostics/src/app/availability/detector-view/detectors/page-operations-detector/page-operations-detector.component.html
khaled-zayed/Azure-AppServices-Diagnostics-Portal
eef71d4ae91ccb38b51cb33183d22c50c9bfb051
[ "MIT" ]
232
2018-03-26T17:27:03.000Z
2022-03-20T03:32:05.000Z
AngularApp/projects/app-service-diagnostics/src/app/availability/detector-view/detectors/page-operations-detector/page-operations-detector.component.html
khaled-zayed/Azure-AppServices-Diagnostics-Portal
eef71d4ae91ccb38b51cb33183d22c50c9bfb051
[ "MIT" ]
45
2018-10-30T10:57:49.000Z
2022-01-17T17:38:44.000Z
<metric-graph [metricSets]="detectorMetrics" [title]="detectorMetricsTitle" [chartType]="metricsChartType" [description]="detectorMetricsDescription" [yAxisLabel]="detectorMetricsYAxisLabel"> </metric-graph> <br/> <feedback-form [source]='getDetectorName()'></feedback-form>
30
60
0.72
3693bb953b7464502da0cf120263724e82ba9c7a
2,407
rs
Rust
src/server.rs
jiricodes/rust_http_server
af709a5c816586edf5fa3f002f09799411f64c49
[ "MIT" ]
null
null
null
src/server.rs
jiricodes/rust_http_server
af709a5c816586edf5fa3f002f09799411f64c49
[ "MIT" ]
null
null
null
src/server.rs
jiricodes/rust_http_server
af709a5c816586edf5fa3f002f09799411f64c49
[ "MIT" ]
null
null
null
//! Main server struct and loop use crate::http::{ParseError, Request, Response, StatusCode}; use std::convert::TryFrom; use std::io::Read; use std::net::TcpListener; /// Trait to handle requests pub trait Handler { fn handle_request(&mut self, request: &Request) -> Response; fn handle_bad_request(&mut self, e: &ParseError) -> Response { println!("Failed to convert the request: {}", e); Response::new( StatusCode::BadRequest, Some("<h1>404 Bad Request</h1>".to_string()), ) } } pub struct Server { address: String, } impl Server { pub fn new(address: String) -> Server { Server { address } } // takes ownership since we want to be dealocated upon exit pub fn run(self, mut handler: impl Handler) { let listener: TcpListener = TcpListener::bind(&self.address).unwrap(); println!("Listening at {}", self.address); loop { match listener.accept() { Ok((mut stream, address)) => { println!("Connection established with {}", address); let mut buffer: [u8; 4096] = [0; 4096]; match stream.read(&mut buffer) { Ok(size) => { println!("Read {} bytes:", size); // println!("{}", String::from_utf8_lossy(&buffer)); let response = match Request::try_from(&buffer as &[u8]) { Ok(request) => handler.handle_request(&request), Err(e) => handler.handle_bad_request(&e), }; if let Err(e) = response.send(&mut stream) { println!("Failed to send response: {}", e); } } Err(e) => println!("Failed to read from connection: {}", e), } } Err(e) => { println!("Failed to establish a connection: {}", e); } } // let result = listener.accept(); // if result.is_err() { // println!("Experienced connection error. Continuing."); // continue ; // } // let (stream, socket_address) = result.unwrap(); } } }
35.925373
86
0.472788
a55a3fb9207b90c45bb11ccdfc3323576c16fcf7
1,641
dart
Dart
lib/animations/basic_animations/hero_anim.dart
SumitShukla007/Flutter_Material_Design
d30b12cb69c23631e991acc40ae1c591d8cbd669
[ "Apache-2.0" ]
20
2020-10-03T11:13:11.000Z
2022-02-10T05:38:10.000Z
lib/animations/basic_animations/hero_anim.dart
SumitShukla007/Flutter_Material_Design
d30b12cb69c23631e991acc40ae1c591d8cbd669
[ "Apache-2.0" ]
null
null
null
lib/animations/basic_animations/hero_anim.dart
SumitShukla007/Flutter_Material_Design
d30b12cb69c23631e991acc40ae1c591d8cbd669
[ "Apache-2.0" ]
3
2021-06-07T13:48:17.000Z
2021-12-18T13:21:26.000Z
import 'package:flutter/material.dart'; class HeroAnimScreen extends StatefulWidget { @override _HeroAnimScreenState createState() => _HeroAnimScreenState(); } class _HeroAnimScreenState extends State<HeroAnimScreen> { @override Widget build(BuildContext context) { return MaterialApp( home: Scaffold( appBar: AppBar( title: Text("Hero Page1"), ), body: Page1(), ), ); } } class Page1 extends StatelessWidget { @override Widget build(BuildContext context) { return GestureDetector( onTap: () => Navigator.push( context, PageRouteBuilder( transitionDuration: Duration(seconds: 1), pageBuilder: (_, __, ___) => Page2(), ), ), child: Align( alignment: Alignment.topCenter, child: Hero( tag: "profile_img", child: Container( child: Image.asset( "images/img.webp", width: 150.0, height: 150.0, ), ), ), ), ); } } class Page2 extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text("Hero Page2"), ), body: Padding( padding: const EdgeInsets.all(8.0), child: Center( child: Hero( tag: 'profile_img', child: Container( width: double.infinity, height: 300.0, child: Image.asset( "images/img.webp", ), ), ), ), ), ); } }
21.88
63
0.520414
96d06ac64fd20beb6d4581027b7e50bc68b85c7b
776
cpp
C++
BosekiAudioFilter/BosekiAudioFilter.cpp
totoki-kei/MyAviutlFilter
6fcb6279319e933580a8a17aca6e6aabd1324055
[ "MIT" ]
null
null
null
BosekiAudioFilter/BosekiAudioFilter.cpp
totoki-kei/MyAviutlFilter
6fcb6279319e933580a8a17aca6e6aabd1324055
[ "MIT" ]
null
null
null
BosekiAudioFilter/BosekiAudioFilter.cpp
totoki-kei/MyAviutlFilter
6fcb6279319e933580a8a17aca6e6aabd1324055
[ "MIT" ]
null
null
null
// BosekiSoundFilter.cpp : DLL アプリケーション用にエクスポートされる関数を定義します。 // #include "stdafx.h" #include "AudioMultiplier.h" #include "AudioPosition.h" #include "AudioWave.h" #include "AudioReverse.h" #include "AudioTest.h" //--------------------------------------------------------------------- // フィルタ構造体のポインタを渡す関数 //--------------------------------------------------------------------- EXTERN_C FILTER_DLL** cdecl GetFilterTableList(void) { //must terminate with nullptr //http://qiita.com/yumetodo/items/4d972da03b3be788fcda static FILTER_DLL* pluginlist[] = { &AudioMultiplier::FilterDeclaration, &AudioPosition::FilterDeclaration, &AudioReverse::FilterDeclaration, &AudioWave::FilterDeclaration, &AudioTest::FilterDeclaration, nullptr, }; return pluginlist; }
25.032258
71
0.625
4ab52631035fa1dae7aff56680377bd9a7041374
436
cs
C#
Server/Generators/DungeonSharp-master/DungeonSharp/Room.cs
LeifBloomquist/MultiRogueLike
f3a2afea40dcfa36423975de5b913146701abfe7
[ "MIT" ]
21
2018-03-19T02:07:41.000Z
2022-02-12T20:13:21.000Z
Server/Generators/DungeonSharp-master/DungeonSharp/Room.cs
LeifBloomquist/MultiRogueLike
f3a2afea40dcfa36423975de5b913146701abfe7
[ "MIT" ]
2
2020-10-30T15:45:35.000Z
2020-10-30T20:34:52.000Z
Server/Generators/DungeonSharp-master/DungeonSharp/Room.cs
LeifBloomquist/MultiRogueLike
f3a2afea40dcfa36423975de5b913146701abfe7
[ "MIT" ]
3
2019-09-29T20:28:02.000Z
2020-10-01T03:53:51.000Z
using System.Collections.Generic; namespace DungeonSharp { internal class Room : IRoom { public int X; public int Y; public int Width; public int Height; public IEnumerable<Coordinate> GetFloorTiles() { for (int y = 0; y < Height; y++) for (int x = 0; x < Width; x++) yield return new Coordinate(X + x, Y + y); } } }
21.8
62
0.504587
2ff7a93afe25442c660521081f5105f3417092f3
1,768
rs
Rust
src/http.rs
dev-launchers/interactive-bot
cd00d9ee7a63af71bf4dea0be3211c4cfc2cd7c5
[ "Apache-2.0", "MIT" ]
null
null
null
src/http.rs
dev-launchers/interactive-bot
cd00d9ee7a63af71bf4dea0be3211c4cfc2cd7c5
[ "Apache-2.0", "MIT" ]
null
null
null
src/http.rs
dev-launchers/interactive-bot
cd00d9ee7a63af71bf4dea0be3211c4cfc2cd7c5
[ "Apache-2.0", "MIT" ]
null
null
null
use super::error::Error; use serde::Serialize; use std::collections::HashMap; use wasm_bindgen::{JsCast, JsValue}; use wasm_bindgen_futures::JsFuture; use web_sys::{RequestInit, Response}; pub struct Request<T: ?Sized> where T: Serialize, { pub url: String, pub method: Method, pub headers: HashMap<String, String>, pub body: T, } pub enum Method { GET, POST, PUT, DELETE, } impl Method { pub fn as_str(&self) -> &str { match self { Method::GET => "GET", Method::POST => "POST", Method::PUT => "PUT", Method::DELETE => "DELETE", } } } pub async fn send<T>(req: Request<T>) -> Result<Response, Error> where T: Serialize, { let mut opts = RequestInit::new(); let method = req.method; opts.method(method.as_str()); match method { Method::GET | Method::DELETE => {} Method::POST | Method::PUT => { // Equivalent to JSON.stringify in JS let body = JsValue::from_str(&serde_json::to_string(&req.body)?); opts.body(Some(&body)); } }; let request = web_sys::Request::new_with_str_and_init(&req.url, &opts)?; for (k, v) in req.headers.iter() { request.headers().set(k, v)?; } let window = worker_global_scope().ok_or(Error::NoWindow)?; // `resp_value` is a JS `Response` object. let resp_value = JsFuture::from(window.fetch_with_request(&request)).await?; let resp: Response = resp_value.dyn_into()?; Ok(resp) } // Returns global execution context of a service worker fn worker_global_scope() -> Option<web_sys::ServiceWorkerGlobalScope> { js_sys::global() .dyn_into::<web_sys::ServiceWorkerGlobalScope>() .ok() }
23.891892
80
0.60181
32d295ce6f3819e00a8091c4d688f5a560081816
956
cql
SQL
cassandra-based/scripts/02-aggregate-functions.cql
hsmak/sql-analytics-sandbox
db3349d8ec20e5d4c966f9cddd0131e5df62950b
[ "MIT" ]
null
null
null
cassandra-based/scripts/02-aggregate-functions.cql
hsmak/sql-analytics-sandbox
db3349d8ec20e5d4c966f9cddd0131e5df62950b
[ "MIT" ]
null
null
null
cassandra-based/scripts/02-aggregate-functions.cql
hsmak/sql-analytics-sandbox
db3349d8ec20e5d4c966f9cddd0131e5df62950b
[ "MIT" ]
null
null
null
-- ############################################ -- -- -- Create a Keyspace -- DROP KEYSPACE if exists KSOfHusain; CREATE KEYSPACE if not exists KSOfHusain WITH replication = {'class': 'SimpleStrategy', 'replication_factor' : 3}; USE KSOfHusain; -- DROP TABLE IF EXISTS reversed_user_status_updates; CREATE TABLE reversed_user_status_updates ( username text, id timeuuid, body text, PRIMARY KEY (username, id) ) WITH CLUSTERING ORDER BY (id DESC); INSERT INTO reversed_user_status_updates(username, id, body) VALUES ('alice', NOW(), 'Reversed status 1'); INSERT INTO reversed_user_status_updates(username, id, body) VALUES ('alice', NOW(), 'Reversed status 2'); INSERT INTO reversed_user_status_updates(username, id, body) VALUES ('alice', NOW(), 'Reversed status 3'); SELECT * FROM reversed_user_status_updates WHERE username = 'alice'; SELECT * FROM reversed_user_status_updates WHERE username = 'alice' ORDER BY id ASC; --
36.769231
114
0.705021
49bb95a3454d4067566cd6562ff6884ad69f7a5d
359
asm
Assembly
programs/oeis/037/A037667.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/037/A037667.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/037/A037667.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A037667: Base 4 digits are, in order, the first n terms of the periodic sequence with initial period 3,2,0. ; 3,14,56,227,910,3640,14563,58254,233016,932067,3728270,14913080,59652323,238609294,954437176,3817748707,15270994830,61083979320,244335917283,977343669134,3909374676536,15637498706147,62549994824590 mov $1,4 pow $1,$0 mul $1,32 div $1,9 mov $0,$1
39.888889
199
0.791086
8c8c7cbb8dc3c827eb1963cdcaa1f854f30fc45a
176
swift
Swift
Pod/Classes/ViewModel/BViewModel.swift
ApterKingRepo/Verify-B
eeafcba91defacc09f73d5fc19923e0242feb2f4
[ "MIT" ]
null
null
null
Pod/Classes/ViewModel/BViewModel.swift
ApterKingRepo/Verify-B
eeafcba91defacc09f73d5fc19923e0242feb2f4
[ "MIT" ]
null
null
null
Pod/Classes/ViewModel/BViewModel.swift
ApterKingRepo/Verify-B
eeafcba91defacc09f73d5fc19923e0242feb2f4
[ "MIT" ]
null
null
null
// // BViewModel.swift // Example // // Created by wangcong on 22/05/2017. // Copyright © 2017 cdsf. All rights reserved. // import UIKit class BViewModel: NSObject { }
12.571429
47
0.664773
0b4623dab1603f85bb3ff230be87bd3549b4bccb
1,493
dart
Dart
lib/components/home/home_tasks.dart
mba-78aoj-grupo3/todo_app
261ad79bba52495324346f49fee479f4f1e5390c
[ "MIT" ]
null
null
null
lib/components/home/home_tasks.dart
mba-78aoj-grupo3/todo_app
261ad79bba52495324346f49fee479f4f1e5390c
[ "MIT" ]
null
null
null
lib/components/home/home_tasks.dart
mba-78aoj-grupo3/todo_app
261ad79bba52495324346f49fee479f4f1e5390c
[ "MIT" ]
null
null
null
import 'package:flutter/material.dart'; import '../../components/task_item.dart'; import '../../database/entities/task.dart'; import '../../resources/spacings.dart'; import '../../resources/strings.dart'; class HomeTasks extends StatelessWidget { const HomeTasks(this.todayTasks, this.onChanged); final List<Task> todayTasks; final Function(bool value, Task task) onChanged; @override Widget build(BuildContext context) { return Padding( padding: const EdgeInsets.symmetric(horizontal: Spacings.x3), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( Strings.todayTaskSection, style: TextStyle( fontSize: 20.0, color: Colors.white, fontWeight: FontWeight.bold), ), const SizedBox(height: Spacings.x3), Container( child: ListView.builder( shrinkWrap: true, itemCount: todayTasks.length, itemBuilder: (context, index) { return Card( child: TaskItem( completed: todayTasks[index].isComplete, title: todayTasks[index].description, onChanged: (value) => onChanged(value, todayTasks[index]), ), ); }), ), const SizedBox(height: Spacings.x20), ], ), ); } }
31.104167
80
0.54789
28ef47ef61225e6b6e2c34388b2b234a3577daac
3,974
hpp
C++
ReactNativeFrontend/ios/Pods/boost/boost/atomic/detail/wait_ops_freebsd_umtx.hpp
Harshitha91/Tmdb-react-native-node
e06e3f25a7ee6946ef07a1f524fdf62e48424293
[ "Apache-2.0" ]
2,728
2015-01-01T10:06:45.000Z
2022-03-30T18:12:58.000Z
ReactNativeFrontend/ios/Pods/boost/boost/atomic/detail/wait_ops_freebsd_umtx.hpp
Harshitha91/Tmdb-react-native-node
e06e3f25a7ee6946ef07a1f524fdf62e48424293
[ "Apache-2.0" ]
1,192
2015-01-01T06:03:19.000Z
2022-03-31T09:14:36.000Z
ReactNativeFrontend/ios/Pods/boost/boost/atomic/detail/wait_ops_freebsd_umtx.hpp
Harshitha91/Tmdb-react-native-node
e06e3f25a7ee6946ef07a1f524fdf62e48424293
[ "Apache-2.0" ]
334
2015-01-08T20:47:03.000Z
2022-02-18T07:07:01.000Z
/* * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at * http://www.boost.org/LICENSE_1_0.txt) * * Copyright (c) 2020 Andrey Semashev */ /*! * \file atomic/detail/wait_ops_freebsd_umtx.hpp * * This header contains implementation of the waiting/notifying atomic operations based on FreeBSD _umtx_op syscall. * https://www.freebsd.org/cgi/man.cgi?query=_umtx_op&apropos=0&sektion=2&manpath=FreeBSD+11-current&format=html */ #ifndef BOOST_ATOMIC_DETAIL_WAIT_OPS_FREEBSD_UMTX_HPP_INCLUDED_ #define BOOST_ATOMIC_DETAIL_WAIT_OPS_FREEBSD_UMTX_HPP_INCLUDED_ #include <sys/types.h> #include <sys/umtx.h> #include <cstddef> #include <boost/memory_order.hpp> #include <boost/atomic/detail/config.hpp> #include <boost/atomic/detail/int_sizes.hpp> #include <boost/atomic/detail/wait_operations_fwd.hpp> #include <boost/atomic/detail/header.hpp> #ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif namespace boost { namespace atomics { namespace detail { #if defined(UMTX_OP_WAIT_UINT) || defined(UMTX_OP_WAIT) template< typename Base > struct wait_operations_freebsd_umtx_common : public Base { typedef Base base_type; typedef typename base_type::storage_type storage_type; static BOOST_CONSTEXPR_OR_CONST bool always_has_native_wait_notify = true; static BOOST_FORCEINLINE bool has_native_wait_notify(storage_type const volatile&) BOOST_NOEXCEPT { return true; } static BOOST_FORCEINLINE void notify_one(storage_type volatile& storage) BOOST_NOEXCEPT { ::_umtx_op(const_cast< storage_type* >(&storage), UMTX_OP_WAKE, 1u, NULL, NULL); } static BOOST_FORCEINLINE void notify_all(storage_type volatile& storage) BOOST_NOEXCEPT { ::_umtx_op(const_cast< storage_type* >(&storage), UMTX_OP_WAKE, (~static_cast< unsigned int >(0u)) >> 1, NULL, NULL); } }; #endif // defined(UMTX_OP_WAIT_UINT) || defined(UMTX_OP_WAIT) // UMTX_OP_WAIT_UINT only appeared in FreeBSD 8.0 #if defined(UMTX_OP_WAIT_UINT) && BOOST_ATOMIC_DETAIL_SIZEOF_INT < BOOST_ATOMIC_DETAIL_SIZEOF_LONG template< typename Base, bool Interprocess > struct wait_operations< Base, sizeof(unsigned int), true, Interprocess > : public wait_operations_freebsd_umtx_common< Base > { typedef wait_operations_freebsd_umtx_common< Base > base_type; typedef typename base_type::storage_type storage_type; static BOOST_FORCEINLINE storage_type wait(storage_type const volatile& storage, storage_type old_val, memory_order order) BOOST_NOEXCEPT { storage_type new_val = base_type::load(storage, order); while (new_val == old_val) { ::_umtx_op(const_cast< storage_type* >(&storage), UMTX_OP_WAIT_UINT, old_val, NULL, NULL); new_val = base_type::load(storage, order); } return new_val; } }; #endif // defined(UMTX_OP_WAIT_UINT) && BOOST_ATOMIC_DETAIL_SIZEOF_INT < BOOST_ATOMIC_DETAIL_SIZEOF_LONG #if defined(UMTX_OP_WAIT) template< typename Base, bool Interprocess > struct wait_operations< Base, sizeof(unsigned long), true, Interprocess > : public wait_operations_freebsd_umtx_common< Base > { typedef wait_operations_freebsd_umtx_common< Base > base_type; typedef typename base_type::storage_type storage_type; static BOOST_FORCEINLINE storage_type wait(storage_type const volatile& storage, storage_type old_val, memory_order order) BOOST_NOEXCEPT { storage_type new_val = base_type::load(storage, order); while (new_val == old_val) { ::_umtx_op(const_cast< storage_type* >(&storage), UMTX_OP_WAIT, old_val, NULL, NULL); new_val = base_type::load(storage, order); } return new_val; } }; #endif // defined(UMTX_OP_WAIT) } // namespace detail } // namespace atomics } // namespace boost #include <boost/atomic/detail/footer.hpp> #endif // BOOST_ATOMIC_DETAIL_WAIT_OPS_FREEBSD_UMTX_HPP_INCLUDED_
33.116667
141
0.747609
b6a0a1bdef656835f5bf187d18122cae0616f81d
699
asm
Assembly
oeis/221/A221172.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/221/A221172.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/221/A221172.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A221172: a(0)=-2, a(1)=3; thereafter a(n) = 2*a(n-1) + a(n-2). ; Submitted by Jamie Morken(s3) ; -2,3,4,11,26,63,152,367,886,2139,5164,12467,30098,72663,175424,423511,1022446,2468403,5959252,14386907,34733066,83853039,202439144,488731327,1179901798,2848534923,6876971644,16602478211,40081928066,96766334343,233614596752,563995527847,1361605652446,3287206832739,7936019317924,19159245468587,46254510255098,111668265978783,269591042212664,650850350404111,1571291743020886,3793433836445883,9158159415912652,22109752668271187,53377664752455026,128865082173181239,311107829098817504,751080740370816247 mov $1,7 mov $3,-2 lpb $0 sub $0,1 add $1,$3 mov $2,$3 add $3,$1 mov $1,$2 lpe mov $0,$3
46.6
501
0.792561
313bdd80ca7ddccb5515d11d34f25085ea0a7978
335
kt
Kotlin
mylibrary/src/main/java/com/esp/library/utilities/data/applicants/addapplication/ESP_LIB_ResponseFileUploadDAO.kt
ahsanm155/ESP_LIBRARY
11d17817eb75077ac97309509d20fe5adae1bc43
[ "MIT" ]
null
null
null
mylibrary/src/main/java/com/esp/library/utilities/data/applicants/addapplication/ESP_LIB_ResponseFileUploadDAO.kt
ahsanm155/ESP_LIBRARY
11d17817eb75077ac97309509d20fe5adae1bc43
[ "MIT" ]
null
null
null
mylibrary/src/main/java/com/esp/library/utilities/data/applicants/addapplication/ESP_LIB_ResponseFileUploadDAO.kt
ahsanm155/ESP_LIBRARY
11d17817eb75077ac97309509d20fe5adae1bc43
[ "MIT" ]
null
null
null
package utilities.data.applicants.addapplication import java.io.Serializable import utilities.data.ESP_LIB_Base class ESP_LIB_ResponseFileUploadDAO : ESP_LIB_Base(), Serializable { var fileId: String? = null var downloadUrl: String? = null companion object { var BUNDLE_KEY = "ResponseFileUploadDAO" } }
18.611111
68
0.743284
83dd06e9d6c4c457c67ce05c374d38bde0e45685
1,122
java
Java
build/tmp/expandedArchives/forge-1.18.1-39.0.40_mapped_parchment_2021.12.19-1.18.1-sources.jar_8da1e53bade44c6d138d26d6ab1ad1d3/net/minecraft/world/level/levelgen/heightproviders/HeightProvider.java
LX-s-Team/CookingLevel-Forge
065ddf23d2efb4f44e0e494fb3b2cbef47b7cca5
[ "MIT" ]
null
null
null
build/tmp/expandedArchives/forge-1.18.1-39.0.40_mapped_parchment_2021.12.19-1.18.1-sources.jar_8da1e53bade44c6d138d26d6ab1ad1d3/net/minecraft/world/level/levelgen/heightproviders/HeightProvider.java
LX-s-Team/CookingLevel-Forge
065ddf23d2efb4f44e0e494fb3b2cbef47b7cca5
[ "MIT" ]
null
null
null
build/tmp/expandedArchives/forge-1.18.1-39.0.40_mapped_parchment_2021.12.19-1.18.1-sources.jar_8da1e53bade44c6d138d26d6ab1ad1d3/net/minecraft/world/level/levelgen/heightproviders/HeightProvider.java
LX-s-Team/CookingLevel-Forge
065ddf23d2efb4f44e0e494fb3b2cbef47b7cca5
[ "MIT" ]
null
null
null
package net.minecraft.world.level.levelgen.heightproviders; import com.mojang.datafixers.util.Either; import com.mojang.serialization.Codec; import java.util.Random; import net.minecraft.core.Registry; import net.minecraft.world.level.levelgen.VerticalAnchor; import net.minecraft.world.level.levelgen.WorldGenerationContext; public abstract class HeightProvider { private static final Codec<Either<VerticalAnchor, HeightProvider>> CONSTANT_OR_DISPATCH_CODEC = Codec.either(VerticalAnchor.CODEC, Registry.HEIGHT_PROVIDER_TYPES.byNameCodec().dispatch(HeightProvider::getType, HeightProviderType::codec)); public static final Codec<HeightProvider> CODEC = CONSTANT_OR_DISPATCH_CODEC.xmap((p_161974_) -> { return p_161974_.map(ConstantHeight::of, (p_161980_) -> { return p_161980_; }); }, (p_161976_) -> { return p_161976_.getType() == HeightProviderType.CONSTANT ? Either.left(((ConstantHeight)p_161976_).getValue()) : Either.right(p_161976_); }); public abstract int sample(Random pRandom, WorldGenerationContext pContext); public abstract HeightProviderType<?> getType(); }
48.782609
241
0.78164
188994e28f3655193d84b02d6976103d13f2f344
2,280
ps1
PowerShell
TMF/internal/functions/validate/Validate-UserSet.ps1
verasbr/tenant-management-framework
7d511cd7c5ff4528f5562874ab378cc6c449a4ef
[ "MIT" ]
12
2021-09-17T15:20:21.000Z
2022-03-29T13:15:36.000Z
TMF/internal/functions/validate/Validate-UserSet.ps1
verasbr/tenant-management-framework
7d511cd7c5ff4528f5562874ab378cc6c449a4ef
[ "MIT" ]
6
2022-03-07T07:47:07.000Z
2022-03-17T10:37:29.000Z
TMF/internal/functions/validate/Validate-UserSet.ps1
verasbr/tenant-management-framework
7d511cd7c5ff4528f5562874ab378cc6c449a4ef
[ "MIT" ]
3
2022-03-07T07:48:38.000Z
2022-03-17T12:23:43.000Z
function Validate-UserSet { <# .SYNOPSIS Validates the properties of a userSet complex type .PARAMETER reference The id, displayName, userPrincipalName or mailNickname of the referenced resource. #> [CmdletBinding()] Param ( [Parameter(ParameterSetName = "Default")] [string] $reference, [ValidateSet("singleUser", "groupMembers", "connectedOrganizationMembers", "requestorManager", "internalSponsors", "externalSponsors")] [string] $type = "singleUser", [bool] $isBackup = $false, [Parameter(Mandatory = $true, ParameterSetName = "RequestorManager")] [int] $managerLevel, [System.Management.Automation.PSCmdlet] $Cmdlet = $PSCmdlet ) begin { if ($managerLevel) { $type = "requestorManager" } } process { if (Test-PSFFunctionInterrupt) { return } $userSetObject = [PSCustomObject]@{ type = $type isBackup = $isBackup } Add-Member -InputObject $userSetObject -MemberType NoteProperty -Name "@odata.type" -Value ("#microsoft.graph.{0}" -f $type) if ($type -in @("singleUser", "groupMembers", "connectedOrganizationMembers")) { Add-Member -InputObject $userSetObject -MemberType NoteProperty -Name reference -Value $reference Add-Member -InputObject $userSetObject -MemberType ScriptMethod -Name getId -Value { switch ($this.type) { "singleUser" { Resolve-User -InputReference $this.reference -SearchInDesiredConfiguration -Cmdlet $PSCmdlet } "groupMembers" { Resolve-Group -InputReference $this.reference -SearchInDesiredConfiguration -Cmdlet $PSCmdlet } "connectedOrganizationMembers" { Resolve-ConnectedOrganization -InputReference $this.reference -SearchInDesiredConfiguration -Cmdlet $PSCmdlet } } } } if ($type -eq "requestorManager") { Add-Member -InputObject $userSetObject -MemberType NoteProperty -Name managerLevel -Value $managerLevel } Add-Member -InputObject $userSetObject -MemberType ScriptMethod -Name prepareBody -Value { $hashtable = @{ isBackup = $this.isBackup "@odata.type" = $this."@odata.type" } if ($this.getId) {$hashtable["id"] = $this.getId()} if ($this.managerLevel) {$hashtable["managerLevel"] = $this.managerLevel} return $hashtable } } end { $userSetObject } }
30.4
137
0.700877
ec17a569874c96b78196ada75c0f5cb2fe1996eb
117
dart
Dart
lib/src/utils/cli.data.dart
victoreronmosele/coverde
1b04d806af05ad9e6a2878bb7a02b533d186b037
[ "MIT" ]
17
2021-09-25T21:50:01.000Z
2022-03-24T11:06:12.000Z
lib/src/utils/cli.data.dart
victoreronmosele/coverde
1b04d806af05ad9e6a2878bb7a02b533d186b037
[ "MIT" ]
10
2021-10-01T00:17:07.000Z
2022-03-11T07:41:41.000Z
lib/src/utils/cli.data.dart
victoreronmosele/coverde
1b04d806af05ad9e6a2878bb7a02b533d186b037
[ "MIT" ]
2
2021-11-25T15:00:16.000Z
2022-02-04T21:03:34.000Z
/// The `coverde` CLI name. const cliName = 'coverde'; /// The `coverde` CLI version. const cliVersion = '0.1.0+1';
19.5
30
0.641026
681eb87d4124ceaa3d7330b21805688823508cd4
2,743
cc
C++
history/dirhistory/src/v2/tsdata_xdr.cc
nahratzah/monsoon_plus_plus
789082078f1d474d38056518f66613ed1319181b
[ "BSD-2-Clause" ]
1
2018-03-06T11:15:40.000Z
2018-03-06T11:15:40.000Z
history/dirhistory/src/v2/tsdata_xdr.cc
nahratzah/monsoon_plus_plus
789082078f1d474d38056518f66613ed1319181b
[ "BSD-2-Clause" ]
null
null
null
history/dirhistory/src/v2/tsdata_xdr.cc
nahratzah/monsoon_plus_plus
789082078f1d474d38056518f66613ed1319181b
[ "BSD-2-Clause" ]
null
null
null
#include "tsdata_xdr.h" #include "xdr_primitives.h" #include "record_array.h" #include "tsdata.h" #include <stack> #include <tuple> namespace monsoon::history::v2 { auto decode(const cache_search_type<dictionary, tsdata_xdr>& cst, dictionary::allocator_type alloc) -> std::shared_ptr<dictionary> { auto result = std::allocate_shared<dictionary>(alloc, alloc); const encdec_ctx& ctx = cst.parent()->get_ctx(); // Build stack of segments. std::stack<file_segment_ptr> ptrs; for (std::shared_ptr<const tsdata_xdr> tsd = cst.parent(); tsd != nullptr; tsd = tsd->get_predecessor()) { if (tsd->dict_ != file_segment_ptr()) ptrs.push(tsd->dict_); } // Decode update for each segment. while (!ptrs.empty()) { auto xdr = ctx.new_reader(ptrs.top(), dictionary::is_compressed); ptrs.pop(); result->decode_update(xdr); if (!xdr.at_end()) throw dirhistory_exception("xdr data remaining"); xdr.close(); } return result; } tsdata_xdr::tsdata_xdr(std::shared_ptr<tsdata_v2> parent, allocator_type alloc) : typed_dynamics<dynamics>(parent), ctx_(parent->get_ctx()) {} tsdata_xdr::tsdata_xdr(std::shared_ptr<tsdata_xdr> parent, allocator_type alloc) : typed_dynamics<dynamics>(parent), ctx_(parent->get_ctx()) {} tsdata_xdr::~tsdata_xdr() noexcept {} auto tsdata_xdr::get_dictionary() const -> std::shared_ptr<const dictionary> { tsdata_xdr*const parent = dynamic_cast<tsdata_xdr*>(&this->parent()); if (parent != nullptr) return parent->get_dictionary(); return get_dynamics_cache<dictionary>(shared_from_this(), dict_); } auto tsdata_xdr::get_dictionary() -> std::shared_ptr<dictionary> { tsdata_xdr*const parent = dynamic_cast<tsdata_xdr*>(&this->parent()); if (parent != nullptr) return parent->get_dictionary(); return get_dynamics_cache<dictionary>(shared_from_this(), dict_); } auto tsdata_xdr::get_predecessor() const -> std::shared_ptr<const tsdata_xdr> { return const_cast<tsdata_xdr&>(*this).get_predecessor(); } auto tsdata_xdr::get() const -> std::shared_ptr<const record_array> { return get_dynamics_cache<record_array>(shared_from_this(), records_); } auto tsdata_xdr::get_predecessor() -> std::shared_ptr<tsdata_xdr> { if (pred_ == file_segment_ptr()) return nullptr; return get_dynamics_cache<tsdata_xdr>(std::const_pointer_cast<tsdata_xdr>(shared_from_this()), pred_); } auto tsdata_xdr::decode(xdr::xdr_istream& in) -> void { ts_ = decode_timestamp(in); pred_ = in.get_optional(&file_segment_ptr::from_xdr).value_or(file_segment_ptr()); dict_ = in.get_optional(&file_segment_ptr::from_xdr).value_or(file_segment_ptr()); records_.decode(in); std::ignore = in.get_uint32(); // reserved_ } } /* namespace monsoon::history::v2 */
29.494624
104
0.725118
0c997c75e6f8130a6ad00cdbe08dc81152f2e474
1,074
lua
Lua
day02/main.lua
michaeladler/aoc-2020
9027cb3c9f89a2af7a3acd41791dc2dbf021211b
[ "Apache-2.0" ]
null
null
null
day02/main.lua
michaeladler/aoc-2020
9027cb3c9f89a2af7a3acd41791dc2dbf021211b
[ "Apache-2.0" ]
null
null
null
day02/main.lua
michaeladler/aoc-2020
9027cb3c9f89a2af7a3acd41791dc2dbf021211b
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env luajit require("io") require("bit") local function is_valid(min, max, letter, pw) local matches = 0 for i = 1, #pw do local c = pw:sub(i, i) if c == letter then matches = matches + 1 end end return tonumber(min) <= matches and matches <= tonumber(max) end local bxor = bit.bxor local function is_valid2(min, max, letter, pw) local found_min = 0 if pw:sub(min, min) == letter then found_min = 1 end local found_max = 0 if pw:sub(max, max) == letter then found_max = 1 end return bxor(found_min, found_max) == 1 end local f = io.open("input.txt", "r") local valid_counts = 0 local valid_counts2 = 0 for line in f:lines() do local min, max, letter, pw = string.match(line, "([%d]*).([%d]*)[%s*]([%a]*):[%s]*([%a]*)") if is_valid(min, max, letter, pw) then valid_counts = valid_counts + 1 end if is_valid2(min, max, letter, pw) then valid_counts2 = valid_counts2 + 1 end end f:close() print("Part 1", valid_counts) print("Part 2:", valid_counts2) assert(valid_counts == 582, "part1") assert(valid_counts2 == 729, "part2")
21.058824
92
0.660149
562192d9d984042b7ebde4729d812a9b6f2aa069
277
go
Go
msngr/freedesktop/freedesktop_linux_test.go
colt3k/utils
8fe59a6315a0797a3ee6addb6cc96ea66582b614
[ "MIT" ]
3
2020-10-07T23:29:33.000Z
2021-09-13T08:10:16.000Z
msngr/freedesktop/freedesktop_linux_test.go
colt3k/utils
8fe59a6315a0797a3ee6addb6cc96ea66582b614
[ "MIT" ]
null
null
null
msngr/freedesktop/freedesktop_linux_test.go
colt3k/utils
8fe59a6315a0797a3ee6addb6cc96ea66582b614
[ "MIT" ]
null
null
null
package freedesktop func Test() { title := "title" message := "message" n := &freedesktop.Notification{ Summary: title, Body: message, ExpireTimeout: 500, AppIcon: "utilities-terminal", } if err := n.Send(); err != nil { t.Error(err) } }
16.294118
38
0.584838
a144d6a7cfd2eb518524d1c0fb249315f5a84b3b
2,113
swift
Swift
ExposureTests/Authentication/SessionTokenSpec.swift
EricssonBroadcastServices/iOSClientExposure
7adb5e9e0030c566617321c47ff85086260f0e05
[ "Apache-2.0" ]
null
null
null
ExposureTests/Authentication/SessionTokenSpec.swift
EricssonBroadcastServices/iOSClientExposure
7adb5e9e0030c566617321c47ff85086260f0e05
[ "Apache-2.0" ]
3
2018-03-09T06:22:25.000Z
2021-05-25T14:47:06.000Z
ExposureTests/Authentication/SessionTokenSpec.swift
EricssonBroadcastServices/iOSClientExposure
7adb5e9e0030c566617321c47ff85086260f0e05
[ "Apache-2.0" ]
2
2018-03-07T20:49:55.000Z
2019-02-07T08:14:13.000Z
// // SessionTokenSpec.swift // Exposure // // Created by Fredrik Sjöberg on 2017-04-24. // Copyright © 2017 emp. All rights reserved. // import Quick import Nimble @testable import Exposure class SessionTokenSpec: QuickSpec { override func spec() { super.spec() describe("AuthorizationHeaders") { it("should produce authorization headers") { let token = SessionToken(value: "TOKEN") let header = token.authorizationHeader let value:String? = header["Authorization"] expect(value).toNot(beNil()) expect(value!).to(equal("Bearer "+"TOKEN")) } it("Should not init with nil value") { expect(SessionToken(value: nil)).to(beNil()) let optionalValue: String? = "TEST" expect(SessionToken(value: optionalValue)).toNot(beNil()) } it("Should be equatable with matching tokens") { expect(SessionToken(value: "TEST") == SessionToken(value: "TEST")).to(beTrue()) } context("Components") { let validFormat = SessionToken(value: "crm|accountId|userId|hello|1000|2000|false|something|other") it("Should contain 9 components") { expect(validFormat.hasValidFormat).to(beTrue()) } it("should parse components") { expect(validFormat.crmToken).to(equal("crm")) expect(validFormat.accountId).to(equal("accountId")) expect(validFormat.userId).to(equal("userId")) let aquired: TimeInterval = 1000 let expiration: TimeInterval = 2000 expect(validFormat.acquired).to(equal(aquired)) expect(validFormat.expiration).to(equal(expiration)) expect(validFormat.isAnonymous).to(equal(false)) } } } } }
35.216667
115
0.523426
7534581dc73b824f13d29828b5dca7e476006f60
1,846
cs
C#
EmpowerData/EntityModels/DIA_AppraisalAppointment.cs
HaloImageEngine/EmpowerClaim-hotfix-1.25.1
91db2d24682518f3e4a45d2fb3dd123968a8663c
[ "Apache-2.0" ]
null
null
null
EmpowerData/EntityModels/DIA_AppraisalAppointment.cs
HaloImageEngine/EmpowerClaim-hotfix-1.25.1
91db2d24682518f3e4a45d2fb3dd123968a8663c
[ "Apache-2.0" ]
null
null
null
EmpowerData/EntityModels/DIA_AppraisalAppointment.cs
HaloImageEngine/EmpowerClaim-hotfix-1.25.1
91db2d24682518f3e4a45d2fb3dd123968a8663c
[ "Apache-2.0" ]
null
null
null
using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace EmpowerData.EntityModels { public partial class DIA_AppraisalAppointment { [Key] public int AppraisalAppointmentSysID { get; set; } public DateTime SysDate { get; set; } [Required] [StringLength(50)] public string Subject { get; set; } [Required] [StringLength(250)] public string Body { get; set; } public DateTime StartTime { get; set; } public DateTime EndTime { get; set; } public bool IsAllDayEvent { get; set; } [StringLength(50)] public string TimeZoneString { get; set; } public int? TimeMarkerID { get; set; } public int? CategoryID { get; set; } public int EnteredByID { get; set; } public int? AssignedToID { get; set; } public int? AppraisalID { get; set; } public int? ResourceID { get; set; } public int? ClaimantID { get; set; } public int? LocationID { get; set; } public int? ContactID { get; set; } [StringLength(100)] public string ContactName { get; set; } [StringLength(20)] public string ContactPhone { get; set; } public int ClaimID { get; set; } [Required] [StringLength(10)] public string ClaimNo { get; set; } public int Importance { get; set; } public int SqlResourceID { get; set; } public int LastUpdatedByID { get; set; } public DateTime LastUpdatedDate { get; set; } [Column(TypeName = "timestamp")] [MaxLength(8)] [Timestamp] public byte[] RecordVersion { get; set; } public virtual CMS_Appraisals Appraisal { get; set; } } }
23.974026
61
0.586132
93bb252e8bccbc25f53451f447137c6e3bb9a9dd
83,724
html
HTML
library/www.baldurbjarnason.com/notes/ebook-widget-semantics/index.html
extratone/extratone
a18e3ac94527626f27dd5447257c9785b7f5d167
[ "MIT" ]
2
2021-06-09T20:03:11.000Z
2021-09-18T21:34:18.000Z
library/www.baldurbjarnason.com/notes/ebook-widget-semantics/index.html
extratone/extratone
a18e3ac94527626f27dd5447257c9785b7f5d167
[ "MIT" ]
497
2020-11-23T12:22:45.000Z
2022-01-17T02:03:22.000Z
library/www.baldurbjarnason.com/notes/ebook-widget-semantics/index.html
extratone/extratone
a18e3ac94527626f27dd5447257c9785b7f5d167
[ "MIT" ]
null
null
null
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <title>The semantics of ebook widgets – Baldur Bjarnason</title> <meta name="description" content=" Over the past few days I&#8217;ve had several interesting conversations on ebooks, interactivity, widgets, standardisation, and other issues that have cropped up as a result of Apple forking the ePub3 format. " /> <meta name="image" content=""> <meta itemprop="name" content="The semantics of ebook widgets" /> <meta itemprop="description" content=" Over the past few days I&#8217;ve had several interesting conversations on ebooks, interactivity, widgets, standardisation, and other issues that have cropped up as a result of Apple forking the ePub3 format. " /> <meta itemprop="image" content=""> <meta name="twitter:card" content="summary" /> <meta name="twitter:title" content="The semantics of ebook widgets" /> <meta name="twitter:description" content=" Over the past few days I&#8217;ve had several interesting conversations on ebooks, interactivity, widgets, standardisation, and other issues that have cropped up as a result of Apple forking the ePub3 format. " /> <meta name="og:title" content="The semantics of ebook widgets" /> <meta name="og:description" content=" Over the past few days I&#8217;ve had several interesting conversations on ebooks, interactivity, widgets, standardisation, and other issues that have cropped up as a result of Apple forking the ePub3 format. " /> <meta name="og:url" content="https://www.baldurbjarnason.com/notes/ebook-widget-semantics/" /> <meta name="og:site_name" content="Baldur Bjarnason" /> <meta name="og:type" content="article" /> <meta name="article:author" content="https://www.baldurbjarnason.com/" /> <meta name="author" content="Baldur Bjarnason" /> <meta name="article:tag" content="" /> <link href="https://www.baldurbjarnason.com/fonts/literata/literata.css" rel="stylesheet" /> <link rel="stylesheet" href="https://www.baldurbjarnason.com/styles/main.min.3a98d38583d9a7fb72c3343ba33af9ea82872d943b7705b3fc07a60f39c06415.css" /> <link href="https://www.baldurbjarnason.com/stylesheets/syntax.css" rel="stylesheet" /> <link href="../../feed.xml" rel="alternate" type="application/rss+xml" title="All posts for Baldur Bjarnason" /> <link href="../../index.xml" rel="feed" type="application/rss+xml" title="All posts for Baldur Bjarnason" /> <link href="https://micro.blog/baldur" rel="me" /> </head> <body class="page"> <nav class="Top" aria-label="Site navigation"> <ul> <li><a href="../../../baldurbjarnason.com/index.html#archive">Writing</a></li> <li><a href="https://www.baldurbjarnason.com/work/2021">Work</a></li> <li><a href="../../../notes.baldurbjarnason.com/index.html">Notes</a></li> <li><a href="https://github.com/baldurbjarnason">GitHub</a></li> <li><a href="mailto:baldur.bjarnason@gmail.com">Email</a></li> </ul> </nav> <header class="header"> <div class="Description"> <div class="Title"><a href="../../../baldurbjarnason.com/index.html">Baldur Bjarnason</a></div> <p> <em> …&thinsp;web developer, writer, and consultant based in Hveragerði, Iceland. </em> </p> <p> I write about web dev, interactive media, digital publishing, and product development. </p> <p> <a href="https://www.baldurbjarnason.com/work/2021">I&rsquo;m available for consulting and hire</a>. </p> </div> </header> <main> <div class="FrontBody"> <header id="start"> <aside class="Date"> <time datetime="2012-02-04T00:00:00Z" >4 February 2012</time > </aside> <h1>The semantics of ebook widgets</h1> <div class="Tags"> </div> </header> <article class="post"> <p>Most of them have been people making very good points that have forced me to clarify my thoughts and reconsider some of my ideas.</p> <p>One such conversation was the following email exchange with <a href="http://grantsutherland.net/">Grant Sutherland</a> (posted with his permission).</p> <p>We didn&#8217;t quite manage to convince each other, but I think we each made a pretty good case for our respective approaches for the discussion to be useful and educational to others, no matter which side you take.</p> <p>Both of our respective principles and approaches to developing more interactive ebooks are, I think, much healthier than the one-sided and opaque approach Apple has decided to take.</p> <hr /> <p><em>From Grant:</em></p> <blockquote> <p>Hi Baldur,</p> <p>I&#8217;m a writer, currently published by Macmillan.</p> <p>I&#8217;ve been interested in the development of ebooks for some while, and have been enjoying your posts.</p> <p>( I wrote something last year along similar lines, probably out of date). <a href="http://grantsutherland.net/essays/traditional_publishing_is_a_burning_platform.html">Traditional Publishing is a Burning Platform</a></p> <p>In relation to your recent exchange with Joseph Pearson, I agree with you both about the widgets being authored declaratively (with bindings).</p> <p>However I strongly disagree that microformats are the appropriate solution for books (however useful they might be on the web). The &#8216;vocabularies&#8217; extension in epub3 allows for any numbers of xml dialects to be dropped into the basic xhtml5. Why not use them? They&#8217;ve already been developed rigorously (e.g. ChemML, KML) and something like TEI seems to me ideally suited as a basis for interactivity/enhancement in a variety of non-fiction ebooks. Microformats are meant to evolve towards useful common standards; but in this case, the common standards already exist. </p> <p>Why reinvent the wheel?</p> <p>Anyway, just a thought.</p> <p>Regards, Grant</p> <p><a href="https://www.baldurbjarnason.com/notes/ebook-widget-semantics/%C2%A0http://grantsutherland.net/"> http://grantsutherland.net</a></p> </blockquote> <hr /> <p><em>To which I replied:</em></p> <p>That&#8217;s a valid point and it&#8217;s one I debated a lot when I was an academic studying and authoring interactive projects. Generally speaking, only a minority thought it was a good idea to reuse these vocabularies because they simple weren&#8217;t designed for our purposes (creating interactive texts). I was a part of that minority in favour of reuse. I changed my mind as soon as I gained more practical experience in authoring interactive projects.</p> <p>There&#8217;s only one, widely accepted, open format that suits our purposes: HTML+CSS+JS. There hasn&#8217;t been a need to create a new format for interactive hypertexts (which is what we are talking about, since text is a subset of hypertext) because we already have one. The problem arises when we remove JS from that equation; we need simple methods of getting back some of the interactive functionality we&#8217;ve lost. None of the other pre-existing formats suit our purposes because we&#8217;ve just given up on the only one that does.(^1)</p> <p>So, short answer: Because it&#8217;s not reinventing the wheel. Not really.</p> <p>Most of those XML formats, like TEI, are both specialised and largely focus on meaning (that is, preserving a fidelity of the information it carries). But when you are creating an interactive project you need to explicitly declare your intent: this is how this element is supposed to behave. Using existing XML formats for this purpose can get extremely complex and awkward because it&#8217;s not what they were designed to do. Relying on a reading system to infer a behaviour based on semantics is an extremely limited way to author interactive ebooks.</p> <p>(TEI is also bloody complicated.)</p> <p>Microformats is a term that Joseph Pearson brought up and I&#8217;m not quite sure I agree with it being applicable in this circumstance, because microformats generally describe semantics and meaning and not behaviour and intent.</p> <p>A simple OBJECT tag, configured by linking to something like a json file using the PARAM tag, is much easier to author than any of these pre-existing XML formats, and has the added benefit of being both explicit in terms of the behaviour that&#8217;s desired, and flexible in terms of how the reading system wants to implement it. It&#8217;s also something that&#8217;s very easy to implement in almost any programming language. None of these apply to a complex XML vocabulary, even if it really did what we need it to do. </p> <p>A small set of simple but flexible widgets (behavioural objects) is very much outside the remit of any of the preexisting formats.</p> <p>The only exception I can think of are SVG+SMIL which could cover a lot of bases but even that is still quite complicated both to author and implement (which is why support is so sparse and buggy, even among web browsers).</p> <p>And even then SVG+SMIL doesn&#8217;t cover some of the basic behaviours we need.</p> <p>I&#8217;d love to have it, though.</p> <p>For authored interactivity we either need javascript (to implement and attach behaviour to semantic elements) or we need simple but configurable objects. Any other solution is too complex to author and implement, or simply doesn&#8217;t solve our problem.</p> <p>For the record, I don&#8217;t think the iBooks widgets cover exactly our needs either. They are a starting point.</p> <p>So, that&#8217;s my reasoning. I hope it makes some sort of sense :-)</p> <p>best, baldur</p> <p><em>The footnote:</em></p> <p>(^1): There are very good reasons for abandoning javascript in the context of ebooks. The biggest reason is security. An ebook is a much more persistent object than a web page. Turning an ebook into a fully-fledged javascript app platform opens readers up to exactly the same security issues as any other app platform, viruses, trojans, worms, etc. etc. It&#8217;s understandable that many ebook platform vendors might want to avoid that. In many cases javascript support may simply present substantial and expensive problems that are very hard to solve.</p> <p>Consider for example iBooks, the only epub platform that supports javascript: It is buggy as hell and updates regularly break working code. It breaks away from established web behaviours in subtle and not so subtle ways that is complex to tackle. And it crashes. A lot. Especially when you are on an iPad 1.</p> <hr /> <p>Addendum. I do miss proper javascript support in ebooks. It has the merit of years of development and testing and phenomenal mindshare. But, I think it&#8217;s clear at this point that cross-platform javascript is a non-starter in the ebook realm. If that&#8217;s the case, we need to start thinking about alternatives.</p> <hr /> <p><em>From Grant:</em></p> <blockquote> <p>Hi Baldur,</p> <p>Thanks for the thoughtful reply. I take your well-made points.</p> <p>I think your key statement is this one:</p> <p>For authored interactivity we either (a) need javascript to implement and attach behaviour to semantic elements or we need (b) simple but configurable objects. Any other solution is too complex to author and implement, or simply doesn&#8217;t solve our problem.</p> <p>My own belief is that certain classes of texts are well-suited to solution (a), whereas others - and I would guess that among these are the type of interactive texts you&#8217;re working on - are more suited to solution (b).</p> <p>As an example of  a text of type (a), take any classic history. By impregnating the text at appropriate points with the various <code>&lt;bio&gt;</code>,<code>&lt;time&gt;</code> and <code>&lt;geo&gt;</code> related tags of the TEI, a work like &#8216;Decline and Fall&#8230;&#8217; could be gently enhanced by the reading system with a sidebarred timeline, map and bio reference. The primary purpose of this type of enhancement (and, in my view, probably the only useful kind of enhancement possible in this type of work) is navigational. It is clearly not a hugely ambitious aim, but it has the inestimable advantage, over the many &#8216;snake-oil&#8217; type&#8217;enhancements we&#8217;ve lately seen, of actually being useful. Because this is the kind of text I tend to read, my view is admittedly skewed toward this solution. </p> <p>(In a way, the Kindle&#8217;s X-Ray facility is something like this, but prone to error because it&#8217;s using text-mining to make the semantic enhancements. And it&#8217;s ugly.)</p> <p>As to texts of type (b), I think you are absolutely right.</p> <p>There is obviously a massive problem here with the stability of this type of book. And I think the lessons to be learned about &#8216;maintainability&#8217; will be learned from the past experiences and current best-practices of programmers.</p> <p>The big lesson I see is that &#8216;unstable&#8217; is the natural state in this world. I&#8217;m reminded of the old joke in biology: &#8216;We biologists have a special word for obects in a stable state - dead.&#8217;</p> <p>Publishers want &#8216;stable&#8217;, but I don&#8217;t think they&#8217;re ever going to get it in this area. The best they can hope for to manage the &#8216;instability&#8217; of these books in a commercially viable manner.</p> <p>My own guess is that books will come to exist on a (lumpy) spectrum of stability that looks something like this:</p> <ol> <li>Plain-text, stored on clay tablets (the first, and still the best for longevity)</li> <li>Plain-text, stored on paper</li> <li>Plain-text semantically enhanced, stored on computers. Behaviors (if any) determined by reading system.</li> <li>Plain-text semantically+programmaticaly enhanced, stored on computers. Behaviours (if any) determined by some combination of reading system and program embedded in text.</li> </ol> <p>With regard to your remarks about the widgetization of behaviours, I agree that SVG+SMIL is the only sane long-term answer. In the meantime, here are a couple of links that might interest you (if you&#8217;re not aware of them already):</p> <p><a href="http://www.simile-widgets.org/">http://www.simile-widgets.org/</a></p> <p><a href="http://lively-kernel.org/">http://lively-kernel.org</a></p> <p>Simile uses json to populate a set of predetermined html/css/javascript widgets. Lively-kernel is less straightforward, and more buggy. It&#8217;s widgets are primarily customizable javascript objects. But if you look here:</p> <p><a href="http://lively-kernel.org/repository/webwerkstatt/documentation/HowConnectWorks.xhtml">http://lively-kernel.org/repository/webwerkstatt/documentation/HowConnectWorks.xhtml</a></p> <p>you&#8217;ll see that they use a similar mechanism to that <code>&lt;object&gt;</code> PARAM technique that you&#8217;re suggesting (but in their case from one highly configurable javascript object to another, rather than from json to html.</p> <p>Hope some of this is of some use to you.</p> <p>Regards, Grant</p> </blockquote> <hr /> <p><em>And me:</em></p> <p>I&#8217;d like to start off by saying that I generally agree with you, in an ideal world semantic text combined with authored javascript would be the ideal solution for creating interactive texts. The only point I&#8217;d make is that in this circumstance the programmer becomes a co-author of the text (interactivity is an act of authorship) but those who can work in this context that embrace this and partner with a skilled programmer will end up creating remarkable things.</p> <p>There is a subset of interactive patterns that can&#8217;t be tied into semantics since the behaviour is the primary carrier of meaning (understanding is derived form the actions the reader takes). In this case you have to author a non-semantic widget into the text. Texts full of this behaviour lend themselves to solution (b), as you call it. They are also, in my opinion, generally only appropriate to non-fiction; like you I&#8217;m skeptical of the benefits of &#8216;enhancing&#8217; narrative text.</p> <p>Then there&#8217;s the issue of supporting true interactive narratives, creating a platform that can support hypertext and non-linear stories.</p> <p>In either case, creating these texts hasn&#8217;t been that much of a problem because we have had a tool at hand: Javascript.</p> <p>The problem is that javascript in ebooks is looking like a non-starter at the moment. The only major platform that implements it is iBooks and even there support is buggy enough to make development substantially more difficult than developing a scripted web site. I think it&#8217;s pretty much a certainty at this point, based on the discussions and debates I&#8217;ve witnessed and participated in, that javascript won&#8217;t be universally supported in ebooks like it is on the web. </p> <p>Which, really, is the origin of my conundrum.</p> <p>On the stability of these texts:</p> <p>Very true, and it&#8217;s a problem I and other academics who were researching and teaching in this field ten years ago have had to tackle again and again, and, believe it or not, what we have now is much better than it was.</p> <p>Most of the interactive works I studied ten years ago and I cited in my research are unplayable now. Hypercard projects, Director-authored CD-ROMs, old flash files, and plain old executable programs, many of the big, influential, texts are now hard to access, locked in a dead platform (Mac Classic). So, this has been a subject of debate for decades now. There was a lot of worrying and scaremongering about the issue at the time, but it ended up not being as much of an issue as people expected.</p> <p>Of course, some works have been lost. It&#8217;s hard to find and play a Voyager Expanded Book today. But the solution was articulated by Mark Bernstein (of Eastgate Systems, publisher of hypertext, maker of tools, etc.): The only thing that preserves works is interest. </p> <p>When there is interest, someone will make sure that the work is available and accessible (see, for example the conversion and update of the &#8220;If Monks Had Macs&#8221; CD-ROM).</p> <p>When there isn&#8217;t interest, no amount of open formats or standardisation will save the work from oblivion. </p> <p>Of course, there are exceptions such as the rights situation with many of the Voyager Expanded Books, but that kind of legal bind won&#8217;t be solved by any amount of standardisation.</p> <p>And, as I wrote, we&#8217;re in a much better place now than we were then. We have an open standard, ePub, which, even with books published on the Kindle, will remain an archival and authoring format.</p> <p>Extending that format with a set of documented, standardised (even if just a de facto standard) objects will not threaten their archivability in any way, provided we do it in a sensible manner.</p> <p>Which brings me to Apple&#8217;s new iBooks 2.0 format. That format runs the risk of instability and obsolescence. It&#8217;s undocumented, intentionally incompatible with the standard, extends it in odd ways. It&#8217;s a very problematic approach to creating interactive texts.</p> <p>With javascript ruled out, we need to establish a path forward in ebook interactivity that isn&#8217;t dominated by the proprietary and exclusionary path Apple is taking. The only way I see of doing that is describing a set of simple, but configurable, interactive objects that can be combined and used to create fairly rich works.</p> <p>Both the Simile Widgets and Lively Kernel are similar to what I think we need, but not quite. (In either case, projects like these are ruled out by the fact that javascript is a non-starter on many ebook platforms.) The Simile Widgets are a little bit too specialised and complex. Lively Kernel is too tightly integrated with javascript both conceptually and in implementation.</p> <p>I think the next step for me would be to write up a description of the forms of interactivity I think are needed for ebooks (there are a few basic actions that can be combined to create 90% of what authors of interactive works need) followed by a list of widgets, with suggested format extensions, that would implement those forms of interactivity.</p> <p>I wouldn&#8217;t be surprised if, with a little bit of thought, those of us who want this can come up with conventions that are closer to the semantic ideal than the hodgepodge of opaque data that Apple is using.</p> <p>I think, for example, that epub:type can be put to effective use. One approach would be to create a vocabulary of interactivity for epub:type which might give us the best of both worlds—if we assume that an interactive act has meaning in and of itself, that is.</p> <p>The analogy would be &#8216;footnote&#8217;, which is a name of a print design feature that has attained an added meaning derived from its common use. If we define a epub:type vocabulary for commonly used interactive design features, especially those that have attained some added meaning from repeated practice, then I think we would have something that is sustainable, usable, and would satisfy the qualms of most.</p> <p>I&#8217;ve really enjoyed this exchange. :-) Would you mind if I posted this conversation on my website? I won&#8217;t do it if you&#8217;d rather I didn&#8217;t, but I think a lot of people would find it interesting to see an exchange that presented both sides equally like this.</p> <p>best, baldur</p> <hr /> <p>References:</p> <ul> <li><a href="http://idpf.org/epub/30/spec/epub30-contentdocs.html#sec-xhtml-content-type-attribute">epub:type in the ePub3 specification</a></li> <li><a href="http://idpf.org/epub/vocab/structure/">EPUB 3 Structural Semantics Vocabulary</a></li> <li><a href="../the-ibooks-textbook-format/index.html">The iBooks 2.0 textbook format</a></li> <li><a href="../the-ibooks-builtin-widgets/index.html">The iBooks 2.0 built-in widgets</a></li> <li><a href="../the-pros-and-cons-of-iBooks-2/index.html">The pros and cons of the iBooks 2.0 textbook format</a></li> <li><a href="http://blog.booki.sh/blog/post/a-favour-from-goliath/">A favour from Goliath: How Apple does ebook widgets right</a></li> <li><a href="../widgets-javascript/index.html">iBooks widgets – to javascript or not to javascript</a></li> </ul> <footer> <div class="FooterNav"> <p class="left"> <a href="https://www.baldurbjarnason.com/notes/widgets-javascript/" ><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="butt" stroke-linejoin="round" > <path d="M19 12H6M12 5l-7 7 7 7" /> </svg> iBooks widgets – to javascript or not to javascript</a >&nbsp; </p> <p class="right"> <a href="https://www.baldurbjarnason.com/notes/epub-widgets-and-windows/" >ePub windows and widgets – a proposal <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="butt" stroke-linejoin="round" > <path d="M5 12h13M12 5l7 7-7 7" /></svg></a > </p> </div> <form action="https://app.convertkit.com/forms/1092832/subscriptions" class="seva-form formkit-form" method="post" data-sv-form="1092832" data-uid="17fe25197d" data-format="inline" data-version="5" data-options='{"settings":{"after_subscribe":{"action":"message","redirect_url":"","success_message":"Success! Now check your email to confirm your subscription."},"return_visitor":{"action":"hide","custom_content":""},"recaptcha":{"enabled":false}},"version":5}' min-width="400 500 600 700 800" > <div class="formkit-header" data-element="header"> <h2>Join my Newsletter</h2> </div> <p> Do you ever wonder why a newly released open source project matters? Why it doesn't? How new or old standards or specifications affect your work? Why the web, tech, and publishing are the way they are? </p> <p> This is an unapologetically political newsletter about tech, the web, and publishing&mdash;with context. </p> <p> Because, to decide whether to use a piece of software, web standard, or open source project, you need to know <em><strong>why</strong></em> it&lsquo;s interesting, not just <em><strong>that</strong></em> it&lsquo;s interesting. </p> <p data-element="fields" data-stacked="false" class="seva-fields formkit-fields" > <label for="email_address" class="visually-hidden" >Your email address</label > <input class="formkit-input" name="email_address" id="email_address" placeholder="example@example.com" required="" type="email" /> <button data-element="submit" class="formkit-submit formkit-submit"> <span>Subscribe</span> </button> </p> <p class="formkit-guarantee" data-element="guarantee"> I won't send you spam. Unsubscribe at any time. </p> </form> </footer> </article> </div> <h2 id="archive">Writing</h2> <ul class="FrontArchive"> <li> <a href="../../2021/ways-of-reading/index.html" >Ways of reading without the influence of community</a > <span class="Date">6 July 2021</span> </li> <li> <a href="../../2021/the-oss-bubble-and-the-blogging-bubble/index.html" >The Open-Source Software bubble that is and the blogging bubble that was</a > <span class="Date">11 May 2021</span> </li> <li> <a href="../../2021/you-are-what-you-do/index.html" >You are what you do, not what you say or write</a > <span class="Date">4 May 2021</span> </li> <li> <a href="../../2021/the-curious-case-of-the-crashing-conic-gradient/index.html" >The Curious Case Of The Crashing Conic Gradient And How I Used A Technique I Learned In The 90s To Fix It</a > <span class="Date">28 April 2021</span> </li> <li> <a href="../../2021/100-things-every-web-developer-should-know/index.html" >136 facts every web dev should know before they burn out and turn to landscape painting or nude modelling</a > <span class="Date">21 April 2021</span> </li> <li> <a href="https://www.baldurbjarnason.com/work/2021/" >I’m available for work</a > <span class="Date">20 April 2021</span> </li> <li> <a href="../../2021/which-kind-of-web-developer-are-you/index.html" >Which type of novelty-seeking web developer are you?</a > <span class="Date">31 March 2021</span> </li> <li> <a href="../../every-day-a-fair-warning/index.html" >Every Day; a Fair Warning (You Should Read These Articles)</a > <span class="Date">3 March 2020</span> </li> <li> <a href="../../2020/weeknote-3/index.html" >Weeknote 3 - Resistance and the dull blade</a > <span class="Date">10 February 2020</span> </li> <li> <a href="../../2020/weeknote-2/index.html" >Weeknote 2 (2020) - News, Bad News, and Star Wars</a > <span class="Date">2 February 2020</span> </li> <li> <a href="../../2020/weeknote-1/index.html" >Weeknote 1 (2020) - Ending the hiatus</a > <span class="Date">26 January 2020</span> </li> <li> <a href="../../the-ed-tech-conundrum/index.html" >The Ed Tech Conundrum</a > <span class="Date">2 January 2020</span> </li> <li> <a href="../../past-present-future-web/index.html" >Thinking about the past, present, and future of web development</a > <span class="Date">1 January 2020</span> </li> <li> <a href="../../the-weakened-web/index.html" >The Web Falls Apart</a > <span class="Date">3 November 2019</span> </li> <li> <a href="../../weeknote-19/index.html" >Weeknote 19 ─ blog redesign and changes at work</a > <span class="Date">27 October 2019</span> </li> <li> <a href="../../life-and-lemonades/index.html" >When life hands you lemonades, sit down and contemplate the meaning of life</a > <span class="Date">10 September 2019</span> </li> <li> <a href="../../weeknote-18/index.html" >Weeknote 18 - Uncertainty and Discomfort</a > <span class="Date">11 August 2019</span> </li> <li> <a href="../../weeknote-17/index.html" >Web Dev: The Red Queen Wire Mommy of Modern Tech</a > <span class="Date">6 August 2019</span> </li> <li> <a href="../../weeknote-16/index.html" >Weeknote 16 – Vacation</a > <span class="Date">29 July 2019</span> </li> <li> <a href="../../weeknote-15/index.html" >Weeknote 15 - Counting Down the Days</a > <span class="Date">1 July 2019</span> </li> <li> <a href="../../weeknote-14/index.html" >Weeknote 14 - Shadows and DOMs</a > <span class="Date">25 June 2019</span> </li> <li> <a href="../../weeknote-13/index.html" >Weeknote 13 - The weight of deadlines</a > <span class="Date">16 June 2019</span> </li> <li> <a href="../../webby-things-1/index.html" >That Web Dev Thing Where Everybody Says Something Clever Involving Toast</a > <span class="Date">15 June 2019</span> </li> <li> <a href="../../swiftui-macos-privacy-web/index.html" >SwiftUI, Privacy, macOS, and the Web</a > <span class="Date">9 June 2019</span> </li> <li> <a href="../../weeknote-12/index.html" >Weeknote 12 - The genres of web media</a > <span class="Date">5 June 2019</span> </li> <li> <a href="../../the-aesthetics-of-concentration/index.html" >The Aesthetics of Concentration</a > <span class="Date">3 June 2019</span> </li> <li> <a href="../../weeknote-11/index.html" >Weeknote 11 - do I have focus?</a > <span class="Date">29 May 2019</span> </li> <li> <a href="../../weeknote-10/index.html" >Weeknote 10 - A clear view and more reading</a > <span class="Date">20 May 2019</span> </li> <li> <a href="../../2019/05/12/weeknote-9-being-contemplative-finishing-a-photo-project/index.html" >Weeknote 9 - Being contemplative, finishing a photo project</a > <span class="Date">12 May 2019</span> </li> <li> <a href="../../2019/05/05/weeknote-8-moving-endgame-and-more-musings-on-colour/index.html" >Weeknote 8 – Moving, Endgame, and more musings on colour</a > <span class="Date">5 May 2019</span> </li> <li> <a href="../../2019/04/29/weeknote-7-story-length-and-that-thing-about-colour/index.html" >Weeknote 7 - Story length and that thing about colour</a > <span class="Date">29 April 2019</span> </li> <li> <a href="../../2019/04/22/weeknote-6-star-trek-rest-and-spring-finally-arrives/index.html" >Weeknote 6 – Star Trek, rest and spring finally arrives</a > <span class="Date">22 April 2019</span> </li> <li> <a href="../../2019/04/14/weeknote-5-stuff-comics-superheroes-and-other-nonsense/index.html" >Weeknote 5 – Stuff, comics, superheroes, and other nonsense</a > <span class="Date">14 April 2019</span> </li> <li> <a href="../../2019/04/07/weeknote-4-tv-week-with-the-expanse/index.html" >Weeknote 4 – TV week with The Expanse</a > <span class="Date">7 April 2019</span> </li> <li> <a href="../../2019/03/31/weeknote-3-mvps-fatigue-and-emotional-crutches/index.html" >Weeknote 3 — MVPs, fatigue, and emotional crutches</a > <span class="Date">31 March 2019</span> </li> <li> <a href="../../2019/03/24/weeknote-2-web-development-mistakes-mary-sues-and-icy-spring/index.html" >Weeknote 2 - Web Development Mistakes, Mary Sues, and Icy Spring</a > <span class="Date">24 March 2019</span> </li> <li> <a href="../../2019/03/18/weeknote-1/index.html" >Weeknote 1</a > <span class="Date">18 March 2019</span> </li> <li> <a href="../../2019/02/12/hitchcock-and-the-author-construct/index.html" >Hitchcock and the author construct</a > <span class="Date">12 February 2019</span> </li> <li> <a href="../../2018/11/03/seams-stitches-and-the-decline-of-the-mac/index.html" >Seams, Stitches, And The Decline Of The Mac</a > <span class="Date">3 November 2018</span> </li> <li> <a href="../../2018/09/03/neither-paper-nor-digital-does-active-reading-well/index.html" >Neither Paper Nor Digital Does Active Reading Well</a > <span class="Date">3 September 2018</span> </li> <li> <a href="../../2018/01/07/leftover-thoughts-from-2017/index.html" >Leftover Thoughts From 2017</a > <span class="Date">7 January 2018</span> </li> <li> <a href="../under-engineering-websites/index.html" >Over-engineering is under-engineering</a > <span class="Date">25 November 2017</span> </li> <li> <a href="../the-process-is-the-thing/index.html" >The process is the thing</a > <span class="Date">23 March 2017</span> </li> <li> <a href="../vonbedon-notes-on-a-project/index.html" >Von Be Don: A few notes on a recent digital publishing project in Iceland</a > <span class="Date">19 February 2017</span> </li> <li> <a href="../why-drm-is-a-problem-for-the-w3c/index.html" >W3C and EME: it isn't about preventing DRM but saving the W3C</a > <span class="Date">14 February 2017</span> </li> <li> <a href="../for-the-want-of-an-indirect-pointer/index.html" >Unpopular opinion: dismissing indirect pointers is a mistake</a > <span class="Date">4 February 2017</span> </li> <li> <a href="../feels-like-poison/index.html" >Anger feels like poison</a > <span class="Date">24 January 2017</span> </li> <li> <a href="../is-js-more-fragile/index.html" >Is JavaScript more fragile?</a > <span class="Date">7 December 2016</span> </li> <li> <a href="../progressive-enhancement-debate/index.html" >Debating Progressive Enhancement</a > <span class="Date">5 December 2016</span> </li> <li> <a href="../the-less-pro-apple/index.html" >The downside of believing in Apple</a > <span class="Date">1 November 2016</span> </li> <li> <a href="../icelandic-politics-primer/index.html" >A short primer on Icelandic politics on the day of the 2016 election</a > <span class="Date">29 October 2016</span> </li> <li> <a href="../web-media-tragedy/index.html" >The Tragedy/Farce of the Open Web according to journalists</a > <span class="Date">18 October 2016</span> </li> <li> <a href="../debating-web-development/index.html" >Notes on debating for the web development community</a > <span class="Date">17 October 2016</span> </li> <li> <a href="../addendum-on-coupling-and-commodification/index.html" >Addendum on loose coupling and the iOS App Store</a > <span class="Date">11 October 2016</span> </li> <li> <a href="../idle-sunday-thoughts-on-modularity/index.html" >Idle thoughts on modularity and loose coupling in digital media</a > <span class="Date">9 October 2016</span> </li> <li> <a href="../when-fear-is-rational/index.html" >When fear is rational</a > <span class="Date">24 June 2016</span> </li> <li> <a href="../once-upon-a-time-there-was-word/index.html" >Once upon a time, I couldn't imagine a better word processor than Word</a > <span class="Date">7 June 2016</span> </li> <li> <a href="../a-thought-to-consider/index.html" >A thought to consider</a > <span class="Date">24 May 2016</span> </li> <li> <a href="../thoughts-on-standardisation/index.html" >A few thoughts on standardisation, W3C, and the IDPF</a > <span class="Date">16 May 2016</span> </li> <li> <a href="../zero-marginal-cost/index.html" >Filling in the gaps – the dynamics of zero marginal cost</a > <span class="Date">21 April 2016</span> </li> <li> <a href="../choosing-a-host/index.html" >Which CMS/blog system would you choose?</a > <span class="Date">12 April 2016</span> </li> <li> <a href="../some-notes-on-security/index.html" >A few simplified points on web and document security</a > <span class="Date">30 March 2016</span> </li> <li> <a href="../judge-the-work/index.html" >Judge the work</a > <span class="Date">21 January 2016</span> </li> <li> <a href="../why-did-paul-graham/index.html" >Why did Paul Graham argue against equality?</a > <span class="Date">13 January 2016</span> </li> <li> <a href="../purpose-joy-capability/index.html" >Purpose, Joy, Capability</a > <span class="Date">4 January 2016</span> </li> <li> <a href="../fix-the-app-store/index.html" >You can't fix the App Store, so here's how you fix it</a > <span class="Date">20 November 2015</span> </li> <li> <a href="../twitter-troubles/index.html" >Why I am worried about Twitter and why you should be too</a > <span class="Date">4 November 2015</span> </li> <li> <a href="../the-crossroads/index.html" >The crossroads or the wilderness</a > <span class="Date">23 October 2015</span> </li> <li> <a href="../people-problems/index.html" >You can't solve people problems with software</a > <span class="Date">28 September 2015</span> </li> <li> <a href="../ad-blockers/index.html" >The discussion about ad blocking is very dumb (but not in the way you think)</a > <span class="Date">18 September 2015</span> </li> <li> <a href="../this-is-a-podcast/index.html" >This is not a book, but it is a podcast</a > <span class="Date">10 September 2015</span> </li> <li> <a href="../a-week-of-this-is-not-a-book/index.html" >A week of 'This is not a book'</a > <span class="Date">7 September 2015</span> </li> <li> <a href="../launching-thisisnotabook/index.html" >Launching "This is not a book" – what it is and why you should be interested</a > <span class="Date">1 September 2015</span> </li> <li> <a href="../my-kingdom-for-a-new-bookstore/index.html" >My kingdom for a new bookstore</a > <span class="Date">28 August 2015</span> </li> <li> <a href="../modern-software-sucks/index.html" >Modern software sucks</a > <span class="Date">26 August 2015</span> </li> <li> <a href="../the-cost-benefit/index.html" >The cost versus benefits of disorganised programming power</a > <span class="Date">25 August 2015</span> </li> <li> <a href="../OSS-and-money/index.html" >Who benefits the most from Open Source Software?</a > <span class="Date">25 August 2015</span> </li> <li> <a href="../sex-apocalypse/index.html" >Sex Apocalypse Later</a > <span class="Date">24 August 2015</span> </li> <li> <a href="../that-amazon-thing/index.html" >Random thoughts on work and that Amazon thing</a > <span class="Date">23 August 2015</span> </li> <li> <a href="../bookmarks-great-caper/index.html" >Bookmarks – UI flaws and other great capers</a > <span class="Date">14 August 2015</span> </li> <li> <a href="../bookmarks-ad-blockers-again/index.html" >Bookmarks – learnable programming</a > <span class="Date">13 August 2015</span> </li> <li> <a href="../bookmarks-midweek-blues/index.html" >Bookmarks – More money for open-source</a > <span class="Date">12 August 2015</span> </li> <li> <a href="../bookmarks-leaving-bosses/index.html" >Bookmarks – Leaving bosses</a > <span class="Date">11 August 2015</span> </li> <li> <a href="../bookmarks-getting-better/index.html" >Bookmarks – Promoting other people's work</a > <span class="Date">10 August 2015</span> </li> <li> <a href="../bookmarks-thingamabob/index.html" >Bookmarks – What Would Kamala Khan Do?</a > <span class="Date">7 August 2015</span> </li> <li> <a href="../trickle-down-golden-goose/index.html" >Bookmarks – Trickle down golden geese</a > <span class="Date">6 August 2015</span> </li> <li> <a href="../hateviews/index.html" >Bookmarks – Hateviews are us</a > <span class="Date">5 August 2015</span> </li> <li> <a href="../bookmarks-milk-it/index.html" >Bookmarks – Milk it</a > <span class="Date">4 August 2015</span> </li> <li> <a href="../iterating-the-web-away/index.html" >Iterating the web away: <br>losing the next generation</a > <span class="Date">4 August 2015</span> </li> <li> <a href="../bookmarks-paying-attention/index.html" >Bookmarks – You haven't been paying attention</a > <span class="Date">3 August 2015</span> </li> <li> <a href="../bookmarks-stop-the-web/index.html" >Bookmarks – It's a note card world, we just live in it</a > <span class="Date">31 July 2015</span> </li> <li> <a href="../bookmarks-sucky-websites/index.html" >Bookmarks – Just call it Smylfeste</a > <span class="Date">30 July 2015</span> </li> <li> <a href="../bookmarks-that-one-is-an-idiot/index.html" >Bookmarks – That one is shaped like an idiot</a > <span class="Date">29 July 2015</span> </li> <li> <a href="../blogger-nostalgia/index.html" >Blogger nostalgia</a > <span class="Date">28 July 2015</span> </li> <li> <a href="../bookmarks-make-it-simpler/index.html" >Bookmarks – Make it simpler</a > <span class="Date">28 July 2015</span> </li> <li> <a href="../bookmarks-javascript-cry/index.html" >Wet streets cause rain and criminal responsibility</a > <span class="Date">27 July 2015</span> </li> <li> <a href="../bookmark-5/index.html" >Tweet bookmarks galore</a > <span class="Date">26 July 2015</span> </li> <li> <a href="../bookmarks-4/index.html" >Random links that catch my fancy, part four of ∞</a > <span class="Date">23 July 2015</span> </li> <li> <a href="../bookmarks-3/index.html" >Random links that catch my fancy, part three of ∞</a > <span class="Date">22 July 2015</span> </li> <li> <a href="../mythic-dimension-of-sexuality/index.html" >Mythic visions of sexuality</a > <span class="Date">21 July 2015</span> </li> <li> <a href="../bookmarks-2/index.html" >Random links that catch my fancy, part two of ∞</a > <span class="Date">21 July 2015</span> </li> <li> <a href="../bookmarks/index.html" >Random links that catch my fancy, part one of ∞</a > <span class="Date">20 July 2015</span> </li> <li> <a href="../modularisation-exercise/index.html" >An exercise for the reader in integration and modularity</a > <span class="Date">17 July 2015</span> </li> <li> <a href="../how-to-read-baldur/index.html" >How to read my nonsense</a > <span class="Date">17 July 2015</span> </li> <li> <a href="../decentralised-or-disorganised/index.html" >Is it distributed or just a disorganised hierarchy?</a > <span class="Date">10 July 2015</span> </li> <li> <a href="../the-robust-web/index.html" >On the vaunted robustness of the web</a > <span class="Date">10 July 2015</span> </li> <li> <a href="../the-rules-have-changed-for-rss/index.html" >The rules of the game have changed for RSS</a > <span class="Date">10 July 2015</span> </li> <li> <a href="../web-app-developer-lament/index.html" >The web app developer's lament</a > <span class="Date">6 July 2015</span> </li> <li> <a href="../paradigm-shift/index.html" >Other people write about digital media</a > <span class="Date">25 June 2015</span> </li> <li> <a href="../media-changes/index.html" >The plural of 'Medium' is clearly 'clusterfuck'</a > <span class="Date">25 June 2015</span> </li> <li> <a href="../burnout/index.html" >Burnout</a > <span class="Date">24 June 2015</span> </li> <li> <a href="../our-working-files/index.html" >The files Steven Pressfield works with</a > <span class="Date">24 June 2015</span> </li> <li> <a href="../ios9-content-blocking/index.html" >iOS 9 content blocking extensions are not a mobile advertising armageddon</a > <span class="Date">14 June 2015</span> </li> <li> <a href="../writing-the-other/index.html" ><em>Writing the Other</em>: <br>a book that's useful to all writers</a > <span class="Date">3 June 2015</span> </li> <li> <a href="../wwdc-predictions/index.html" >Should I make a WWDC prediction? <br>Yes, let's</a > <span class="Date">3 June 2015</span> </li> <li> <a href="../grim-meathook-present-2/index.html" >Grim Meathook Present #2</a > <span class="Date">2 June 2015</span> </li> <li> <a href="../software-quality/index.html" >Other people discuss software quality (spoiler: it sucks)</a > <span class="Date">2 June 2015</span> </li> <li> <a href="../startup-fallacy/index.html" >Other people talk about startups and entrepreneurship</a > <span class="Date">2 June 2015</span> </li> <li> <a href="../quick-thoughts-big-problems/index.html" >A few quick links and thoughts on big web problems</a > <span class="Date">29 May 2015</span> </li> <li> <a href="../femininity-heroism/index.html" >I really want the Supergirl TV show to be fun</a > <span class="Date">25 May 2015</span> </li> <li> <a href="../grim-meathook-present/index.html" >Our Grim Meathook Present</a > <span class="Date">25 May 2015</span> </li> <li> <a href="../new-age-of-html/index.html" >The new age of HTML:<br> the web is being torn apart</a > <span class="Date">20 May 2015</span> </li> <li> <a href="../her-movie-his-name/index.html" >Her movie, his name;<br> Mad Max: Fury Road</a > <span class="Date">19 May 2015</span> </li> <li> <a href="../we-are-a-violent-species/index.html" >We are a violent species</a > <span class="Date">19 May 2015</span> </li> <li> <a href="../toxic-environments/index.html" >Toxic environments: <br> inequality in tech is a symptom of something worse</a > <span class="Date">18 May 2015</span> </li> <li> <a href="../../2015/05/16/where-i-write-about-facebooks-instant-articles/index.html" >Where I write about Facebook's Instant Articles</a > <span class="Date">16 May 2015</span> </li> <li> <a href="../media-websites-vs-facebook/index.html" >Facebook and the media: <br>united, they attack the web</a > <span class="Date">15 May 2015</span> </li> <li> <a href="../decision-cycles/index.html" >Speeding up decision cycles with rules and heuristics</a > <span class="Date">14 May 2015</span> </li> <li> <a href="../a-you-are-here-5/index.html" >You are here #5: <br>UX, design, and CSS as a parasite</a > <span class="Date">14 May 2015</span> </li> <li> <a href="../you-are-here-4/index.html" >You are here #4: <br>an epic journey through app dev and male bodies</a > <span class="Date">13 May 2015</span> </li> <li> <a href="../you-are-here-3/index.html" >You are here #3: <br>the glorious wonders of online reading await you</a > <span class="Date">12 May 2015</span> </li> <li> <a href="../18-39-16/index.html" >2015-05-11-18-39-16</a > <span class="Date">11 May 2015</span> </li> <li> <a href="../you-are-here-2/index.html" >You are here #2: <br>an artisanal curation of reading material</a > <span class="Date">11 May 2015</span> </li> <li> <a href="../you-are-here-1/index.html" >You are here #1: <br>a selection of fine links and tweets for your pleasure</a > <span class="Date">10 May 2015</span> </li> <li> <a href="../00-59-18/index.html" >2015-05-07-00-59-18</a > <span class="Date">7 May 2015</span> </li> <li> <a href="../../2015/05/04/four-publishing-related-thoughts-on-a-friday-afternoon/index.html" >Five publishing-related thoughts on a Friday afternoon</a > <span class="Date">4 May 2015</span> </li> <li> <a href="../../2015/05/04/why-should-people-read-more-books/index.html" >Why should people read more books?</a > <span class="Date">4 May 2015</span> </li> <li> <a href="../../2015/05/04/how-is-taxing-ebooks-as-print-books-supposed-to-work/index.html" >How is taxing ebooks as print books supposed to work?</a > <span class="Date">4 May 2015</span> </li> <li> <a href="../../2015/03/04/kathy-sierras-badass-making-users-awesome-the-book-you-all-should-read/index.html" >Kathy Sierra's Badass: Making Users Awesome – the book you all should read</a > <span class="Date">4 March 2015</span> </li> <li> <a href="../../2015/03/01/idle-sunday-thoughts-about-web-trends/index.html" >Idle Sunday thoughts about web trends</a > <span class="Date">1 March 2015</span> </li> <li> <a href="../../2015/03/01/repetition-only-works-in-fiction/index.html" >Repetition only works in fiction</a > <span class="Date">1 March 2015</span> </li> <li> <a href="../../2015/03/01/the-web-has-covered-the-basicse2808a-e2808athats-why-itll-get-harder-from-now/index.html" >The web has covered the basics — that’s why it’ll get harder from now</a > <span class="Date">1 March 2015</span> </li> <li> <a href="../../2015/01/09/a-draft-of-a-chapter-of-some-thoughts-on-things/index.html" >A draft of a chapter of some thoughts on things.</a > <span class="Date">9 January 2015</span> </li> <li> <a href="../../2014/12/31/taking-stock-of-2013-and-2014/index.html" >Taking stock of 2013 and 2014</a > <span class="Date">31 December 2014</span> </li> <li> <a href="../../2014/12/17/the-weather-of-course/index.html" >The weather, of course</a > <span class="Date">17 December 2014</span> </li> <li> <a href="../../2014/12/03/publishing-business-ideas-are-a-dime-a-dozen/index.html" >Publishing business ideas are a dime a dozen</a > <span class="Date">3 December 2014</span> </li> <li> <a href="../../2014/11/25/eu-vat-changes-shift-the-digital-landscape/index.html" >EU VAT changes shift the digital landscape</a > <span class="Date">25 November 2014</span> </li> <li> <a href="../../2014/11/25/money-is-a-poor-measure-of-value/index.html" >Money is a poor measure of value</a > <span class="Date">25 November 2014</span> </li> <li> <a href="../../2014/11/13/on-conference/index.html" >On conferences</a > <span class="Date">13 November 2014</span> </li> <li> <a href="../../2014/11/12/crushed-by-multinationals/index.html" >Crushed by multinationals</a > <span class="Date">12 November 2014</span> </li> <li> <a href="../../2014/11/07/software-as-a-strategy-prefabricated-publishers/index.html" >Software as a strategy: prefabricated publishers</a > <span class="Date">7 November 2014</span> </li> <li> <a href="../../2014/11/06/software-as-strategy-in-the-ebook-world/index.html" >Software as strategy in the ebook world</a > <span class="Date">6 November 2014</span> </li> <li> <a href="../../2014/11/05/the-five-types-of-unpublished-books/index.html" >The five types of unpublished books</a > <span class="Date">5 November 2014</span> </li> <li> <a href="../../2014/11/04/four-hundred-words-from-anita-elberses-book-blockbusters/index.html" >Four hundred words from Anita Elberse's book "Blockbusters"</a > <span class="Date">4 November 2014</span> </li> <li> <a href="../../2014/11/04/the-splintered-author/index.html" >The splintered author</a > <span class="Date">4 November 2014</span> </li> <li> <a href="../../2014/11/03/there-is-no-war-between-amazon-and-traditional-publishing/index.html" >There is no war between Amazon and Traditional Publishing</a > <span class="Date">3 November 2014</span> </li> <li> <a href="../../2014/10/10/ebooks-suck-for-learning/index.html" >Ebooks suck for learning</a > <span class="Date">10 October 2014</span> </li> <li> <a href="../../2014/09/09/the-poisoning-of-social-media-a-reading-list/index.html" >The Poisoning of Social Media: A Reading List</a > <span class="Date">9 September 2014</span> </li> <li> <a href="../../2014/08/10/wobbly-amazon/index.html" >Wobbly Amazon</a > <span class="Date">10 August 2014</span> </li> <li> <a href="../../2014/07/24/this-weeks-must-read-post/index.html" >This week's must-read post</a > <span class="Date">24 July 2014</span> </li> <li> <a href="../../2014/07/10/friends-dont-let-their-friends-become-authors/index.html" >Friends don’t let their friends become authors</a > <span class="Date">10 July 2014</span> </li> <li> <a href="../../2014/07/04/both-at-the-same-time/index.html" >Both at the same time</a > <span class="Date">4 July 2014</span> </li> <li> <a href="../../2014/04/15/so-i-had-to-make-an-ebook-cover/index.html" >So I had to make an ebook cover...</a > <span class="Date">15 April 2014</span> </li> <li> <a href="../../2014/03/31/so-long-readmill-and-thanks-for-all-the-fish/index.html" >So long, Readmill, and thanks for all the fish</a > <span class="Date">31 March 2014</span> </li> <li> <a href="../../2014/03/24/what-ebook-production-problems-are-self-publishers-facing/index.html" >What ebook production problems are self-publishers facing?</a > <span class="Date">24 March 2014</span> </li> <li> <a href="../../2014/03/13/many-stories-many-truths/index.html" >Many stories, many truths</a > <span class="Date">13 March 2014</span> </li> <li> <a href="../../2014/02/28/problem-statements-for-digital-publishing-research/index.html" >Problem statements for digital publishing research</a > <span class="Date">28 February 2014</span> </li> <li> <a href="../../2014/02/21/to-do-to-do/index.html" >To do, to do</a > <span class="Date">21 February 2014</span> </li> <li> <a href="../../2014/02/20/ibooks-author-tempts-you-with-bling/index.html" >iBooks Author tempts you with bling</a > <span class="Date">20 February 2014</span> </li> <li> <a href="../../2014/02/19/microsoft-word-is-a-liability/index.html" >Microsoft Word is a liability</a > <span class="Date">19 February 2014</span> </li> <li> <a href="../../2014/02/18/the-print-design-mentality/index.html" >The print design mentality</a > <span class="Date">18 February 2014</span> </li> <li> <a href="../../2014/02/12/book-contracts/index.html" >Book contracts</a > <span class="Date">12 February 2014</span> </li> <li> <a href="../../2014/02/05/intermission-sorting-through-the-banal/index.html" >Intermission: sorting through the banal</a > <span class="Date">5 February 2014</span> </li> <li> <a href="../../2014/01/30/how-to-create-value-with-a-new-thing/index.html" >How to create value with a new thing</a > <span class="Date">30 January 2014</span> </li> <li> <a href="../../2014/01/29/html-is-too-complex/index.html" >HTML is too complex</a > <span class="Date">29 January 2014</span> </li> <li> <a href="../../2014/01/28/the-ebook-as-an-api/index.html" >The ebook as an API</a > <span class="Date">28 January 2014</span> </li> <li> <a href="../../2014/01/27/my-last-word-on-drm/index.html" >My last word on DRM</a > <span class="Date">27 January 2014</span> </li> <li> <a href="../../2014/01/23/except-except-except/index.html" >Except, except, except</a > <span class="Date">23 January 2014</span> </li> <li> <a href="../../2014/01/22/a-thought-exercise/index.html" >A thought exercise</a > <span class="Date">22 January 2014</span> </li> <li> <a href="../../2014/01/21/losing-faith-in-yourself/index.html" >Losing faith in yourself</a > <span class="Date">21 January 2014</span> </li> <li> <a href="../../2014/01/20/changing-your-readership-mix/index.html" >Changing your readership mix</a > <span class="Date">20 January 2014</span> </li> <li> <a href="../../2014/01/18/sex-education-readers-and-futures-what-works-what-doesnt/index.html" >Sex, education, readers, and futures: what works, what doesn't</a > <span class="Date">18 January 2014</span> </li> <li> <a href="../../2014/01/17/the-various-types-of-readers/index.html" >The various types of readers</a > <span class="Date">17 January 2014</span> </li> <li> <a href="../../2014/01/16/the-unevenly-distributed-ebook-future/index.html" >The unevenly distributed ebook future</a > <span class="Date">16 January 2014</span> </li> <li> <a href="../../2014/01/15/sex-violence-and-stilbrot/index.html" >Sex, violence, and stílbrot</a > <span class="Date">15 January 2014</span> </li> <li> <a href="../../2014/01/14/recipe-for-pundit-response-to-hugh-howeys-suggestions/index.html" >Recipe for pundit response to Hugh Howey’s suggestions</a > <span class="Date">14 January 2014</span> </li> <li> <a href="../../2014/01/13/bling-it-up-for-education/index.html" >Bling it up for education</a > <span class="Date">13 January 2014</span> </li> <li> <a href="../../2014/01/09/blogging-has-trained-me-to-assume-youre-stupid/index.html" >Blogging has trained me to assume you’re stupid</a > <span class="Date">9 January 2014</span> </li> <li> <a href="../../2014/01/08/ergodic-literature/index.html" >Ergodic literature</a > <span class="Date">8 January 2014</span> </li> <li> <a href="../../2014/01/07/what-i-thought-i-wanted-versus-what-i-really-wanted/index.html" >What I thought I wanted versus what I really wanted</a > <span class="Date">7 January 2014</span> </li> <li> <a href="../../2014/01/06/the-mistake-of-enhancing-novels/index.html" >The mistake of 'enhancing' novels</a > <span class="Date">6 January 2014</span> </li> <li> <a href="../../2014/01/04/pessimistic-ramblings-and-other-fun-links-week-overview-further-reading/index.html" >Pessimistic ramblings and other fun links (week overview + further reading)</a > <span class="Date">4 January 2014</span> </li> <li> <a href="../../2014/01/03/stumbling-into-publishing/index.html" >Stumbling into publishing</a > <span class="Date">3 January 2014</span> </li> <li> <a href="../../2014/01/02/the-publishing-industrys-new-product-categories/index.html" >The publishing industry's new product categories</a > <span class="Date">2 January 2014</span> </li> <li> <a href="../../2014/01/01/the-last-two-knights-and-necromancers-stories/index.html" >The last two Knights and Necromancers stories</a > <span class="Date">1 January 2014</span> </li> <li> <a href="../../2013/12/31/random-loosely-connected-thoughts-on-the-future/index.html" >Random, loosely connected, thoughts on the future</a > <span class="Date">31 December 2013</span> </li> <li> <a href="../../2013/12/29/old-photos-posted-without-context-reykjavik-cats/index.html" >Old photos posted without context: Reykjavík Cats</a > <span class="Date">29 December 2013</span> </li> <li> <a href="../../2013/12/22/old-photos-posted-without-context-sweep-after-use/index.html" >Old photos posted without context: Sweep After Use</a > <span class="Date">22 December 2013</span> </li> <li> <a href="../../2013/12/20/the-checklist-ibooks-image-handling/index.html" >The Checklist: fix iBooks image handling</a > <span class="Date">20 December 2013</span> </li> <li> <a href="../../2013/12/17/great-text-transcends-nothing/index.html" >Great text transcends nothing</a > <span class="Date">17 December 2013</span> </li> <li> <a href="../../2013/10/17/quarantine-all-ebooks/index.html" >Quarantine all ebooks</a > <span class="Date">17 October 2013</span> </li> <li> <a href="../../2013/10/17/the-self-publishers-perspective-of-the-ebook-market/index.html" >The self-publisher's perspective of the ebook market</a > <span class="Date">17 October 2013</span> </li> <li> <a href="../../2013/10/10/light-evening-trauma/index.html" >Light evening trauma</a > <span class="Date">10 October 2013</span> </li> <li> <a href="../../2013/10/02/just-say-no-to-ebook-css-and-js/index.html" >Just say no to ebook CSS and JS</a > <span class="Date">2 October 2013</span> </li> <li> <a href="../../2013/09/17/the-google-wave-heuristic/index.html" >The Google Wave Heuristic</a > <span class="Date">17 September 2013</span> </li> <li> <a href="../../2013/09/12/amazons-biggest-ally-is-apple/index.html" >Amazon's biggest ally is Apple</a > <span class="Date">12 September 2013</span> </li> <li> <a href="../../2013/08/26/readmill-versus-kindle-readmill-is-worth-the-hassle/index.html" >Readmill versus Kindle – Readmill is worth the hassle</a > <span class="Date">26 August 2013</span> </li> <li> <a href="../../2013/08/19/proprietary-ebook-formats-versus-drm/index.html" >Proprietary ebook formats versus DRM</a > <span class="Date">19 August 2013</span> </li> <li> <a href="../../2013/08/16/publishing-has-catered-to-dumb-for-a-long-while/index.html" >Publishing has catered to dumb for a long while</a > <span class="Date">16 August 2013</span> </li> <li> <a href="../../2013/08/14/computers-are-both-too-difficult-and-people-are-computer-illiterate/index.html" >Computers are too difficult and people are computer illiterate</a > <span class="Date">14 August 2013</span> </li> <li> <a href="../../2013/08/12/why-disruption-goes-unchecked/index.html" >Why disruption goes unchecked</a > <span class="Date">12 August 2013</span> </li> <li> <a href="../../2013/08/09/make-ebooks-worth-it/index.html" >Make ebooks worth it</a > <span class="Date">9 August 2013</span> </li> <li> <a href="../../2013/08/08/ebooks-and-cognitive-mapping/index.html" >Ebooks and cognitive mapping</a > <span class="Date">8 August 2013</span> </li> <li> <a href="../../2013/08/07/ebook-silos-update/index.html" >Ebook silos, update</a > <span class="Date">7 August 2013</span> </li> <li> <a href="../../2013/08/06/ebook-silos-and-missed-opportunities/index.html" >Ebook silos and missed opportunities</a > <span class="Date">6 August 2013</span> </li> <li> <a href="../../2013/08/05/technology-is-not-inherently-good/index.html" >Technology is not inherently good</a > <span class="Date">5 August 2013</span> </li> <li> <a href="../../2013/07/29/administrative-note-on-baldurbjarnason-com-and-feeds/index.html" >Administrative note on baldurbjarnason.com and feeds</a > <span class="Date">29 July 2013</span> </li> <li> <a href="../../2013/07/29/posted-without-comment/index.html" >Posted without comment</a > <span class="Date">29 July 2013</span> </li> <li> <a href="../../2013/07/24/the-inefficiencies-of-joy/index.html" >The inefficiencies of joy</a > <span class="Date">24 July 2013</span> </li> <li> <a href="../../2013/07/23/winner-takes-all-versus-the-matthew-effect/index.html" >Winner takes all versus the Matthew effect</a > <span class="Date">23 July 2013</span> </li> <li> <a href="../../2013/07/22/what-you-people-read-on-my-websites/index.html" >What you people read (on my websites)</a > <span class="Date">22 July 2013</span> </li> <li> <a href="../../2013/07/19/tolerating-the-heat-noticing-the-water/index.html" >Tolerating the heat, noticing the water</a > <span class="Date">19 July 2013</span> </li> <li> <a href="../../2013/07/18/if-the-kindle-fails-so-will-ebooks/index.html" >If the Kindle fails so will ebooks</a > <span class="Date">18 July 2013</span> </li> <li> <a href="../../2013/07/16/followup-to-this-ebook-is-a-lemon/index.html" >Followup to 'this ebook is a lemon'</a > <span class="Date">16 July 2013</span> </li> <li> <a href="../../2013/07/12/this-ebook-is-a-lemon/index.html" >This ebook is a lemon</a > <span class="Date">12 July 2013</span> </li> <li> <a href="../../2013/07/10/caught-between-madmen-and-mercenaries/index.html" >Caught between madmen and mercenaries</a > <span class="Date">10 July 2013</span> </li> <li> <a href="../../2013/07/03/major-update-to-studio-tendras-oz-project/index.html" >Major update to Studio Tendra's Oz project</a > <span class="Date">3 July 2013</span> </li> <li> <a href="../../2013/07/01/what-are-self-publishings-biggest-pain-points/index.html" >What are self-publishing's biggest pain points?</a > <span class="Date">1 July 2013</span> </li> <li> <a href="../../2013/07/01/intellectual-terrain/index.html" >Intellectual terrain</a > <span class="Date">1 July 2013</span> </li> <li> <a href="../../2013/06/26/good-books-dont-win/index.html" >Good books don't win</a > <span class="Date">26 June 2013</span> </li> <li> <a href="../why-does-it-matter/index.html" >Why does it matter?</a > <span class="Date">10 May 2013</span> </li> <li> <a href="../../2013/05/07/the-oz-reading-club-books-two-and-three/index.html" >The OZ Reading Club: Books three and four</a > <span class="Date">7 May 2013</span> </li> <li> <a href="../the-ebook-innovation/index.html" >Which kind of innovation?</a > <span class="Date">3 May 2013</span> </li> <li> <a href="../books-and-print/index.html" >Books and Print Showcase</a > <span class="Date">2 May 2013</span> </li> <li> <a href="../../2013/04/30/peasants/index.html" >Peasants</a > <span class="Date">30 April 2013</span> </li> <li> <a href="../for-the-love/index.html" >For the love</a > <span class="Date">14 April 2013</span> </li> <li> <a href="../../2013/04/05/the-idiocies-of-young-men/index.html" >The idiocies of young men</a > <span class="Date">5 April 2013</span> </li> <li> <a href="../../2013/04/02/studio-tendras-grand-and-marvelous-oz-reading-club/index.html" >Studio Tendra's grand and marvellous Oz Reading Club</a > <span class="Date">2 April 2013</span> </li> <li> <a href="../../2013/03/29/icelands-crowd-sourced-constitution-is-dead/index.html" >Iceland’s ‘crowd-sourced’ constitution is dead</a > <span class="Date">29 March 2013</span> </li> <li> <a href="../the-bn-fallacy/index.html" >The B&amp;N fallacy</a > <span class="Date">27 February 2013</span> </li> <li> <a href="https://www.baldurbjarnason.com/notes/hire-me/" >Hire me!</a > <span class="Date">19 February 2013</span> </li> <li> <a href="../../2013/02/15/a-question-only-you-can-answer/index.html" >A question only you can answer</a > <span class="Date">15 February 2013</span> </li> <li> <a href="../respect-the-reader/index.html" >Respect the reader</a > <span class="Date">6 February 2013</span> </li> <li> <a href="../../2013/02/05/33-observations-on-the-year-2012/index.html" >33 observations on the year 2012</a > <span class="Date">5 February 2013</span> </li> <li> <a href="../../2013/02/04/knights-and-necromancers-new-books-and-megapacks/index.html" >Knights and Necromancers: new books and megapacks!</a > <span class="Date">4 February 2013</span> </li> <li> <a href="../../2013/01/02/the-falcons-shriek/index.html" >The falcon's shriek</a > <span class="Date">2 January 2013</span> </li> <li> <a href="../../2012/12/29/what-is-actually-going-on-in-iceland/index.html" >What is actually going on in Iceland</a > <span class="Date">29 December 2012</span> </li> <li> <a href="../../2012/12/25/merry-christmas/index.html" >Merry Christmas!</a > <span class="Date">25 December 2012</span> </li> <li> <a href="../tag-soup/index.html" >Tag soup is history</a > <span class="Date">21 December 2012</span> </li> <li> <a href="https://www.baldurbjarnason.com/notes/schlock/" >Schlock</a > <span class="Date">15 December 2012</span> </li> <li> <a href="../../2012/12/05/strange-definitions-of-nice/index.html" >Strange definitions of 'nice'</a > <span class="Date">5 December 2012</span> </li> <li> <a href="../../2012/12/04/books-of-christmas-past/index.html" >Books of Christmas Past</a > <span class="Date">4 December 2012</span> </li> <li> <a href="../ids-in-css/index.html" >Using IDs in CSS</a > <span class="Date">26 November 2012</span> </li> <li> <a href="../../2012/11/22/design-highlights-from-the-icelandic-book-season/index.html" >Design highlights from the Icelandic book season</a > <span class="Date">22 November 2012</span> </li> <li> <a href="../../2012/11/19/news-updates-and-the-icelandic-book-market/index.html" >News, updates, and the Icelandic book market</a > <span class="Date">19 November 2012</span> </li> <li> <a href="https://www.baldurbjarnason.com/notes/standardisation/" >A response, of sorts</a > <span class="Date">15 November 2012</span> </li> <li> <a href="../../2012/11/08/high-tide-and-a-room-of-your-own/index.html" >High tide and a room of your own</a > <span class="Date">8 November 2012</span> </li> <li> <a href="../../2012/11/06/knights-and-necromancers-2-has-been-released/index.html" >Knights and Necromancers 2 has been released</a > <span class="Date">6 November 2012</span> </li> <li> <a href="../../2012/10/30/the-comment-fiction-challenge-post-mortem/index.html" >The comment-fiction challenge post-mortem</a > <span class="Date">30 October 2012</span> </li> <li> <a href="../../2012/10/29/fantasy-collapse-and-a-sense-of-history/index.html" >Fantasy, Collapse, and a sense of history</a > <span class="Date">29 October 2012</span> </li> <li> <a href="../../2012/10/26/two-questions-on-putting-books-on-the-web/index.html" >Two questions on putting books on the web</a > <span class="Date">26 October 2012</span> </li> <li> <a href="https://www.baldurbjarnason.com/notes/ibooks-30/" >iBooks 3.0</a > <span class="Date">25 October 2012</span> </li> <li> <a href="../../2012/10/22/perceptions-of-society/index.html" >Perceptions of society</a > <span class="Date">22 October 2012</span> </li> <li> <a href="../../2012/10/19/what-ive-been-up-to/index.html" >What I've been up to</a > <span class="Date">19 October 2012</span> </li> <li> <a href="../../2012/10/01/the-readmill-comment-fiction-challenge/index.html" >The Readmill comment fiction challenge</a > <span class="Date">1 October 2012</span> </li> <li> <a href="https://www.baldurbjarnason.com/notes/is-it-safe/" >Is it safe?</a > <span class="Date">27 September 2012</span> </li> <li> <a href="../the-time-work-takes/index.html" >The time work takes</a > <span class="Date">24 September 2012</span> </li> <li> <a href="../../2012/09/21/i-need-your-help/index.html" >I need your help</a > <span class="Date">21 September 2012</span> </li> <li> <a href="../../2012/09/19/designing-the-covers/index.html" >Designing the covers</a > <span class="Date">19 September 2012</span> </li> <li> <a href="../../2012/09/19/free-kindle-version/index.html" >Free Kindle version</a > <span class="Date">19 September 2012</span> </li> <li> <a href="../../2012/09/17/what-is-this/index.html" >What is this?</a > <span class="Date">17 September 2012</span> </li> <li> <a href="../the-stillborn-creature/index.html" >The stillborn creature</a > <span class="Date">1 August 2012</span> </li> <li> <a href="https://www.baldurbjarnason.com/notes/epub-javascript-security/" >EPUB javascript security</a > <span class="Date">27 July 2012</span> </li> <li> <a href="https://www.baldurbjarnason.com/notes/i-be-writing/" >I be writing</a > <span class="Date">21 July 2012</span> </li> <li> <a href="https://www.baldurbjarnason.com/notes/farce/" >Farce</a > <span class="Date">16 July 2012</span> </li> <li> <a href="https://www.baldurbjarnason.com/notes/bad-writing/" >Bad writing</a > <span class="Date">19 June 2012</span> </li> <li> <a href="../points-on-drm/index.html" >A few random points on DRM</a > <span class="Date">7 June 2012</span> </li> <li> <a href="../web-and-ebooks/index.html" >The web and ebooks have little in common</a > <span class="Date">7 May 2012</span> </li> <li> <a href="https://www.baldurbjarnason.com/notes/end-of-ebook-dev/" >The end of ebook development</a > <span class="Date">26 April 2012</span> </li> <li> <a href="../aftermath/index.html" >Aftermath – notes on the Amazon post</a > <span class="Date">20 April 2012</span> </li> <li> <a href="https://www.baldurbjarnason.com/notes/today-is-not-tomorrow/" >Today is not tomorrow (or, how to beat Amazon)</a > <span class="Date">15 April 2012</span> </li> <li> <a href="../bits-and-bobs/index.html" >Bits, bobs, and anecdata</a > <span class="Date">3 April 2012</span> </li> <li> <a href="https://www.baldurbjarnason.com/notes/lessons-in-interactivity/" >Lessons in interactivity</a > <span class="Date">29 March 2012</span> </li> <li> <a href="../hierarchies-of-ebook-design/index.html" >Hierarchies of ebook design</a > <span class="Date">20 March 2012</span> </li> <li> <a href="https://www.baldurbjarnason.com/notes/treat-ebook-developers-as-developers/" >It's time to treat ebook developers as developers</a > <span class="Date">12 March 2012</span> </li> <li> <a href="../code-does-not-change-minds/index.html" >Code doesn't change minds</a > <span class="Date">7 March 2012</span> </li> <li> <a href="https://www.baldurbjarnason.com/notes/amazon-wins/" >Game over, Amazon wins</a > <span class="Date">3 March 2012</span> </li> <li> <a href="../idpf-css-pgt/index.html" >On CSS Page Templates</a > <span class="Date">2 March 2012</span> </li> <li> <a href="https://www.baldurbjarnason.com/notes/javascript-in-ebooks/" >Javascript in ebooks</a > <span class="Date">29 February 2012</span> </li> <li> <a href="../explanatory-windows/index.html" >Explanatory windows</a > <span class="Date">20 February 2012</span> </li> <li> <a href="https://www.baldurbjarnason.com/notes/readium-and-good-intentions/" >Readium and other good intentions</a > <span class="Date">13 February 2012</span> </li> <li> <a href="https://www.baldurbjarnason.com/notes/epub-widgets-and-windows/" >ePub windows and widgets – a proposal</a > <span class="Date">10 February 2012</span> </li> <li> <a href="index.html" >The semantics of ebook widgets</a > <span class="Date">4 February 2012</span> </li> <li> <a href="https://www.baldurbjarnason.com/notes/widgets-javascript/" >iBooks widgets – to javascript or not to javascript</a > <span class="Date">1 February 2012</span> </li> <li> <a href="../what-do-we-want-from-the-kindle/index.html" >What do we want from the Kindle platform?</a > <span class="Date">1 February 2012</span> </li> <li> <a href="https://www.baldurbjarnason.com/notes/disruptive-crap/" >Disruptive crap</a > <span class="Date">27 January 2012</span> </li> <li> <a href="../elsewhere/index.html" >Me, elsewhere</a > <span class="Date">26 January 2012</span> </li> <li> <a href="https://www.baldurbjarnason.com/notes/the-pros-and-cons-of-iBooks-2/" >The pros and cons of the iBooks 2.0 textbook format</a > <span class="Date">21 January 2012</span> </li> <li> <a href="https://www.baldurbjarnason.com/notes/the-ibooks-builtin-widgets/" >The iBooks 2.0 built-in widgets</a > <span class="Date">20 January 2012</span> </li> <li> <a href="https://www.baldurbjarnason.com/notes/the-ibooks-textbook-format/" >The iBooks 2.0 textbook format</a > <span class="Date">19 January 2012</span> </li> <li> <a href="https://www.baldurbjarnason.com/notes/the-publishing-animal/" >The publishing animal</a > <span class="Date">17 January 2012</span> </li> <li> <a href="../A-day-of-innovation-on-the-future-of-the-book/index.html" >A day of innovation on the future of the book</a > <span class="Date">8 December 2011</span> </li> <li> <a href="https://www.baldurbjarnason.com/notes/what-a-publisher-does/" >What a publisher does</a > <span class="Date">30 November 2011</span> </li> <li> <a href="../Design-Pseudoscience/index.html" >Design pseudoscience</a > <span class="Date">8 November 2011</span> </li> <li> <a href="../a-tale-of-three-blog-posts/index.html" >A tale of three blog posts</a > <span class="Date">28 October 2011</span> </li> <li> <a href="https://www.baldurbjarnason.com/notes/css-and-ebook-design/" >CSS and ebook design</a > <span class="Date">24 October 2011</span> </li> <li> <a href="../the-loss-of-ambient-intimacy/index.html" >The loss of ambient intimacy</a > <span class="Date">15 September 2011</span> </li> <li> <a href="../friday-links-and-reading/index.html" >Friday links and reading</a > <span class="Date">26 August 2011</span> </li> <li> <a href="https://www.baldurbjarnason.com/notes/convert-or-engage/" >Convert or engage</a > <span class="Date">4 August 2011</span> </li> <li> <a href="../CSS3-hyphens/index.html" >CSS3 Hyphens</a > <span class="Date">30 July 2011</span> </li> <li> <a href="../just-you-and-the-megacorporation/index.html" >Just you &amp; Google</a > <span class="Date">29 July 2011</span> </li> <li> <a href="../knowledge-is-not-adoption/index.html" >Knowledge is not adoption</a > <span class="Date">24 July 2011</span> </li> <li> <a href="../HTML5-history-api/index.html" >HTML5 history API</a > <span class="Date">23 July 2011</span> </li> <li> <a href="../social-in-the-mind/index.html" >Your friends, in boxes</a > <span class="Date">17 July 2011</span> </li> <li> <a href="../localstorage-and-messaging/index.html" >Localstorage &amp; messaging in ePub</a > <span class="Date">27 January 2011</span> </li> <li> <a href="../javascript-in-epub/index.html" >Javascript in epub</a > <span class="Date">26 January 2011</span> </li> <li> <a href="../an-epub-experiment/index.html" >An epub experiment</a > <span class="Date">25 January 2011</span> </li> <li> <a href="../what-is-an-ebook/index.html" >What is an ebook?</a > <span class="Date">21 December 2010</span> </li> <li> <a href="https://www.baldurbjarnason.com/notes/hypotheses-and-testing/" >Hypotheses and testing</a > <span class="Date">25 October 2010</span> </li> <li> <a href="https://www.baldurbjarnason.com/notes/identifying-publishing-inn/" >Identifying publishing innovators</a > <span class="Date">7 October 2010</span> </li> <li> <a href="https://www.baldurbjarnason.com/notes/on-quality-in-publishing/" >On quality in publishing</a > <span class="Date">7 October 2010</span> </li> <li> <a href="../An-interesting-discussion/index.html" >An interesting discussion</a > <span class="Date">28 June 2010</span> </li> </ul> </main> <div class="Bottom"></div> </body> </html>
31.158913
840
0.631014
7b043d88cc75a0eea7ced95d064130aae5c511f1
139
rb
Ruby
app/models/user.rb
Strycora/phase_two_project
f4633ead03d1f302b6bf132a5e8212ffb38eb7f7
[ "MIT" ]
null
null
null
app/models/user.rb
Strycora/phase_two_project
f4633ead03d1f302b6bf132a5e8212ffb38eb7f7
[ "MIT" ]
null
null
null
app/models/user.rb
Strycora/phase_two_project
f4633ead03d1f302b6bf132a5e8212ffb38eb7f7
[ "MIT" ]
null
null
null
class User < ActiveRecord::Base has_secure_password validates :username, presence: true, uniqueness: true has_many :dragons end
15.444444
55
0.755396
19f5309ef69800382a4e432f5487ae0938fef85b
4,745
dart
Dart
lib/screens/bottom_bar/bottom_bar_ui.dart
Volgograd-Power-Engineering-College/vpec
760ea3771a171799114110eb233c67a5b099b876
[ "Apache-2.0" ]
null
null
null
lib/screens/bottom_bar/bottom_bar_ui.dart
Volgograd-Power-Engineering-College/vpec
760ea3771a171799114110eb233c67a5b099b876
[ "Apache-2.0" ]
1
2021-11-19T19:17:46.000Z
2021-12-01T17:34:16.000Z
lib/screens/bottom_bar/bottom_bar_ui.dart
ShyroTeam/vpec
bdc1a8c5a6d7438be620da93922b6899f341c818
[ "Apache-2.0" ]
null
null
null
import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import '/utils/icons.dart'; import '../announcements/announcements_screen.dart'; import '../lessons_schedule/lessons_schedule_logic.dart'; import '../lessons_schedule/lessons_schedule_screen.dart'; import '../menu/menu_screen.dart'; import '../news/news_screen.dart'; import '../timetable/timetable_tabs/timetable_tabs_screen.dart'; import 'bottom_bar_logic.dart'; class PageStorageUI extends StatelessWidget { const PageStorageUI({ Key? key, }) : super(key: key); // List of screens for navigation static List<Widget> pages = [ const NewsScreenProvider(), const AnnouncementsScreen(), const TimeTableTabs(), ChangeNotifierProvider( create: (_) => LessonsScheduleLogic(), child: const LessonsScheduleScreen()), const MenuScreen(), ]; @override Widget build(BuildContext context) { return Consumer<BottomBarLogic>( builder: (context, storage, child) => PageStorage( child: pages[storage.bottomBarIndex], bucket: PageStorageBucket(), ), ); } } class BottomBarUI extends StatelessWidget { const BottomBarUI({Key? key}) : super(key: key); @override Widget build(BuildContext context) { return Consumer<BottomBarLogic>( builder: (context, storage, child) => BottomNavigationBar( type: BottomNavigationBarType.shifting, currentIndex: storage.bottomBarIndex, onTap: (index) { storage.setIndex(index); }, items: [ BottomNavigationBarItem( backgroundColor: Theme.of(context).bottomNavigationBarTheme.backgroundColor, icon: const Icon(VpecIconPack.news_outline), activeIcon: const Icon(VpecIconPack.news), label: 'События'), BottomNavigationBarItem( backgroundColor: Theme.of(context).bottomNavigationBarTheme.backgroundColor, icon: const Icon(Icons.notifications_outlined), activeIcon: const Icon(Icons.notifications), label: 'Объявления'), BottomNavigationBarItem( backgroundColor: Theme.of(context).bottomNavigationBarTheme.backgroundColor, icon: const Icon(Icons.schedule_outlined), activeIcon: const Icon(Icons.watch_later), label: 'Звонки'), BottomNavigationBarItem( backgroundColor: Theme.of(context).bottomNavigationBarTheme.backgroundColor, icon: const Icon(Icons.dashboard_outlined), activeIcon: const Icon(Icons.dashboard), label: 'Расписание'), BottomNavigationBarItem( backgroundColor: Theme.of(context).bottomNavigationBarTheme.backgroundColor, icon: const Icon(Icons.menu_outlined), activeIcon: const Icon(Icons.menu), label: 'Меню', ), ], ), ); } } class BuildTabletUI extends StatelessWidget { const BuildTabletUI({Key? key}) : super(key: key); @override Widget build(BuildContext context) { return Consumer<BottomBarLogic>( child: const Expanded( child: PageStorageUI(), ), builder: (context, storage, child) => Row( children: [ NavigationRail( groupAlignment: -0.9, selectedIndex: storage.bottomBarIndex, labelType: NavigationRailLabelType.none, onDestinationSelected: (value) => storage.setIndex(value), destinations: const [ NavigationRailDestination( icon: Icon(VpecIconPack.news_outline), selectedIcon: Icon(VpecIconPack.news), label: Text('События'), ), NavigationRailDestination( icon: Icon(Icons.notifications_outlined), selectedIcon: Icon(Icons.notifications), label: Text('Объявления'), ), NavigationRailDestination( icon: Icon(Icons.schedule_outlined), selectedIcon: Icon(Icons.watch_later), label: Text('Звонки'), ), NavigationRailDestination( icon: Icon(Icons.dashboard_outlined), selectedIcon: Icon(Icons.dashboard), label: Text('Расписание'), ), NavigationRailDestination( icon: Icon(Icons.menu_outlined), selectedIcon: Icon(Icons.menu), label: Text('Меню'), ), ], ), child!, ], ), ); } }
33.892857
77
0.598314
800dac400a89147dd194405fcae76a61c4646f0c
1,727
java
Java
wallet/vo/TokenVo.java
MonetChain-Project/MonetChain_Android
6a43ca5b3aae95b71d474d19ba295b538c9e1d87
[ "MIT" ]
2
2018-05-21T01:39:55.000Z
2019-03-22T05:48:10.000Z
wallet/vo/TokenVo.java
MonetChain-Project/MonetBlockchain_Android
6a43ca5b3aae95b71d474d19ba295b538c9e1d87
[ "MIT" ]
null
null
null
wallet/vo/TokenVo.java
MonetChain-Project/MonetBlockchain_Android
6a43ca5b3aae95b71d474d19ba295b538c9e1d87
[ "MIT" ]
null
null
null
package com.lingtuan.firefly.wallet.vo; import org.json.JSONObject; /** * Created on 2018/3/19. * token info */ public class TokenVo { //token img private String tokenPic; //token name private String tokenName; //token info private String tokenInfo; //token number private String tokenNumber; //token price private String tokenPrice; //token total price private String tokenTotalPrice; //token is checked private boolean isChecked; public String getTokenPic() { return tokenPic; } public void setTokenPic(String tokenPic) { this.tokenPic = tokenPic; } public String getTokenName() { return tokenName; } public void setTokenName(String tokenName) { this.tokenName = tokenName; } public String getTokenInfo() { return tokenInfo; } public void setTokenInfo(String tokenInfo) { this.tokenInfo = tokenInfo; } public String getTokenNumber() { return tokenNumber; } public void setTokenNumber(String tokenNumber) { this.tokenNumber = tokenNumber; } public String getTokenPrice() { return tokenPrice; } public void setTokenPrice(String tokenPrice) { this.tokenPrice = tokenPrice; } public String getTokenTotalPrice() { return tokenTotalPrice; } public void setTokenTotalPrice(String tokenTotalPrice) { this.tokenTotalPrice = tokenTotalPrice; } public boolean isChecked() { return isChecked; } public void setChecked(boolean checked) { isChecked = checked; } public TokenVo parse(JSONObject object){ return this; } }
19.625
60
0.639838
80bad5790bdfea9252636455df3096302777880d
1,309
java
Java
src/main/java/com/oven/demo/common/util/LogUtils.java
503612012/demo
a6f3bc2173cf9140bc72aad0ee1474c163f2de7a
[ "Apache-2.0" ]
16
2019-04-25T01:28:18.000Z
2022-02-23T02:00:34.000Z
src/main/java/com/oven/demo/common/util/LogUtils.java
503612012/demo
a6f3bc2173cf9140bc72aad0ee1474c163f2de7a
[ "Apache-2.0" ]
3
2020-11-03T06:01:39.000Z
2022-02-09T22:09:21.000Z
src/main/java/com/oven/demo/common/util/LogUtils.java
503612012/demo
283b19aaa13344001098a4b112a46cdd55a56307
[ "Apache-2.0" ]
4
2019-04-25T08:47:16.000Z
2020-08-25T01:50:32.000Z
package com.oven.demo.common.util; import lombok.extern.slf4j.Slf4j; import java.lang.reflect.Field; /** * 获取对象属性更改日志 * * @author Oven */ @Slf4j public class LogUtils { /** * 获取对象属性更改日志 * * @param oldObj 修改前对象 * @param newObj 修改后对象 */ private static String getChangeInfo(Object oldObj, Object newObj) { try { StringBuilder result = new StringBuilder(); Field[] fields = oldObj.getClass().getDeclaredFields(); boolean isChange = false; for (Field item : fields) { item.setAccessible(true); String oldValue = item.get(oldObj).toString(); String newValue = item.get(newObj).toString(); if (oldValue != null && !oldValue.equals(newValue)) { result.append(item.getName()).append("由[").append(oldValue).append("]改为[").append(newValue).append("]").append(", "); isChange = true; } } if (isChange) { String str = result.toString(); return str.substring(0, str.length() - 2); } return result.toString(); } catch (Exception e) { log.error("获取对象属性更改日志异常:", e); return ""; } } }
27.851064
137
0.521772
477164c83daac03b2df4ee1705f5d9c968bb277a
1,744
lua
Lua
src/IncludedCommands/Fun/play.lua
TheNexusAvenger/Nexus-Admin
38ae3f128b19af023b3fff137e5bfd695675b310
[ "MIT" ]
4
2021-04-08T02:10:44.000Z
2022-03-23T21:34:19.000Z
src/IncludedCommands/Fun/play.lua
TheNexusAvenger/Nexus-Admin
38ae3f128b19af023b3fff137e5bfd695675b310
[ "MIT" ]
4
2020-07-22T20:08:43.000Z
2021-01-06T02:32:01.000Z
src/IncludedCommands/Fun/play.lua
TheNexusAvenger/Nexus-Admin
38ae3f128b19af023b3fff137e5bfd695675b310
[ "MIT" ]
2
2020-07-23T10:05:14.000Z
2021-07-24T21:57:58.000Z
--[[ TheNexusAvenger Implementation of a command. --]] local BaseCommand = require(script.Parent.Parent:WaitForChild("BaseCommand")) local CommonState = require(script.Parent.Parent:WaitForChild("CommonState")) local Command = BaseCommand:Extend() --[[ Creates the command. --]] function Command:__new() self:InitializeSuper("play","FunCommands","Plays music with the given id.") self.Arguments = { { Type = "integer", Name = "AudioId", Description = "Audio id to play.", }, } --Create the audio. CommonState.GlobalAudio = Instance.new("Sound") CommonState.GlobalAudio.Name = "NexusAdmin_GlobalAudio" CommonState.GlobalAudio.Looped = true CommonState.GlobalAudio.Parent = self.Workspace end --[[ Runs the command. --]] function Command:Run(CommandContext,AudioId) self.super:Run(CommandContext) --Get the audio information. local Worked,ProductData = pcall(function() return self.MarketplaceService:GetProductInfo(AudioId) end) if not Worked or not ProductData then self:SendError("Error loading audio "..AudioId..".") return end --Display a message for playing the audio. if ProductData.AssetTypeId ~= 3 then self:SendError(tostring(ProductData.Name.."("..AudioId..") is not an audio.")) return end for _,Player in pairs(self.Players:GetPlayers()) do self.API.Messages:DisplayHint(Player,tostring("Now playing \""..tostring(ProductData.Name).."\" ("..AudioId..").")) end --Play the audio. CommonState.GlobalAudio:Stop() CommonState.GlobalAudio.SoundId = "rbxassetid://"..AudioId CommonState.GlobalAudio:Play() end return Command
26.424242
123
0.668578
c5ad3f5dfed692bba7078c372f7ee86c960f72c6
1,563
swift
Swift
Classes/Application.swift
RockerHX/Devices
9e7f0a69e20171305baf94ca340af1cebfe841d5
[ "MIT" ]
112
2018-04-03T02:03:51.000Z
2021-08-30T09:21:45.000Z
Classes/Application.swift
RockerHX/Devices
9e7f0a69e20171305baf94ca340af1cebfe841d5
[ "MIT" ]
1
2018-09-29T03:03:17.000Z
2018-09-30T01:43:03.000Z
Classes/Application.swift
RockerHX/Devices
9e7f0a69e20171305baf94ca340af1cebfe841d5
[ "MIT" ]
2
2018-04-09T13:49:20.000Z
2018-09-26T02:48:30.000Z
// // Application.swift // Devices // // Created by RockerHX on 2018/4/24. // import Foundation extension Device { public struct Application { enum Key: String { case FirstLanuch = "NotFirstLanuch" } // MARK: - Singleton - public static let shared = Application() // MARK: - Public Property - public private(set) var version: String public private(set) var build: String public private(set) var name: String public private(set) var wholeVersion: String public private(set) var firstLanuch: Bool = true // MARK: - Initialize Methods - fileprivate init() { let infoDictionary = Bundle.main.infoDictionary version = infoDictionary?["CFBundleShortVersionString"] as! String build = infoDictionary?["CFBundleVersion"] as! String if let appName = infoDictionary?["CFBundleDisplayName"] as? String { name = appName } else { name = infoDictionary?["CFBundleName"] as! String } wholeVersion = "\(version) (Build \(build))" let key = Key.FirstLanuch.rawValue let userDefaults = UserDefaults.standard let currentVersion = wholeVersion if let storeVersion = userDefaults.string(forKey: key) { firstLanuch = (currentVersion != storeVersion) } userDefaults.set(currentVersion, forKey: key) userDefaults.synchronize() } } }
28.944444
80
0.586692
d5a9e9282563a60abe74267bd2622cd5c11d95f7
2,206
dart
Dart
lib/misc/AbstractFolderIdWrapper.dart
SaurabhSM/ews
2614ef691f6d672a94f7898be8a33ad6f4fa088e
[ "MIT" ]
null
null
null
lib/misc/AbstractFolderIdWrapper.dart
SaurabhSM/ews
2614ef691f6d672a94f7898be8a33ad6f4fa088e
[ "MIT" ]
null
null
null
lib/misc/AbstractFolderIdWrapper.dart
SaurabhSM/ews
2614ef691f6d672a94f7898be8a33ad6f4fa088e
[ "MIT" ]
null
null
null
/* * Exchange Web Services Managed API * * Copyright (c) Microsoft Corporation * All rights reserved. * * MIT License * * Permission is hereby granted, free of charge, to any person obtaining a copy of this * software and associated documentation files (the "Software"), to deal in the Software * without restriction, including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons * to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or * substantial portions of the Software. * * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ import 'package:ews/Core/EwsServiceXmlWriter.dart'; import 'package:ews/Core/ServiceObjects/Folders/Folder.dart'; import 'package:ews/Enumerations/ExchangeVersion.dart'; /// <summary> /// Represents the abstraction of a folder Id. /// </summary> abstract class AbstractFolderIdWrapper { /// <summary> /// Obtains the Folder object associated with the wrapper. /// </summary> /// <returns>The Folder object associated with the wrapper.</returns> Folder GetFolder() { return null; } /// <summary> /// Initializes a new instance of AbstractFolderIdWrapper. /// </summary> AbstractFolderIdWrapper() {} /// <summary> /// Writes the Id encapsulated in the wrapper to XML. /// </summary> /// <param name="writer">The writer to write the Id to.</param> void WriteToXml(EwsServiceXmlWriter writer); /// <summary> /// Validates folderId against specified version. /// </summary> /// <param name="version">The version.</param> void Validate(ExchangeVersion version) {} }
37.389831
93
0.732548
e91c4c9e09bf4217ac2cd733a068127ac588eb33
280,008
cpp
C++
The-Forge/Common_3/Renderer/Vulkan/Vulkan.cpp
Origamijr/The-Forge
bfdd16c8b00a8a0b5c73af2b031a05578900edab
[ "Apache-2.0" ]
null
null
null
The-Forge/Common_3/Renderer/Vulkan/Vulkan.cpp
Origamijr/The-Forge
bfdd16c8b00a8a0b5c73af2b031a05578900edab
[ "Apache-2.0" ]
null
null
null
The-Forge/Common_3/Renderer/Vulkan/Vulkan.cpp
Origamijr/The-Forge
bfdd16c8b00a8a0b5c73af2b031a05578900edab
[ "Apache-2.0" ]
1
2020-03-06T09:53:01.000Z
2020-03-06T09:53:01.000Z
/* * Copyright (c) 2018-2020 The Forge Interactive Inc. * * This file is part of The-Forge * (see https://github.com/ConfettiFX/The-Forge). * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #ifdef VULKAN #define RENDERER_IMPLEMENTATION #define VMA_IMPLEMENTATION /************************************************************************/ // Debugging Macros /************************************************************************/ // Uncomment this to enable render doc capture support //#define USE_RENDER_DOC // Debug Utils Extension is still WIP and does not work with all Validation Layers // Disable this to use the old debug report and debug marker extensions // Debug Utils requires the Nightly Build of RenderDoc //#define USE_DEBUG_UTILS_EXTENSION /************************************************************************/ /************************************************************************/ #if defined(_WIN32) // Pull in minimal Windows headers #if !defined(NOMINMAX) #define NOMINMAX #endif #if !defined(WIN32_LEAN_AND_MEAN) #define WIN32_LEAN_AND_MEAN #endif #include <Windows.h> #endif #if defined(__linux__) #define stricmp(a, b) strcasecmp(a, b) #define vsprintf_s vsnprintf #define strncpy_s strncpy #endif #if defined(NX64) #include "../../../Switch/Common_3/Renderer/Vulkan/NX/NXVulkan.h" #endif #include "../IRenderer.h" #include "../../ThirdParty/OpenSource/EASTL/functional.h" #include "../../ThirdParty/OpenSource/EASTL/sort.h" #include "../../ThirdParty/OpenSource/EASTL/string_hash_map.h" #include "../../OS/Interfaces/ILog.h" #include "../../ThirdParty/OpenSource/VulkanMemoryAllocator/VulkanMemoryAllocator.h" #include "../../OS/Core/Atomics.h" #include "../../OS/Core/GPUConfig.h" #include "../../ThirdParty/OpenSource/tinyimageformat/tinyimageformat_base.h" #include "../../ThirdParty/OpenSource/tinyimageformat/tinyimageformat_query.h" #include "VulkanCapsBuilder.h" #if defined(VK_USE_DISPATCH_TABLES) && !defined(NX64) #include "../../../Common_3/ThirdParty/OpenSource/volk/volkForgeExt.h" #endif #include "../../OS/Interfaces/IMemory.h" extern void vk_createShaderReflection(const uint8_t* shaderCode, uint32_t shaderSize, ShaderStage shaderStage, ShaderReflection* pOutReflection); #ifdef ENABLE_RAYTRACING extern void addRaytracingPipelineImpl(const RaytracingPipelineDesc*, Pipeline**); extern void vk_FillRaytracingDescriptorData(const AccelerationStructure* pAccelerationStructure, void* pWriteNV); #endif // clang-format off VkBlendOp gVkBlendOpTranslator[BlendMode::MAX_BLEND_MODES] = { VK_BLEND_OP_ADD, VK_BLEND_OP_SUBTRACT, VK_BLEND_OP_REVERSE_SUBTRACT, VK_BLEND_OP_MIN, VK_BLEND_OP_MAX, }; VkBlendFactor gVkBlendConstantTranslator[BlendConstant::MAX_BLEND_CONSTANTS] = { VK_BLEND_FACTOR_ZERO, VK_BLEND_FACTOR_ONE, VK_BLEND_FACTOR_SRC_COLOR, VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR, VK_BLEND_FACTOR_DST_COLOR, VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR, VK_BLEND_FACTOR_SRC_ALPHA, VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA, VK_BLEND_FACTOR_DST_ALPHA, VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA, VK_BLEND_FACTOR_SRC_ALPHA_SATURATE, VK_BLEND_FACTOR_CONSTANT_COLOR, VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR, }; VkCompareOp gVkComparisonFuncTranslator[CompareMode::MAX_COMPARE_MODES] = { VK_COMPARE_OP_NEVER, VK_COMPARE_OP_LESS, VK_COMPARE_OP_EQUAL, VK_COMPARE_OP_LESS_OR_EQUAL, VK_COMPARE_OP_GREATER, VK_COMPARE_OP_NOT_EQUAL, VK_COMPARE_OP_GREATER_OR_EQUAL, VK_COMPARE_OP_ALWAYS, }; VkStencilOp gVkStencilOpTranslator[StencilOp::MAX_STENCIL_OPS] = { VK_STENCIL_OP_KEEP, VK_STENCIL_OP_ZERO, VK_STENCIL_OP_REPLACE, VK_STENCIL_OP_INVERT, VK_STENCIL_OP_INCREMENT_AND_WRAP, VK_STENCIL_OP_DECREMENT_AND_WRAP, VK_STENCIL_OP_INCREMENT_AND_CLAMP, VK_STENCIL_OP_DECREMENT_AND_CLAMP, }; VkCullModeFlagBits gVkCullModeTranslator[CullMode::MAX_CULL_MODES] = { VK_CULL_MODE_NONE, VK_CULL_MODE_BACK_BIT, VK_CULL_MODE_FRONT_BIT }; VkPolygonMode gVkFillModeTranslator[FillMode::MAX_FILL_MODES] = { VK_POLYGON_MODE_FILL, VK_POLYGON_MODE_LINE }; VkFrontFace gVkFrontFaceTranslator[] = { VK_FRONT_FACE_COUNTER_CLOCKWISE, VK_FRONT_FACE_CLOCKWISE }; static const VkFormat gVkFormatTranslator[] = { VK_FORMAT_UNDEFINED, VK_FORMAT_R8_UNORM, VK_FORMAT_R8G8_UNORM, VK_FORMAT_UNDEFINED, // RGB8 not directly supported VK_FORMAT_R8G8B8A8_UNORM, VK_FORMAT_R16_UNORM, VK_FORMAT_R16G16_UNORM, VK_FORMAT_UNDEFINED, // RGB16 not directly supported VK_FORMAT_R16G16B16A16_UNORM, VK_FORMAT_R8_SNORM, VK_FORMAT_R8G8_SNORM, VK_FORMAT_UNDEFINED, // RGB8S not directly supported VK_FORMAT_R8G8B8A8_SNORM, VK_FORMAT_R16_SNORM, VK_FORMAT_R16G16_SNORM, VK_FORMAT_UNDEFINED, // RGB16S not directly supported VK_FORMAT_R16G16B16A16_SNORM, VK_FORMAT_R16_SFLOAT, VK_FORMAT_R16G16_SFLOAT, VK_FORMAT_UNDEFINED, // RGB16F not directly supported VK_FORMAT_R16G16B16A16_SFLOAT, VK_FORMAT_R32_SFLOAT, VK_FORMAT_R32G32_SFLOAT, VK_FORMAT_R32G32B32_SFLOAT, VK_FORMAT_R32G32B32A32_SFLOAT, VK_FORMAT_R16_SINT, VK_FORMAT_R16G16_SINT, VK_FORMAT_UNDEFINED, // RGB16I not directly supported VK_FORMAT_R16G16B16A16_SINT, VK_FORMAT_R32_SINT, VK_FORMAT_R32G32_SINT, VK_FORMAT_R32G32B32_SINT, VK_FORMAT_R32G32B32A32_SINT, VK_FORMAT_R16_UINT, VK_FORMAT_R16G16_UINT, VK_FORMAT_UNDEFINED, // RGB16UI not directly supported VK_FORMAT_R16G16B16A16_UINT, VK_FORMAT_R32_UINT, VK_FORMAT_R32G32_UINT, VK_FORMAT_R32G32B32_UINT, VK_FORMAT_R32G32B32A32_UINT, VK_FORMAT_UNDEFINED, // RGBE8 not directly supported VK_FORMAT_E5B9G9R9_UFLOAT_PACK32, VK_FORMAT_B10G11R11_UFLOAT_PACK32, // order switched in vulkan compared to DX11/12 VK_FORMAT_B5G6R5_UNORM_PACK16, VK_FORMAT_UNDEFINED, // RGBA4 not directly supported VK_FORMAT_A2R10G10B10_UNORM_PACK32,// order switched in vulkan compared to DX11/12 // Depth formats VK_FORMAT_D16_UNORM, VK_FORMAT_D24_UNORM_S8_UINT, VK_FORMAT_D24_UNORM_S8_UINT, VK_FORMAT_D32_SFLOAT, // DXT formats VK_FORMAT_BC1_RGBA_UNORM_BLOCK, VK_FORMAT_BC2_UNORM_BLOCK, VK_FORMAT_BC3_UNORM_BLOCK, VK_FORMAT_BC4_UNORM_BLOCK, VK_FORMAT_BC5_UNORM_BLOCK, // PVR formats VK_FORMAT_UNDEFINED, // PVR_2BPP = 56, VK_FORMAT_UNDEFINED, // PVR_2BPPA = 57, VK_FORMAT_UNDEFINED, // PVR_4BPP = 58, VK_FORMAT_UNDEFINED, // PVR_4BPPA = 59, VK_FORMAT_UNDEFINED, // INTZ = 60, // NVidia hack. Supported on all DX10+ HW // XBox 360 specific fron buffer formats. NOt listed in other renderers. Please, add them when extend this structure. VK_FORMAT_UNDEFINED, // LE_XRGB8 = 61, VK_FORMAT_UNDEFINED, // LE_ARGB8 = 62, VK_FORMAT_UNDEFINED, // LE_X2RGB10 = 63, VK_FORMAT_UNDEFINED, // LE_A2RGB10 = 64, // compressed mobile forms VK_FORMAT_UNDEFINED, // ETC1 = 65, // RGB VK_FORMAT_UNDEFINED, // ATC = 66, // RGB VK_FORMAT_UNDEFINED, // ATCA = 67, // RGBA, explicit alpha VK_FORMAT_UNDEFINED, // ATCI = 68, // RGBA, interpolated alpha VK_FORMAT_UNDEFINED, // RAWZ = 69, //depth only, Nvidia (requires recombination of data) //FIX IT: PS3 as well? VK_FORMAT_UNDEFINED, // DF16 = 70, //depth only, Intel/AMD VK_FORMAT_UNDEFINED, // STENCILONLY = 71, // stencil ony usage // BC formats VK_FORMAT_BC1_RGBA_UNORM_BLOCK, // GNF_BC1 = 72, VK_FORMAT_BC2_UNORM_BLOCK, // GNF_BC2 = 73, VK_FORMAT_BC3_UNORM_BLOCK, // GNF_BC3 = 74, VK_FORMAT_BC4_UNORM_BLOCK, // GNF_BC4 = 75, VK_FORMAT_BC5_UNORM_BLOCK, // GNF_BC5 = 76, VK_FORMAT_BC6H_UFLOAT_BLOCK, // GNF_BC6HUF = 77, VK_FORMAT_BC6H_SFLOAT_BLOCK, // GNF_BC6HSF = 78, VK_FORMAT_BC7_UNORM_BLOCK, // GNF_BC7 = 79, // Reveser Form VK_FORMAT_B8G8R8A8_UNORM, // BGRA8 = 80, // Extend for DXGI VK_FORMAT_X8_D24_UNORM_PACK32, // X8D24PAX32 = 81, VK_FORMAT_S8_UINT, // S8 = 82, VK_FORMAT_D16_UNORM_S8_UINT, // D16S8 = 83, VK_FORMAT_D32_SFLOAT_S8_UINT, // D32S8 = 84, // ASTC formats VK_FORMAT_ASTC_4x4_UNORM_BLOCK, VK_FORMAT_ASTC_5x4_UNORM_BLOCK, VK_FORMAT_ASTC_5x5_UNORM_BLOCK, VK_FORMAT_ASTC_6x5_UNORM_BLOCK, VK_FORMAT_ASTC_6x6_UNORM_BLOCK, VK_FORMAT_ASTC_8x5_UNORM_BLOCK, VK_FORMAT_ASTC_8x6_UNORM_BLOCK, VK_FORMAT_ASTC_8x8_UNORM_BLOCK, VK_FORMAT_ASTC_10x5_UNORM_BLOCK, VK_FORMAT_ASTC_10x6_UNORM_BLOCK, VK_FORMAT_ASTC_10x8_UNORM_BLOCK, VK_FORMAT_ASTC_10x10_UNORM_BLOCK, VK_FORMAT_ASTC_12x10_UNORM_BLOCK, VK_FORMAT_ASTC_12x12_UNORM_BLOCK, }; VkAttachmentLoadOp gVkAttachmentLoadOpTranslator[LoadActionType::MAX_LOAD_ACTION] = { VK_ATTACHMENT_LOAD_OP_DONT_CARE, VK_ATTACHMENT_LOAD_OP_LOAD, VK_ATTACHMENT_LOAD_OP_CLEAR, }; const char* gVkWantedInstanceExtensions[] = { VK_KHR_SURFACE_EXTENSION_NAME, #if defined(VK_USE_PLATFORM_WIN32_KHR) VK_KHR_WIN32_SURFACE_EXTENSION_NAME, #elif defined(VK_USE_PLATFORM_XLIB_KHR) VK_KHR_XLIB_SURFACE_EXTENSION_NAME, #elif defined(VK_USE_PLATFORM_XCB_KHR) VK_KHR_XCB_SURFACE_EXTENSION_NAME, #elif defined(VK_USE_PLATFORM_ANDROID_KHR) VK_KHR_ANDROID_SURFACE_EXTENSION_NAME, #elif defined(VK_USE_PLATFORM_GGP) VK_GGP_STREAM_DESCRIPTOR_SURFACE_EXTENSION_NAME, #elif defined(VK_USE_PLATFORM_VI_NN) VK_NN_VI_SURFACE_EXTENSION_NAME, #endif // Debug utils not supported on all devices yet #ifdef USE_DEBUG_UTILS_EXTENSION VK_EXT_DEBUG_UTILS_EXTENSION_NAME, #else VK_EXT_DEBUG_REPORT_EXTENSION_NAME, #endif VK_NV_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME, // To legally use HDR formats VK_EXT_SWAPCHAIN_COLOR_SPACE_EXTENSION_NAME, /************************************************************************/ // VR Extensions /************************************************************************/ VK_KHR_DISPLAY_EXTENSION_NAME, VK_EXT_DIRECT_MODE_DISPLAY_EXTENSION_NAME, /************************************************************************/ // Multi GPU Extensions /************************************************************************/ #if VK_KHR_device_group_creation VK_KHR_DEVICE_GROUP_CREATION_EXTENSION_NAME, #endif #ifndef NX64 /************************************************************************/ // Property querying extensions /************************************************************************/ VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME, /************************************************************************/ /************************************************************************/ #endif }; const char* gVkWantedDeviceExtensions[] = { VK_KHR_SWAPCHAIN_EXTENSION_NAME, VK_KHR_MAINTENANCE1_EXTENSION_NAME, VK_KHR_SHADER_DRAW_PARAMETERS_EXTENSION_NAME, VK_EXT_SHADER_SUBGROUP_BALLOT_EXTENSION_NAME, VK_EXT_SHADER_SUBGROUP_VOTE_EXTENSION_NAME, VK_KHR_DEDICATED_ALLOCATION_EXTENSION_NAME, VK_KHR_GET_MEMORY_REQUIREMENTS_2_EXTENSION_NAME, #ifdef USE_EXTERNAL_MEMORY_EXTENSIONS VK_KHR_EXTERNAL_MEMORY_EXTENSION_NAME, VK_KHR_EXTERNAL_SEMAPHORE_EXTENSION_NAME, VK_KHR_EXTERNAL_FENCE_EXTENSION_NAME, #if defined(VK_USE_PLATFORM_WIN32_KHR) VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME, VK_KHR_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME, VK_KHR_EXTERNAL_FENCE_WIN32_EXTENSION_NAME, #endif #endif // Debug marker extension in case debug utils is not supported #ifndef USE_DEBUG_UTILS_EXTENSION VK_EXT_DEBUG_MARKER_EXTENSION_NAME, #endif #if defined(VK_USE_PLATFORM_GGP) VK_GGP_FRAME_TOKEN_EXTENSION_NAME, #endif #if VK_KHR_draw_indirect_count VK_KHR_DRAW_INDIRECT_COUNT_EXTENSION_NAME, #endif // Fragment shader interlock extension to be used for ROV type functionality in Vulkan #if VK_EXT_fragment_shader_interlock VK_EXT_FRAGMENT_SHADER_INTERLOCK_EXTENSION_NAME, #endif /************************************************************************/ // NVIDIA Specific Extensions /************************************************************************/ #ifdef USE_NV_EXTENSIONS VK_NVX_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME, #endif /************************************************************************/ // AMD Specific Extensions /************************************************************************/ VK_AMD_DRAW_INDIRECT_COUNT_EXTENSION_NAME, VK_AMD_SHADER_BALLOT_EXTENSION_NAME, VK_AMD_GCN_SHADER_EXTENSION_NAME, /************************************************************************/ // Multi GPU Extensions /************************************************************************/ #if VK_KHR_device_group VK_KHR_DEVICE_GROUP_EXTENSION_NAME, #endif /************************************************************************/ // Bindless & None Uniform access Extensions /************************************************************************/ VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME, /************************************************************************/ // Descriptor Update Template Extension for efficient descriptor set updates /************************************************************************/ VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_EXTENSION_NAME, /************************************************************************/ // Raytracing /************************************************************************/ #ifdef ENABLE_RAYTRACING VK_NV_RAY_TRACING_EXTENSION_NAME, #endif /************************************************************************/ /************************************************************************/ }; // clang-format on #ifdef USE_DEBUG_UTILS_EXTENSION static bool gDebugUtilsExtension = false; #endif static bool gRenderDocLayerEnabled = false; static bool gDedicatedAllocationExtension = false; static bool gExternalMemoryExtension = false; static bool gDrawIndirectCountExtension = false; static bool gDeviceGroupCreationExtension = false; static bool gDescriptorIndexingExtension = false; static bool gAMDDrawIndirectCountExtension = false; static bool gAMDGCNShaderExtension = false; static bool gNVRayTracingExtension = false; static bool gDebugMarkerSupport = false; #if defined(VK_KHR_DRAW_INDIRECT_COUNT_EXTENSION_NAME) PFN_vkCmdDrawIndirectCountKHR pfnVkCmdDrawIndirectCountKHR = NULL; PFN_vkCmdDrawIndexedIndirectCountKHR pfnVkCmdDrawIndexedIndirectCountKHR = NULL; #else PFN_vkCmdDrawIndirectCountAMD pfnVkCmdDrawIndirectCountKHR = NULL; PFN_vkCmdDrawIndexedIndirectCountAMD pfnVkCmdDrawIndexedIndirectCountKHR = NULL; #endif /************************************************************************/ // IMPLEMENTATION /************************************************************************/ #if defined(RENDERER_IMPLEMENTATION) #if !defined(VK_USE_DISPATCH_TABLES) #ifdef _MSC_VER #pragma comment(lib, "vulkan-1.lib") #endif #endif #define SAFE_FREE(p_var) \ if (p_var) \ { \ conf_free((void*)p_var); \ } #if defined(__cplusplus) #define DECLARE_ZERO(type, var) type var = {}; #else #define DECLARE_ZERO(type, var) type var = { 0 }; #endif // Internal utility functions (may become external one day) VkSampleCountFlagBits util_to_vk_sample_count(SampleCount sampleCount); // clang-format off API_INTERFACE void FORGE_CALLCONV addBuffer(Renderer* pRenderer, const BufferDesc* pDesc, Buffer** pp_buffer); API_INTERFACE void FORGE_CALLCONV removeBuffer(Renderer* pRenderer, Buffer* pBuffer); API_INTERFACE void FORGE_CALLCONV addTexture(Renderer* pRenderer, const TextureDesc* pDesc, Texture** ppTexture); API_INTERFACE void FORGE_CALLCONV removeTexture(Renderer* pRenderer, Texture* pTexture); API_INTERFACE void FORGE_CALLCONV mapBuffer(Renderer* pRenderer, Buffer* pBuffer, ReadRange* pRange); API_INTERFACE void FORGE_CALLCONV unmapBuffer(Renderer* pRenderer, Buffer* pBuffer); API_INTERFACE void FORGE_CALLCONV cmdUpdateBuffer(Cmd* pCmd, Buffer* pBuffer, uint64_t dstOffset, Buffer* pSrcBuffer, uint64_t srcOffset, uint64_t size); API_INTERFACE void FORGE_CALLCONV cmdUpdateSubresource(Cmd* pCmd, Texture* pTexture, Buffer* pSrcBuffer, SubresourceDataDesc* pSubresourceDesc); // clang-format on //+1 for Acceleration Structure because it is not counted by VK_DESCRIPTOR_TYPE_RANGE_SIZE #define CONF_DESCRIPTOR_TYPE_RANGE_SIZE (VK_DESCRIPTOR_TYPE_RANGE_SIZE + 1) static uint32_t gDescriptorTypeRangeSize = VK_DESCRIPTOR_TYPE_RANGE_SIZE; static void removeVirtualTexture(Renderer* pRenderer, VirtualTexture* pTexture); /************************************************************************/ // DescriptorInfo Heap Structures /************************************************************************/ /// CPU Visible Heap to store all the resources needing CPU read / write operations - Textures/Buffers/RTV typedef struct DescriptorPool { VkDevice pDevice; VkDescriptorPool pCurrentPool; VkDescriptorPoolSize* pPoolSizes; eastl::vector<VkDescriptorPool> mDescriptorPools; uint32_t mPoolSizeCount; uint32_t mNumDescriptorSets; uint32_t mUsedDescriptorSetCount; VkDescriptorPoolCreateFlags mFlags; Mutex* pMutex; } DescriptorPool; /************************************************************************/ // Static DescriptorInfo Heap Implementation /************************************************************************/ static void add_descriptor_pool( Renderer* pRenderer, uint32_t numDescriptorSets, VkDescriptorPoolCreateFlags flags, VkDescriptorPoolSize* pPoolSizes, uint32_t numPoolSizes, DescriptorPool** ppPool) { DescriptorPool* pPool = (DescriptorPool*)conf_calloc(1, sizeof(*pPool)); pPool->mFlags = flags; pPool->mNumDescriptorSets = numDescriptorSets; pPool->mUsedDescriptorSetCount = 0; pPool->pDevice = pRenderer->pVkDevice; pPool->pMutex = (Mutex*)conf_calloc(1, sizeof(Mutex)); pPool->pMutex->Init(); pPool->mPoolSizeCount = numPoolSizes; pPool->pPoolSizes = (VkDescriptorPoolSize*)conf_calloc(numPoolSizes, sizeof(VkDescriptorPoolSize)); for (uint32_t i = 0; i < numPoolSizes; ++i) pPool->pPoolSizes[i] = pPoolSizes[i]; VkDescriptorPoolCreateInfo poolCreateInfo = {}; poolCreateInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO; poolCreateInfo.pNext = NULL; poolCreateInfo.poolSizeCount = numPoolSizes; poolCreateInfo.pPoolSizes = pPoolSizes; poolCreateInfo.flags = flags; poolCreateInfo.maxSets = numDescriptorSets; VkResult res = vkCreateDescriptorPool(pPool->pDevice, &poolCreateInfo, NULL, &pPool->pCurrentPool); ASSERT(VK_SUCCESS == res); pPool->mDescriptorPools.emplace_back(pPool->pCurrentPool); *ppPool = pPool; } static void reset_descriptor_pool(DescriptorPool* pPool) { VkResult res = vkResetDescriptorPool(pPool->pDevice, pPool->pCurrentPool, pPool->mFlags); pPool->mUsedDescriptorSetCount = 0; ASSERT(VK_SUCCESS == res); } static void remove_descriptor_pool(Renderer* pRenderer, DescriptorPool* pPool) { for (uint32_t i = 0; i < (uint32_t)pPool->mDescriptorPools.size(); ++i) vkDestroyDescriptorPool(pRenderer->pVkDevice, pPool->mDescriptorPools[i], NULL); pPool->mDescriptorPools.~vector(); pPool->pMutex->Destroy(); conf_free(pPool->pMutex); SAFE_FREE(pPool->pPoolSizes); SAFE_FREE(pPool); } static void consume_descriptor_sets(DescriptorPool* pPool, const VkDescriptorSetLayout* pLayouts, VkDescriptorSet** pSets, uint32_t numDescriptorSets) { // Need a lock since vkAllocateDescriptorSets needs to be externally synchronized // This is fine since this will only happen during Init time MutexLock lock(*pPool->pMutex); DECLARE_ZERO(VkDescriptorSetAllocateInfo, alloc_info); alloc_info.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO; alloc_info.pNext = NULL; alloc_info.descriptorPool = pPool->pCurrentPool; alloc_info.descriptorSetCount = numDescriptorSets; alloc_info.pSetLayouts = pLayouts; VkResult vk_res = vkAllocateDescriptorSets(pPool->pDevice, &alloc_info, *pSets); if (VK_SUCCESS != vk_res) { VkDescriptorPool pDescriptorPool = VK_NULL_HANDLE; VkDescriptorPoolCreateInfo poolCreateInfo = {}; poolCreateInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO; poolCreateInfo.pNext = NULL; poolCreateInfo.poolSizeCount = pPool->mPoolSizeCount; poolCreateInfo.pPoolSizes = pPool->pPoolSizes; poolCreateInfo.flags = pPool->mFlags; poolCreateInfo.maxSets = pPool->mNumDescriptorSets; VkResult res = vkCreateDescriptorPool(pPool->pDevice, &poolCreateInfo, NULL, &pDescriptorPool); ASSERT(VK_SUCCESS == res); pPool->mDescriptorPools.emplace_back(pDescriptorPool); pPool->pCurrentPool = pDescriptorPool; pPool->mUsedDescriptorSetCount = 0; alloc_info.descriptorPool = pPool->pCurrentPool; vk_res = vkAllocateDescriptorSets(pPool->pDevice, &alloc_info, *pSets); } ASSERT(VK_SUCCESS == vk_res); pPool->mUsedDescriptorSetCount += numDescriptorSets; } /************************************************************************/ /************************************************************************/ VkPipelineBindPoint gPipelineBindPoint[PIPELINE_TYPE_COUNT] = { VK_PIPELINE_BIND_POINT_MAX_ENUM, VK_PIPELINE_BIND_POINT_COMPUTE, VK_PIPELINE_BIND_POINT_GRAPHICS, #ifdef ENABLE_RAYTRACING VK_PIPELINE_BIND_POINT_RAY_TRACING_NV #endif }; using DescriptorNameToIndexMap = eastl::string_hash_map<uint32_t>; union DescriptorUpdateData { VkDescriptorImageInfo mImageInfo; VkDescriptorBufferInfo mBufferInfo; VkBufferView mBuferView; }; struct SizeOffset { uint32_t mSize; uint32_t mOffset; }; /************************************************************************/ // Descriptor Set Structure /************************************************************************/ typedef struct DescriptorIndexMap { eastl::string_hash_map<uint32_t> mMap; } DescriptorIndexMap; static const DescriptorInfo* get_descriptor(const RootSignature* pRootSignature, const char* pResName) { DescriptorNameToIndexMap::const_iterator it = pRootSignature->pDescriptorNameToIndexMap->mMap.find(pResName); if (it != pRootSignature->pDescriptorNameToIndexMap->mMap.end()) { return &pRootSignature->pDescriptors[it->second]; } else { LOGF(LogLevel::eERROR, "Invalid descriptor param (%s)", pResName); return NULL; } } /************************************************************************/ // Render Pass Implementation /************************************************************************/ typedef struct RenderPassDesc { TinyImageFormat* pColorFormats; const LoadActionType* pLoadActionsColor; bool* pSrgbValues; uint32_t mRenderTargetCount; SampleCount mSampleCount; TinyImageFormat mDepthStencilFormat; LoadActionType mLoadActionDepth; LoadActionType mLoadActionStencil; } RenderPassDesc; typedef struct RenderPass { VkRenderPass pRenderPass; RenderPassDesc mDesc; } RenderPass; typedef struct FrameBufferDesc { RenderPass* pRenderPass; RenderTarget** ppRenderTargets; RenderTarget* pDepthStencil; uint32_t* pColorArraySlices; uint32_t* pColorMipSlices; uint32_t mDepthArraySlice; uint32_t mDepthMipSlice; uint32_t mRenderTargetCount; } FrameBufferDesc; typedef struct FrameBuffer { VkFramebuffer pFramebuffer; uint32_t mWidth; uint32_t mHeight; uint32_t mArraySize; } FrameBuffer; static void add_render_pass(Renderer* pRenderer, const RenderPassDesc* pDesc, RenderPass** ppRenderPass) { RenderPass* pRenderPass = (RenderPass*)conf_calloc(1, sizeof(*pRenderPass)); pRenderPass->mDesc = *pDesc; /************************************************************************/ // Add render pass /************************************************************************/ ASSERT(VK_NULL_HANDLE != pRenderer->pVkDevice); uint32_t colorAttachmentCount = pDesc->mRenderTargetCount; uint32_t depthAttachmentCount = (pDesc->mDepthStencilFormat != TinyImageFormat_UNDEFINED) ? 1 : 0; VkAttachmentDescription* attachments = NULL; VkAttachmentReference* color_attachment_refs = NULL; VkAttachmentReference* depth_stencil_attachment_ref = NULL; VkSampleCountFlagBits sample_count = util_to_vk_sample_count(pDesc->mSampleCount); // Fill out attachment descriptions and references { attachments = (VkAttachmentDescription*)conf_calloc(colorAttachmentCount + depthAttachmentCount, sizeof(*attachments)); ASSERT(attachments); if (colorAttachmentCount > 0) { color_attachment_refs = (VkAttachmentReference*)conf_calloc(colorAttachmentCount, sizeof(*color_attachment_refs)); ASSERT(color_attachment_refs); } if (depthAttachmentCount > 0) { depth_stencil_attachment_ref = (VkAttachmentReference*)conf_calloc(1, sizeof(*depth_stencil_attachment_ref)); ASSERT(depth_stencil_attachment_ref); } // Color for (uint32_t i = 0; i < colorAttachmentCount; ++i) { const uint32_t ssidx = i; // descriptions attachments[ssidx].flags = 0; attachments[ssidx].format = (VkFormat)TinyImageFormat_ToVkFormat(pDesc->pColorFormats[i]); attachments[ssidx].samples = sample_count; attachments[ssidx].loadOp = pDesc->pLoadActionsColor ? gVkAttachmentLoadOpTranslator[pDesc->pLoadActionsColor[i]] : VK_ATTACHMENT_LOAD_OP_DONT_CARE; attachments[ssidx].storeOp = VK_ATTACHMENT_STORE_OP_STORE; attachments[ssidx].stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE; attachments[ssidx].stencilStoreOp = VK_ATTACHMENT_STORE_OP_STORE; attachments[ssidx].initialLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL; attachments[ssidx].finalLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL; // references color_attachment_refs[i].attachment = ssidx; color_attachment_refs[i].layout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL; } } // Depth stencil if (depthAttachmentCount > 0) { uint32_t idx = colorAttachmentCount; attachments[idx].flags = 0; attachments[idx].format = (VkFormat) TinyImageFormat_ToVkFormat(pDesc->mDepthStencilFormat); attachments[idx].samples = sample_count; attachments[idx].loadOp = gVkAttachmentLoadOpTranslator[pDesc->mLoadActionDepth]; attachments[idx].storeOp = VK_ATTACHMENT_STORE_OP_STORE; attachments[idx].stencilLoadOp = gVkAttachmentLoadOpTranslator[pDesc->mLoadActionStencil]; attachments[idx].stencilStoreOp = VK_ATTACHMENT_STORE_OP_STORE; attachments[idx].initialLayout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL; attachments[idx].finalLayout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL; depth_stencil_attachment_ref[0].attachment = idx; depth_stencil_attachment_ref[0].layout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL; } DECLARE_ZERO(VkSubpassDescription, subpass); subpass.flags = 0; subpass.pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS; subpass.inputAttachmentCount = 0; subpass.pInputAttachments = NULL; subpass.colorAttachmentCount = colorAttachmentCount; subpass.pColorAttachments = color_attachment_refs; subpass.pResolveAttachments = NULL; subpass.pDepthStencilAttachment = depth_stencil_attachment_ref; subpass.preserveAttachmentCount = 0; subpass.pPreserveAttachments = NULL; uint32_t attachment_count = colorAttachmentCount; attachment_count += depthAttachmentCount; DECLARE_ZERO(VkRenderPassCreateInfo, create_info); create_info.sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO; create_info.pNext = NULL; create_info.flags = 0; create_info.attachmentCount = attachment_count; create_info.pAttachments = attachments; create_info.subpassCount = 1; create_info.pSubpasses = &subpass; create_info.dependencyCount = 0; create_info.pDependencies = NULL; VkResult vk_res = vkCreateRenderPass(pRenderer->pVkDevice, &create_info, NULL, &(pRenderPass->pRenderPass)); ASSERT(VK_SUCCESS == vk_res); SAFE_FREE(attachments); SAFE_FREE(color_attachment_refs); SAFE_FREE(depth_stencil_attachment_ref); *ppRenderPass = pRenderPass; } static void remove_render_pass(Renderer* pRenderer, RenderPass* pRenderPass) { vkDestroyRenderPass(pRenderer->pVkDevice, pRenderPass->pRenderPass, NULL); SAFE_FREE(pRenderPass); } static void add_framebuffer(Renderer* pRenderer, const FrameBufferDesc* pDesc, FrameBuffer** ppFrameBuffer) { ASSERT(VK_NULL_HANDLE != pRenderer->pVkDevice); FrameBuffer* pFrameBuffer = (FrameBuffer*)conf_calloc(1, sizeof(*pFrameBuffer)); ASSERT(pFrameBuffer); uint32_t colorAttachmentCount = pDesc->mRenderTargetCount; uint32_t depthAttachmentCount = (pDesc->pDepthStencil) ? 1 : 0; if (colorAttachmentCount) { pFrameBuffer->mWidth = pDesc->ppRenderTargets[0]->mWidth; pFrameBuffer->mHeight = pDesc->ppRenderTargets[0]->mHeight; if (pDesc->pColorArraySlices) pFrameBuffer->mArraySize = 1; else pFrameBuffer->mArraySize = pDesc->ppRenderTargets[0]->mArraySize; } else { pFrameBuffer->mWidth = pDesc->pDepthStencil->mWidth; pFrameBuffer->mHeight = pDesc->pDepthStencil->mHeight; if (pDesc->mDepthArraySlice != -1) pFrameBuffer->mArraySize = 1; else pFrameBuffer->mArraySize = pDesc->pDepthStencil->mArraySize; } /************************************************************************/ // Add frame buffer /************************************************************************/ uint32_t attachment_count = colorAttachmentCount; attachment_count += depthAttachmentCount; VkImageView* pImageViews = (VkImageView*)conf_calloc(attachment_count, sizeof(*pImageViews)); ASSERT(pImageViews); VkImageView* iter_attachments = pImageViews; // Color for (uint32_t i = 0; i < pDesc->mRenderTargetCount; ++i) { if (!pDesc->pColorMipSlices && !pDesc->pColorArraySlices) { *iter_attachments = pDesc->ppRenderTargets[i]->pVkDescriptor; ++iter_attachments; } else { uint32_t handle = 0; if (pDesc->pColorMipSlices) { if (pDesc->pColorArraySlices) handle = pDesc->pColorMipSlices[i] * pDesc->ppRenderTargets[i]->mArraySize + pDesc->pColorArraySlices[i]; else handle = pDesc->pColorMipSlices[i]; } else if (pDesc->pColorArraySlices) { handle = pDesc->pColorArraySlices[i]; } *iter_attachments = pDesc->ppRenderTargets[i]->pVkSliceDescriptors[handle]; ++iter_attachments; } } // Depth/stencil if (pDesc->pDepthStencil) { if (-1 == pDesc->mDepthMipSlice && -1 == pDesc->mDepthArraySlice) { *iter_attachments = pDesc->pDepthStencil->pVkDescriptor; ++iter_attachments; } else { uint32_t handle = 0; if (pDesc->mDepthMipSlice != -1) { if (pDesc->mDepthArraySlice != -1) handle = pDesc->mDepthMipSlice * pDesc->pDepthStencil->mArraySize + pDesc->mDepthArraySlice; else handle = pDesc->mDepthMipSlice; } else if (pDesc->mDepthArraySlice != -1) { handle = pDesc->mDepthArraySlice; } *iter_attachments = pDesc->pDepthStencil->pVkSliceDescriptors[handle]; ++iter_attachments; } } DECLARE_ZERO(VkFramebufferCreateInfo, add_info); add_info.sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO; add_info.pNext = NULL; add_info.flags = 0; add_info.renderPass = pDesc->pRenderPass->pRenderPass; add_info.attachmentCount = attachment_count; add_info.pAttachments = pImageViews; add_info.width = pFrameBuffer->mWidth; add_info.height = pFrameBuffer->mHeight; add_info.layers = pFrameBuffer->mArraySize; VkResult vk_res = vkCreateFramebuffer(pRenderer->pVkDevice, &add_info, NULL, &(pFrameBuffer->pFramebuffer)); ASSERT(VK_SUCCESS == vk_res); SAFE_FREE(pImageViews); /************************************************************************/ /************************************************************************/ *ppFrameBuffer = pFrameBuffer; } static void remove_framebuffer(Renderer* pRenderer, FrameBuffer* pFrameBuffer) { ASSERT(pRenderer); ASSERT(pFrameBuffer); vkDestroyFramebuffer(pRenderer->pVkDevice, pFrameBuffer->pFramebuffer, NULL); SAFE_FREE(pFrameBuffer); } /************************************************************************/ // Per Thread Render Pass synchronization logic /************************************************************************/ /// Render-passes are not exposed to the app code since they are not available on all apis /// This map takes care of hashing a render pass based on the render targets passed to cmdBeginRender using RenderPassMap = eastl::hash_map<uint64_t, struct RenderPass*>; using RenderPassMapNode = RenderPassMap::value_type; using RenderPassMapIt = RenderPassMap::iterator; using FrameBufferMap = eastl::hash_map<uint64_t, struct FrameBuffer*>; using FrameBufferMapNode = FrameBufferMap::value_type; using FrameBufferMapIt = FrameBufferMap::iterator; // RenderPass map per thread (this will make lookups lock free and we only need a lock when inserting a RenderPass Map for the first time) eastl::hash_map<ThreadID, RenderPassMap>* gRenderPassMap; // FrameBuffer map per thread (this will make lookups lock free and we only need a lock when inserting a FrameBuffer map for the first time) eastl::hash_map<ThreadID, FrameBufferMap>* gFrameBufferMap; Mutex* pRenderPassMutex; static RenderPassMap& get_render_pass_map() { eastl::hash_map<ThreadID, RenderPassMap>::iterator it = gRenderPassMap->find(Thread::GetCurrentThreadID()); if (it == gRenderPassMap->end()) { // Only need a lock when creating a new renderpass map for this thread MutexLock lock(*pRenderPassMutex); return gRenderPassMap->insert(Thread::GetCurrentThreadID()).first->second; } else { return it->second; } } static FrameBufferMap& get_frame_buffer_map() { eastl::hash_map<ThreadID, FrameBufferMap>::iterator it = gFrameBufferMap->find(Thread::GetCurrentThreadID()); if (it == gFrameBufferMap->end()) { // Only need a lock when creating a new framebuffer map for this thread MutexLock lock(*pRenderPassMutex); return gFrameBufferMap->insert(Thread::GetCurrentThreadID()).first->second; } else { return it->second; } } /************************************************************************/ // Logging, Validation layer implementation /************************************************************************/ // Proxy log callback static void internal_log(LogType type, const char* msg, const char* component) { #ifndef NX64 switch (type) { case LOG_TYPE_INFO: LOGF(LogLevel::eINFO, "%s ( %s )", component, msg); break; case LOG_TYPE_WARN: LOGF(LogLevel::eWARNING, "%s ( %s )", component, msg); break; case LOG_TYPE_DEBUG: LOGF(LogLevel::eDEBUG, "%s ( %s )", component, msg); break; case LOG_TYPE_ERROR: LOGF(LogLevel::eERROR, "%s ( %s )", component, msg); break; default: break; } #endif } #ifdef USE_DEBUG_UTILS_EXTENSION // Debug callback for Vulkan layers static VkBool32 VKAPI_PTR internal_debug_report_callback( VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, VkDebugUtilsMessageTypeFlagsEXT messageType, const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData, void* pUserData) { const char* pLayerPrefix = pCallbackData->pMessageIdName; const char* pMessage = pCallbackData->pMessage; int32_t messageCode = pCallbackData->messageIdNumber; if (messageSeverity & VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT) { LOGF(LogLevel::eINFO, "[%s] : %s (%i)", pLayerPrefix, pMessage, messageCode); } else if (messageSeverity & VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT) { // Code 64 is vkCmdClearAttachments issued before any draws // We ignore this since we dont use load store actions // Instead we clear the attachments in the DirectX way if (messageCode == 64) return VK_FALSE; LOGF(LogLevel::eWARNING, "[%s] : %s (%i)", pLayerPrefix, pMessage, messageCode); } else if (messageSeverity & VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT) { LOGF(LogLevel::eERROR, "[%s] : %s (%i)", pLayerPrefix, pMessage, messageCode); } return VK_FALSE; } #else static VKAPI_ATTR VkBool32 VKAPI_CALL internal_debug_report_callback( VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objectType, uint64_t object, size_t location, int32_t messageCode, const char* pLayerPrefix, const char* pMessage, void* pUserData) { if (flags & VK_DEBUG_REPORT_INFORMATION_BIT_EXT) { LOGF(LogLevel::eINFO, "[%s] : %s (%i)", pLayerPrefix, pMessage, messageCode); } else if (flags & VK_DEBUG_REPORT_WARNING_BIT_EXT) { LOGF(LogLevel::eWARNING, "[%s] : %s (%i)", pLayerPrefix, pMessage, messageCode); } else if (flags & VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT) { LOGF(LogLevel::eWARNING, "[%s] : %s (%i)", pLayerPrefix, pMessage, messageCode); } else if (flags & VK_DEBUG_REPORT_ERROR_BIT_EXT) { LOGF(LogLevel::eERROR, "[%s] : %s (%i)", pLayerPrefix, pMessage, messageCode); } return VK_FALSE; } #endif /************************************************************************/ /************************************************************************/ static inline VkPipelineColorBlendStateCreateInfo util_to_blend_desc(const BlendStateDesc* pDesc, VkPipelineColorBlendAttachmentState* pAttachments) { int blendDescIndex = 0; #ifdef _DEBUG for (int i = 0; i < MAX_RENDER_TARGET_ATTACHMENTS; ++i) { if (pDesc->mRenderTargetMask & (1 << i)) { ASSERT(pDesc->mSrcFactors[blendDescIndex] < BlendConstant::MAX_BLEND_CONSTANTS); ASSERT(pDesc->mDstFactors[blendDescIndex] < BlendConstant::MAX_BLEND_CONSTANTS); ASSERT(pDesc->mSrcAlphaFactors[blendDescIndex] < BlendConstant::MAX_BLEND_CONSTANTS); ASSERT(pDesc->mDstAlphaFactors[blendDescIndex] < BlendConstant::MAX_BLEND_CONSTANTS); ASSERT(pDesc->mBlendModes[blendDescIndex] < BlendMode::MAX_BLEND_MODES); ASSERT(pDesc->mBlendAlphaModes[blendDescIndex] < BlendMode::MAX_BLEND_MODES); } if (pDesc->mIndependentBlend) ++blendDescIndex; } blendDescIndex = 0; #endif for (int i = 0; i < MAX_RENDER_TARGET_ATTACHMENTS; ++i) { if (pDesc->mRenderTargetMask & (1 << i)) { VkBool32 blendEnable = (gVkBlendConstantTranslator[pDesc->mSrcFactors[blendDescIndex]] != VK_BLEND_FACTOR_ONE || gVkBlendConstantTranslator[pDesc->mDstFactors[blendDescIndex]] != VK_BLEND_FACTOR_ZERO || gVkBlendConstantTranslator[pDesc->mSrcAlphaFactors[blendDescIndex]] != VK_BLEND_FACTOR_ONE || gVkBlendConstantTranslator[pDesc->mDstAlphaFactors[blendDescIndex]] != VK_BLEND_FACTOR_ZERO); pAttachments[i].blendEnable = blendEnable; pAttachments[i].colorWriteMask = pDesc->mMasks[blendDescIndex]; pAttachments[i].srcColorBlendFactor = gVkBlendConstantTranslator[pDesc->mSrcFactors[blendDescIndex]]; pAttachments[i].dstColorBlendFactor = gVkBlendConstantTranslator[pDesc->mDstFactors[blendDescIndex]]; pAttachments[i].colorBlendOp = gVkBlendOpTranslator[pDesc->mBlendModes[blendDescIndex]]; pAttachments[i].srcAlphaBlendFactor = gVkBlendConstantTranslator[pDesc->mSrcAlphaFactors[blendDescIndex]]; pAttachments[i].dstAlphaBlendFactor = gVkBlendConstantTranslator[pDesc->mDstAlphaFactors[blendDescIndex]]; pAttachments[i].alphaBlendOp = gVkBlendOpTranslator[pDesc->mBlendAlphaModes[blendDescIndex]]; } if (pDesc->mIndependentBlend) ++blendDescIndex; } VkPipelineColorBlendStateCreateInfo cb = {}; cb.sType = VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO; cb.pNext = NULL; cb.flags = 0; cb.logicOpEnable = VK_FALSE; cb.logicOp = VK_LOGIC_OP_CLEAR; cb.pAttachments = pAttachments; cb.blendConstants[0] = 0.0f; cb.blendConstants[1] = 0.0f; cb.blendConstants[2] = 0.0f; cb.blendConstants[3] = 0.0f; return cb; } static inline VkPipelineDepthStencilStateCreateInfo util_to_depth_desc(const DepthStateDesc* pDesc) { ASSERT(pDesc->mDepthFunc < CompareMode::MAX_COMPARE_MODES); ASSERT(pDesc->mStencilFrontFunc < CompareMode::MAX_COMPARE_MODES); ASSERT(pDesc->mStencilFrontFail < StencilOp::MAX_STENCIL_OPS); ASSERT(pDesc->mDepthFrontFail < StencilOp::MAX_STENCIL_OPS); ASSERT(pDesc->mStencilFrontPass < StencilOp::MAX_STENCIL_OPS); ASSERT(pDesc->mStencilBackFunc < CompareMode::MAX_COMPARE_MODES); ASSERT(pDesc->mStencilBackFail < StencilOp::MAX_STENCIL_OPS); ASSERT(pDesc->mDepthBackFail < StencilOp::MAX_STENCIL_OPS); ASSERT(pDesc->mStencilBackPass < StencilOp::MAX_STENCIL_OPS); VkPipelineDepthStencilStateCreateInfo ds = {}; ds.sType = VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO; ds.pNext = NULL; ds.flags = 0; ds.depthTestEnable = pDesc->mDepthTest ? VK_TRUE : VK_FALSE; ds.depthWriteEnable = pDesc->mDepthWrite ? VK_TRUE : VK_FALSE; ds.depthCompareOp = gVkComparisonFuncTranslator[pDesc->mDepthFunc]; ds.depthBoundsTestEnable = VK_FALSE; ds.stencilTestEnable = pDesc->mStencilTest ? VK_TRUE : VK_FALSE; ds.front.failOp = gVkStencilOpTranslator[pDesc->mStencilFrontFail]; ds.front.passOp = gVkStencilOpTranslator[pDesc->mStencilFrontPass]; ds.front.depthFailOp = gVkStencilOpTranslator[pDesc->mDepthFrontFail]; ds.front.compareOp = VkCompareOp(pDesc->mStencilFrontFunc); ds.front.compareMask = pDesc->mStencilReadMask; ds.front.writeMask = pDesc->mStencilWriteMask; ds.front.reference = 0; ds.back.failOp = gVkStencilOpTranslator[pDesc->mStencilBackFail]; ds.back.passOp = gVkStencilOpTranslator[pDesc->mStencilBackPass]; ds.back.depthFailOp = gVkStencilOpTranslator[pDesc->mDepthBackFail]; ds.back.compareOp = gVkComparisonFuncTranslator[pDesc->mStencilBackFunc]; ds.back.compareMask = pDesc->mStencilReadMask; ds.back.writeMask = pDesc->mStencilWriteMask; // devsh fixed ds.back.reference = 0; ds.minDepthBounds = 0; ds.maxDepthBounds = 1; return ds; } static inline VkPipelineRasterizationStateCreateInfo util_to_rasterizer_desc(const RasterizerStateDesc* pDesc) { ASSERT(pDesc->mFillMode < FillMode::MAX_FILL_MODES); ASSERT(pDesc->mCullMode < CullMode::MAX_CULL_MODES); ASSERT(pDesc->mFrontFace == FRONT_FACE_CCW || pDesc->mFrontFace == FRONT_FACE_CW); VkPipelineRasterizationStateCreateInfo rs = {}; rs.sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO; rs.pNext = NULL; rs.flags = 0; rs.depthClampEnable = VK_TRUE; rs.rasterizerDiscardEnable = VK_FALSE; rs.polygonMode = gVkFillModeTranslator[pDesc->mFillMode]; rs.cullMode = gVkCullModeTranslator[pDesc->mCullMode]; rs.frontFace = gVkFrontFaceTranslator[pDesc->mFrontFace]; rs.depthBiasEnable = (pDesc->mDepthBias != 0) ? VK_TRUE : VK_FALSE; rs.depthBiasConstantFactor = float(pDesc->mDepthBias); rs.depthBiasClamp = 0.0f; rs.depthBiasSlopeFactor = pDesc->mSlopeScaledDepthBias; rs.lineWidth = 1; return rs; } /************************************************************************/ // Create default resources to be used a null descriptors in case user does not specify some descriptors /************************************************************************/ static VkPipelineRasterizationStateCreateInfo gDefaultRasterizerDesc = {}; static VkPipelineDepthStencilStateCreateInfo gDefaultDepthDesc = {}; static VkPipelineColorBlendStateCreateInfo gDefaultBlendDesc = {}; static VkPipelineColorBlendAttachmentState gDefaultBlendAttachments[MAX_RENDER_TARGET_ATTACHMENTS] = {}; typedef struct NullDescriptors { Texture* pDefaultTextureSRV[MAX_GPUS][TEXTURE_DIM_COUNT]; Texture* pDefaultTextureUAV[MAX_GPUS][TEXTURE_DIM_COUNT]; Buffer* pDefaultBufferSRV[MAX_GPUS]; Buffer* pDefaultBufferUAV[MAX_GPUS]; Sampler* pDefaultSampler; } NullDescriptors; static void add_default_resources(Renderer* pRenderer) { pRenderer->pNullDescriptors = (NullDescriptors*)conf_calloc(1, sizeof(NullDescriptors)); for (uint32_t i = 0; i < pRenderer->mLinkedNodeCount; ++i) { // 1D texture TextureDesc textureDesc = {}; textureDesc.mNodeIndex = i; textureDesc.mArraySize = 1; textureDesc.mDepth = 1; textureDesc.mFormat = TinyImageFormat_R8G8B8A8_UNORM; textureDesc.mHeight = 1; textureDesc.mMipLevels = 1; textureDesc.mSampleCount = SAMPLE_COUNT_1; textureDesc.mStartState = RESOURCE_STATE_COMMON; textureDesc.mDescriptors = DESCRIPTOR_TYPE_TEXTURE; textureDesc.mWidth = 1; addTexture(pRenderer, &textureDesc, &pRenderer->pNullDescriptors->pDefaultTextureSRV[i][TEXTURE_DIM_1D]); textureDesc.mDescriptors = DESCRIPTOR_TYPE_RW_TEXTURE; addTexture(pRenderer, &textureDesc, &pRenderer->pNullDescriptors->pDefaultTextureUAV[i][TEXTURE_DIM_1D]); // 1D texture array textureDesc.mArraySize = 2; textureDesc.mDescriptors = DESCRIPTOR_TYPE_TEXTURE; addTexture(pRenderer, &textureDesc, &pRenderer->pNullDescriptors->pDefaultTextureSRV[i][TEXTURE_DIM_1D_ARRAY]); textureDesc.mDescriptors = DESCRIPTOR_TYPE_RW_TEXTURE; addTexture(pRenderer, &textureDesc, &pRenderer->pNullDescriptors->pDefaultTextureUAV[i][TEXTURE_DIM_1D_ARRAY]); // 2D texture textureDesc.mWidth = 2; textureDesc.mHeight = 2; textureDesc.mArraySize = 1; textureDesc.mDescriptors = DESCRIPTOR_TYPE_TEXTURE; addTexture(pRenderer, &textureDesc, &pRenderer->pNullDescriptors->pDefaultTextureSRV[i][TEXTURE_DIM_2D]); textureDesc.mDescriptors = DESCRIPTOR_TYPE_RW_TEXTURE; addTexture(pRenderer, &textureDesc, &pRenderer->pNullDescriptors->pDefaultTextureUAV[i][TEXTURE_DIM_2D]); // 2D MS texture textureDesc.mDescriptors = DESCRIPTOR_TYPE_TEXTURE; textureDesc.mSampleCount = SAMPLE_COUNT_2; addTexture(pRenderer, &textureDesc, &pRenderer->pNullDescriptors->pDefaultTextureSRV[i][TEXTURE_DIM_2DMS]); textureDesc.mSampleCount = SAMPLE_COUNT_1; // 2D texture array textureDesc.mArraySize = 2; textureDesc.mDescriptors = DESCRIPTOR_TYPE_TEXTURE; addTexture(pRenderer, &textureDesc, &pRenderer->pNullDescriptors->pDefaultTextureSRV[i][TEXTURE_DIM_2D_ARRAY]); textureDesc.mDescriptors = DESCRIPTOR_TYPE_RW_TEXTURE; addTexture(pRenderer, &textureDesc, &pRenderer->pNullDescriptors->pDefaultTextureUAV[i][TEXTURE_DIM_2D_ARRAY]); // 2D MS texture array textureDesc.mDescriptors = DESCRIPTOR_TYPE_TEXTURE; textureDesc.mSampleCount = SAMPLE_COUNT_2; addTexture(pRenderer, &textureDesc, &pRenderer->pNullDescriptors->pDefaultTextureSRV[i][TEXTURE_DIM_2DMS_ARRAY]); textureDesc.mSampleCount = SAMPLE_COUNT_1; // 3D texture textureDesc.mDepth = 2; textureDesc.mArraySize = 1; textureDesc.mDescriptors = DESCRIPTOR_TYPE_TEXTURE; addTexture(pRenderer, &textureDesc, &pRenderer->pNullDescriptors->pDefaultTextureSRV[i][TEXTURE_DIM_3D]); textureDesc.mDescriptors = DESCRIPTOR_TYPE_RW_TEXTURE; addTexture(pRenderer, &textureDesc, &pRenderer->pNullDescriptors->pDefaultTextureUAV[i][TEXTURE_DIM_3D]); // Cube texture textureDesc.mWidth = 2; textureDesc.mHeight = 2; textureDesc.mDepth = 1; textureDesc.mArraySize = 6; textureDesc.mDescriptors = DESCRIPTOR_TYPE_TEXTURE_CUBE; addTexture(pRenderer, &textureDesc, &pRenderer->pNullDescriptors->pDefaultTextureSRV[i][TEXTURE_DIM_CUBE]); textureDesc.mArraySize = 6 * 2; addTexture(pRenderer, &textureDesc, &pRenderer->pNullDescriptors->pDefaultTextureSRV[i][TEXTURE_DIM_CUBE_ARRAY]); BufferDesc bufferDesc = {}; bufferDesc.mNodeIndex = i; bufferDesc.mDescriptors = DESCRIPTOR_TYPE_BUFFER | DESCRIPTOR_TYPE_UNIFORM_BUFFER; bufferDesc.mMemoryUsage = RESOURCE_MEMORY_USAGE_GPU_ONLY; bufferDesc.mStartState = RESOURCE_STATE_COMMON; bufferDesc.mSize = sizeof(uint32_t); bufferDesc.mFirstElement = 0; bufferDesc.mElementCount = 1; bufferDesc.mStructStride = sizeof(uint32_t); bufferDesc.mFormat = TinyImageFormat_R32_UINT; addBuffer(pRenderer, &bufferDesc, &pRenderer->pNullDescriptors->pDefaultBufferSRV[i]); bufferDesc.mDescriptors = DESCRIPTOR_TYPE_RW_BUFFER; addBuffer(pRenderer, &bufferDesc, &pRenderer->pNullDescriptors->pDefaultBufferUAV[i]); } SamplerDesc samplerDesc = {}; samplerDesc.mAddressU = ADDRESS_MODE_CLAMP_TO_BORDER; samplerDesc.mAddressV = ADDRESS_MODE_CLAMP_TO_BORDER; samplerDesc.mAddressW = ADDRESS_MODE_CLAMP_TO_BORDER; addSampler(pRenderer, &samplerDesc, &pRenderer->pNullDescriptors->pDefaultSampler); BlendStateDesc blendStateDesc = {}; blendStateDesc.mDstAlphaFactors[0] = BC_ZERO; blendStateDesc.mDstFactors[0] = BC_ZERO; blendStateDesc.mSrcAlphaFactors[0] = BC_ONE; blendStateDesc.mSrcFactors[0] = BC_ONE; blendStateDesc.mMasks[0] = ALL; blendStateDesc.mRenderTargetMask = BLEND_STATE_TARGET_ALL; blendStateDesc.mIndependentBlend = false; gDefaultBlendDesc = util_to_blend_desc(&blendStateDesc, gDefaultBlendAttachments); DepthStateDesc depthStateDesc = {}; depthStateDesc.mDepthFunc = CMP_LEQUAL; depthStateDesc.mDepthTest = false; depthStateDesc.mDepthWrite = false; depthStateDesc.mStencilBackFunc = CMP_ALWAYS; depthStateDesc.mStencilFrontFunc = CMP_ALWAYS; depthStateDesc.mStencilReadMask = 0xFF; depthStateDesc.mStencilWriteMask = 0xFF; gDefaultDepthDesc = util_to_depth_desc(&depthStateDesc); RasterizerStateDesc rasterizerStateDesc = {}; rasterizerStateDesc.mCullMode = CULL_MODE_BACK; gDefaultRasterizerDesc = util_to_rasterizer_desc(&rasterizerStateDesc); // Create command buffer to transition resources to the correct state Queue* graphicsQueue = {}; CmdPool* cmdPool = {}; Cmd* cmd = {}; QueueDesc queueDesc = {}; queueDesc.mType = QUEUE_TYPE_GRAPHICS; addQueue(pRenderer, &queueDesc, &graphicsQueue); CmdPoolDesc cmdPoolDesc = {}; cmdPoolDesc.pQueue = graphicsQueue; cmdPoolDesc.mTransient = true; addCmdPool(pRenderer, &cmdPoolDesc, &cmdPool); CmdDesc cmdDesc = {}; cmdDesc.pPool = cmdPool; addCmd(pRenderer, &cmdDesc, &cmd); // Transition resources beginCmd(cmd); eastl::vector<BufferBarrier> bufferBarriers; eastl::vector<TextureBarrier> textureBarriers; for (uint32_t i = 0; i < pRenderer->mLinkedNodeCount; ++i) { for (uint32_t dim = 0; dim < TEXTURE_DIM_COUNT; ++dim) { if (pRenderer->pNullDescriptors->pDefaultTextureSRV[i][dim]) textureBarriers.push_back(TextureBarrier{ pRenderer->pNullDescriptors->pDefaultTextureSRV[i][dim], RESOURCE_STATE_SHADER_RESOURCE }); if (pRenderer->pNullDescriptors->pDefaultTextureUAV[i][dim]) textureBarriers.push_back(TextureBarrier{ pRenderer->pNullDescriptors->pDefaultTextureUAV[i][dim], RESOURCE_STATE_UNORDERED_ACCESS }); } bufferBarriers.push_back(BufferBarrier{ pRenderer->pNullDescriptors->pDefaultBufferSRV[i], RESOURCE_STATE_SHADER_RESOURCE, false }); bufferBarriers.push_back(BufferBarrier{ pRenderer->pNullDescriptors->pDefaultBufferUAV[i], RESOURCE_STATE_UNORDERED_ACCESS, false }); } uint32_t bufferBarrierCount = (uint32_t)bufferBarriers.size(); uint32_t textureBarrierCount = (uint32_t)textureBarriers.size(); cmdResourceBarrier(cmd, bufferBarrierCount, bufferBarriers.data(), textureBarrierCount, textureBarriers.data(), 0, NULL); endCmd(cmd); QueueSubmitDesc submitDesc = {}; submitDesc.mCmdCount = 1; submitDesc.ppCmds = &cmd; queueSubmit(graphicsQueue, &submitDesc); waitQueueIdle(graphicsQueue); // Delete command buffer removeCmd(pRenderer, cmd); removeCmdPool(pRenderer, cmdPool); removeQueue(pRenderer, graphicsQueue); } static void remove_default_resources(Renderer* pRenderer) { for (uint32_t i = 0; i < pRenderer->mLinkedNodeCount; ++i) { for (uint32_t dim = 0; dim < TEXTURE_DIM_COUNT; ++dim) { if (pRenderer->pNullDescriptors->pDefaultTextureSRV[i][dim]) removeTexture(pRenderer, pRenderer->pNullDescriptors->pDefaultTextureSRV[i][dim]); if (pRenderer->pNullDescriptors->pDefaultTextureUAV[i][dim]) removeTexture(pRenderer, pRenderer->pNullDescriptors->pDefaultTextureUAV[i][dim]); } removeBuffer(pRenderer, pRenderer->pNullDescriptors->pDefaultBufferSRV[i]); removeBuffer(pRenderer, pRenderer->pNullDescriptors->pDefaultBufferUAV[i]); } removeSampler(pRenderer, pRenderer->pNullDescriptors->pDefaultSampler); SAFE_FREE(pRenderer->pNullDescriptors); } /************************************************************************/ // Globals /************************************************************************/ static tfrg_atomic64_t gRenderTargetIds = 1; /************************************************************************/ // Internal utility functions /************************************************************************/ VkFilter util_to_vk_filter(FilterType filter) { switch (filter) { case FILTER_NEAREST: return VK_FILTER_NEAREST; case FILTER_LINEAR: return VK_FILTER_LINEAR; default: return VK_FILTER_LINEAR; } } VkSamplerMipmapMode util_to_vk_mip_map_mode(MipMapMode mipMapMode) { switch (mipMapMode) { case MIPMAP_MODE_NEAREST: return VK_SAMPLER_MIPMAP_MODE_NEAREST; case MIPMAP_MODE_LINEAR: return VK_SAMPLER_MIPMAP_MODE_LINEAR; default: ASSERT(false && "Invalid Mip Map Mode"); return VK_SAMPLER_MIPMAP_MODE_MAX_ENUM; } } VkSamplerAddressMode util_to_vk_address_mode(AddressMode addressMode) { switch (addressMode) { case ADDRESS_MODE_MIRROR: return VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT; case ADDRESS_MODE_REPEAT: return VK_SAMPLER_ADDRESS_MODE_REPEAT; case ADDRESS_MODE_CLAMP_TO_EDGE: return VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE; case ADDRESS_MODE_CLAMP_TO_BORDER: return VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER; default: return VK_SAMPLER_ADDRESS_MODE_REPEAT; } } VkShaderStageFlags util_to_vk_shader_stages(ShaderStage shader_stages) { VkShaderStageFlags result = 0; if (SHADER_STAGE_ALL_GRAPHICS == (shader_stages & SHADER_STAGE_ALL_GRAPHICS)) { result = VK_SHADER_STAGE_ALL_GRAPHICS; } else { if (SHADER_STAGE_VERT == (shader_stages & SHADER_STAGE_VERT)) { result |= VK_SHADER_STAGE_VERTEX_BIT; } if (SHADER_STAGE_TESC == (shader_stages & SHADER_STAGE_TESC)) { result |= VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT; } if (SHADER_STAGE_TESE == (shader_stages & SHADER_STAGE_TESE)) { result |= VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT; } if (SHADER_STAGE_GEOM == (shader_stages & SHADER_STAGE_GEOM)) { result |= VK_SHADER_STAGE_GEOMETRY_BIT; } if (SHADER_STAGE_FRAG == (shader_stages & SHADER_STAGE_FRAG)) { result |= VK_SHADER_STAGE_FRAGMENT_BIT; } if (SHADER_STAGE_COMP == (shader_stages & SHADER_STAGE_COMP)) { result |= VK_SHADER_STAGE_COMPUTE_BIT; } } return result; } VkSampleCountFlagBits util_to_vk_sample_count(SampleCount sampleCount) { VkSampleCountFlagBits result = VK_SAMPLE_COUNT_1_BIT; switch (sampleCount) { case SAMPLE_COUNT_1: result = VK_SAMPLE_COUNT_1_BIT; break; case SAMPLE_COUNT_2: result = VK_SAMPLE_COUNT_2_BIT; break; case SAMPLE_COUNT_4: result = VK_SAMPLE_COUNT_4_BIT; break; case SAMPLE_COUNT_8: result = VK_SAMPLE_COUNT_8_BIT; break; case SAMPLE_COUNT_16: result = VK_SAMPLE_COUNT_16_BIT; break; } return result; } VkBufferUsageFlags util_to_vk_buffer_usage(DescriptorType usage, bool typed) { VkBufferUsageFlags result = VK_BUFFER_USAGE_TRANSFER_SRC_BIT; if (usage & DESCRIPTOR_TYPE_UNIFORM_BUFFER) { result |= VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT; } if (usage & DESCRIPTOR_TYPE_RW_BUFFER) { result |= VK_BUFFER_USAGE_STORAGE_BUFFER_BIT; if (typed) result |= VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT; } if (usage & DESCRIPTOR_TYPE_BUFFER) { result |= VK_BUFFER_USAGE_STORAGE_BUFFER_BIT; if (typed) result |= VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT; } if (usage & DESCRIPTOR_TYPE_INDEX_BUFFER) { result |= VK_BUFFER_USAGE_INDEX_BUFFER_BIT; } if (usage & DESCRIPTOR_TYPE_VERTEX_BUFFER) { result |= VK_BUFFER_USAGE_VERTEX_BUFFER_BIT; } if (usage & DESCRIPTOR_TYPE_INDIRECT_BUFFER) { result |= VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT; } #ifdef ENABLE_RAYTRACING if (usage & DESCRIPTOR_TYPE_RAY_TRACING) { result |= VK_BUFFER_USAGE_RAY_TRACING_BIT_NV; } #endif return result; } VkImageUsageFlags util_to_vk_image_usage(DescriptorType usage) { VkImageUsageFlags result = 0; if (DESCRIPTOR_TYPE_TEXTURE == (usage & DESCRIPTOR_TYPE_TEXTURE)) result |= VK_IMAGE_USAGE_SAMPLED_BIT; if (DESCRIPTOR_TYPE_RW_TEXTURE == (usage & DESCRIPTOR_TYPE_RW_TEXTURE)) result |= VK_IMAGE_USAGE_STORAGE_BIT; return result; } VkAccessFlags util_to_vk_access_flags(ResourceState state) { VkAccessFlags ret = 0; if (state & RESOURCE_STATE_COPY_SOURCE) { ret |= VK_ACCESS_TRANSFER_READ_BIT; } if (state & RESOURCE_STATE_COPY_DEST) { ret |= VK_ACCESS_TRANSFER_WRITE_BIT; } if (state & RESOURCE_STATE_VERTEX_AND_CONSTANT_BUFFER) { ret |= VK_ACCESS_UNIFORM_READ_BIT | VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT; } if (state & RESOURCE_STATE_INDEX_BUFFER) { ret |= VK_ACCESS_INDEX_READ_BIT; } if (state & RESOURCE_STATE_UNORDERED_ACCESS) { ret |= VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT; } if (state & RESOURCE_STATE_INDIRECT_ARGUMENT) { ret |= VK_ACCESS_INDIRECT_COMMAND_READ_BIT; } if (state & RESOURCE_STATE_RENDER_TARGET) { ret |= VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT; } if (state & RESOURCE_STATE_DEPTH_WRITE) { ret |= VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT; } if ((state & RESOURCE_STATE_SHADER_RESOURCE) || (state & RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE)) { ret |= VK_ACCESS_SHADER_READ_BIT; } if (state & RESOURCE_STATE_PRESENT) { ret |= VK_ACCESS_MEMORY_READ_BIT; } return ret; } VkImageLayout util_to_vk_image_layout(ResourceState usage) { if (usage & RESOURCE_STATE_COPY_SOURCE) return VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL; if (usage & RESOURCE_STATE_COPY_DEST) return VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL; if (usage & RESOURCE_STATE_RENDER_TARGET) return VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL; if (usage & RESOURCE_STATE_DEPTH_WRITE) return VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL; if (usage & RESOURCE_STATE_UNORDERED_ACCESS) return VK_IMAGE_LAYOUT_GENERAL; if ((usage & RESOURCE_STATE_SHADER_RESOURCE) || (usage & RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE)) return VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL; if (usage & RESOURCE_STATE_PRESENT) return VK_IMAGE_LAYOUT_PRESENT_SRC_KHR; if (usage == RESOURCE_STATE_COMMON) return VK_IMAGE_LAYOUT_GENERAL; return VK_IMAGE_LAYOUT_UNDEFINED; } // Determines pipeline stages involved for given accesses VkPipelineStageFlags util_determine_pipeline_stage_flags(VkAccessFlags accessFlags, QueueType queueType) { VkPipelineStageFlags flags = 0; switch (queueType) { case QUEUE_TYPE_GRAPHICS: { if ((accessFlags & (VK_ACCESS_INDEX_READ_BIT | VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT)) != 0) flags |= VK_PIPELINE_STAGE_VERTEX_INPUT_BIT; if ((accessFlags & (VK_ACCESS_UNIFORM_READ_BIT | VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT)) != 0) { flags |= VK_PIPELINE_STAGE_VERTEX_SHADER_BIT; flags |= VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT; flags |= VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT; flags |= VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT; flags |= VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT; flags |= VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT; #ifdef ENABLE_RAYTRACING flags |= VK_PIPELINE_STAGE_RAY_TRACING_SHADER_BIT_NV; #endif } if ((accessFlags & VK_ACCESS_INPUT_ATTACHMENT_READ_BIT) != 0) flags |= VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT; if ((accessFlags & (VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT)) != 0) flags |= VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT; if ((accessFlags & (VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT | VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT)) != 0) flags |= VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT | VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT; break; } case QUEUE_TYPE_COMPUTE: { if ((accessFlags & (VK_ACCESS_INDEX_READ_BIT | VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT)) != 0 || (accessFlags & VK_ACCESS_INPUT_ATTACHMENT_READ_BIT) != 0 || (accessFlags & (VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT)) != 0 || (accessFlags & (VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT | VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT)) != 0) return VK_PIPELINE_STAGE_ALL_COMMANDS_BIT; if ((accessFlags & (VK_ACCESS_UNIFORM_READ_BIT | VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT)) != 0) flags |= VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT; break; } case QUEUE_TYPE_TRANSFER: return VK_PIPELINE_STAGE_ALL_COMMANDS_BIT; default: break; } // Compatible with both compute and graphics queues if ((accessFlags & VK_ACCESS_INDIRECT_COMMAND_READ_BIT) != 0) flags |= VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT; if ((accessFlags & (VK_ACCESS_TRANSFER_READ_BIT | VK_ACCESS_TRANSFER_WRITE_BIT)) != 0) flags |= VK_PIPELINE_STAGE_TRANSFER_BIT; if ((accessFlags & (VK_ACCESS_HOST_READ_BIT | VK_ACCESS_HOST_WRITE_BIT)) != 0) flags |= VK_PIPELINE_STAGE_HOST_BIT; if (flags == 0) flags = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT; return flags; } VkImageAspectFlags util_vk_determine_aspect_mask(VkFormat format, bool includeStencilBit) { VkImageAspectFlags result = 0; switch (format) { // Depth case VK_FORMAT_D16_UNORM: case VK_FORMAT_X8_D24_UNORM_PACK32: case VK_FORMAT_D32_SFLOAT: result = VK_IMAGE_ASPECT_DEPTH_BIT; break; // Stencil case VK_FORMAT_S8_UINT: result = VK_IMAGE_ASPECT_STENCIL_BIT; break; // Depth/stencil case VK_FORMAT_D16_UNORM_S8_UINT: case VK_FORMAT_D24_UNORM_S8_UINT: case VK_FORMAT_D32_SFLOAT_S8_UINT: result = VK_IMAGE_ASPECT_DEPTH_BIT; if (includeStencilBit) result |= VK_IMAGE_ASPECT_STENCIL_BIT; break; // Assume everything else is Color default: result = VK_IMAGE_ASPECT_COLOR_BIT; break; } return result; } VkFormatFeatureFlags util_vk_image_usage_to_format_features(VkImageUsageFlags usage) { VkFormatFeatureFlags result = (VkFormatFeatureFlags)0; if (VK_IMAGE_USAGE_SAMPLED_BIT == (usage & VK_IMAGE_USAGE_SAMPLED_BIT)) { result |= VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT; } if (VK_IMAGE_USAGE_STORAGE_BIT == (usage & VK_IMAGE_USAGE_STORAGE_BIT)) { result |= VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT; } if (VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT == (usage & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT)) { result |= VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT; } if (VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT == (usage & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT)) { result |= VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT; } return result; } VkQueueFlags util_to_vk_queue_flags(QueueType queueType) { switch (queueType) { case QUEUE_TYPE_GRAPHICS: return VK_QUEUE_GRAPHICS_BIT; case QUEUE_TYPE_TRANSFER: return VK_QUEUE_TRANSFER_BIT; case QUEUE_TYPE_COMPUTE: return VK_QUEUE_COMPUTE_BIT; default: ASSERT(false && "Invalid Queue Type"); return VK_QUEUE_FLAG_BITS_MAX_ENUM; } } VkDescriptorType util_to_vk_descriptor_type(DescriptorType type) { switch (type) { case DESCRIPTOR_TYPE_UNDEFINED: ASSERT("Invalid DescriptorInfo Type"); return VK_DESCRIPTOR_TYPE_MAX_ENUM; case DESCRIPTOR_TYPE_SAMPLER: return VK_DESCRIPTOR_TYPE_SAMPLER; case DESCRIPTOR_TYPE_TEXTURE: return VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE; case DESCRIPTOR_TYPE_UNIFORM_BUFFER: return VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER; case DESCRIPTOR_TYPE_RW_TEXTURE: return VK_DESCRIPTOR_TYPE_STORAGE_IMAGE; case DESCRIPTOR_TYPE_BUFFER: case DESCRIPTOR_TYPE_RW_BUFFER: return VK_DESCRIPTOR_TYPE_STORAGE_BUFFER; case DESCRIPTOR_TYPE_INPUT_ATTACHMENT: return VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT; case DESCRIPTOR_TYPE_TEXEL_BUFFER: return VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER; case DESCRIPTOR_TYPE_RW_TEXEL_BUFFER: return VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER; #ifdef ENABLE_RAYTRACING case DESCRIPTOR_TYPE_RAY_TRACING: return VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_NV; #endif default: ASSERT("Invalid DescriptorInfo Type"); return VK_DESCRIPTOR_TYPE_MAX_ENUM; break; } } VkShaderStageFlags util_to_vk_shader_stage_flags(ShaderStage stages) { VkShaderStageFlags res = 0; if (stages & SHADER_STAGE_ALL_GRAPHICS) return VK_SHADER_STAGE_ALL_GRAPHICS; if (stages & SHADER_STAGE_VERT) res |= VK_SHADER_STAGE_VERTEX_BIT; if (stages & SHADER_STAGE_GEOM) res |= VK_SHADER_STAGE_GEOMETRY_BIT; if (stages & SHADER_STAGE_TESE) res |= VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT; if (stages & SHADER_STAGE_TESC) res |= VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT; if (stages & SHADER_STAGE_COMP) res |= VK_SHADER_STAGE_COMPUTE_BIT; #ifdef ENABLE_RAYTRACING if (stages & SHADER_STAGE_RAYTRACING) res |= ( VK_SHADER_STAGE_RAYGEN_BIT_NV | VK_SHADER_STAGE_ANY_HIT_BIT_NV | VK_SHADER_STAGE_CLOSEST_HIT_BIT_NV | VK_SHADER_STAGE_MISS_BIT_NV | VK_SHADER_STAGE_INTERSECTION_BIT_NV | VK_SHADER_STAGE_CALLABLE_BIT_NV); #endif ASSERT(res != 0); return res; } /************************************************************************/ // Multi GPU Helper Functions /************************************************************************/ uint32_t util_calculate_shared_device_mask(uint32_t gpuCount) { return (1 << gpuCount) - 1; } void util_calculate_device_indices( Renderer* pRenderer, uint32_t nodeIndex, uint32_t* pSharedNodeIndices, uint32_t sharedNodeIndexCount, uint32_t* pIndices) { for (uint32_t i = 0; i < pRenderer->mLinkedNodeCount; ++i) pIndices[i] = i; pIndices[nodeIndex] = nodeIndex; /************************************************************************/ // Set the node indices which need sharing access to the creation node // Example: Texture created on GPU0 but GPU1 will need to access it, GPU2 does not care // pIndices = { 0, 0, 2 } /************************************************************************/ for (uint32_t i = 0; i < sharedNodeIndexCount; ++i) pIndices[pSharedNodeIndices[i]] = nodeIndex; } /************************************************************************/ // Internal init functions /************************************************************************/ void CreateInstance(const char* app_name, const RendererDesc* pDesc, uint32_t userDefinedInstanceLayerCount, const char** userDefinedInstanceLayers, Renderer* pRenderer) { // These are the extensions that we have loaded const char* instanceExtensionCache[MAX_INSTANCE_EXTENSIONS] = {}; uint32_t layerCount = 0; uint32_t extCount = 0; vkEnumerateInstanceLayerProperties(&layerCount, NULL); vkEnumerateInstanceExtensionProperties(NULL, &extCount, NULL); VkLayerProperties* layers = (VkLayerProperties*)alloca(sizeof(VkLayerProperties) * layerCount); vkEnumerateInstanceLayerProperties(&layerCount, layers); VkExtensionProperties* exts = (VkExtensionProperties*)alloca(sizeof(VkExtensionProperties) * extCount); vkEnumerateInstanceExtensionProperties(NULL, &extCount, exts); for (uint32_t i = 0; i < layerCount; ++i) { internal_log(LOG_TYPE_INFO, layers[i].layerName, "vkinstance-layer"); } for (uint32_t i = 0; i < extCount; ++i) { internal_log(LOG_TYPE_INFO, exts[i].extensionName, "vkinstance-ext"); } DECLARE_ZERO(VkApplicationInfo, app_info); app_info.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO; app_info.pNext = NULL; app_info.pApplicationName = app_name; app_info.applicationVersion = VK_MAKE_VERSION(1, 0, 0); app_info.pEngineName = "TheForge"; app_info.engineVersion = VK_MAKE_VERSION(1, 0, 0); app_info.apiVersion = VK_API_VERSION_1_1; VkResult vk_res = VK_RESULT_MAX_ENUM; eastl::vector<const char*> layerTemp = eastl::vector<const char*>(userDefinedInstanceLayerCount); memcpy(layerTemp.data(), userDefinedInstanceLayers, layerTemp.size() * sizeof(char*)); // Instance { // check to see if the layers are present for (uint32_t i = 0; i < (uint32_t)layerTemp.size(); ++i) { bool layerFound = false; for (uint32_t j = 0; j < layerCount; ++j) { if (strcmp(userDefinedInstanceLayers[i], layers[j].layerName) == 0) { layerFound = true; break; } } if (layerFound == false) { internal_log(LOG_TYPE_WARN, userDefinedInstanceLayers[i], "vkinstance-layer-missing"); // deleate layer and get new index i = (uint32_t)( layerTemp.erase(layerTemp.begin() + i) - layerTemp.begin()); } } uint32_t extension_count = 0; const uint32_t initialCount = sizeof(gVkWantedInstanceExtensions) / sizeof(gVkWantedInstanceExtensions[0]); const uint32_t userRequestedCount = (uint32_t)pDesc->mInstanceExtensionCount; eastl::vector<const char*> wantedInstanceExtensions(initialCount + userRequestedCount); for (uint32_t i = 0; i < initialCount; ++i) { wantedInstanceExtensions[i] = gVkWantedInstanceExtensions[i]; } for (uint32_t i = 0; i < userRequestedCount; ++i) { wantedInstanceExtensions[initialCount + i] = pDesc->ppInstanceExtensions[i]; } const uint32_t wanted_extension_count = (uint32_t)wantedInstanceExtensions.size(); // Layer extensions for (uint32_t i = 0; i < layerTemp.size(); ++i) { const char* layer_name = layerTemp[i]; uint32_t count = 0; vkEnumerateInstanceExtensionProperties(layer_name, &count, NULL); VkExtensionProperties* properties = (VkExtensionProperties*)conf_calloc(count, sizeof(*properties)); ASSERT(properties != NULL); vkEnumerateInstanceExtensionProperties(layer_name, &count, properties); for (uint32_t j = 0; j < count; ++j) { for (uint32_t k = 0; k < wanted_extension_count; ++k) { if (strcmp(wantedInstanceExtensions[k], properties[j].extensionName) == 0) { if (strcmp(wantedInstanceExtensions[k], VK_KHR_DEVICE_GROUP_CREATION_EXTENSION_NAME) == 0) gDeviceGroupCreationExtension = true; #ifdef USE_DEBUG_UTILS_EXTENSION if (strcmp(wantedInstanceExtensions[k], VK_EXT_DEBUG_UTILS_EXTENSION_NAME) == 0) gDebugUtilsExtension = true; #endif instanceExtensionCache[extension_count++] = wantedInstanceExtensions[k]; // clear wanted extenstion so we dont load it more then once wantedInstanceExtensions[k] = ""; break; } } } SAFE_FREE((void*)properties); } // Standalone extensions { const char* layer_name = NULL; uint32_t count = 0; vkEnumerateInstanceExtensionProperties(layer_name, &count, NULL); if (count > 0) { VkExtensionProperties* properties = (VkExtensionProperties*)conf_calloc(count, sizeof(*properties)); ASSERT(properties != NULL); vkEnumerateInstanceExtensionProperties(layer_name, &count, properties); for (uint32_t j = 0; j < count; ++j) { for (uint32_t k = 0; k < wanted_extension_count; ++k) { if (strcmp(wantedInstanceExtensions[k], properties[j].extensionName) == 0) { instanceExtensionCache[extension_count++] = wantedInstanceExtensions[k]; // clear wanted extenstion so we dont load it more then once //gVkWantedInstanceExtensions[k] = ""; if (strcmp(wantedInstanceExtensions[k], VK_KHR_DEVICE_GROUP_CREATION_EXTENSION_NAME) == 0) gDeviceGroupCreationExtension = true; #ifdef USE_DEBUG_UTILS_EXTENSION if (strcmp(wantedInstanceExtensions[k], VK_EXT_DEBUG_UTILS_EXTENSION_NAME) == 0) gDebugUtilsExtension = true; #endif break; } } } SAFE_FREE((void*)properties); } } #if VK_HEADER_VERSION >= 108 VkValidationFeaturesEXT validationFeaturesExt = { VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT }; VkValidationFeatureEnableEXT enabledValidationFeatures[] = { VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT, }; if (pDesc->mEnableGPUBasedValidation) { validationFeaturesExt.enabledValidationFeatureCount = 1; validationFeaturesExt.pEnabledValidationFeatures = enabledValidationFeatures; } #endif // Add more extensions here DECLARE_ZERO(VkInstanceCreateInfo, create_info); create_info.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO; #if VK_HEADER_VERSION >= 108 create_info.pNext = &validationFeaturesExt; #endif create_info.flags = 0; create_info.pApplicationInfo = &app_info; create_info.enabledLayerCount = (uint32_t)layerTemp.size(); create_info.ppEnabledLayerNames = layerTemp.data(); create_info.enabledExtensionCount = extension_count; create_info.ppEnabledExtensionNames = instanceExtensionCache; vk_res = vkCreateInstance(&create_info, NULL, &(pRenderer->pVkInstance)); ASSERT(VK_SUCCESS == vk_res); } #if defined(NX64) loadExtensionsNX(pRenderer->pVkInstance); #else // Load Vulkan instance functions volkLoadInstance(pRenderer->pVkInstance); #endif // Debug { #ifdef USE_DEBUG_UTILS_EXTENSION if (gDebugUtilsExtension) { VkDebugUtilsMessengerCreateInfoEXT create_info = {}; create_info.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT; create_info.pfnUserCallback = internal_debug_report_callback; create_info.messageSeverity = VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT | VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT; create_info.messageType = VK_DEBUG_UTILS_MESSAGE_TYPE_GENERAL_BIT_EXT | VK_DEBUG_UTILS_MESSAGE_TYPE_VALIDATION_BIT_EXT | VK_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT; create_info.flags = 0; create_info.pUserData = NULL; VkResult res = vkCreateDebugUtilsMessengerEXT(pRenderer->pVkInstance, &create_info, NULL, &(pRenderer->pVkDebugUtilsMessenger)); if (VK_SUCCESS != res) { internal_log( LOG_TYPE_ERROR, "vkCreateDebugUtilsMessengerEXT failed - disabling Vulkan debug callbacks", "internal_vk_init_instance"); } } #else DECLARE_ZERO(VkDebugReportCallbackCreateInfoEXT, create_info); create_info.sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT; create_info.pNext = NULL; create_info.pfnCallback = internal_debug_report_callback; create_info.flags = VK_DEBUG_REPORT_WARNING_BIT_EXT | #if defined(NX64) || defined(__ANDROID__) VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT | // Performance warnings are not very vaild on desktop #endif VK_DEBUG_REPORT_ERROR_BIT_EXT | VK_DEBUG_REPORT_DEBUG_BIT_EXT/* | VK_DEBUG_REPORT_INFORMATION_BIT_EXT*/; VkResult res = vkCreateDebugReportCallbackEXT(pRenderer->pVkInstance, &create_info, NULL, &(pRenderer->pVkDebugReport)); if (VK_SUCCESS != res) { internal_log( LOG_TYPE_ERROR, "vkCreateDebugReportCallbackEXT failed - disabling Vulkan debug callbacks", "internal_vk_init_instance"); } #endif } } static void RemoveInstance(Renderer* pRenderer) { ASSERT(VK_NULL_HANDLE != pRenderer->pVkInstance); #ifdef USE_DEBUG_UTILS_EXTENSION if (pRenderer->pVkDebugUtilsMessenger) { vkDestroyDebugUtilsMessengerEXT(pRenderer->pVkInstance, pRenderer->pVkDebugUtilsMessenger, NULL); pRenderer->pVkDebugUtilsMessenger = NULL; } #else if (pRenderer->pVkDebugReport) { vkDestroyDebugReportCallbackEXT(pRenderer->pVkInstance, pRenderer->pVkDebugReport, NULL); pRenderer->pVkDebugReport = NULL; } #endif vkDestroyInstance(pRenderer->pVkInstance, NULL); } static void AddDevice(const RendererDesc* pDesc, Renderer* pRenderer) { ASSERT(VK_NULL_HANDLE != pRenderer->pVkInstance); // These are the extensions that we have loaded const char* deviceExtensionCache[MAX_DEVICE_EXTENSIONS] = {}; VkResult vk_res = VK_RESULT_MAX_ENUM; #if VK_KHR_device_group_creation VkDeviceGroupDeviceCreateInfoKHR deviceGroupInfo = { VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO_KHR }; eastl::vector<VkPhysicalDeviceGroupPropertiesKHR> props; pRenderer->mLinkedNodeCount = 1; if (pRenderer->mGpuMode == GPU_MODE_LINKED && gDeviceGroupCreationExtension) { // (not shown) fill out devCreateInfo as usual. uint32_t deviceGroupCount = 0; // Query the number of device groups vkEnumeratePhysicalDeviceGroupsKHR(pRenderer->pVkInstance, &deviceGroupCount, NULL); // Allocate and initialize structures to query the device groups props.resize(deviceGroupCount); for (uint32_t i = 0; i < deviceGroupCount; ++i) { props[i].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES_KHR; props[i].pNext = NULL; } vk_res = vkEnumeratePhysicalDeviceGroupsKHR(pRenderer->pVkInstance, &deviceGroupCount, props.data()); ASSERT(VK_SUCCESS == vk_res); // If the first device group has more than one physical device. create // a logical device using all of the physical devices. for (uint32_t i = 0; i < deviceGroupCount; ++i) { if (props[i].physicalDeviceCount > 1) { deviceGroupInfo.physicalDeviceCount = props[i].physicalDeviceCount; deviceGroupInfo.pPhysicalDevices = props[i].physicalDevices; pRenderer->mLinkedNodeCount = deviceGroupInfo.physicalDeviceCount; break; } } } #endif if (pRenderer->mLinkedNodeCount < 2) { pRenderer->mGpuMode = GPU_MODE_SINGLE; } uint32_t gpuCount = 0; VkPhysicalDevice gpus[MAX_GPUS] = {}; VkPhysicalDeviceProperties2 gpuProperties[MAX_GPUS] = {}; VkPhysicalDeviceMemoryProperties gpuMemoryProperties[MAX_GPUS] = {}; VkPhysicalDeviceFeatures2KHR gpuFeatures[MAX_GPUS] = {}; VkQueueFamilyProperties* queueFamilyProperties[MAX_GPUS] = {}; uint32_t queueFamilyPropertyCount[MAX_GPUS] = {}; vk_res = vkEnumeratePhysicalDevices(pRenderer->pVkInstance, &gpuCount, NULL); ASSERT(VK_SUCCESS == vk_res); ASSERT(gpuCount); gpuCount = min<uint32_t>(MAX_GPUS, gpuCount); vk_res = vkEnumeratePhysicalDevices(pRenderer->pVkInstance, &gpuCount, gpus); ASSERT(VK_SUCCESS == vk_res); /************************************************************************/ // Select discrete gpus first // If we have multiple discrete gpus prefer with bigger VRAM size // To find VRAM in Vulkan, loop through all the heaps and find if the // heap has the DEVICE_LOCAL_BIT flag set /************************************************************************/ auto isDeviceBetter = [&gpuProperties, &gpuMemoryProperties](uint32_t testIndex, uint32_t refIndex)->bool { const VkPhysicalDeviceProperties& testProps = gpuProperties[testIndex].properties; const VkPhysicalDeviceProperties& refProps = gpuProperties[refIndex].properties; if (testProps.deviceType == VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU && refProps.deviceType == VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU) { return true; } if (testProps.deviceType == VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU && refProps.deviceType == VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU) { return false; } //compare by preset if both gpu's are of same type (integrated vs discrete) if (testProps.vendorID == refProps.vendorID && testProps.deviceID == refProps.deviceID) { const VkPhysicalDeviceMemoryProperties& testMemoryProps = gpuMemoryProperties[testIndex]; const VkPhysicalDeviceMemoryProperties& refMemoryProps = gpuMemoryProperties[refIndex]; //if presets are the same then sort by vram size VkDeviceSize totalTestVram = 0; VkDeviceSize totalRefVram = 0; for (uint32_t i = 0; i < testMemoryProps.memoryHeapCount; ++i) { if (VK_MEMORY_HEAP_DEVICE_LOCAL_BIT & testMemoryProps.memoryHeaps[i].flags) totalTestVram += testMemoryProps.memoryHeaps[i].size; } for (uint32_t i = 0; i < refMemoryProps.memoryHeapCount; ++i) { if (VK_MEMORY_HEAP_DEVICE_LOCAL_BIT & refMemoryProps.memoryHeaps[i].flags) totalRefVram += refMemoryProps.memoryHeaps[i].size; } return totalTestVram >= totalRefVram; } return false; }; uint32_t gpuIndex = UINT32_MAX; GPUSettings gpuSettings[MAX_GPUS] = {}; for (uint32_t i = 0; i < gpuCount; ++i) { // Get memory properties vkGetPhysicalDeviceMemoryProperties(gpus[i], &gpuMemoryProperties[i]); // Get features gpuFeatures[i].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR; #if VK_EXT_fragment_shader_interlock VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT fragmentShaderInterlockFeatures = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT }; gpuFeatures[i].pNext = &fragmentShaderInterlockFeatures; #endif vkGetPhysicalDeviceFeatures2KHR(gpus[i], &gpuFeatures[i]); // Get device properties VkPhysicalDeviceSubgroupProperties subgroupProperties = {}; subgroupProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES; subgroupProperties.pNext = NULL; gpuProperties[i].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR; gpuProperties[i].pNext = &subgroupProperties; vkGetPhysicalDeviceProperties2(gpus[i], &gpuProperties[i]); // Get queue family properties vkGetPhysicalDeviceQueueFamilyProperties(gpus[i], &queueFamilyPropertyCount[i], NULL); queueFamilyProperties[i] = (VkQueueFamilyProperties*)conf_calloc(queueFamilyPropertyCount[i], sizeof(VkQueueFamilyProperties)); vkGetPhysicalDeviceQueueFamilyProperties(gpus[i], &queueFamilyPropertyCount[i], queueFamilyProperties[i]); gpuSettings[i].mUniformBufferAlignment = (uint32_t)gpuProperties[i].properties.limits.minUniformBufferOffsetAlignment; gpuSettings[i].mUploadBufferTextureAlignment = 16; // TODO: (uint32_t)pRenderer->mVkGpuProperties[i].properties.limits.optimalBufferCopyOffsetAlignment; gpuSettings[i].mUploadBufferTextureRowAlignment = 1; // TODO: (uint32_t)pRenderer->mVkGpuProperties[i].properties.limits.optimalBufferCopyRowPitchAlignment; gpuSettings[i].mMaxVertexInputBindings = gpuProperties[i].properties.limits.maxVertexInputBindings; gpuSettings[i].mMultiDrawIndirect = gpuProperties[i].properties.limits.maxDrawIndirectCount > 1; gpuSettings[i].mWaveLaneCount = subgroupProperties.subgroupSize; #if VK_EXT_fragment_shader_interlock gpuSettings[i].mROVsSupported = (bool)fragmentShaderInterlockFeatures.fragmentShaderPixelInterlock; #endif //save vendor and model Id as string sprintf(gpuSettings[i].mGpuVendorPreset.mModelId, "%#x", gpuProperties[i].properties.deviceID); sprintf(gpuSettings[i].mGpuVendorPreset.mVendorId, "%#x", gpuProperties[i].properties.vendorID); strncpy( gpuSettings[i].mGpuVendorPreset.mGpuName, gpuProperties[i].properties.deviceName, MAX_GPU_VENDOR_STRING_LENGTH); //TODO: Fix once vulkan adds support for revision ID strncpy(gpuSettings[i].mGpuVendorPreset.mRevisionId, "0x00", MAX_GPU_VENDOR_STRING_LENGTH); gpuSettings[i].mGpuVendorPreset.mPresetLevel = getGPUPresetLevel( gpuSettings[i].mGpuVendorPreset.mVendorId, gpuSettings[i].mGpuVendorPreset.mModelId, gpuSettings[i].mGpuVendorPreset.mRevisionId); LOGF(LogLevel::eINFO, "GPU[%i] detected. Vendor ID: %x, Model ID: %x, Preset: %s, GPU Name: %s", i, gpuSettings[i].mGpuVendorPreset.mVendorId, gpuSettings[i].mGpuVendorPreset.mModelId, presetLevelToString(gpuSettings[i].mGpuVendorPreset.mPresetLevel), gpuSettings[i].mGpuVendorPreset.mGpuName); // Check that gpu supports at least graphics if (gpuIndex == UINT32_MAX || isDeviceBetter(i, gpuIndex)) { uint32_t count = queueFamilyPropertyCount[i]; VkQueueFamilyProperties* properties = queueFamilyProperties[i]; //select if graphics queue is available for (uint32_t j = 0; j < count; j++) { //get graphics queue family if (properties[j].queueFlags & VK_QUEUE_GRAPHICS_BIT) { gpuIndex = i; break; } } } } #if defined(AUTOMATED_TESTING) && defined(ACTIVE_TESTING_GPU) // Overwrite gpuIndex for automatic testing GPUVendorPreset activeTestingPreset; bool activeTestingGpu = getActiveGpuConfig(activeTestingPreset); if (activeTestingGpu) { for (uint32_t i = 0; i < pRenderer->mNumOfGPUs; i++) { VkPhysicalDeviceProperties& props = gpuProperties[i].properties; char deviceId[MAX_GPU_VENDOR_STRING_LENGTH]; sprintf(deviceId, "%#x", props.deviceID); char vendorId[MAX_GPU_VENDOR_STRING_LENGTH]; sprintf(vendorId, "%#x", props.vendorID); if (strcmp(vendorId, activeTestingPreset.mVendorId) == 0 && strcmp(deviceId, activeTestingPreset.mModelId)==0) { gpuIndex = i; break; } } } #endif // If we don't own the instance or device, then we need to set the gpuIndex to the correct physical device #if defined(VK_USE_DISPATCH_TABLES) gpuIndex = UINT32_MAX; for (uint32_t i = 0; i < gpuCount; i++) { if (gpus[i] == pRenderer->pVkActiveGPU) { gpuIndex = i; } } #endif ASSERT(gpuIndex != UINT32_MAX); pRenderer->pVkActiveGPU = gpus[gpuIndex]; pRenderer->pVkActiveGPUProperties = (VkPhysicalDeviceProperties2*)conf_malloc(sizeof(VkPhysicalDeviceProperties2)); pRenderer->pActiveGpuSettings = (GPUSettings*)conf_malloc(sizeof(GPUSettings)); *pRenderer->pVkActiveGPUProperties = gpuProperties[gpuIndex]; *pRenderer->pActiveGpuSettings = gpuSettings[gpuIndex]; ASSERT(VK_NULL_HANDLE != pRenderer->pVkActiveGPU); LOGF(LogLevel::eINFO, "GPU[%d] is selected as default GPU", gpuIndex); LOGF(LogLevel::eINFO, "Name of selected gpu: %s", pRenderer->pActiveGpuSettings->mGpuVendorPreset.mGpuName); LOGF(LogLevel::eINFO, "Vendor id of selected gpu: %s", pRenderer->pActiveGpuSettings->mGpuVendorPreset.mVendorId); LOGF(LogLevel::eINFO, "Model id of selected gpu: %s", pRenderer->pActiveGpuSettings->mGpuVendorPreset.mModelId); LOGF(LogLevel::eINFO, "Preset of selected gpu: %s", presetLevelToString(pRenderer->pActiveGpuSettings->mGpuVendorPreset.mPresetLevel)); uint32_t layerCount = 0; uint32_t extCount = 0; vkEnumerateDeviceLayerProperties(pRenderer->pVkActiveGPU, &layerCount, NULL); vkEnumerateDeviceExtensionProperties(pRenderer->pVkActiveGPU, NULL, &extCount, NULL); VkLayerProperties* layers = (VkLayerProperties*)alloca(sizeof(VkLayerProperties) * layerCount); vkEnumerateDeviceLayerProperties(pRenderer->pVkActiveGPU, &layerCount, layers); VkExtensionProperties* exts = (VkExtensionProperties*)alloca(sizeof(VkExtensionProperties) * extCount); vkEnumerateDeviceExtensionProperties(pRenderer->pVkActiveGPU, NULL, &extCount, exts); for (uint32_t i = 0; i < layerCount; ++i) { internal_log(LOG_TYPE_INFO, layers[i].layerName, "vkdevice-layer"); if (strcmp(layers[i].layerName, "VK_LAYER_RENDERDOC_Capture") == 0) gRenderDocLayerEnabled = true; } for (uint32_t i = 0; i < extCount; ++i) { internal_log(LOG_TYPE_INFO, exts[i].extensionName, "vkdevice-ext"); } uint32_t extension_count = 0; bool dedicatedAllocationExtension = false; bool memoryReq2Extension = false; bool externalMemoryExtension = false; #if defined(VK_USE_PLATFORM_WIN32_KHR) bool externalMemoryWin32Extension = false; #endif // Standalone extensions { const char* layer_name = NULL; uint32_t initialCount = sizeof(gVkWantedDeviceExtensions) / sizeof(gVkWantedDeviceExtensions[0]); const uint32_t userRequestedCount = (uint32_t)pDesc->mDeviceExtensionCount; eastl::vector<const char*> wantedDeviceExtensions(initialCount + userRequestedCount); for (uint32_t i = 0; i < initialCount; ++i) { wantedDeviceExtensions[i] = gVkWantedDeviceExtensions[i]; } for (uint32_t i = 0; i < userRequestedCount; ++i) { wantedDeviceExtensions[initialCount + i] = pDesc->ppDeviceExtensions[i]; } const uint32_t wanted_extension_count = (uint32_t)wantedDeviceExtensions.size(); uint32_t count = 0; vkEnumerateDeviceExtensionProperties(pRenderer->pVkActiveGPU, layer_name, &count, NULL); if (count > 0) { VkExtensionProperties* properties = (VkExtensionProperties*)conf_calloc(count, sizeof(*properties)); ASSERT(properties != NULL); vkEnumerateDeviceExtensionProperties(pRenderer->pVkActiveGPU, layer_name, &count, properties); for (uint32_t j = 0; j < count; ++j) { for (uint32_t k = 0; k < wanted_extension_count; ++k) { if (strcmp(wantedDeviceExtensions[k], properties[j].extensionName) == 0) { deviceExtensionCache[extension_count++] = wantedDeviceExtensions[k]; #ifndef USE_DEBUG_UTILS_EXTENSION if (strcmp(wantedDeviceExtensions[k], VK_EXT_DEBUG_MARKER_EXTENSION_NAME) == 0) gDebugMarkerSupport = true; #endif if (strcmp(wantedDeviceExtensions[k], VK_KHR_DEDICATED_ALLOCATION_EXTENSION_NAME) == 0) dedicatedAllocationExtension = true; if (strcmp(wantedDeviceExtensions[k], VK_KHR_GET_MEMORY_REQUIREMENTS_2_EXTENSION_NAME) == 0) memoryReq2Extension = true; if (strcmp(wantedDeviceExtensions[k], VK_KHR_EXTERNAL_MEMORY_EXTENSION_NAME) == 0) externalMemoryExtension = true; #if defined(VK_USE_PLATFORM_WIN32_KHR) if (strcmp(wantedDeviceExtensions[k], VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME) == 0) externalMemoryWin32Extension = true; #endif #ifdef VK_KHR_DRAW_INDIRECT_COUNT_EXTENSION_NAME if (strcmp(wantedDeviceExtensions[k], VK_KHR_DRAW_INDIRECT_COUNT_EXTENSION_NAME) == 0) gDrawIndirectCountExtension = true; #endif if (strcmp(wantedDeviceExtensions[k], VK_AMD_DRAW_INDIRECT_COUNT_EXTENSION_NAME) == 0) gAMDDrawIndirectCountExtension = true; if (strcmp(wantedDeviceExtensions[k], VK_AMD_GCN_SHADER_EXTENSION_NAME) == 0) gAMDGCNShaderExtension = true; if (strcmp(wantedDeviceExtensions[k], VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME) == 0) gDescriptorIndexingExtension = true; #ifdef VK_NV_RAY_TRACING_SPEC_VERSION if (strcmp(wantedDeviceExtensions[k], VK_NV_RAY_TRACING_EXTENSION_NAME) == 0) { pRenderer->mRaytracingExtension = 1; gNVRayTracingExtension = true; gDescriptorTypeRangeSize = CONF_DESCRIPTOR_TYPE_RANGE_SIZE; } #endif break; } } } SAFE_FREE((void*)properties); } } #if !defined(VK_USE_DISPATCH_TABLES) // Add more extensions here #if VK_EXT_fragment_shader_interlock VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT fragmentShaderInterlockFeatures = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT }; VkPhysicalDeviceDescriptorIndexingFeaturesEXT descriptorIndexingFeatures = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES_EXT, &fragmentShaderInterlockFeatures }; #else VkPhysicalDeviceDescriptorIndexingFeaturesEXT descriptorIndexingFeatures = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES_EXT }; #endif // VK_EXT_fragment_shader_interlock VkPhysicalDeviceFeatures2KHR gpuFeatures2 = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR }; gpuFeatures2.pNext = &descriptorIndexingFeatures; #ifndef NX64 vkGetPhysicalDeviceFeatures2KHR(pRenderer->pVkActiveGPU, &gpuFeatures2); #else vkGetPhysicalDeviceFeatures2(pRenderer->pVkActiveGPU, &gpuFeatures2); #endif // need a queue_priorite for each queue in the queue family we create uint32_t queueFamiliesCount = queueFamilyPropertyCount[gpuIndex]; VkQueueFamilyProperties* queueFamiliesProperties = queueFamilyProperties[gpuIndex]; eastl::vector<eastl::vector<float> > queue_priorities(queueFamiliesCount); uint32_t queue_create_infos_count = 0; DECLARE_ZERO(VkDeviceQueueCreateInfo, queue_create_infos[4]); //create all queue families with maximum amount of queues for (uint32_t i = 0; i < queueFamiliesCount; i++) { uint32_t queueCount = queueFamiliesProperties[i].queueCount; if (queueCount > 0) { queue_create_infos[queue_create_infos_count].sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO; queue_create_infos[queue_create_infos_count].pNext = NULL; queue_create_infos[queue_create_infos_count].flags = 0; queue_create_infos[queue_create_infos_count].queueFamilyIndex = i; queue_create_infos[queue_create_infos_count].queueCount = queueCount; queue_priorities[i].resize(queueCount); memset(queue_priorities[i].data(), 1, queue_priorities[i].size() * sizeof(float)); queue_create_infos[queue_create_infos_count].pQueuePriorities = queue_priorities[i].data(); queue_create_infos_count++; } } DECLARE_ZERO(VkDeviceCreateInfo, create_info); create_info.sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO; create_info.pNext = &gpuFeatures2; create_info.flags = 0; create_info.queueCreateInfoCount = queue_create_infos_count; create_info.pQueueCreateInfos = queue_create_infos; create_info.enabledLayerCount = 0; create_info.ppEnabledLayerNames = NULL; create_info.enabledExtensionCount = extension_count; create_info.ppEnabledExtensionNames = deviceExtensionCache; create_info.pEnabledFeatures = NULL; /************************************************************************/ // Add Device Group Extension if requested and available /************************************************************************/ #if VK_KHR_device_group_creation if (pRenderer->mGpuMode == GPU_MODE_LINKED) { create_info.pNext = &deviceGroupInfo; } #endif vk_res = vkCreateDevice(pRenderer->pVkActiveGPU, &create_info, NULL, &(pRenderer->pVkDevice)); ASSERT(VK_SUCCESS == vk_res); #if !defined(NX64) // Load Vulkan device functions to bypass loader volkLoadDevice(pRenderer->pVkDevice); #endif queue_priorities.clear(); #endif gDedicatedAllocationExtension = dedicatedAllocationExtension && memoryReq2Extension; #if defined(VK_USE_PLATFORM_WIN32_KHR) gExternalMemoryExtension = externalMemoryExtension && externalMemoryWin32Extension; #endif if (gDedicatedAllocationExtension) { LOGF(LogLevel::eINFO, "Successfully loaded Dedicated Allocation extension"); } if (gExternalMemoryExtension) { LOGF(LogLevel::eINFO, "Successfully loaded External Memory extension"); } #ifdef VK_KHR_DRAW_INDIRECT_COUNT_EXTENSION_NAME if (gDrawIndirectCountExtension) { pfnVkCmdDrawIndirectCountKHR = vkCmdDrawIndirectCountKHR; pfnVkCmdDrawIndexedIndirectCountKHR = vkCmdDrawIndexedIndirectCountKHR; LOGF(LogLevel::eINFO, "Successfully loaded Draw Indirect extension"); } else if (gAMDDrawIndirectCountExtension) #endif { pfnVkCmdDrawIndirectCountKHR = vkCmdDrawIndirectCountAMD; pfnVkCmdDrawIndexedIndirectCountKHR = vkCmdDrawIndexedIndirectCountAMD; LOGF(LogLevel::eINFO, "Successfully loaded AMD Draw Indirect extension"); } if (gAMDGCNShaderExtension) { LOGF(LogLevel::eINFO, "Successfully loaded AMD GCN Shader extension"); } if (gDescriptorIndexingExtension) { LOGF(LogLevel::eINFO, "Successfully loaded Descriptor Indexing extension"); } if (gNVRayTracingExtension) { LOGF(LogLevel::eINFO, "Successfully loaded Nvidia Ray Tracing extension"); } #ifdef USE_DEBUG_UTILS_EXTENSION gDebugMarkerSupport = (&vkCmdBeginDebugUtilsLabelEXT) && (&vkCmdEndDebugUtilsLabelEXT) && (&vkCmdInsertDebugUtilsLabelEXT) && (&vkSetDebugUtilsObjectNameEXT); #endif for (uint32_t i = 0; i < gpuCount; ++i) SAFE_FREE(queueFamilyProperties[i]); utils_caps_builder(pRenderer); } static void RemoveDevice(Renderer* pRenderer) { vkDestroyDevice(pRenderer->pVkDevice, NULL); SAFE_FREE(pRenderer->pActiveGpuSettings); SAFE_FREE(pRenderer->pVkActiveGPUProperties); } VkDeviceMemory get_vk_device_memory(Renderer* pRenderer, Buffer* pBuffer) { VmaAllocationInfo allocInfo = {}; vmaGetAllocationInfo(pRenderer->pVmaAllocator, pBuffer->pVkAllocation, &allocInfo); return allocInfo.deviceMemory; } uint64_t get_vk_device_memory_offset(Renderer* pRenderer, Buffer* pBuffer) { VmaAllocationInfo allocInfo = {}; vmaGetAllocationInfo(pRenderer->pVmaAllocator, pBuffer->pVkAllocation, &allocInfo); return (uint64_t)allocInfo.offset; } /************************************************************************/ // Renderer Init Remove /************************************************************************/ void initRenderer(const char* appName, const RendererDesc* pDesc, Renderer** ppRenderer) { ASSERT(appName); ASSERT(pDesc); ASSERT(ppRenderer); Renderer* pRenderer = (Renderer*)conf_calloc(1, sizeof(Renderer)); ASSERT(pRenderer); pRenderer->mGpuMode = pDesc->mGpuMode; pRenderer->mShaderTarget = pDesc->mShaderTarget; pRenderer->mEnableGpuBasedValidation = pDesc->mEnableGPUBasedValidation; pRenderer->mApi = RENDERER_API_VULKAN; pRenderer->pName = (char*)conf_calloc(strlen(appName) + 1, sizeof(char)); memcpy(pRenderer->pName, appName, strlen(appName)); // Initialize the Vulkan internal bits { #if defined(VK_USE_DISPATCH_TABLES) VkResult vkRes = volkInitializeWithDispatchTables(pRenderer); if (vkRes != VK_SUCCESS) { LOGF(LogLevel::eERROR, "Failed to initialize Vulkan"); return; } #else const char** instanceLayers = (const char**)alloca((2 + pDesc->mInstanceLayerCount) * sizeof(char*)); uint32_t instanceLayerCount = 0; #if defined(_DEBUG) // this turns on all validation layers instanceLayers[instanceLayerCount++] = "VK_LAYER_LUNARG_standard_validation"; #endif // this turns on render doc layer for gpu capture #ifdef USE_RENDER_DOC instanceLayers[instanceLayerCount++] = "VK_LAYER_RENDERDOC_Capture"; #endif // Add user specified instance layers for instance creation for (uint32_t i = 0; i < (uint32_t)pDesc->mInstanceLayerCount; ++i) instanceLayers[instanceLayerCount++] = pDesc->ppInstanceLayers[i]; #if !defined(NX64) VkResult vkRes = volkInitialize(); if (vkRes != VK_SUCCESS) { LOGF(LogLevel::eERROR, "Failed to initialize Vulkan"); return; } #endif CreateInstance(appName, pDesc, instanceLayerCount, instanceLayers, pRenderer); #endif AddDevice(pDesc, pRenderer); //anything below LOW preset is not supported and we will exit if (pRenderer->pActiveGpuSettings->mGpuVendorPreset.mPresetLevel < GPU_PRESET_LOW) { //have the condition in the assert as well so its cleared when the assert message box appears ASSERT(pRenderer->pActiveGpuSettings->mGpuVendorPreset.mPresetLevel >= GPU_PRESET_LOW); SAFE_FREE(pRenderer->pName); //remove device and any memory we allocated in just above as this is the first function called //when initializing the forge #if !defined(VK_USE_DISPATCH_TABLES) RemoveDevice(pRenderer); RemoveInstance(pRenderer); SAFE_FREE(pRenderer); LOGF(LogLevel::eERROR, "Selected GPU has an Office Preset in gpu.cfg."); LOGF(LogLevel::eERROR, "Office preset is not supported by The Forge."); #endif //return NULL pRenderer so that client can gracefully handle exit //This is better than exiting from here in case client has allocated memory or has fallbacks *pRenderer = {}; return; } /************************************************************************/ // Memory allocator /************************************************************************/ VmaAllocatorCreateInfo createInfo = { 0 }; createInfo.device = pRenderer->pVkDevice; createInfo.physicalDevice = pRenderer->pVkActiveGPU; // Render Doc Capture currently does not support use of this extension if (gDedicatedAllocationExtension && !gRenderDocLayerEnabled) { createInfo.flags |= VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT; } VmaVulkanFunctions vulkanFunctions = {}; vulkanFunctions.vkAllocateMemory = vkAllocateMemory; vulkanFunctions.vkBindBufferMemory = vkBindBufferMemory; vulkanFunctions.vkBindImageMemory = vkBindImageMemory; vulkanFunctions.vkCreateBuffer = vkCreateBuffer; vulkanFunctions.vkCreateImage = vkCreateImage; vulkanFunctions.vkDestroyBuffer = vkDestroyBuffer; vulkanFunctions.vkDestroyImage = vkDestroyImage; vulkanFunctions.vkFreeMemory = vkFreeMemory; vulkanFunctions.vkGetBufferMemoryRequirements = vkGetBufferMemoryRequirements; vulkanFunctions.vkGetBufferMemoryRequirements2KHR = vkGetBufferMemoryRequirements2KHR; vulkanFunctions.vkGetImageMemoryRequirements = vkGetImageMemoryRequirements; vulkanFunctions.vkGetImageMemoryRequirements2KHR = vkGetImageMemoryRequirements2KHR; vulkanFunctions.vkGetPhysicalDeviceMemoryProperties = vkGetPhysicalDeviceMemoryProperties; vulkanFunctions.vkGetPhysicalDeviceProperties = vkGetPhysicalDeviceProperties; vulkanFunctions.vkMapMemory = vkMapMemory; vulkanFunctions.vkUnmapMemory = vkUnmapMemory; vulkanFunctions.vkFlushMappedMemoryRanges = vkFlushMappedMemoryRanges; vulkanFunctions.vkInvalidateMappedMemoryRanges = vkInvalidateMappedMemoryRanges; vulkanFunctions.vkCmdCopyBuffer = vkCmdCopyBuffer; createInfo.pVulkanFunctions = &vulkanFunctions; vmaCreateAllocator(&createInfo, &pRenderer->pVmaAllocator); } VkDescriptorPoolSize descriptorPoolSizes[CONF_DESCRIPTOR_TYPE_RANGE_SIZE] = { { VK_DESCRIPTOR_TYPE_SAMPLER, 1024 }, { VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 1 }, { VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, 8192 }, { VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, 1024 }, { VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER, 1024 }, { VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER, 1024 }, { VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 8192 }, { VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 1024 }, { VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, 1024 }, { VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, 1 }, { VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, 1 }, }; #ifdef VK_NV_RAY_TRACING_SPEC_VERSION if (gNVRayTracingExtension) { descriptorPoolSizes[CONF_DESCRIPTOR_TYPE_RANGE_SIZE - 1] = { VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_NV, 1024 }; } #endif add_descriptor_pool(pRenderer, 8192, (VkDescriptorPoolCreateFlags)0, descriptorPoolSizes, gDescriptorTypeRangeSize, &pRenderer->pDescriptorPool); pRenderPassMutex = (Mutex*)conf_calloc(1, sizeof(Mutex)); pRenderPassMutex->Init(); gRenderPassMap = conf_placement_new<eastl::hash_map<ThreadID, RenderPassMap> >(conf_malloc(sizeof(*gRenderPassMap))); gFrameBufferMap = conf_placement_new<eastl::hash_map<ThreadID, FrameBufferMap> >(conf_malloc(sizeof(*gFrameBufferMap))); VkPhysicalDeviceFeatures2KHR gpuFeatures = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR }; vkGetPhysicalDeviceFeatures2KHR(pRenderer->pVkActiveGPU, &gpuFeatures); // Set shader macro based on runtime information static char descriptorIndexingMacroBuffer[2] = {}; static char textureArrayDynamicIndexingMacroBuffer[2] = {}; sprintf(descriptorIndexingMacroBuffer, "%u", (uint32_t)(gDescriptorIndexingExtension)); sprintf(textureArrayDynamicIndexingMacroBuffer, "%u", (uint32_t)(gpuFeatures.features.shaderSampledImageArrayDynamicIndexing)); static ShaderMacro rendererShaderDefines[] = { { "VK_EXT_DESCRIPTOR_INDEXING_ENABLED", descriptorIndexingMacroBuffer }, { "VK_FEATURE_TEXTURE_ARRAY_DYNAMIC_INDEXING_ENABLED", textureArrayDynamicIndexingMacroBuffer }, // Descriptor set indices { "UPDATE_FREQ_NONE", "set = 0" }, { "UPDATE_FREQ_PER_FRAME", "set = 1" }, { "UPDATE_FREQ_PER_BATCH", "set = 2" }, { "UPDATE_FREQ_PER_DRAW", "set = 3" }, }; pRenderer->mBuiltinShaderDefinesCount = sizeof(rendererShaderDefines) / sizeof(rendererShaderDefines[0]); pRenderer->pBuiltinShaderDefines = rendererShaderDefines; const uint32_t maxQueueFlag = VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT | VK_QUEUE_TRANSFER_BIT | VK_QUEUE_SPARSE_BINDING_BIT | VK_QUEUE_PROTECTED_BIT; pRenderer->pUsedQueueCount = (uint32_t**)conf_malloc(pRenderer->mLinkedNodeCount * sizeof(uint32_t*)); for (uint32_t i = 0; i < pRenderer->mLinkedNodeCount; ++i) pRenderer->pUsedQueueCount[i] = (uint32_t*)conf_calloc(maxQueueFlag, sizeof(uint32_t)); add_default_resources(pRenderer); // Renderer is good! *ppRenderer = pRenderer; } void removeRenderer(Renderer* pRenderer) { ASSERT(pRenderer); remove_default_resources(pRenderer); remove_descriptor_pool(pRenderer, pRenderer->pDescriptorPool); // Remove the renderpasses for (eastl::hash_map<ThreadID, RenderPassMap>::value_type& t : *gRenderPassMap) for (RenderPassMapNode& it : t.second) remove_render_pass(pRenderer, it.second); for (eastl::hash_map<ThreadID, FrameBufferMap>::value_type& t : *gFrameBufferMap) for (FrameBufferMapNode& it : t.second) remove_framebuffer(pRenderer, it.second); // Destroy the Vulkan bits vmaDestroyAllocator(pRenderer->pVmaAllocator); #if defined(VK_USE_DISPATCH_TABLES) #else RemoveDevice(pRenderer); RemoveInstance(pRenderer); #endif pRenderPassMutex->Destroy(); gRenderPassMap->clear(true); gFrameBufferMap->clear(true); SAFE_FREE(pRenderPassMutex); SAFE_FREE(gRenderPassMap); SAFE_FREE(gFrameBufferMap); for (uint32_t i = 0; i < pRenderer->mLinkedNodeCount; ++i) SAFE_FREE(pRenderer->pUsedQueueCount[i]); // Free all the renderer components! SAFE_FREE(pRenderer->pUsedQueueCount); SAFE_FREE(pRenderer->pCapBits); SAFE_FREE(pRenderer->pName); SAFE_FREE(pRenderer); } /************************************************************************/ // Resource Creation Functions /************************************************************************/ void addFence(Renderer* pRenderer, Fence** ppFence) { ASSERT(pRenderer); ASSERT(ppFence); ASSERT(VK_NULL_HANDLE != pRenderer->pVkDevice); Fence* pFence = (Fence*)conf_calloc(1, sizeof(Fence)); ASSERT(pFence); DECLARE_ZERO(VkFenceCreateInfo, add_info); add_info.sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO; add_info.pNext = NULL; add_info.flags = 0; VkResult vk_res = vkCreateFence(pRenderer->pVkDevice, &add_info, NULL, &(pFence->pVkFence)); ASSERT(VK_SUCCESS == vk_res); pFence->mSubmitted = false; *ppFence = pFence; } void removeFence(Renderer* pRenderer, Fence* pFence) { ASSERT(pRenderer); ASSERT(pFence); ASSERT(VK_NULL_HANDLE != pRenderer->pVkDevice); ASSERT(VK_NULL_HANDLE != pFence->pVkFence); vkDestroyFence(pRenderer->pVkDevice, pFence->pVkFence, NULL); SAFE_FREE(pFence); } void addSemaphore(Renderer* pRenderer, Semaphore** ppSemaphore) { ASSERT(pRenderer); ASSERT(ppSemaphore); ASSERT(VK_NULL_HANDLE != pRenderer->pVkDevice); Semaphore* pSemaphore = (Semaphore*)conf_calloc(1, sizeof(Semaphore)); ASSERT(pSemaphore); DECLARE_ZERO(VkSemaphoreCreateInfo, add_info); add_info.sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO; add_info.pNext = NULL; add_info.flags = 0; VkResult vk_res = vkCreateSemaphore(pRenderer->pVkDevice, &add_info, NULL, &(pSemaphore->pVkSemaphore)); ASSERT(VK_SUCCESS == vk_res); // Set signal inital state. pSemaphore->mSignaled = false; *ppSemaphore = pSemaphore; } void removeSemaphore(Renderer* pRenderer, Semaphore* pSemaphore) { ASSERT(pRenderer); ASSERT(pSemaphore); ASSERT(VK_NULL_HANDLE != pRenderer->pVkDevice); ASSERT(VK_NULL_HANDLE != pSemaphore->pVkSemaphore); vkDestroySemaphore(pRenderer->pVkDevice, pSemaphore->pVkSemaphore, NULL); SAFE_FREE(pSemaphore); } void addQueue(Renderer* pRenderer, QueueDesc* pDesc, Queue** ppQueue) { ASSERT(pDesc != NULL); uint32_t queueFamilyIndex = -1; VkQueueFlags requiredFlags = util_to_vk_queue_flags(pDesc->mType); uint32_t queueIndex = -1; bool found = false; const uint32_t nodeIndex = pDesc->mNodeIndex; // Get queue family properties uint32_t queueFamilyPropertyCount = 0; VkQueueFamilyProperties* queueFamilyProperties = NULL; vkGetPhysicalDeviceQueueFamilyProperties(pRenderer->pVkActiveGPU, &queueFamilyPropertyCount, NULL); queueFamilyProperties = (VkQueueFamilyProperties*)alloca(queueFamilyPropertyCount * sizeof(VkQueueFamilyProperties)); vkGetPhysicalDeviceQueueFamilyProperties(pRenderer->pVkActiveGPU, &queueFamilyPropertyCount, queueFamilyProperties); // Try to find a dedicated queue of this type for (uint32_t index = 0; index < queueFamilyPropertyCount; ++index) { VkQueueFlags queueFlags = queueFamilyProperties[index].queueFlags; if ((queueFlags & requiredFlags) && ((queueFlags & ~requiredFlags) == 0) && pRenderer->pUsedQueueCount[nodeIndex][queueFlags] < queueFamilyProperties[index].queueCount) { found = true; queueFamilyIndex = index; queueIndex = pRenderer->pUsedQueueCount[nodeIndex][queueFlags]; break; } } // If hardware doesn't provide a dedicated queue try to find a non-dedicated one if (!found) { for (uint32_t index = 0; index < queueFamilyPropertyCount; ++index) { VkQueueFlags queueFlags = queueFamilyProperties[index].queueFlags; if ((queueFlags & requiredFlags) && pRenderer->pUsedQueueCount[nodeIndex][queueFlags] < queueFamilyProperties[index].queueCount) { found = true; queueFamilyIndex = index; queueIndex = pRenderer->pUsedQueueCount[nodeIndex][queueFlags]; break; } } } if (!found) { found = true; queueFamilyIndex = 0; queueIndex = 0; LOGF(LogLevel::eWARNING, "Could not find queue of type %u. Using default queue", (uint32_t)pDesc->mType); } if (found) { VkQueueFamilyProperties& queueProps = queueFamilyProperties[queueFamilyIndex]; Queue* pQueue = (Queue*)conf_calloc(1, sizeof(Queue)); ASSERT(pQueue); pQueue->mVkQueueFamilyIndex = queueFamilyIndex; pQueue->mNodeIndex = pDesc->mNodeIndex; pQueue->mType = pDesc->mType; pQueue->mVkQueueIndex = queueIndex; pQueue->mGpuMode = pRenderer->mGpuMode; pQueue->mTimestampPeriod = pRenderer->pVkActiveGPUProperties->properties.limits.timestampPeriod; pQueue->mFlags = queueFamilyProperties[pQueue->mVkQueueFamilyIndex].queueFlags; pQueue->mUploadGranularity = { queueProps.minImageTransferGranularity.width, queueProps.minImageTransferGranularity.height, queueProps.minImageTransferGranularity.depth }; //get queue handle vkGetDeviceQueue( pRenderer->pVkDevice, pQueue->mVkQueueFamilyIndex, pQueue->mVkQueueIndex, &(pQueue->pVkQueue)); ASSERT(VK_NULL_HANDLE != pQueue->pVkQueue); ++pRenderer->pUsedQueueCount[nodeIndex][queueProps.queueFlags]; *ppQueue = pQueue; } else { LOGF(LogLevel::eERROR, "Cannot create queue of type (%u)", pDesc->mType); } } void removeQueue(Renderer* pRenderer, Queue* pQueue) { ASSERT(pQueue != NULL); const uint32_t nodeIndex = pQueue->mNodeIndex; VkQueueFlags queueFlags = pQueue->mFlags; --pRenderer->pUsedQueueCount[nodeIndex][queueFlags]; SAFE_FREE(pQueue); } void addCmdPool(Renderer* pRenderer, const CmdPoolDesc* pDesc, CmdPool** ppCmdPool) { ASSERT(pRenderer); ASSERT(VK_NULL_HANDLE != pRenderer->pVkDevice); ASSERT(ppCmdPool); CmdPool* pCmdPool = (CmdPool*)conf_calloc(1, sizeof(CmdPool)); ASSERT(pCmdPool); pCmdPool->pQueue = pDesc->pQueue; DECLARE_ZERO(VkCommandPoolCreateInfo, add_info); add_info.sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO; add_info.pNext = NULL; add_info.flags = VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT; add_info.queueFamilyIndex = pDesc->pQueue->mVkQueueFamilyIndex; if (pDesc->mTransient) { add_info.flags |= VK_COMMAND_POOL_CREATE_TRANSIENT_BIT; } VkResult vk_res = vkCreateCommandPool(pRenderer->pVkDevice, &add_info, NULL, &(pCmdPool->pVkCmdPool)); ASSERT(VK_SUCCESS == vk_res); *ppCmdPool = pCmdPool; } void removeCmdPool(Renderer* pRenderer, CmdPool* pCmdPool) { ASSERT(pRenderer); ASSERT(pCmdPool); ASSERT(VK_NULL_HANDLE != pRenderer->pVkDevice); ASSERT(VK_NULL_HANDLE != pCmdPool->pVkCmdPool); vkDestroyCommandPool(pRenderer->pVkDevice, pCmdPool->pVkCmdPool, NULL); SAFE_FREE(pCmdPool); } void addCmd(Renderer* pRenderer, const CmdDesc* pDesc, Cmd** ppCmd) { ASSERT(pRenderer); ASSERT(VK_NULL_HANDLE != pDesc->pPool); ASSERT(ppCmd); Cmd* pCmd = (Cmd*)conf_calloc(1, sizeof(Cmd)); ASSERT(pCmd); pCmd->pRenderer = pRenderer; pCmd->pQueue = pDesc->pPool->pQueue; pCmd->pCmdPool = pDesc->pPool; pCmd->mType = pDesc->pPool->pQueue->mType; pCmd->mNodeIndex = pDesc->pPool->pQueue->mNodeIndex; DECLARE_ZERO(VkCommandBufferAllocateInfo, alloc_info); alloc_info.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO; alloc_info.pNext = NULL; alloc_info.commandPool = pDesc->pPool->pVkCmdPool; alloc_info.level = pDesc->mSecondary ? VK_COMMAND_BUFFER_LEVEL_SECONDARY : VK_COMMAND_BUFFER_LEVEL_PRIMARY; alloc_info.commandBufferCount = 1; VkResult vk_res = vkAllocateCommandBuffers(pRenderer->pVkDevice, &alloc_info, &(pCmd->pVkCmdBuf)); ASSERT(VK_SUCCESS == vk_res); *ppCmd = pCmd; } void removeCmd(Renderer* pRenderer, Cmd* pCmd) { ASSERT(pRenderer); ASSERT(pCmd); ASSERT(VK_NULL_HANDLE != pCmd->pRenderer->pVkDevice); ASSERT(VK_NULL_HANDLE != pCmd->pVkCmdBuf); vkFreeCommandBuffers(pRenderer->pVkDevice, pCmd->pCmdPool->pVkCmdPool, 1, &(pCmd->pVkCmdBuf)); SAFE_FREE(pCmd); } void addCmd_n(Renderer* pRenderer, const CmdDesc* pDesc, uint32_t cmdCount, Cmd*** pppCmd) { //verify that ***cmd is valid ASSERT(pRenderer); ASSERT(pDesc); ASSERT(cmdCount); ASSERT(pppCmd); Cmd** ppCmds = (Cmd**)conf_calloc(cmdCount, sizeof(Cmd*)); ASSERT(ppCmds); //add n new cmds to given pool for (uint32_t i = 0; i < cmdCount; ++i) { ::addCmd(pRenderer, pDesc, &ppCmds[i]); } *pppCmd = ppCmds; } void removeCmd_n(Renderer* pRenderer, uint32_t cmdCount, Cmd** ppCmds) { //verify that given command list is valid ASSERT(ppCmds); //remove every given cmd in array for (uint32_t i = 0; i < cmdCount; ++i) { removeCmd(pRenderer, ppCmds[i]); } SAFE_FREE(ppCmds); } void toggleVSync(Renderer* pRenderer, SwapChain** ppSwapChain) { SwapChain* pSwapChain = *ppSwapChain; Queue queue = {}; queue.mVkQueueFamilyIndex = pSwapChain->mPresentQueueFamilyIndex; Queue* queues[] = { &queue }; SwapChainDesc desc = *pSwapChain->pDesc; desc.mEnableVsync = !desc.mEnableVsync; desc.mPresentQueueCount = 1; desc.ppPresentQueues = queues; //toggle vsync on or off //for Vulkan we need to remove the SwapChain and recreate it with correct vsync option removeSwapChain(pRenderer, pSwapChain); addSwapChain(pRenderer, &desc, ppSwapChain); } void addSwapChain(Renderer* pRenderer, const SwapChainDesc* pDesc, SwapChain** ppSwapChain) { ASSERT(pRenderer); ASSERT(pDesc); ASSERT(ppSwapChain); ASSERT(pDesc->mImageCount <= MAX_SWAPCHAIN_IMAGES); SwapChain* pSwapChain = (SwapChain*)conf_calloc(1, sizeof(SwapChain) + pDesc->mImageCount * sizeof(RenderTarget*) + sizeof(SwapChainDesc)); pSwapChain->ppRenderTargets = (RenderTarget**)(pSwapChain + 1); pSwapChain->pDesc = (SwapChainDesc*)(pSwapChain->ppRenderTargets + pDesc->mImageCount); ASSERT(pSwapChain); /************************************************************************/ // Create surface /************************************************************************/ ASSERT(VK_NULL_HANDLE != pRenderer->pVkInstance); VkResult vk_res; // Create a WSI surface for the window: #if defined(VK_USE_PLATFORM_WIN32_KHR) DECLARE_ZERO(VkWin32SurfaceCreateInfoKHR, add_info); add_info.sType = VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR; add_info.pNext = NULL; add_info.flags = 0; add_info.hinstance = ::GetModuleHandle(NULL); add_info.hwnd = (HWND)pDesc->mWindowHandle.window; vk_res = vkCreateWin32SurfaceKHR(pRenderer->pVkInstance, &add_info, NULL, &pSwapChain->pVkSurface); #elif defined(VK_USE_PLATFORM_XLIB_KHR) DECLARE_ZERO(VkXlibSurfaceCreateInfoKHR, add_info); add_info.sType = VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR; add_info.pNext = NULL; add_info.flags = 0; add_info.dpy = pDesc->mWindowHandle.display; //TODO add_info.window = pDesc->mWindowHandle.window; //TODO vk_res = vkCreateXlibSurfaceKHR(pRenderer->pVkInstance, &add_info, NULL, &pSwapChain->pVkSurface); #elif defined(VK_USE_PLATFORM_XCB_KHR) DECLARE_ZERO(VkXcbSurfaceCreateInfoKHR, add_info); add_info.sType = VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR; add_info.pNext = NULL; add_info.flags = 0; add_info.connection = pDesc->mWindowHandle.connection; //TODO add_info.window = pDesc->mWindowHandle.window; //TODO vk_res = vkCreateXcbSurfaceKHR(pRenderer->pVkInstance, &add_info, NULL, &pSwapChain->pVkSurface); #elif defined(VK_USE_PLATFORM_IOS_MVK) // Add IOS support here #elif defined(VK_USE_PLATFORM_MACOS_MVK) // Add MacOS support here #elif defined(VK_USE_PLATFORM_ANDROID_KHR) DECLARE_ZERO(VkAndroidSurfaceCreateInfoKHR, add_info); add_info.sType = VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR; add_info.pNext = NULL; add_info.flags = 0; add_info.window = (ANativeWindow*)pDesc->mWindowHandle.window; vk_res = vkCreateAndroidSurfaceKHR(pRenderer->pVkInstance, &add_info, NULL, &pSwapChain->pVkSurface); #elif defined(VK_USE_PLATFORM_GGP) extern VkResult ggpCreateSurface(VkInstance, VkSurfaceKHR* surface); vk_res = ggpCreateSurface(pRenderer->pVkInstance, &pSwapChain->pVkSurface); #elif defined(VK_USE_PLATFORM_VI_NN) extern VkResult nxCreateSurface(VkInstance, VkSurfaceKHR* surface); vk_res = nxCreateSurface(pRenderer->pVkInstance, &pSwapChain->pVkSurface); #else #error PLATFORM NOT SUPPORTED #endif ASSERT(VK_SUCCESS == vk_res); /************************************************************************/ // Create swap chain /************************************************************************/ ASSERT(VK_NULL_HANDLE != pRenderer->pVkActiveGPU); // Image count if (0 == pDesc->mImageCount) { ((SwapChainDesc*)pDesc)->mImageCount = 2; } DECLARE_ZERO(VkSurfaceCapabilitiesKHR, caps); vk_res = vkGetPhysicalDeviceSurfaceCapabilitiesKHR(pRenderer->pVkActiveGPU, pSwapChain->pVkSurface, &caps); ASSERT(VK_SUCCESS == vk_res); if ((caps.maxImageCount > 0) && (pDesc->mImageCount > caps.maxImageCount)) { ((SwapChainDesc*)pDesc)->mImageCount = caps.maxImageCount; } // Surface format // Select a surface format, depending on whether HDR is available. VkSurfaceFormatKHR hdrSurfaceFormat = { VK_FORMAT_A2B10G10R10_UNORM_PACK32, VK_COLOR_SPACE_HDR10_ST2084_EXT }; DECLARE_ZERO(VkSurfaceFormatKHR, surface_format); surface_format.format = VK_FORMAT_UNDEFINED; uint32_t surfaceFormatCount = 0; VkSurfaceFormatKHR* formats = NULL; // Get surface formats count vk_res = vkGetPhysicalDeviceSurfaceFormatsKHR(pRenderer->pVkActiveGPU, pSwapChain->pVkSurface, &surfaceFormatCount, NULL); ASSERT(VK_SUCCESS == vk_res); // Allocate and get surface formats formats = (VkSurfaceFormatKHR*)conf_calloc(surfaceFormatCount, sizeof(*formats)); vk_res = vkGetPhysicalDeviceSurfaceFormatsKHR(pRenderer->pVkActiveGPU, pSwapChain->pVkSurface, &surfaceFormatCount, formats); ASSERT(VK_SUCCESS == vk_res); if ((1 == surfaceFormatCount) && (VK_FORMAT_UNDEFINED == formats[0].format)) { surface_format.format = VK_FORMAT_B8G8R8A8_UNORM; surface_format.colorSpace = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR; } else { VkFormat requested_format = (VkFormat)TinyImageFormat_ToVkFormat(pDesc->mColorFormat); VkColorSpaceKHR requested_color_space = requested_format == hdrSurfaceFormat.format ? hdrSurfaceFormat.colorSpace : VK_COLOR_SPACE_SRGB_NONLINEAR_KHR; for (uint32_t i = 0; i < surfaceFormatCount; ++i) { if ((requested_format == formats[i].format) && (requested_color_space == formats[i].colorSpace)) { surface_format.format = requested_format; surface_format.colorSpace = requested_color_space; break; } } // Default to VK_FORMAT_B8G8R8A8_UNORM if requested format isn't found if (VK_FORMAT_UNDEFINED == surface_format.format) { surface_format.format = VK_FORMAT_B8G8R8A8_UNORM; surface_format.colorSpace = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR; } } ASSERT(VK_FORMAT_UNDEFINED != surface_format.format); // Free formats SAFE_FREE(formats); // The VK_PRESENT_MODE_FIFO_KHR mode must always be present as per spec // This mode waits for the vertical blank ("v-sync") VkPresentModeKHR present_mode = VK_PRESENT_MODE_FIFO_KHR; uint32_t swapChainImageCount = 0; VkPresentModeKHR* modes = NULL; // Get present mode count vk_res = vkGetPhysicalDeviceSurfacePresentModesKHR(pRenderer->pVkActiveGPU, pSwapChain->pVkSurface, &swapChainImageCount, NULL); ASSERT(VK_SUCCESS == vk_res); // Allocate and get present modes modes = (VkPresentModeKHR*)alloca(swapChainImageCount * sizeof(*modes)); vk_res = vkGetPhysicalDeviceSurfacePresentModesKHR(pRenderer->pVkActiveGPU, pSwapChain->pVkSurface, &swapChainImageCount, modes); ASSERT(VK_SUCCESS == vk_res); const uint32_t preferredModeCount = 4; VkPresentModeKHR preferredModeList[preferredModeCount] = { VK_PRESENT_MODE_IMMEDIATE_KHR, VK_PRESENT_MODE_MAILBOX_KHR, VK_PRESENT_MODE_FIFO_RELAXED_KHR, VK_PRESENT_MODE_FIFO_KHR }; uint32_t preferredModeStartIndex = pDesc->mEnableVsync ? 2 : 0; for (uint32_t j = preferredModeStartIndex; j < preferredModeCount; ++j) { VkPresentModeKHR mode = preferredModeList[j]; uint32_t i = 0; for (; i < swapChainImageCount; ++i) { if (modes[i] == mode) { break; } } if (i < swapChainImageCount) { present_mode = mode; break; } } // Swapchain VkExtent2D extent = { 0 }; extent.width = pDesc->mWidth; extent.height = pDesc->mHeight; VkSharingMode sharing_mode = VK_SHARING_MODE_EXCLUSIVE; uint32_t queue_family_index_count = 0; uint32_t queue_family_indices[2] = { pDesc->ppPresentQueues[0]->mVkQueueFamilyIndex, 0 }; uint32_t presentQueueFamilyIndex = -1; uint32_t nodeIndex = 0; // Get queue family properties uint32_t queueFamilyPropertyCount = 0; VkQueueFamilyProperties* queueFamilyProperties = NULL; vkGetPhysicalDeviceQueueFamilyProperties(pRenderer->pVkActiveGPU, &queueFamilyPropertyCount, NULL); queueFamilyProperties = (VkQueueFamilyProperties*)alloca(queueFamilyPropertyCount * sizeof(VkQueueFamilyProperties)); vkGetPhysicalDeviceQueueFamilyProperties(pRenderer->pVkActiveGPU, &queueFamilyPropertyCount, queueFamilyProperties); // Check if hardware provides dedicated present queue if (queueFamilyPropertyCount) { for (uint32_t index = 0; index < queueFamilyPropertyCount; ++index) { VkBool32 supports_present = VK_FALSE; VkResult res = vkGetPhysicalDeviceSurfaceSupportKHR(pRenderer->pVkActiveGPU, index, pSwapChain->pVkSurface, &supports_present); if ((VK_SUCCESS == res) && (VK_TRUE == supports_present) && pDesc->ppPresentQueues[0]->mVkQueueFamilyIndex != index) { presentQueueFamilyIndex = index; break; } } // If there is no dedicated present queue, just find the first available queue which supports present if (presentQueueFamilyIndex == -1) { for (uint32_t index = 0; index < queueFamilyPropertyCount; ++index) { VkBool32 supports_present = VK_FALSE; VkResult res = vkGetPhysicalDeviceSurfaceSupportKHR(pRenderer->pVkActiveGPU, index, pSwapChain->pVkSurface, &supports_present); if ((VK_SUCCESS == res) && (VK_TRUE == supports_present)) { presentQueueFamilyIndex = index; break; } else { // No present queue family available. Something goes wrong. ASSERT(0); } } } } // Find if gpu has a dedicated present queue if (presentQueueFamilyIndex != -1 && queue_family_indices[0] != presentQueueFamilyIndex) { queue_family_indices[0] = presentQueueFamilyIndex; vkGetDeviceQueue(pRenderer->pVkDevice, queue_family_indices[0], 0, &pSwapChain->pPresentQueue); queue_family_index_count = 1; pSwapChain->mPresentQueueFamilyIndex = presentQueueFamilyIndex; } else { pSwapChain->mPresentQueueFamilyIndex = queue_family_indices[0]; pSwapChain->pPresentQueue = VK_NULL_HANDLE; } VkSurfaceTransformFlagBitsKHR pre_transform; // #TODO: Add more if necessary but identity should be enough for now if (caps.supportedTransforms & VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR) { pre_transform = VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR; } else { pre_transform = caps.currentTransform; } DECLARE_ZERO(VkSwapchainCreateInfoKHR, swapChainCreateInfo); swapChainCreateInfo.sType = VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR; swapChainCreateInfo.pNext = NULL; swapChainCreateInfo.flags = 0; swapChainCreateInfo.surface = pSwapChain->pVkSurface; #ifndef VK_USE_PLATFORM_ANDROID_KHR swapChainCreateInfo.minImageCount = pDesc->mImageCount; #else //TODO: thomas Fixme hack swapChainCreateInfo.minImageCount = caps.minImageCount; #endif swapChainCreateInfo.imageFormat = surface_format.format; swapChainCreateInfo.imageColorSpace = surface_format.colorSpace; swapChainCreateInfo.imageExtent = extent; swapChainCreateInfo.imageArrayLayers = 1; swapChainCreateInfo.imageUsage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_SAMPLED_BIT; swapChainCreateInfo.imageSharingMode = sharing_mode; swapChainCreateInfo.queueFamilyIndexCount = queue_family_index_count; swapChainCreateInfo.pQueueFamilyIndices = queue_family_indices; swapChainCreateInfo.preTransform = pre_transform; swapChainCreateInfo.compositeAlpha = VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR; swapChainCreateInfo.presentMode = present_mode; swapChainCreateInfo.clipped = VK_TRUE; swapChainCreateInfo.oldSwapchain = 0; vk_res = vkCreateSwapchainKHR(pRenderer->pVkDevice, &swapChainCreateInfo, NULL, &(pSwapChain->pSwapChain)); ASSERT(VK_SUCCESS == vk_res); ((SwapChainDesc*)pDesc)->mColorFormat = TinyImageFormat_FromVkFormat((TinyImageFormat_VkFormat)surface_format.format); // Create rendertargets from swapchain uint32_t image_count = 0; vk_res = vkGetSwapchainImagesKHR(pRenderer->pVkDevice, pSwapChain->pSwapChain, &image_count, NULL); ASSERT(VK_SUCCESS == vk_res); ASSERT(image_count == pDesc->mImageCount); VkImage* images = (VkImage*)alloca(image_count * sizeof(VkImage)); vk_res = vkGetSwapchainImagesKHR(pRenderer->pVkDevice, pSwapChain->pSwapChain, &image_count, images); ASSERT(VK_SUCCESS == vk_res); RenderTargetDesc descColor = {}; descColor.mWidth = pDesc->mWidth; descColor.mHeight = pDesc->mHeight; descColor.mDepth = 1; descColor.mArraySize = 1; descColor.mFormat = pDesc->mColorFormat; descColor.mClearValue = pDesc->mColorClearValue; descColor.mSampleCount = SAMPLE_COUNT_1; descColor.mSampleQuality = 0; // Populate the vk_image field and add the Vulkan texture objects for (uint32_t i = 0; i < pDesc->mImageCount; ++i) { descColor.pNativeHandle = (void*)images[i]; addRenderTarget(pRenderer, &descColor, &pSwapChain->ppRenderTargets[i]); } /************************************************************************/ /************************************************************************/ *pSwapChain->pDesc = *pDesc; pSwapChain->mEnableVsync = pDesc->mEnableVsync; pSwapChain->mImageCount = pDesc->mImageCount; *ppSwapChain = pSwapChain; } void removeSwapChain(Renderer* pRenderer, SwapChain* pSwapChain) { ASSERT(pRenderer); ASSERT(pSwapChain); for (uint32_t i = 0; i < pSwapChain->mImageCount; ++i) { removeRenderTarget(pRenderer, pSwapChain->ppRenderTargets[i]); } vkDestroySwapchainKHR(pRenderer->pVkDevice, pSwapChain->pSwapChain, NULL); vkDestroySurfaceKHR(pRenderer->pVkInstance, pSwapChain->pVkSurface, NULL); SAFE_FREE(pSwapChain); } void addBuffer(Renderer* pRenderer, const BufferDesc* pDesc, Buffer** ppBuffer) { ASSERT(pRenderer); ASSERT(pDesc); ASSERT(pDesc->mSize > 0); ASSERT(VK_NULL_HANDLE != pRenderer->pVkDevice); Buffer* pBuffer = (Buffer*)conf_calloc(1, sizeof(Buffer)); ASSERT(ppBuffer); uint64_t allocationSize = pDesc->mSize; // Align the buffer size to multiples of the dynamic uniform buffer minimum size if (pDesc->mDescriptors & DESCRIPTOR_TYPE_UNIFORM_BUFFER) { uint64_t minAlignment = pRenderer->pActiveGpuSettings->mUniformBufferAlignment; allocationSize = round_up_64(allocationSize, minAlignment); } DECLARE_ZERO(VkBufferCreateInfo, add_info); add_info.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO; add_info.pNext = NULL; add_info.flags = 0; add_info.size = allocationSize; add_info.usage = util_to_vk_buffer_usage(pDesc->mDescriptors, pDesc->mFormat != TinyImageFormat_UNDEFINED); add_info.sharingMode = VK_SHARING_MODE_EXCLUSIVE; add_info.queueFamilyIndexCount = 0; add_info.pQueueFamilyIndices = NULL; // Buffer can be used as dest in a transfer command (Uploading data to a storage buffer, Readback query data) if (pDesc->mMemoryUsage == RESOURCE_MEMORY_USAGE_GPU_ONLY || pDesc->mMemoryUsage == RESOURCE_MEMORY_USAGE_GPU_TO_CPU) add_info.usage |= VK_BUFFER_USAGE_TRANSFER_DST_BIT; const bool linkedMultiGpu = (pRenderer->mGpuMode == GPU_MODE_LINKED && (pDesc->pSharedNodeIndices || pDesc->mNodeIndex)); VmaAllocationCreateInfo vma_mem_reqs = { 0 }; vma_mem_reqs.usage = (VmaMemoryUsage)pDesc->mMemoryUsage; vma_mem_reqs.flags = 0; if (pDesc->mFlags & BUFFER_CREATION_FLAG_OWN_MEMORY_BIT) vma_mem_reqs.flags |= VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT; if (pDesc->mFlags & BUFFER_CREATION_FLAG_PERSISTENT_MAP_BIT) vma_mem_reqs.flags |= VMA_ALLOCATION_CREATE_MAPPED_BIT; if (linkedMultiGpu) vma_mem_reqs.flags |= VMA_ALLOCATION_CREATE_DONT_BIND_BIT; VmaAllocationInfo alloc_info = {}; VkResult vk_res = (VkResult)vmaCreateBuffer(pRenderer->pVmaAllocator, &add_info, &vma_mem_reqs, &pBuffer->pVkBuffer, &pBuffer->pVkAllocation, &alloc_info); ASSERT(VK_SUCCESS == vk_res); pBuffer->pCpuMappedAddress = alloc_info.pMappedData; /************************************************************************/ // Buffer to be used on multiple GPUs /************************************************************************/ if (linkedMultiGpu) { VmaAllocationInfo allocInfo = {}; vmaGetAllocationInfo(pRenderer->pVmaAllocator, pBuffer->pVkAllocation, &allocInfo); /************************************************************************/ // Set all the device indices to the index of the device where we will create the buffer /************************************************************************/ uint32_t* pIndices = (uint32_t*)alloca(pRenderer->mLinkedNodeCount * sizeof(uint32_t)); util_calculate_device_indices(pRenderer, pDesc->mNodeIndex, pDesc->pSharedNodeIndices, pDesc->mSharedNodeIndexCount, pIndices); /************************************************************************/ // #TODO : Move this to the Vulkan memory allocator /************************************************************************/ VkBindBufferMemoryInfoKHR bindInfo = { VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO_KHR }; VkBindBufferMemoryDeviceGroupInfoKHR bindDeviceGroup = { VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO_KHR }; bindDeviceGroup.deviceIndexCount = pRenderer->mLinkedNodeCount; bindDeviceGroup.pDeviceIndices = pIndices; bindInfo.buffer = pBuffer->pVkBuffer; bindInfo.memory = allocInfo.deviceMemory; bindInfo.memoryOffset = allocInfo.offset; bindInfo.pNext = &bindDeviceGroup; vkBindBufferMemory2KHR(pRenderer->pVkDevice, 1, &bindInfo); /************************************************************************/ /************************************************************************/ } pBuffer->mCurrentState = RESOURCE_STATE_UNDEFINED; /************************************************************************/ // Set descriptor data /************************************************************************/ if ((pDesc->mDescriptors & DESCRIPTOR_TYPE_UNIFORM_BUFFER) || (pDesc->mDescriptors & DESCRIPTOR_TYPE_BUFFER) || (pDesc->mDescriptors & DESCRIPTOR_TYPE_RW_BUFFER)) { if ((pDesc->mDescriptors & DESCRIPTOR_TYPE_BUFFER) || (pDesc->mDescriptors & DESCRIPTOR_TYPE_RW_BUFFER)) { pBuffer->mOffset = pDesc->mStructStride * pDesc->mFirstElement; } } if (add_info.usage & VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT) { VkBufferViewCreateInfo viewInfo = { VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO, NULL }; viewInfo.buffer = pBuffer->pVkBuffer; viewInfo.flags = 0; viewInfo.format = (VkFormat)TinyImageFormat_ToVkFormat(pDesc->mFormat); viewInfo.offset = pDesc->mFirstElement * pDesc->mStructStride; viewInfo.range = pDesc->mElementCount * pDesc->mStructStride; VkFormatProperties formatProps = {}; vkGetPhysicalDeviceFormatProperties(pRenderer->pVkActiveGPU, viewInfo.format, &formatProps); if (!(formatProps.bufferFeatures & VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT)) { LOGF(LogLevel::eWARNING, "Failed to create uniform texel buffer view for format %u", (uint32_t)pDesc->mFormat); } else { vkCreateBufferView(pRenderer->pVkDevice, &viewInfo, NULL, &pBuffer->pVkUniformTexelView); } } if (add_info.usage & VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT) { VkBufferViewCreateInfo viewInfo = { VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO, NULL }; viewInfo.buffer = pBuffer->pVkBuffer; viewInfo.flags = 0; viewInfo.format = (VkFormat)TinyImageFormat_ToVkFormat(pDesc->mFormat); viewInfo.offset = pDesc->mFirstElement * pDesc->mStructStride; viewInfo.range = pDesc->mElementCount * pDesc->mStructStride; VkFormatProperties formatProps = {}; vkGetPhysicalDeviceFormatProperties(pRenderer->pVkActiveGPU, viewInfo.format, &formatProps); if (!(formatProps.bufferFeatures & VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT)) { LOGF(LogLevel::eWARNING, "Failed to create storage texel buffer view for format %u", (uint32_t)pDesc->mFormat); } else { vkCreateBufferView(pRenderer->pVkDevice, &viewInfo, NULL, &pBuffer->pVkStorageTexelView); } } if (pDesc->pDebugName) { char name[MAX_DEBUG_NAME_LENGTH] = {}; wcstombs(name, pDesc->pDebugName, MAX_DEBUG_NAME_LENGTH); setBufferName(pRenderer, pBuffer, name); } /************************************************************************/ /************************************************************************/ pBuffer->mSize = (uint32_t)pDesc->mSize; pBuffer->mMemoryUsage = pDesc->mMemoryUsage; pBuffer->mNodeIndex = pDesc->mNodeIndex; pBuffer->mStartState = pDesc->mStartState; pBuffer->mDescriptors = pDesc->mDescriptors; *ppBuffer = pBuffer; } void removeBuffer(Renderer* pRenderer, Buffer* pBuffer) { ASSERT(pRenderer); ASSERT(pBuffer); ASSERT(VK_NULL_HANDLE != pRenderer->pVkDevice); ASSERT(VK_NULL_HANDLE != pBuffer->pVkBuffer); if (pBuffer->pVkUniformTexelView) { vkDestroyBufferView(pRenderer->pVkDevice, pBuffer->pVkUniformTexelView, NULL); pBuffer->pVkUniformTexelView = VK_NULL_HANDLE; } if (pBuffer->pVkStorageTexelView) { vkDestroyBufferView(pRenderer->pVkDevice, pBuffer->pVkStorageTexelView, NULL); pBuffer->pVkStorageTexelView = VK_NULL_HANDLE; } vmaDestroyBuffer(pRenderer->pVmaAllocator, pBuffer->pVkBuffer, pBuffer->pVkAllocation); SAFE_FREE(pBuffer); } void addTexture(Renderer* pRenderer, const TextureDesc* pDesc, Texture** ppTexture) { ASSERT(pRenderer); ASSERT(pDesc && pDesc->mWidth && pDesc->mHeight && (pDesc->mDepth || pDesc->mArraySize)); if (pDesc->mSampleCount > SAMPLE_COUNT_1 && pDesc->mMipLevels > 1) { LOGF(LogLevel::eERROR, "Multi-Sampled textures cannot have mip maps"); ASSERT(false); return; } size_t totalSize = sizeof(Texture); totalSize += (pDesc->mDescriptors & DESCRIPTOR_TYPE_RW_TEXTURE ? (pDesc->mMipLevels * sizeof(VkImageView)) : 0); Texture* pTexture = (Texture*)conf_calloc(1, totalSize); ASSERT(pTexture); if (pDesc->mDescriptors & DESCRIPTOR_TYPE_RW_TEXTURE) pTexture->pVkUAVDescriptors = (VkImageView*)(pTexture + 1); if (pDesc->pNativeHandle && !(pDesc->mFlags & TEXTURE_CREATION_FLAG_IMPORT_BIT)) { pTexture->mOwnsImage = false; pTexture->pVkImage = (VkImage)pDesc->pNativeHandle; } else { pTexture->mOwnsImage = true; } VkImageUsageFlags additionalFlags = 0; if (pDesc->mStartState & RESOURCE_STATE_RENDER_TARGET) additionalFlags |= VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT; else if (pDesc->mStartState & RESOURCE_STATE_DEPTH_WRITE) additionalFlags |= VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT; VkImageType image_type = VK_IMAGE_TYPE_MAX_ENUM; if (pDesc->mFlags & TEXTURE_CREATION_FLAG_FORCE_2D) { ASSERT(pDesc->mDepth == 1); image_type = VK_IMAGE_TYPE_2D; } else if (pDesc->mFlags & TEXTURE_CREATION_FLAG_FORCE_3D) { image_type = VK_IMAGE_TYPE_3D; } else { if (pDesc->mDepth > 1) image_type = VK_IMAGE_TYPE_3D; else if (pDesc->mHeight > 1) image_type = VK_IMAGE_TYPE_2D; else image_type = VK_IMAGE_TYPE_1D; } DescriptorType descriptors = pDesc->mDescriptors; bool cubemapRequired = (DESCRIPTOR_TYPE_TEXTURE_CUBE == (descriptors & DESCRIPTOR_TYPE_TEXTURE_CUBE)); bool arrayRequired = false; if (VK_NULL_HANDLE == pTexture->pVkImage) { DECLARE_ZERO(VkImageCreateInfo, add_info); add_info.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO; add_info.pNext = NULL; add_info.flags = 0; add_info.imageType = image_type; add_info.format = (VkFormat)TinyImageFormat_ToVkFormat(pDesc->mFormat); add_info.extent.width = pDesc->mWidth; add_info.extent.height = pDesc->mHeight; add_info.extent.depth = pDesc->mDepth; add_info.mipLevels = pDesc->mMipLevels; add_info.arrayLayers = pDesc->mArraySize; add_info.samples = util_to_vk_sample_count(pDesc->mSampleCount); add_info.tiling = (0 != pDesc->mHostVisible) ? VK_IMAGE_TILING_LINEAR : VK_IMAGE_TILING_OPTIMAL; add_info.usage = util_to_vk_image_usage(descriptors); add_info.usage |= additionalFlags; add_info.sharingMode = VK_SHARING_MODE_EXCLUSIVE; add_info.queueFamilyIndexCount = 0; add_info.pQueueFamilyIndices = NULL; add_info.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED; if (cubemapRequired) add_info.flags |= VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT; if (arrayRequired) add_info.flags |= VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR; if (VK_IMAGE_USAGE_SAMPLED_BIT & add_info.usage) { // Make it easy to copy to and from textures add_info.usage |= (VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT); } ASSERT(pRenderer->pCapBits->canShaderReadFrom[pDesc->mFormat] && "GPU shader can't' read from this format"); // TODO Deano move hostvisible flag to capbits structure // Verify that GPU supports this format DECLARE_ZERO(VkFormatProperties, format_props); vkGetPhysicalDeviceFormatProperties(pRenderer->pVkActiveGPU, add_info.format, &format_props); VkFormatFeatureFlags format_features = util_vk_image_usage_to_format_features(add_info.usage); if (pDesc->mHostVisible) { VkFormatFeatureFlags flags = format_props.linearTilingFeatures & format_features; ASSERT((0 != flags) && "Format is not supported for host visible images"); } else { VkFormatFeatureFlags flags = format_props.optimalTilingFeatures & format_features; ASSERT((0 != flags) && "Format is not supported for GPU local images (i.e. not host visible images)"); } const bool linkedMultiGpu = (pRenderer->mGpuMode == GPU_MODE_LINKED) && (pDesc->pSharedNodeIndices || pDesc->mNodeIndex); VmaAllocationCreateInfo mem_reqs = { 0 }; if (pDesc->mFlags & TEXTURE_CREATION_FLAG_OWN_MEMORY_BIT) mem_reqs.flags |= VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT; if (linkedMultiGpu) mem_reqs.flags |= VMA_ALLOCATION_CREATE_DONT_BIND_BIT; mem_reqs.usage = (VmaMemoryUsage)VMA_MEMORY_USAGE_GPU_ONLY; VkExternalMemoryImageCreateInfoKHR externalInfo = { VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_KHR, NULL }; #if defined(VK_USE_PLATFORM_WIN32_KHR) VkImportMemoryWin32HandleInfoKHR importInfo = { VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR, NULL }; #endif VkExportMemoryAllocateInfoKHR exportMemoryInfo = { VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_KHR, NULL }; if (gExternalMemoryExtension && pDesc->mFlags & TEXTURE_CREATION_FLAG_IMPORT_BIT) { add_info.pNext = &externalInfo; #if defined(VK_USE_PLATFORM_WIN32_KHR) struct ImportHandleInfo { void* pHandle; VkExternalMemoryHandleTypeFlagBitsKHR mHandleType; }; ImportHandleInfo* pHandleInfo = (ImportHandleInfo*)pDesc->pNativeHandle; importInfo.handle = pHandleInfo->pHandle; importInfo.handleType = pHandleInfo->mHandleType; externalInfo.handleTypes = pHandleInfo->mHandleType; mem_reqs.pUserData = &importInfo; // Allocate external (importable / exportable) memory as dedicated memory to avoid adding unnecessary complexity to the Vulkan Memory Allocator mem_reqs.flags |= VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT; #endif } else if (gExternalMemoryExtension && pDesc->mFlags & TEXTURE_CREATION_FLAG_EXPORT_BIT) { #if defined(VK_USE_PLATFORM_WIN32_KHR) exportMemoryInfo.handleTypes = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR; #endif mem_reqs.pUserData = &exportMemoryInfo; // Allocate external (importable / exportable) memory as dedicated memory to avoid adding unnecessary complexity to the Vulkan Memory Allocator mem_reqs.flags |= VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT; } VmaAllocationInfo alloc_info = {}; VkResult vk_res = (VkResult)vmaCreateImage(pRenderer->pVmaAllocator, &add_info, &mem_reqs, &pTexture->pVkImage, &pTexture->pVkAllocation, &alloc_info); ASSERT(VK_SUCCESS == vk_res); /************************************************************************/ // Texture to be used on multiple GPUs /************************************************************************/ if (linkedMultiGpu) { VmaAllocationInfo allocInfo = {}; vmaGetAllocationInfo(pRenderer->pVmaAllocator, pTexture->pVkAllocation, &allocInfo); /************************************************************************/ // Set all the device indices to the index of the device where we will create the texture /************************************************************************/ uint32_t* pIndices = (uint32_t*)alloca(pRenderer->mLinkedNodeCount * sizeof(uint32_t)); util_calculate_device_indices(pRenderer, pDesc->mNodeIndex, pDesc->pSharedNodeIndices, pDesc->mSharedNodeIndexCount, pIndices); /************************************************************************/ // #TODO : Move this to the Vulkan memory allocator /************************************************************************/ VkBindImageMemoryInfoKHR bindInfo = { VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO_KHR }; VkBindImageMemoryDeviceGroupInfoKHR bindDeviceGroup = { VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO_KHR }; bindDeviceGroup.deviceIndexCount = pRenderer->mLinkedNodeCount; bindDeviceGroup.pDeviceIndices = pIndices; bindInfo.image = pTexture->pVkImage; bindInfo.memory = allocInfo.deviceMemory; bindInfo.memoryOffset = allocInfo.offset; bindInfo.pNext = &bindDeviceGroup; vkBindImageMemory2KHR(pRenderer->pVkDevice, 1, &bindInfo); /************************************************************************/ /************************************************************************/ } pTexture->mCurrentState = RESOURCE_STATE_UNDEFINED; } /************************************************************************/ // Create image view /************************************************************************/ VkImageViewType view_type = VK_IMAGE_VIEW_TYPE_MAX_ENUM; switch (image_type) { case VK_IMAGE_TYPE_1D: view_type = pDesc->mArraySize > 1 ? VK_IMAGE_VIEW_TYPE_1D_ARRAY : VK_IMAGE_VIEW_TYPE_1D; break; case VK_IMAGE_TYPE_2D: if (cubemapRequired) view_type = (pDesc->mArraySize > 6) ? VK_IMAGE_VIEW_TYPE_CUBE_ARRAY : VK_IMAGE_VIEW_TYPE_CUBE; else view_type = pDesc->mArraySize > 1 ? VK_IMAGE_VIEW_TYPE_2D_ARRAY : VK_IMAGE_VIEW_TYPE_2D; break; case VK_IMAGE_TYPE_3D: if (pDesc->mArraySize > 1) { LOGF(LogLevel::eERROR, "Cannot support 3D Texture Array in Vulkan"); ASSERT(false); } view_type = VK_IMAGE_VIEW_TYPE_3D; break; default: ASSERT(false && "Image Format not supported!"); break; } ASSERT(view_type != VK_IMAGE_VIEW_TYPE_MAX_ENUM && "Invalid Image View"); VkImageViewCreateInfo srvDesc = {}; // SRV srvDesc.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO; srvDesc.pNext = NULL; srvDesc.flags = 0; srvDesc.image = pTexture->pVkImage; srvDesc.viewType = view_type; srvDesc.format = (VkFormat)TinyImageFormat_ToVkFormat(pDesc->mFormat); srvDesc.components.r = VK_COMPONENT_SWIZZLE_R; srvDesc.components.g = VK_COMPONENT_SWIZZLE_G; srvDesc.components.b = VK_COMPONENT_SWIZZLE_B; srvDesc.components.a = VK_COMPONENT_SWIZZLE_A; srvDesc.subresourceRange.aspectMask = util_vk_determine_aspect_mask(srvDesc.format, false); srvDesc.subresourceRange.baseMipLevel = 0; srvDesc.subresourceRange.levelCount = pDesc->mMipLevels; srvDesc.subresourceRange.baseArrayLayer = 0; srvDesc.subresourceRange.layerCount = pDesc->mArraySize; pTexture->mAspectMask = util_vk_determine_aspect_mask(srvDesc.format, true); if (descriptors & DESCRIPTOR_TYPE_TEXTURE) { VkResult vk_res = vkCreateImageView(pRenderer->pVkDevice, &srvDesc, NULL, &pTexture->pVkSRVDescriptor); ASSERT(VK_SUCCESS == vk_res); } // SRV stencil if ((TinyImageFormat_HasStencil(pDesc->mFormat)) && (descriptors & DESCRIPTOR_TYPE_TEXTURE)) { srvDesc.subresourceRange.aspectMask = VK_IMAGE_ASPECT_STENCIL_BIT; VkResult vk_res = vkCreateImageView(pRenderer->pVkDevice, &srvDesc, NULL, &pTexture->pVkSRVStencilDescriptor); ASSERT(VK_SUCCESS == vk_res); } // UAV if (descriptors & DESCRIPTOR_TYPE_RW_TEXTURE) { VkImageViewCreateInfo uavDesc = srvDesc; // #NOTE : We dont support imageCube, imageCubeArray for consistency with other APIs // All cubemaps will be used as image2DArray for Image Load / Store ops if (uavDesc.viewType == VK_IMAGE_VIEW_TYPE_CUBE_ARRAY || uavDesc.viewType == VK_IMAGE_VIEW_TYPE_CUBE) uavDesc.viewType = VK_IMAGE_VIEW_TYPE_2D_ARRAY; uavDesc.subresourceRange.levelCount = 1; for (uint32_t i = 0; i < pDesc->mMipLevels; ++i) { uavDesc.subresourceRange.baseMipLevel = i; VkResult vk_res = vkCreateImageView(pRenderer->pVkDevice, &uavDesc, NULL, &pTexture->pVkUAVDescriptors[i]); ASSERT(VK_SUCCESS == vk_res); } } /************************************************************************/ /************************************************************************/ pTexture->mNodeIndex = pDesc->mNodeIndex; pTexture->mStartState = pDesc->mStartState; pTexture->mWidth = pDesc->mWidth; pTexture->mHeight = pDesc->mHeight; pTexture->mDepth = pDesc->mDepth; pTexture->mMipLevels = pDesc->mMipLevels; pTexture->mUav = pDesc->mDescriptors & DESCRIPTOR_TYPE_RW_TEXTURE; if (pDesc->pDebugName) { char name[MAX_DEBUG_NAME_LENGTH] = {}; wcstombs(name, pDesc->pDebugName, MAX_DEBUG_NAME_LENGTH); setTextureName(pRenderer, pTexture, name); } *ppTexture = pTexture; } void removeTexture(Renderer* pRenderer, Texture* pTexture) { ASSERT(pRenderer); ASSERT(pTexture); ASSERT(VK_NULL_HANDLE != pRenderer->pVkDevice); ASSERT(VK_NULL_HANDLE != pTexture->pVkImage); if (pTexture->mOwnsImage) vmaDestroyImage(pRenderer->pVmaAllocator, pTexture->pVkImage, pTexture->pVkAllocation); if (VK_NULL_HANDLE != pTexture->pVkSRVDescriptor) vkDestroyImageView(pRenderer->pVkDevice, pTexture->pVkSRVDescriptor, NULL); if (VK_NULL_HANDLE != pTexture->pVkSRVStencilDescriptor) vkDestroyImageView(pRenderer->pVkDevice, pTexture->pVkSRVStencilDescriptor, NULL); if (pTexture->pVkUAVDescriptors) { for (uint32_t i = 0; i < pTexture->mMipLevels; ++i) { vkDestroyImageView(pRenderer->pVkDevice, pTexture->pVkUAVDescriptors[i], NULL); } } if (pTexture->pSvt) { removeVirtualTexture(pRenderer, pTexture->pSvt); } SAFE_FREE(pTexture); } void addRenderTarget(Renderer* pRenderer, const RenderTargetDesc* pDesc, RenderTarget** ppRenderTarget) { ASSERT(pRenderer); ASSERT(pDesc); ASSERT(ppRenderTarget); bool const isDepth = TinyImageFormat_IsDepthOnly(pDesc->mFormat) || TinyImageFormat_IsDepthAndStencil(pDesc->mFormat); ASSERT(!((isDepth) && (pDesc->mDescriptors & DESCRIPTOR_TYPE_RW_TEXTURE)) && "Cannot use depth stencil as UAV"); ((RenderTargetDesc*)pDesc)->mMipLevels = max(1U, pDesc->mMipLevels); uint32_t depthOrArraySize = pDesc->mArraySize * pDesc->mDepth; uint32_t numRTVs = pDesc->mMipLevels; if ((pDesc->mDescriptors & DESCRIPTOR_TYPE_RENDER_TARGET_ARRAY_SLICES) || (pDesc->mDescriptors & DESCRIPTOR_TYPE_RENDER_TARGET_DEPTH_SLICES)) numRTVs *= depthOrArraySize; size_t totalSize = sizeof(RenderTarget); totalSize += numRTVs * sizeof(VkImageView); RenderTarget* pRenderTarget = (RenderTarget*)conf_calloc(1, totalSize); ASSERT(pRenderTarget); pRenderTarget->pVkSliceDescriptors = (VkImageView*)(pRenderTarget + 1); // Monotonically increasing thread safe id generation pRenderTarget->mId = tfrg_atomic64_add_relaxed(&gRenderTargetIds, 1); TextureDesc textureDesc = {}; textureDesc.mArraySize = pDesc->mArraySize; textureDesc.mClearValue = pDesc->mClearValue; textureDesc.mDepth = pDesc->mDepth; textureDesc.mFlags = pDesc->mFlags; textureDesc.mFormat = pDesc->mFormat; textureDesc.mHeight = pDesc->mHeight; textureDesc.mHostVisible = false; textureDesc.mMipLevels = pDesc->mMipLevels; textureDesc.mSampleCount = pDesc->mSampleCount; textureDesc.mSampleQuality = pDesc->mSampleQuality; textureDesc.mWidth = pDesc->mWidth; textureDesc.pNativeHandle = pDesc->pNativeHandle; textureDesc.mNodeIndex = pDesc->mNodeIndex; textureDesc.pSharedNodeIndices = pDesc->pSharedNodeIndices; textureDesc.mSharedNodeIndexCount = pDesc->mSharedNodeIndexCount; if (!isDepth) textureDesc.mStartState |= RESOURCE_STATE_RENDER_TARGET; else textureDesc.mStartState |= RESOURCE_STATE_DEPTH_WRITE; // Set this by default to be able to sample the rendertarget in shader textureDesc.mDescriptors = pDesc->mDescriptors; // Create SRV by default for a render target textureDesc.mDescriptors |= DESCRIPTOR_TYPE_TEXTURE; if (isDepth) { // Make sure depth/stencil format is supported - fall back to VK_FORMAT_D16_UNORM if not VkFormat vk_depth_stencil_format = (VkFormat) TinyImageFormat_ToVkFormat(pDesc->mFormat); if (VK_FORMAT_UNDEFINED != vk_depth_stencil_format) { DECLARE_ZERO(VkImageFormatProperties, properties); VkResult vk_res = vkGetPhysicalDeviceImageFormatProperties( pRenderer->pVkActiveGPU, vk_depth_stencil_format, VK_IMAGE_TYPE_2D, VK_IMAGE_TILING_OPTIMAL, VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, 0, &properties); // Fall back to something that's guaranteed to work if (VK_SUCCESS != vk_res) { textureDesc.mFormat = TinyImageFormat_D16_UNORM; LOGF(LogLevel::eWARNING, "Depth stencil format (%u) not supported. Falling back to D16 format", pDesc->mFormat); } } } addTexture(pRenderer, &textureDesc, &pRenderTarget->pTexture); VkImageViewType viewType = VK_IMAGE_VIEW_TYPE_MAX_ENUM; if (pDesc->mDepth > 1) viewType = VK_IMAGE_VIEW_TYPE_3D; else if (pDesc->mHeight > 1) viewType = pDesc->mArraySize > 1 ? VK_IMAGE_VIEW_TYPE_2D_ARRAY : VK_IMAGE_VIEW_TYPE_2D; else viewType = pDesc->mArraySize > 1 ? VK_IMAGE_VIEW_TYPE_1D_ARRAY : VK_IMAGE_VIEW_TYPE_1D; VkImageViewCreateInfo rtvDesc = { VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO, NULL }; rtvDesc.flags = 0; rtvDesc.image = pRenderTarget->pTexture->pVkImage; rtvDesc.viewType = viewType; rtvDesc.format = (VkFormat)TinyImageFormat_ToVkFormat(pDesc->mFormat); rtvDesc.components.r = VK_COMPONENT_SWIZZLE_R; rtvDesc.components.g = VK_COMPONENT_SWIZZLE_G; rtvDesc.components.b = VK_COMPONENT_SWIZZLE_B; rtvDesc.components.a = VK_COMPONENT_SWIZZLE_A; rtvDesc.subresourceRange.aspectMask = util_vk_determine_aspect_mask(rtvDesc.format, true); rtvDesc.subresourceRange.baseMipLevel = 0; rtvDesc.subresourceRange.levelCount = 1; rtvDesc.subresourceRange.baseArrayLayer = 0; rtvDesc.subresourceRange.layerCount = depthOrArraySize; if (VK_IMAGE_VIEW_TYPE_3D == viewType) rtvDesc.subresourceRange.layerCount = 1; vkCreateImageView(pRenderer->pVkDevice, &rtvDesc, NULL, &pRenderTarget->pVkDescriptor); for (uint32_t i = 0; i < pDesc->mMipLevels; ++i) { rtvDesc.subresourceRange.baseMipLevel = i; if ((pDesc->mDescriptors & DESCRIPTOR_TYPE_RENDER_TARGET_ARRAY_SLICES) || (pDesc->mDescriptors & DESCRIPTOR_TYPE_RENDER_TARGET_DEPTH_SLICES)) { for (uint32_t j = 0; j < depthOrArraySize; ++j) { rtvDesc.subresourceRange.layerCount = 1; rtvDesc.subresourceRange.baseArrayLayer = j; VkResult vkRes = vkCreateImageView(pRenderer->pVkDevice, &rtvDesc, NULL, &pRenderTarget->pVkSliceDescriptors[i * depthOrArraySize + j]); ASSERT(VK_SUCCESS == vkRes); } } else { VkResult vkRes = vkCreateImageView(pRenderer->pVkDevice, &rtvDesc, NULL, &pRenderTarget->pVkSliceDescriptors[i]); ASSERT(VK_SUCCESS == vkRes); } } pRenderTarget->mWidth = pDesc->mWidth; pRenderTarget->mHeight = pDesc->mHeight; pRenderTarget->mArraySize = pDesc->mArraySize; pRenderTarget->mDepth = pDesc->mDepth; pRenderTarget->mMipLevels = pDesc->mMipLevels; pRenderTarget->mSampleCount = pDesc->mSampleCount; pRenderTarget->mSampleQuality = pDesc->mSampleQuality; pRenderTarget->mFormat = pDesc->mFormat; pRenderTarget->mClearValue = pDesc->mClearValue; *ppRenderTarget = pRenderTarget; } void removeRenderTarget(Renderer* pRenderer, RenderTarget* pRenderTarget) { ::removeTexture(pRenderer, pRenderTarget->pTexture); vkDestroyImageView(pRenderer->pVkDevice, pRenderTarget->pVkDescriptor, NULL); const uint32_t depthOrArraySize = pRenderTarget->mArraySize * pRenderTarget->mDepth; if ((pRenderTarget->mDescriptors & DESCRIPTOR_TYPE_RENDER_TARGET_ARRAY_SLICES) || (pRenderTarget->mDescriptors & DESCRIPTOR_TYPE_RENDER_TARGET_DEPTH_SLICES)) { for (uint32_t i = 0; i < pRenderTarget->mMipLevels; ++i) for (uint32_t j = 0; j < depthOrArraySize; ++j) vkDestroyImageView(pRenderer->pVkDevice, pRenderTarget->pVkSliceDescriptors[i * depthOrArraySize + j], NULL); } else { for (uint32_t i = 0; i < pRenderTarget->mMipLevels; ++i) vkDestroyImageView(pRenderer->pVkDevice, pRenderTarget->pVkSliceDescriptors[i], NULL); } SAFE_FREE(pRenderTarget); } void addSampler(Renderer* pRenderer, const SamplerDesc* pDesc, Sampler** ppSampler) { ASSERT(pRenderer); ASSERT(VK_NULL_HANDLE != pRenderer->pVkDevice); ASSERT(pDesc->mCompareFunc < MAX_COMPARE_MODES); ASSERT(ppSampler); Sampler* pSampler = (Sampler*)conf_calloc(1, sizeof(Sampler)); ASSERT(pSampler); DECLARE_ZERO(VkSamplerCreateInfo, add_info); add_info.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO; add_info.pNext = NULL; add_info.flags = 0; add_info.magFilter = util_to_vk_filter(pDesc->mMagFilter); add_info.minFilter = util_to_vk_filter(pDesc->mMinFilter); add_info.mipmapMode = util_to_vk_mip_map_mode(pDesc->mMipMapMode); add_info.addressModeU = util_to_vk_address_mode(pDesc->mAddressU); add_info.addressModeV = util_to_vk_address_mode(pDesc->mAddressV); add_info.addressModeW = util_to_vk_address_mode(pDesc->mAddressW); add_info.mipLodBias = pDesc->mMipLodBias; add_info.anisotropyEnable = (pDesc->mMaxAnisotropy > 0.0f)? VK_TRUE : VK_FALSE; add_info.maxAnisotropy = pDesc->mMaxAnisotropy; add_info.compareEnable = (gVkComparisonFuncTranslator[pDesc->mCompareFunc] != VK_COMPARE_OP_NEVER) ? VK_TRUE : VK_FALSE; add_info.compareOp = gVkComparisonFuncTranslator[pDesc->mCompareFunc]; add_info.minLod = 0.0f; add_info.maxLod = ((pDesc->mMipMapMode == MIPMAP_MODE_LINEAR) ? FLT_MAX : 0.0f); add_info.borderColor = VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK; add_info.unnormalizedCoordinates = VK_FALSE; VkResult vk_res = vkCreateSampler(pRenderer->pVkDevice, &add_info, NULL, &(pSampler->pVkSampler)); ASSERT(VK_SUCCESS == vk_res); *ppSampler = pSampler; } void removeSampler(Renderer* pRenderer, Sampler* pSampler) { ASSERT(pRenderer); ASSERT(pSampler); ASSERT(VK_NULL_HANDLE != pRenderer->pVkDevice); ASSERT(VK_NULL_HANDLE != pSampler->pVkSampler); vkDestroySampler(pRenderer->pVkDevice, pSampler->pVkSampler, NULL); SAFE_FREE(pSampler); } /************************************************************************/ // Buffer Functions /************************************************************************/ void mapBuffer(Renderer* pRenderer, Buffer* pBuffer, ReadRange* pRange) { ASSERT(pBuffer->mMemoryUsage != RESOURCE_MEMORY_USAGE_GPU_ONLY && "Trying to map non-cpu accessible resource"); VkResult vk_res = vmaMapMemory(pRenderer->pVmaAllocator, pBuffer->pVkAllocation, &pBuffer->pCpuMappedAddress); ASSERT(vk_res == VK_SUCCESS); if (pRange) { pBuffer->pCpuMappedAddress = ((uint8_t*)pBuffer->pCpuMappedAddress + pRange->mOffset); } } void unmapBuffer(Renderer* pRenderer, Buffer* pBuffer) { ASSERT(pBuffer->mMemoryUsage != RESOURCE_MEMORY_USAGE_GPU_ONLY && "Trying to unmap non-cpu accessible resource"); vmaUnmapMemory(pRenderer->pVmaAllocator, pBuffer->pVkAllocation); pBuffer->pCpuMappedAddress = NULL; } /************************************************************************/ // Descriptor Set Functions /************************************************************************/ void addDescriptorSet(Renderer* pRenderer, const DescriptorSetDesc* pDesc, DescriptorSet** ppDescriptorSet) { ASSERT(pRenderer); ASSERT(pDesc); ASSERT(ppDescriptorSet); const RootSignature* pRootSignature = pDesc->pRootSignature; const DescriptorUpdateFrequency updateFreq = pDesc->mUpdateFrequency; const uint32_t nodeIndex = pDesc->mNodeIndex; const uint32_t descriptorCount = pRootSignature->mVkCumulativeDescriptorCounts[updateFreq]; const uint32_t dynamicOffsetCount = pRootSignature->mVkDynamicDescriptorCounts[updateFreq]; uint32_t totalSize = sizeof(DescriptorSet); if (VK_NULL_HANDLE != pRootSignature->mVkDescriptorSetLayouts[updateFreq]) { totalSize += pDesc->mMaxSets * sizeof(VkDescriptorSet); totalSize += pDesc->mMaxSets * sizeof(DescriptorUpdateData*); totalSize += pDesc->mMaxSets * descriptorCount * sizeof(DescriptorUpdateData); } if (dynamicOffsetCount) { ASSERT(1 == dynamicOffsetCount); totalSize += pDesc->mMaxSets * sizeof(SizeOffset); } DescriptorSet* pDescriptorSet = (DescriptorSet*)conf_calloc(1, totalSize); pDescriptorSet->pRootSignature = pRootSignature; pDescriptorSet->mUpdateFrequency = updateFreq; pDescriptorSet->mDynamicOffsetCount = dynamicOffsetCount; pDescriptorSet->mNodeIndex = nodeIndex; pDescriptorSet->mMaxSets = pDesc->mMaxSets; uint8_t* pMem = (uint8_t*)(pDescriptorSet + 1); pDescriptorSet->pHandles = (VkDescriptorSet*)pMem; if (VK_NULL_HANDLE != pRootSignature->mVkDescriptorSetLayouts[updateFreq]) { pMem += pDesc->mMaxSets * sizeof(VkDescriptorSet); pDescriptorSet->ppUpdateData = (DescriptorUpdateData**)pMem; pMem += pDesc->mMaxSets * sizeof(DescriptorUpdateData*); VkDescriptorSetLayout* pLayouts = (VkDescriptorSetLayout*)alloca(pDesc->mMaxSets * sizeof(VkDescriptorSetLayout)); VkDescriptorSet** pHandles = (VkDescriptorSet**)alloca(pDesc->mMaxSets * sizeof(VkDescriptorSet*)); for (uint32_t i = 0; i < pDesc->mMaxSets; ++i) { pLayouts[i] = pRootSignature->mVkDescriptorSetLayouts[updateFreq]; pHandles[i] = &pDescriptorSet->pHandles[i]; pDescriptorSet->ppUpdateData[i] = (DescriptorUpdateData*)pMem; pMem += descriptorCount * sizeof(DescriptorUpdateData); memcpy(pDescriptorSet->ppUpdateData[i], pRootSignature->pUpdateTemplateData[updateFreq][pDescriptorSet->mNodeIndex], descriptorCount * sizeof(DescriptorUpdateData)); } consume_descriptor_sets(pRenderer->pDescriptorPool, pLayouts, pHandles, pDesc->mMaxSets); } else { LOGF(LogLevel::eERROR, "NULL Descriptor Set Layout for update frequency %u. Cannot allocate descriptor set", (uint32_t)updateFreq); ASSERT(false && "NULL Descriptor Set Layout for update frequency. Cannot allocate descriptor set"); } if (pDescriptorSet->mDynamicOffsetCount) { ASSERT(1 == pDescriptorSet->mDynamicOffsetCount); pDescriptorSet->pDynamicSizeOffsets = (SizeOffset*)pMem; pMem += pDescriptorSet->mMaxSets * sizeof(SizeOffset); } *ppDescriptorSet = pDescriptorSet; } void removeDescriptorSet(Renderer* pRenderer, DescriptorSet* pDescriptorSet) { ASSERT(pRenderer); ASSERT(pDescriptorSet); SAFE_FREE(pDescriptorSet); } void updateDescriptorSet(Renderer* pRenderer, uint32_t index, DescriptorSet* pDescriptorSet, uint32_t count, const DescriptorData* pParams) { #ifdef _DEBUG #define VALIDATE_DESCRIPTOR(descriptor,...) \ if (!(descriptor)) \ { \ eastl::string msg = __FUNCTION__ + eastl::string(" : ") + eastl::string().sprintf(__VA_ARGS__); \ LOGF(LogLevel::eERROR, msg.c_str()); \ _FailedAssert(__FILE__, __LINE__, msg.c_str()); \ continue; \ } #else #define VALIDATE_DESCRIPTOR(descriptor,...) #endif ASSERT(pRenderer); ASSERT(pDescriptorSet); ASSERT(pDescriptorSet->pHandles); ASSERT(index < pDescriptorSet->mMaxSets); const RootSignature* pRootSignature = pDescriptorSet->pRootSignature; DescriptorUpdateFrequency updateFreq = (DescriptorUpdateFrequency)pDescriptorSet->mUpdateFrequency; DescriptorUpdateData* pUpdateData = pDescriptorSet->ppUpdateData[index]; bool update = false; #ifdef ENABLE_RAYTRACING VkWriteDescriptorSet* raytracingWrites = NULL; VkWriteDescriptorSetAccelerationStructureNV* raytracingWritesNV = NULL; uint32_t raytracingWriteCount = 0; if (pRootSignature->mVkRaytracingDescriptorCounts[updateFreq]) { raytracingWrites = (VkWriteDescriptorSet*)alloca(pRootSignature->mVkRaytracingDescriptorCounts[updateFreq] * sizeof(VkWriteDescriptorSet)); raytracingWritesNV = (VkWriteDescriptorSetAccelerationStructureNV*)alloca(pRootSignature->mVkRaytracingDescriptorCounts[updateFreq] * sizeof(VkWriteDescriptorSetAccelerationStructureNV)); } #endif for (uint32_t i = 0; i < count; ++i) { const DescriptorData* pParam = pParams + i; uint32_t paramIndex = pParam->mIndex; VALIDATE_DESCRIPTOR(pParam->pName || (paramIndex != -1), "DescriptorData has NULL name and invalid index"); const DescriptorInfo* pDesc = (paramIndex != -1) ? (pRootSignature->pDescriptors + paramIndex) : get_descriptor(pRootSignature, pParam->pName); if (paramIndex != -1) { VALIDATE_DESCRIPTOR(pDesc, "Invalid descriptor with param index (%u)", paramIndex); } else { VALIDATE_DESCRIPTOR(pDesc, "Invalid descriptor with param name (%s)", pParam->pName); } const DescriptorType type = (DescriptorType)pDesc->mType; const uint32_t arrayCount = max(1U, pParam->mCount); VALIDATE_DESCRIPTOR(pDesc->mUpdateFrequency == updateFreq, "Descriptor (%s) - Mismatching update frequency and set index", pDesc->pName); switch (type) { case DESCRIPTOR_TYPE_SAMPLER: { // Index is invalid when descriptor is a static sampler VALIDATE_DESCRIPTOR(pDesc->mIndexInParent != -1, "Trying to update a static sampler (%s). All static samplers must be set in addRootSignature and cannot be updated later", pDesc->pName); VALIDATE_DESCRIPTOR(pParam->ppSamplers, "NULL Sampler (%s)", pDesc->pName); for (uint32_t arr = 0; arr < arrayCount; ++arr) { VALIDATE_DESCRIPTOR(pParam->ppSamplers[arr], "NULL Sampler (%s [%u] )", pDesc->pName, arr); pUpdateData[pDesc->mHandleIndex + arr].mImageInfo = { pParam->ppSamplers[arr]->pVkSampler, VK_NULL_HANDLE }; update = true; } break; } case DESCRIPTOR_TYPE_TEXTURE: { VALIDATE_DESCRIPTOR(pParam->ppTextures, "NULL Texture (%s)", pDesc->pName); if (!pParam->mBindStencilResource) { for (uint32_t arr = 0; arr < arrayCount; ++arr) { VALIDATE_DESCRIPTOR(pParam->ppTextures[arr], "NULL Texture (%s [%u] )", pDesc->pName, arr); pUpdateData[pDesc->mHandleIndex + arr].mImageInfo = { VK_NULL_HANDLE, // Sampler pParam->ppTextures[arr]->pVkSRVDescriptor, // Image View VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL // Image Layout }; update = true; } } else { for (uint32_t arr = 0; arr < arrayCount; ++arr) { VALIDATE_DESCRIPTOR(pParam->ppTextures[arr], "NULL Texture (%s [%u] )", pDesc->pName, arr); pUpdateData[pDesc->mHandleIndex + arr].mImageInfo = { VK_NULL_HANDLE, // Sampler pParam->ppTextures[arr]->pVkSRVStencilDescriptor, // Image View VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL // Image Layout }; update = true; } } break; } case DESCRIPTOR_TYPE_RW_TEXTURE: { VALIDATE_DESCRIPTOR(pParam->ppTextures, "NULL RW Texture (%s)", pDesc->pName); const uint32_t mipSlice = pParam->mUAVMipSlice; for (uint32_t arr = 0; arr < arrayCount; ++arr) { VALIDATE_DESCRIPTOR(pParam->ppTextures[arr], "NULL RW Texture (%s [%u] )", pDesc->pName, arr); VALIDATE_DESCRIPTOR(mipSlice < pParam->ppTextures[arr]->mMipLevels, "Descriptor : (%s [%u] ) Mip Slice (%u) exceeds mip levels (%u)", pDesc->pName, arr, mipSlice, pParam->ppTextures[arr]->mMipLevels); pUpdateData[pDesc->mHandleIndex + arr].mImageInfo = { VK_NULL_HANDLE, // Sampler pParam->ppTextures[arr]->pVkUAVDescriptors[mipSlice], // Image View VK_IMAGE_LAYOUT_GENERAL // Image Layout }; update = true; } break; } case DESCRIPTOR_TYPE_UNIFORM_BUFFER: { if (pDesc->mVkType == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC) { VALIDATE_DESCRIPTOR(pParam->ppBuffers, "NULL Uniform Buffer (%s)", pDesc->pName); VALIDATE_DESCRIPTOR(pParam->ppBuffers[0], "NULL Uniform Buffer (%s [%u] )", pDesc->pName, 0); VALIDATE_DESCRIPTOR(arrayCount == 1, "Descriptor (%s) : VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC does not support arrays", pDesc->pName); VALIDATE_DESCRIPTOR(pParam->pSizes, "Descriptor (%s) : Must provide pSizes for VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC", pDesc->pName); VALIDATE_DESCRIPTOR(pParam->pSizes[0] > 0, "Descriptor (%s) - pSizes[%u] is zero", pDesc->pName, 0); VALIDATE_DESCRIPTOR(pParam->pSizes[0] <= pRenderer->pVkActiveGPUProperties->properties.limits.maxUniformBufferRange, "Descriptor (%s) - pSizes[%u] is %ull which exceeds max size %u", pDesc->pName, 0, pParam->pSizes[0], pRenderer->pVkActiveGPUProperties->properties.limits.maxUniformBufferRange); pDescriptorSet->pDynamicSizeOffsets[index].mOffset = pParam->pOffsets ? (uint32_t)pParam->pOffsets[0] : 0; pUpdateData[pDesc->mHandleIndex + 0].mBufferInfo = { pParam->ppBuffers[0]->pVkBuffer, pParam->ppBuffers[0]->mOffset, pParam->pSizes[0] }; // If this is a different size we have to update the VkDescriptorBufferInfo::range so a call to vkUpdateDescriptorSet is necessary if (pParam->pSizes[0] != (uint32_t)pDescriptorSet->pDynamicSizeOffsets[index].mSize) { pDescriptorSet->pDynamicSizeOffsets[index].mSize = (uint32_t)pParam->pSizes[0]; update = true; } break; } case DESCRIPTOR_TYPE_BUFFER: case DESCRIPTOR_TYPE_BUFFER_RAW: case DESCRIPTOR_TYPE_RW_BUFFER: case DESCRIPTOR_TYPE_RW_BUFFER_RAW: { VALIDATE_DESCRIPTOR(pParam->ppBuffers, "NULL Buffer (%s)", pDesc->pName); for (uint32_t arr = 0; arr < arrayCount; ++arr) { VALIDATE_DESCRIPTOR(pParam->ppBuffers[arr], "NULL Buffer (%s [%u] )", pDesc->pName, arr); pUpdateData[pDesc->mHandleIndex + arr].mBufferInfo = { pParam->ppBuffers[arr]->pVkBuffer, pParam->ppBuffers[arr]->mOffset, VK_WHOLE_SIZE }; if (pParam->pOffsets) { VALIDATE_DESCRIPTOR(pParam->pSizes, "Descriptor (%s) - pSizes must be provided with pOffsets", pDesc->pName); VALIDATE_DESCRIPTOR(pParam->pSizes[arr] > 0, "Descriptor (%s) - pSizes[%u] is zero", pDesc->pName, arr); VALIDATE_DESCRIPTOR(pParam->pSizes[arr] <= pRenderer->pVkActiveGPUProperties->properties.limits.maxUniformBufferRange, "Descriptor (%s) - pSizes[%u] is %ull which exceeds max size %u", pDesc->pName, arr, pParam->pSizes[arr], pRenderer->pVkActiveGPUProperties->properties.limits.maxUniformBufferRange); pUpdateData[pDesc->mHandleIndex + arr].mBufferInfo.offset = pParam->pOffsets[arr]; pUpdateData[pDesc->mHandleIndex + arr].mBufferInfo.range = pParam->pSizes[arr]; } update = true; } } break; } case DESCRIPTOR_TYPE_TEXEL_BUFFER: { VALIDATE_DESCRIPTOR(pParam->ppBuffers, "NULL Texel Buffer (%s)", pDesc->pName); for (uint32_t arr = 0; arr < arrayCount; ++arr) { VALIDATE_DESCRIPTOR(pParam->ppBuffers[arr], "NULL Texel Buffer (%s [%u] )", pDesc->pName, arr); pUpdateData[pDesc->mHandleIndex + arr].mBuferView = pParam->ppBuffers[arr]->pVkUniformTexelView; update = true; } break; } case DESCRIPTOR_TYPE_RW_TEXEL_BUFFER: { VALIDATE_DESCRIPTOR(pParam->ppBuffers, "NULL RW Texel Buffer (%s)", pDesc->pName); for (uint32_t arr = 0; arr < arrayCount; ++arr) { VALIDATE_DESCRIPTOR(pParam->ppBuffers[arr], "NULL RW Texel Buffer (%s [%u] )", pDesc->pName, arr); pUpdateData[pDesc->mHandleIndex + arr].mBuferView = pParam->ppBuffers[arr]->pVkStorageTexelView; update = true; } break; } #ifdef ENABLE_RAYTRACING case DESCRIPTOR_TYPE_RAY_TRACING: { VALIDATE_DESCRIPTOR(pParam->ppAccelerationStructures, "NULL Acceleration Structure (%s)", pDesc->pName); for (uint32_t arr = 0; arr < arrayCount; ++arr) { VALIDATE_DESCRIPTOR(pParam->ppAccelerationStructures[arr], "Acceleration Structure (%s [%u] )", pDesc->pName, arr); VkWriteDescriptorSet* pWrite = raytracingWrites + raytracingWriteCount; VkWriteDescriptorSetAccelerationStructureNV* pWriteNV = raytracingWritesNV + raytracingWriteCount; pWrite->sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET; pWrite->pNext = pWriteNV; pWrite->dstSet = pDescriptorSet->pHandles[index]; pWrite->descriptorCount = 1; pWrite->descriptorType = (VkDescriptorType)pDesc->mVkType; pWrite->dstArrayElement = arr; pWrite->dstBinding = pDesc->mReg; vk_FillRaytracingDescriptorData(pParam->ppAccelerationStructures[arr], pWriteNV); ++raytracingWriteCount; } break; } #endif default: break; } } // If this was called to just update a dynamic offset skip the update if (update) vkUpdateDescriptorSetWithTemplateKHR(pRenderer->pVkDevice, pDescriptorSet->pHandles[index], pRootSignature->mUpdateTemplates[updateFreq], pUpdateData); #ifdef ENABLE_RAYTRACING // Raytracing Update Descriptor Set since it does not support update template if (raytracingWriteCount) vkUpdateDescriptorSets(pRenderer->pVkDevice, raytracingWriteCount, raytracingWrites, 0, NULL); #endif } void cmdBindDescriptorSet(Cmd* pCmd, uint32_t index, DescriptorSet* pDescriptorSet) { ASSERT(pCmd); ASSERT(pDescriptorSet); ASSERT(pDescriptorSet->pHandles); ASSERT(index < pDescriptorSet->mMaxSets); const RootSignature* pRootSignature = pDescriptorSet->pRootSignature; if (pCmd->pBoundPipelineLayout != pRootSignature->pPipelineLayout) { pCmd->pBoundPipelineLayout = pRootSignature->pPipelineLayout; // Vulkan requires to bind all descriptor sets upto the highest set number even if they are empty // Example: If shader uses only set 2, we still have to bind empty sets for set=0 and set=1 for (uint32_t setIndex = 0; setIndex < DESCRIPTOR_UPDATE_FREQ_COUNT; ++setIndex) { if (pRootSignature->mVkEmptyDescriptorSets[setIndex] != VK_NULL_HANDLE) { vkCmdBindDescriptorSets( pCmd->pVkCmdBuf, gPipelineBindPoint[pRootSignature->mPipelineType], pRootSignature->pPipelineLayout, setIndex, 1, &pRootSignature->mVkEmptyDescriptorSets[setIndex], 0, NULL); } } } vkCmdBindDescriptorSets(pCmd->pVkCmdBuf, gPipelineBindPoint[pRootSignature->mPipelineType], pRootSignature->pPipelineLayout, pDescriptorSet->mUpdateFrequency, 1, &pDescriptorSet->pHandles[index], pDescriptorSet->mDynamicOffsetCount, pDescriptorSet->mDynamicOffsetCount ? &pDescriptorSet->pDynamicSizeOffsets[index].mOffset : NULL); } void cmdBindPushConstants(Cmd* pCmd, RootSignature* pRootSignature, const char* pName, const void* pConstants) { ASSERT(pCmd); ASSERT(pConstants); ASSERT(pRootSignature); ASSERT(pName); const DescriptorInfo* pDesc = get_descriptor(pRootSignature, pName); ASSERT(pDesc); ASSERT(DESCRIPTOR_TYPE_ROOT_CONSTANT == pDesc->mType); vkCmdPushConstants(pCmd->pVkCmdBuf, pRootSignature->pPipelineLayout, pDesc->mVkStages, 0, pDesc->mSize, pConstants); } void cmdBindPushConstantsByIndex(Cmd* pCmd, RootSignature* pRootSignature, uint32_t paramIndex, const void* pConstants) { ASSERT(pCmd); ASSERT(pConstants); ASSERT(pRootSignature); ASSERT(paramIndex >= 0 && paramIndex < pRootSignature->mDescriptorCount); const DescriptorInfo* pDesc = pRootSignature->pDescriptors + paramIndex; ASSERT(pDesc); ASSERT(DESCRIPTOR_TYPE_ROOT_CONSTANT == pDesc->mType); vkCmdPushConstants(pCmd->pVkCmdBuf, pRootSignature->pPipelineLayout, pDesc->mVkStages, 0, pDesc->mSize, pConstants); } /************************************************************************/ // Shader Functions /************************************************************************/ void addShaderBinary(Renderer* pRenderer, const BinaryShaderDesc* pDesc, Shader** ppShaderProgram) { ASSERT(pRenderer); ASSERT(pDesc); ASSERT(ppShaderProgram); ASSERT(VK_NULL_HANDLE != pRenderer->pVkDevice); uint32_t counter = 0; size_t totalSize = sizeof(Shader); totalSize += sizeof(PipelineReflection); for (uint32_t i = 0; i < SHADER_STAGE_COUNT; ++i) { ShaderStage stage_mask = (ShaderStage)(1 << i); if (stage_mask == (pDesc->mStages & stage_mask)) { const BinaryShaderStageDesc* pStageDesc = nullptr; switch (stage_mask) { case SHADER_STAGE_VERT: totalSize += (strlen(pDesc->mVert.pEntryPoint) + 1) * sizeof(char); break; case SHADER_STAGE_TESC: totalSize += (strlen(pDesc->mHull.pEntryPoint) + 1) * sizeof(char); break; case SHADER_STAGE_TESE: totalSize += (strlen(pDesc->mDomain.pEntryPoint) + 1) * sizeof(char); break; case SHADER_STAGE_GEOM: totalSize += (strlen(pDesc->mGeom.pEntryPoint) + 1) * sizeof(char); break; case SHADER_STAGE_FRAG: totalSize += (strlen(pDesc->mFrag.pEntryPoint) + 1) * sizeof(char); break; case SHADER_STAGE_COMP: totalSize += (strlen(pDesc->mComp.pEntryPoint) + 1) * sizeof(char); break; case SHADER_STAGE_RAYTRACING: totalSize += (strlen(pDesc->mComp.pEntryPoint) + 1) * sizeof(char); break; default: break; } ++counter; } } totalSize += counter * sizeof(VkShaderModule); totalSize += counter * sizeof(char*); Shader* pShaderProgram = (Shader*)conf_calloc(1, totalSize); pShaderProgram->mStages = pDesc->mStages; pShaderProgram->pReflection = (PipelineReflection*)(pShaderProgram + 1); pShaderProgram->pShaderModules = (VkShaderModule*)(pShaderProgram->pReflection + 1); pShaderProgram->pEntryNames = (char**)(pShaderProgram->pShaderModules + counter); uint8_t* mem = (uint8_t*)(pShaderProgram->pEntryNames + counter); counter = 0; ShaderReflection stageReflections[SHADER_STAGE_COUNT] = {}; for (uint32_t i = 0; i < SHADER_STAGE_COUNT; ++i) { ShaderStage stage_mask = (ShaderStage)(1 << i); if (stage_mask == (pShaderProgram->mStages & stage_mask)) { DECLARE_ZERO(VkShaderModuleCreateInfo, create_info); create_info.sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO; create_info.pNext = NULL; create_info.flags = 0; const BinaryShaderStageDesc* pStageDesc = nullptr; switch (stage_mask) { case SHADER_STAGE_VERT: { vk_createShaderReflection( (const uint8_t*)pDesc->mVert.pByteCode, (uint32_t)pDesc->mVert.mByteCodeSize, stage_mask, &stageReflections[counter]); create_info.codeSize = pDesc->mVert.mByteCodeSize; create_info.pCode = (const uint32_t*)pDesc->mVert.pByteCode; pStageDesc = &pDesc->mVert; VkResult vk_res = vkCreateShaderModule(pRenderer->pVkDevice, &create_info, NULL, &(pShaderProgram->pShaderModules[counter])); ASSERT(VK_SUCCESS == vk_res); } break; case SHADER_STAGE_TESC: { vk_createShaderReflection( (const uint8_t*)pDesc->mHull.pByteCode, (uint32_t)pDesc->mHull.mByteCodeSize, stage_mask, &stageReflections[counter]); create_info.codeSize = pDesc->mHull.mByteCodeSize; create_info.pCode = (const uint32_t*)pDesc->mHull.pByteCode; pStageDesc = &pDesc->mHull; VkResult vk_res = vkCreateShaderModule(pRenderer->pVkDevice, &create_info, NULL, &(pShaderProgram->pShaderModules[counter])); ASSERT(VK_SUCCESS == vk_res); } break; case SHADER_STAGE_TESE: { vk_createShaderReflection( (const uint8_t*)pDesc->mDomain.pByteCode, (uint32_t)pDesc->mDomain.mByteCodeSize, stage_mask, &stageReflections[counter]); create_info.codeSize = pDesc->mDomain.mByteCodeSize; create_info.pCode = (const uint32_t*)pDesc->mDomain.pByteCode; pStageDesc = &pDesc->mDomain; VkResult vk_res = vkCreateShaderModule(pRenderer->pVkDevice, &create_info, NULL, &(pShaderProgram->pShaderModules[counter])); ASSERT(VK_SUCCESS == vk_res); } break; case SHADER_STAGE_GEOM: { vk_createShaderReflection( (const uint8_t*)pDesc->mGeom.pByteCode, (uint32_t)pDesc->mGeom.mByteCodeSize, stage_mask, &stageReflections[counter]); create_info.codeSize = pDesc->mGeom.mByteCodeSize; create_info.pCode = (const uint32_t*)pDesc->mGeom.pByteCode; pStageDesc = &pDesc->mGeom; VkResult vk_res = vkCreateShaderModule(pRenderer->pVkDevice, &create_info, NULL, &(pShaderProgram->pShaderModules[counter])); ASSERT(VK_SUCCESS == vk_res); } break; case SHADER_STAGE_FRAG: { vk_createShaderReflection( (const uint8_t*)pDesc->mFrag.pByteCode, (uint32_t)pDesc->mFrag.mByteCodeSize, stage_mask, &stageReflections[counter]); create_info.codeSize = pDesc->mFrag.mByteCodeSize; create_info.pCode = (const uint32_t*)pDesc->mFrag.pByteCode; pStageDesc = &pDesc->mFrag; VkResult vk_res = vkCreateShaderModule(pRenderer->pVkDevice, &create_info, NULL, &(pShaderProgram->pShaderModules[counter])); ASSERT(VK_SUCCESS == vk_res); } break; case SHADER_STAGE_COMP: #ifdef ENABLE_RAYTRACING case SHADER_STAGE_RAYTRACING: #endif { vk_createShaderReflection( (const uint8_t*)pDesc->mComp.pByteCode, (uint32_t)pDesc->mComp.mByteCodeSize, stage_mask, &stageReflections[counter]); create_info.codeSize = pDesc->mComp.mByteCodeSize; create_info.pCode = (const uint32_t*)pDesc->mComp.pByteCode; pStageDesc = &pDesc->mComp; VkResult vk_res = vkCreateShaderModule(pRenderer->pVkDevice, &create_info, NULL, &(pShaderProgram->pShaderModules[counter])); ASSERT(VK_SUCCESS == vk_res); } break; default: ASSERT(false && "Shader Stage not supported!"); break; } pShaderProgram->pEntryNames[counter] = (char*)mem; mem += (strlen(pStageDesc->pEntryPoint) + 1) * sizeof(char); memcpy(pShaderProgram->pEntryNames[counter], pStageDesc->pEntryPoint, strlen(pStageDesc->pEntryPoint)); ++counter; } } createPipelineReflection(stageReflections, counter, pShaderProgram->pReflection); *ppShaderProgram = pShaderProgram; } void removeShader(Renderer* pRenderer, Shader* pShaderProgram) { ASSERT(pRenderer); ASSERT(VK_NULL_HANDLE != pRenderer->pVkDevice); if (pShaderProgram->mStages & SHADER_STAGE_VERT) { vkDestroyShaderModule(pRenderer->pVkDevice, pShaderProgram->pShaderModules[pShaderProgram->pReflection->mVertexStageIndex], NULL); } if (pShaderProgram->mStages & SHADER_STAGE_TESC) { vkDestroyShaderModule(pRenderer->pVkDevice, pShaderProgram->pShaderModules[pShaderProgram->pReflection->mHullStageIndex], NULL); } if (pShaderProgram->mStages & SHADER_STAGE_TESE) { vkDestroyShaderModule(pRenderer->pVkDevice, pShaderProgram->pShaderModules[pShaderProgram->pReflection->mDomainStageIndex], NULL); } if (pShaderProgram->mStages & SHADER_STAGE_GEOM) { vkDestroyShaderModule(pRenderer->pVkDevice, pShaderProgram->pShaderModules[pShaderProgram->pReflection->mGeometryStageIndex], NULL); } if (pShaderProgram->mStages & SHADER_STAGE_FRAG) { vkDestroyShaderModule(pRenderer->pVkDevice, pShaderProgram->pShaderModules[pShaderProgram->pReflection->mPixelStageIndex], NULL); } if (pShaderProgram->mStages & SHADER_STAGE_COMP) { vkDestroyShaderModule(pRenderer->pVkDevice, pShaderProgram->pShaderModules[0], NULL); } #ifdef ENABLE_RAYTRACING if (pShaderProgram->mStages & SHADER_STAGE_RAYTRACING) { vkDestroyShaderModule(pRenderer->pVkDevice, pShaderProgram->pShaderModules[0], NULL); } #endif destroyPipelineReflection(pShaderProgram->pReflection); SAFE_FREE(pShaderProgram); } /************************************************************************/ // Root Signature Functions /************************************************************************/ typedef struct UpdateFrequencyLayoutInfo { /// Array of all bindings in the descriptor set eastl::vector<VkDescriptorSetLayoutBinding> mBindings; /// Array of all descriptors in this descriptor set eastl::vector<DescriptorInfo*> mDescriptors; /// Array of all descriptors marked as dynamic in this descriptor set (applicable to DESCRIPTOR_TYPE_UNIFORM_BUFFER) eastl::vector<DescriptorInfo*> mDynamicDescriptors; /// Hash map to get index of the descriptor in the root signature eastl::hash_map<DescriptorInfo*, uint32_t> mDescriptorIndexMap; } UpdateFrequencyLayoutInfo; void addRootSignature(Renderer* pRenderer, const RootSignatureDesc* pRootSignatureDesc, RootSignature** ppRootSignature) { ASSERT(pRenderer); ASSERT(pRootSignatureDesc); ASSERT(ppRootSignature); eastl::vector<UpdateFrequencyLayoutInfo> layouts(DESCRIPTOR_UPDATE_FREQ_COUNT); eastl::vector<DescriptorInfo*> pushConstantDescriptors; eastl::vector<ShaderResource> shaderResources; eastl::hash_map<eastl::string, Sampler*> staticSamplerMap; for (uint32_t i = 0; i < pRootSignatureDesc->mStaticSamplerCount; ++i) { ASSERT(pRootSignatureDesc->ppStaticSamplers[i]); staticSamplerMap.insert({ { pRootSignatureDesc->ppStaticSamplerNames[i], pRootSignatureDesc->ppStaticSamplers[i] } }); } PipelineType pipelineType = PIPELINE_TYPE_UNDEFINED; DescriptorIndexMap indexMap; // Collect all unique shader resources in the given shaders // Resources are parsed by name (two resources named "XYZ" in two shaders will be considered the same resource) for (uint32_t sh = 0; sh < pRootSignatureDesc->mShaderCount; ++sh) { PipelineReflection const* pReflection = pRootSignatureDesc->ppShaders[sh]->pReflection; if (pReflection->mShaderStages & SHADER_STAGE_COMP) pipelineType = PIPELINE_TYPE_COMPUTE; #ifdef ENABLE_RAYTRACING else if (pReflection->mShaderStages & SHADER_STAGE_RAYTRACING) pipelineType = PIPELINE_TYPE_RAYTRACING; #endif else pipelineType = PIPELINE_TYPE_GRAPHICS; for (uint32_t i = 0; i < pReflection->mShaderResourceCount; ++i) { ShaderResource const* pRes = &pReflection->pShaderResources[i]; uint32_t setIndex = pRes->set; if (pRes->type == DESCRIPTOR_TYPE_ROOT_CONSTANT) setIndex = 0; eastl::string_hash_map<uint32_t>::iterator it = indexMap.mMap.find(pRes->name); if (it == indexMap.mMap.end()) { decltype(shaderResources)::iterator it = eastl::find(shaderResources.begin(), shaderResources.end(), *pRes, [](const ShaderResource& a, const ShaderResource& b) { return ((a.reg << 16) | (a.set & 0xFFFF)) == ((b.reg << 16) | (b.set & 0xFFFF)); }); if (it == shaderResources.end()) { indexMap.mMap.insert(pRes->name, (uint32_t)shaderResources.size()); shaderResources.push_back(*pRes); } else { ASSERT(pRes->type == it->type); if (pRes->type != it->type) { LOGF(LogLevel::eERROR, "\nFailed to create root signature\n" "Shared shader resources %s and %s have mismatching types (%u) and (%u). All shader resources " "sharing the same register and space addRootSignature " "must have the same type", pRes->name, it->name, (uint32_t)pRes->type, (uint32_t)it->type); return; } indexMap.mMap.insert(pRes->name, indexMap.mMap[it->name]); it->used_stages |= pRes->used_stages; } } else { if (shaderResources[it->second].reg != pRes->reg) { LOGF( LogLevel::eERROR, "\nFailed to create root signature\n" "Shared shader resource %s has mismatching binding. All shader resources " "shared by multiple shaders specified in addRootSignature " "must have the same binding and set", pRes->name); return; } if (shaderResources[it->second].set != pRes->set) { LOGF( LogLevel::eERROR, "\nFailed to create root signature\n" "Shared shader resource %s has mismatching set. All shader resources " "shared by multiple shaders specified in addRootSignature " "must have the same binding and set", pRes->name); return; } for (ShaderResource& res : shaderResources) { if (strcmp(res.name, it->first) == 0) { res.used_stages |= pRes->used_stages; break; } } } } } size_t totalSize = sizeof(RootSignature); totalSize += shaderResources.size() * sizeof(DescriptorInfo); totalSize += sizeof(DescriptorIndexMap); RootSignature* pRootSignature = (RootSignature*)conf_calloc(1, totalSize); ASSERT(pRootSignature); pRootSignature->pDescriptors = (DescriptorInfo*)(pRootSignature + 1); pRootSignature->pDescriptorNameToIndexMap = (DescriptorIndexMap*)(pRootSignature->pDescriptors + shaderResources.size()); ASSERT(pRootSignature->pDescriptorNameToIndexMap); conf_placement_new<DescriptorIndexMap>(pRootSignature->pDescriptorNameToIndexMap); if ((uint32_t)shaderResources.size()) { pRootSignature->mDescriptorCount = (uint32_t)shaderResources.size(); } pRootSignature->mPipelineType = pipelineType; pRootSignature->pDescriptorNameToIndexMap->mMap = indexMap.mMap; // Fill the descriptor array to be stored in the root signature for (uint32_t i = 0; i < (uint32_t)shaderResources.size(); ++i) { DescriptorInfo* pDesc = &pRootSignature->pDescriptors[i]; ShaderResource const* pRes = &shaderResources[i]; uint32_t setIndex = pRes->set; DescriptorUpdateFrequency updateFreq = (DescriptorUpdateFrequency)setIndex; // Copy the binding information generated from the shader reflection into the descriptor pDesc->mReg = pRes->reg; pDesc->mSize = pRes->size; pDesc->mType = pRes->type; pDesc->pName = pRes->name; pDesc->mDim = pRes->dim; // If descriptor is not a root constant create a new layout binding for this descriptor and add it to the binding array if (pDesc->mType != DESCRIPTOR_TYPE_ROOT_CONSTANT) { VkDescriptorSetLayoutBinding binding = {}; binding.binding = pRes->reg; binding.descriptorCount = pDesc->mSize; binding.descriptorType = util_to_vk_descriptor_type((DescriptorType)pDesc->mType); eastl::string name = pRes->name; name.make_lower(); // If a user specified a uniform buffer to be used as a dynamic uniform buffer change its type to VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC // Also log a message for debugging purpose if (name.find("rootcbv") != eastl::string::npos) { if (pDesc->mSize == 1) { LOGF(LogLevel::eINFO, "Descriptor (%s) : User specified VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC", pDesc->pName); binding.descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC; } else { LOGF( LogLevel::eWARNING, "Descriptor (%s) : Cannot use VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC for arrays", pDesc->pName); } } binding.stageFlags = util_to_vk_shader_stage_flags(pRes->used_stages); // Store the vulkan related info in the descriptor to avoid constantly calling the util_to_vk mapping functions pDesc->mVkType = binding.descriptorType; pDesc->mVkStages = binding.stageFlags; pDesc->mUpdateFrequency = updateFreq; if (binding.descriptorType == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC) { layouts[setIndex].mDynamicDescriptors.emplace_back(pDesc); } // Find if the given descriptor is a static sampler decltype(staticSamplerMap)::iterator it = staticSamplerMap.find(pDesc->pName); if (it != staticSamplerMap.end()) { LOGF(LogLevel::eINFO, "Descriptor (%s) : User specified Static Sampler", pDesc->pName); // Set the index to an invalid value so we can use this later for error checking if user tries to update a static sampler pDesc->mIndexInParent = -1; binding.pImmutableSamplers = &it->second->pVkSampler; } else { layouts[setIndex].mDescriptors.emplace_back(pDesc); } layouts[setIndex].mBindings.push_back(binding); } // If descriptor is a root constant, add it to the root constant array else { LOGF(LogLevel::eINFO, "Descriptor (%s) : User specified Push Constant", pDesc->pName); pDesc->mVkStages = util_to_vk_shader_stage_flags(pRes->used_stages); setIndex = 0; pushConstantDescriptors.emplace_back(pDesc); } layouts[setIndex].mDescriptorIndexMap[pDesc] = i; } pRootSignature->mVkPushConstantCount = (uint32_t)pushConstantDescriptors.size(); // Create push constant ranges for (uint32_t i = 0; i < pRootSignature->mVkPushConstantCount; ++i) { DescriptorInfo* pDesc = pushConstantDescriptors[i]; pDesc->mIndexInParent = i; } // Create descriptor layouts // Put most frequently changed params first for (uint32_t i = (uint32_t)layouts.size(); i-- > 0U;) { UpdateFrequencyLayoutInfo& layout = layouts[i]; if (layouts[i].mBindings.size()) { // sort table by type (CBV/SRV/UAV) by register eastl::stable_sort(layout.mBindings.begin(), layout.mBindings.end(), [](const VkDescriptorSetLayoutBinding& lhs, const VkDescriptorSetLayoutBinding& rhs) { return lhs.binding > rhs.binding; }); eastl::stable_sort(layout.mBindings.begin(), layout.mBindings.end(), [](const VkDescriptorSetLayoutBinding& lhs, const VkDescriptorSetLayoutBinding& rhs) { return lhs.descriptorType > rhs.descriptorType; }); } bool createLayout = layout.mBindings.size() > 0; // Check if we need to create an empty layout in case there is an empty set between two used sets // Example: set = 0 is used, set = 2 is used. In this case, set = 1 needs to exist even if it is empty if (!createLayout && i < layouts.size() - 1) { createLayout = pRootSignature->mVkDescriptorSetLayouts[i + 1] != VK_NULL_HANDLE; } if (createLayout) { VkDescriptorSetLayoutCreateInfo layoutInfo = {}; layoutInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO; layoutInfo.pNext = NULL; layoutInfo.bindingCount = (uint32_t)layout.mBindings.size(); layoutInfo.pBindings = layout.mBindings.data(); layoutInfo.flags = 0; vkCreateDescriptorSetLayout(pRenderer->pVkDevice, &layoutInfo, NULL, &pRootSignature->mVkDescriptorSetLayouts[i]); } if (!layouts[i].mBindings.size()) continue; pRootSignature->mVkDescriptorCounts[i] = (uint32_t)layout.mDescriptors.size(); // Loop through descriptors belonging to this update frequency and increment the cumulative descriptor count for (uint32_t descIndex = 0; descIndex < (uint32_t)layout.mDescriptors.size(); ++descIndex) { DescriptorInfo* pDesc = layout.mDescriptors[descIndex]; pDesc->mIndexInParent = descIndex; pDesc->mHandleIndex = pRootSignature->mVkCumulativeDescriptorCounts[i]; pRootSignature->mVkCumulativeDescriptorCounts[i] += pDesc->mSize; } pRootSignature->mVkDynamicDescriptorCounts[i] = (uint32_t)layout.mDynamicDescriptors.size(); for (uint32_t descIndex = 0; descIndex < pRootSignature->mVkDynamicDescriptorCounts[i]; ++descIndex) { DescriptorInfo* pDesc = layout.mDynamicDescriptors[descIndex]; pDesc->mRootDescriptorIndex = descIndex; } } /************************************************************************/ // Pipeline layout /************************************************************************/ eastl::vector<VkDescriptorSetLayout> descriptorSetLayouts; eastl::vector<VkPushConstantRange> pushConstants(pRootSignature->mVkPushConstantCount); for (uint32_t i = 0; i < DESCRIPTOR_UPDATE_FREQ_COUNT; ++i) if (pRootSignature->mVkDescriptorSetLayouts[i]) descriptorSetLayouts.emplace_back(pRootSignature->mVkDescriptorSetLayouts[i]); for (uint32_t i = 0; i < pRootSignature->mVkPushConstantCount; ++i) { pushConstants[i].offset = 0; pushConstants[i].size = pushConstantDescriptors[i]->mSize; pushConstants[i].stageFlags = pushConstantDescriptors[i]->mVkStages; } DECLARE_ZERO(VkPipelineLayoutCreateInfo, add_info); add_info.sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO; add_info.pNext = NULL; add_info.flags = 0; add_info.setLayoutCount = (uint32_t)descriptorSetLayouts.size(); add_info.pSetLayouts = descriptorSetLayouts.data(); add_info.pushConstantRangeCount = pRootSignature->mVkPushConstantCount; add_info.pPushConstantRanges = pushConstants.data(); VkResult vk_res = vkCreatePipelineLayout(pRenderer->pVkDevice, &add_info, NULL, &(pRootSignature->pPipelineLayout)); ASSERT(VK_SUCCESS == vk_res); /************************************************************************/ // Update templates /************************************************************************/ for (uint32_t setIndex = 0; setIndex < DESCRIPTOR_UPDATE_FREQ_COUNT; ++setIndex) { if (pRootSignature->mVkDescriptorCounts[setIndex]) { pRootSignature->pUpdateTemplateData[setIndex] = (void**)conf_calloc(pRenderer->mLinkedNodeCount, sizeof(DescriptorUpdateData*)); const UpdateFrequencyLayoutInfo& layout = layouts[setIndex]; VkDescriptorUpdateTemplateEntry* pEntries = (VkDescriptorUpdateTemplateEntry*)alloca(pRootSignature->mVkDescriptorCounts[setIndex] * sizeof(VkDescriptorUpdateTemplateEntry)); uint32_t entryCount = 0; for (uint32_t nodeIndex = 0; nodeIndex < pRenderer->mLinkedNodeCount; ++nodeIndex) { pRootSignature->pUpdateTemplateData[setIndex][nodeIndex] = conf_calloc(pRootSignature->mVkCumulativeDescriptorCounts[setIndex], sizeof(DescriptorUpdateData)); } // Fill the write descriptors with default values during initialize so the only thing we change in cmdBindDescriptors is the the VkBuffer / VkImageView objects for (uint32_t i = 0; i < (uint32_t)layout.mDescriptors.size(); ++i) { const DescriptorInfo* pDesc = layout.mDescriptors[i]; const uint64_t offset = pDesc->mHandleIndex * sizeof(DescriptorUpdateData); #ifdef VK_NV_RAY_TRACING_SPEC_VERSION // Raytracing descriptors dont support update template so we ignore them if (pDesc->mType == DESCRIPTOR_TYPE_RAY_TRACING) { pRootSignature->mVkRaytracingDescriptorCounts[setIndex] += pDesc->mSize; continue; } #endif pEntries[entryCount].descriptorCount = pDesc->mSize; pEntries[entryCount].descriptorType = (VkDescriptorType)pDesc->mVkType; pEntries[entryCount].dstArrayElement = 0; pEntries[entryCount].dstBinding = pDesc->mReg; pEntries[entryCount].offset = offset; pEntries[entryCount].stride = sizeof(DescriptorUpdateData); for (uint32_t nodeIndex = 0; nodeIndex < pRenderer->mLinkedNodeCount; ++nodeIndex) { DescriptorUpdateData* pUpdateData = (DescriptorUpdateData*)pRootSignature->pUpdateTemplateData[setIndex][nodeIndex]; const DescriptorType type = (DescriptorType)pDesc->mType; const uint32_t arrayCount = pDesc->mSize; switch (type) { case DESCRIPTOR_TYPE_SAMPLER: { for (uint32_t arr = 0; arr < arrayCount; ++arr) pUpdateData[pDesc->mHandleIndex + arr].mImageInfo = { pRenderer->pNullDescriptors->pDefaultSampler->pVkSampler, VK_NULL_HANDLE }; break; } case DESCRIPTOR_TYPE_TEXTURE: { for (uint32_t arr = 0; arr < arrayCount; ++arr) pUpdateData[pDesc->mHandleIndex + arr].mImageInfo = { VK_NULL_HANDLE, pRenderer->pNullDescriptors->pDefaultTextureSRV[nodeIndex][pDesc->mDim]->pVkSRVDescriptor, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL }; break; } case DESCRIPTOR_TYPE_RW_TEXTURE: { for (uint32_t arr = 0; arr < arrayCount; ++arr) pUpdateData[pDesc->mHandleIndex + arr].mImageInfo = { VK_NULL_HANDLE, pRenderer->pNullDescriptors->pDefaultTextureUAV[nodeIndex][pDesc->mDim]->pVkUAVDescriptors[0], VK_IMAGE_LAYOUT_GENERAL }; break; } case DESCRIPTOR_TYPE_UNIFORM_BUFFER: case DESCRIPTOR_TYPE_BUFFER: case DESCRIPTOR_TYPE_BUFFER_RAW: { for (uint32_t arr = 0; arr < arrayCount; ++arr) pUpdateData[pDesc->mHandleIndex + arr].mBufferInfo = { pRenderer->pNullDescriptors->pDefaultBufferSRV[nodeIndex]->pVkBuffer, pRenderer->pNullDescriptors->pDefaultBufferSRV[nodeIndex]->mOffset, VK_WHOLE_SIZE }; break; } case DESCRIPTOR_TYPE_RW_BUFFER: case DESCRIPTOR_TYPE_RW_BUFFER_RAW: { for (uint32_t arr = 0; arr < arrayCount; ++arr) pUpdateData[pDesc->mHandleIndex + arr].mBufferInfo = { pRenderer->pNullDescriptors->pDefaultBufferUAV[nodeIndex]->pVkBuffer, pRenderer->pNullDescriptors->pDefaultBufferUAV[nodeIndex]->mOffset, VK_WHOLE_SIZE }; break; } case DESCRIPTOR_TYPE_TEXEL_BUFFER: { for (uint32_t arr = 0; arr < arrayCount; ++arr) pUpdateData[pDesc->mHandleIndex + arr].mBuferView = pRenderer->pNullDescriptors->pDefaultBufferSRV[nodeIndex]->pVkUniformTexelView; break; } case DESCRIPTOR_TYPE_RW_TEXEL_BUFFER: { for (uint32_t arr = 0; arr < arrayCount; ++arr) pUpdateData[pDesc->mHandleIndex + arr].mBuferView = pRenderer->pNullDescriptors->pDefaultBufferUAV[nodeIndex]->pVkStorageTexelView; break; } default: break; } } ++entryCount; } VkDescriptorUpdateTemplateCreateInfoKHR createInfo = {}; createInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO_KHR; createInfo.pNext = NULL; createInfo.descriptorSetLayout = pRootSignature->mVkDescriptorSetLayouts[setIndex]; createInfo.descriptorUpdateEntryCount = entryCount; createInfo.pDescriptorUpdateEntries = pEntries; createInfo.pipelineBindPoint = gPipelineBindPoint[pRootSignature->mPipelineType]; createInfo.pipelineLayout = pRootSignature->pPipelineLayout; createInfo.set = setIndex; createInfo.templateType = VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET_KHR; VkResult vkRes = vkCreateDescriptorUpdateTemplateKHR(pRenderer->pVkDevice, &createInfo, NULL, &pRootSignature->mUpdateTemplates[setIndex]); ASSERT(VK_SUCCESS == vkRes); } else if (VK_NULL_HANDLE != pRootSignature->mVkDescriptorSetLayouts[setIndex]) { // Consume empty descriptor sets from empty descriptor set pool VkDescriptorSet* pSets[] = { &pRootSignature->mVkEmptyDescriptorSets[setIndex] }; consume_descriptor_sets(pRenderer->pDescriptorPool, &pRootSignature->mVkDescriptorSetLayouts[setIndex], pSets, 1); } } *ppRootSignature = pRootSignature; } void removeRootSignature(Renderer* pRenderer, RootSignature* pRootSignature) { for (uint32_t i = 0; i < DESCRIPTOR_UPDATE_FREQ_COUNT; ++i) { vkDestroyDescriptorSetLayout(pRenderer->pVkDevice, pRootSignature->mVkDescriptorSetLayouts[i], NULL); if (VK_NULL_HANDLE != pRootSignature->mUpdateTemplates[i]) vkDestroyDescriptorUpdateTemplateKHR(pRenderer->pVkDevice, pRootSignature->mUpdateTemplates[i], NULL); if (pRootSignature->mVkDescriptorCounts[i]) for (uint32_t nodeIndex = 0; nodeIndex < pRenderer->mLinkedNodeCount; ++nodeIndex) SAFE_FREE(pRootSignature->pUpdateTemplateData[i][nodeIndex]); SAFE_FREE(pRootSignature->pUpdateTemplateData[i]); } // Need delete since the destructor frees allocated memory pRootSignature->pDescriptorNameToIndexMap->mMap.clear(true); vkDestroyPipelineLayout(pRenderer->pVkDevice, pRootSignature->pPipelineLayout, NULL); SAFE_FREE(pRootSignature); } /************************************************************************/ // Pipeline State Functions /************************************************************************/ static void addGraphicsPipelineImpl(Renderer* pRenderer, const GraphicsPipelineDesc* pDesc, Pipeline** ppPipeline) { ASSERT(pRenderer); ASSERT(ppPipeline); ASSERT(pDesc); ASSERT(pDesc->pShaderProgram); ASSERT(pDesc->pRootSignature); Pipeline* pPipeline = (Pipeline*)conf_calloc(1, sizeof(Pipeline)); ASSERT(pPipeline); const Shader* pShaderProgram = pDesc->pShaderProgram; const VertexLayout* pVertexLayout = pDesc->pVertexLayout; pPipeline->mType = PIPELINE_TYPE_GRAPHICS; // Create tempporary renderpass for pipeline creation RenderPassDesc renderPassDesc = { 0 }; RenderPass* pRenderPass = NULL; renderPassDesc.mRenderTargetCount = pDesc->mRenderTargetCount; renderPassDesc.pColorFormats = pDesc->pColorFormats; renderPassDesc.mSampleCount = pDesc->mSampleCount; renderPassDesc.mDepthStencilFormat = pDesc->mDepthStencilFormat; add_render_pass(pRenderer, &renderPassDesc, &pRenderPass); ASSERT(VK_NULL_HANDLE != pRenderer->pVkDevice); for (uint32_t i = 0; i < pShaderProgram->pReflection->mStageReflectionCount; ++i) ASSERT(VK_NULL_HANDLE != pShaderProgram->pShaderModules[i]); // Pipeline { uint32_t stage_count = 0; DECLARE_ZERO(VkPipelineShaderStageCreateInfo, stages[5]); for (uint32_t i = 0; i < 5; ++i) { ShaderStage stage_mask = (ShaderStage)(1 << i); if (stage_mask == (pShaderProgram->mStages & stage_mask)) { stages[stage_count].sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO; stages[stage_count].pNext = NULL; stages[stage_count].flags = 0; stages[stage_count].pSpecializationInfo = NULL; switch (stage_mask) { case SHADER_STAGE_VERT: { stages[stage_count].pName = pShaderProgram->pReflection->mStageReflections[pShaderProgram->pReflection->mVertexStageIndex].pEntryPoint; stages[stage_count].stage = VK_SHADER_STAGE_VERTEX_BIT; stages[stage_count].module = pShaderProgram->pShaderModules[pShaderProgram->pReflection->mVertexStageIndex]; } break; case SHADER_STAGE_TESC: { stages[stage_count].pName = pShaderProgram->pReflection->mStageReflections[pShaderProgram->pReflection->mHullStageIndex].pEntryPoint; stages[stage_count].stage = VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT; stages[stage_count].module = pShaderProgram->pShaderModules[pShaderProgram->pReflection->mHullStageIndex]; } break; case SHADER_STAGE_TESE: { stages[stage_count].pName = pShaderProgram->pReflection->mStageReflections[pShaderProgram->pReflection->mDomainStageIndex].pEntryPoint; stages[stage_count].stage = VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT; stages[stage_count].module = pShaderProgram->pShaderModules[pShaderProgram->pReflection->mDomainStageIndex]; } break; case SHADER_STAGE_GEOM: { stages[stage_count].pName = pShaderProgram->pReflection->mStageReflections[pShaderProgram->pReflection->mGeometryStageIndex].pEntryPoint; stages[stage_count].stage = VK_SHADER_STAGE_GEOMETRY_BIT; stages[stage_count].module = pShaderProgram->pShaderModules[pShaderProgram->pReflection->mGeometryStageIndex]; } break; case SHADER_STAGE_FRAG: { stages[stage_count].pName = pShaderProgram->pReflection->mStageReflections[pShaderProgram->pReflection->mPixelStageIndex].pEntryPoint; stages[stage_count].stage = VK_SHADER_STAGE_FRAGMENT_BIT; stages[stage_count].module = pShaderProgram->pShaderModules[pShaderProgram->pReflection->mPixelStageIndex]; } break; default: ASSERT(false && "Shader Stage not supported!"); break; } ++stage_count; } } // Make sure there's a shader ASSERT(0 != stage_count); uint32_t input_binding_count = 0; VkVertexInputBindingDescription input_bindings[MAX_VERTEX_BINDINGS] = { { 0 } }; uint32_t input_attribute_count = 0; VkVertexInputAttributeDescription input_attributes[MAX_VERTEX_ATTRIBS] = { { 0 } }; // Make sure there's attributes if (pVertexLayout != NULL) { // Ignore everything that's beyond max_vertex_attribs uint32_t attrib_count = pVertexLayout->mAttribCount > MAX_VERTEX_ATTRIBS ? MAX_VERTEX_ATTRIBS : pVertexLayout->mAttribCount; uint32_t binding_value = UINT32_MAX; // Initial values for (uint32_t i = 0; i < attrib_count; ++i) { const VertexAttrib* attrib = &(pVertexLayout->mAttribs[i]); if (binding_value != attrib->mBinding) { binding_value = attrib->mBinding; ++input_binding_count; } input_bindings[input_binding_count - 1].binding = binding_value; if (attrib->mRate == VERTEX_ATTRIB_RATE_INSTANCE) { input_bindings[input_binding_count - 1].inputRate = VK_VERTEX_INPUT_RATE_INSTANCE; } else { input_bindings[input_binding_count - 1].inputRate = VK_VERTEX_INPUT_RATE_VERTEX; } input_bindings[input_binding_count - 1].stride += TinyImageFormat_BitSizeOfBlock(attrib->mFormat) / 8; input_attributes[input_attribute_count].location = attrib->mLocation; input_attributes[input_attribute_count].binding = attrib->mBinding; input_attributes[input_attribute_count].format = (VkFormat)TinyImageFormat_ToVkFormat(attrib->mFormat); input_attributes[input_attribute_count].offset = attrib->mOffset; ++input_attribute_count; } } DECLARE_ZERO(VkPipelineVertexInputStateCreateInfo, vi); vi.sType = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO; vi.pNext = NULL; vi.flags = 0; vi.vertexBindingDescriptionCount = input_binding_count; vi.pVertexBindingDescriptions = input_bindings; vi.vertexAttributeDescriptionCount = input_attribute_count; vi.pVertexAttributeDescriptions = input_attributes; VkPrimitiveTopology topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST; switch (pDesc->mPrimitiveTopo) { case PRIMITIVE_TOPO_POINT_LIST: topology = VK_PRIMITIVE_TOPOLOGY_POINT_LIST; break; case PRIMITIVE_TOPO_LINE_LIST: topology = VK_PRIMITIVE_TOPOLOGY_LINE_LIST; break; case PRIMITIVE_TOPO_LINE_STRIP: topology = VK_PRIMITIVE_TOPOLOGY_LINE_STRIP; break; case PRIMITIVE_TOPO_TRI_STRIP: topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP; break; case PRIMITIVE_TOPO_PATCH_LIST: topology = VK_PRIMITIVE_TOPOLOGY_PATCH_LIST; break; case PRIMITIVE_TOPO_TRI_LIST: topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST; break; default: ASSERT(false && "Primitive Topo not supported!"); break; } DECLARE_ZERO(VkPipelineInputAssemblyStateCreateInfo, ia); ia.sType = VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO; ia.pNext = NULL; ia.flags = 0; ia.topology = topology; ia.primitiveRestartEnable = VK_FALSE; DECLARE_ZERO(VkPipelineTessellationStateCreateInfo, ts); if ((pShaderProgram->mStages & SHADER_STAGE_TESC) && (pShaderProgram->mStages & SHADER_STAGE_TESE)) { ts.sType = VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO; ts.pNext = NULL; ts.flags = 0; ts.patchControlPoints = pShaderProgram->pReflection->mStageReflections[pShaderProgram->pReflection->mHullStageIndex].mNumControlPoint; } DECLARE_ZERO(VkPipelineViewportStateCreateInfo, vs); vs.sType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO; vs.pNext = NULL; vs.flags = 0; // we are using dynimic viewports but we must set the count to 1 vs.viewportCount = 1; vs.pViewports = NULL; vs.scissorCount = 1; vs.pScissors = NULL; DECLARE_ZERO(VkPipelineMultisampleStateCreateInfo, ms); ms.sType = VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO; ms.pNext = NULL; ms.flags = 0; ms.rasterizationSamples = util_to_vk_sample_count(pDesc->mSampleCount); ms.sampleShadingEnable = VK_FALSE; ms.minSampleShading = 0.0f; ms.pSampleMask = 0; ms.alphaToCoverageEnable = VK_FALSE; ms.alphaToOneEnable = VK_FALSE; DECLARE_ZERO(VkPipelineRasterizationStateCreateInfo, rs); rs = pDesc->pRasterizerState ? util_to_rasterizer_desc(pDesc->pRasterizerState) : gDefaultRasterizerDesc; /// TODO: Dont create depth state if no depth stencil bound DECLARE_ZERO(VkPipelineDepthStencilStateCreateInfo, ds); ds = pDesc->pDepthState ? util_to_depth_desc(pDesc->pDepthState) : gDefaultDepthDesc; DECLARE_ZERO(VkPipelineColorBlendStateCreateInfo, cb); DECLARE_ZERO(VkPipelineColorBlendAttachmentState, cbAtt[MAX_RENDER_TARGET_ATTACHMENTS]); cb = pDesc->pBlendState ? util_to_blend_desc(pDesc->pBlendState, cbAtt) : gDefaultBlendDesc; cb.attachmentCount = pDesc->mRenderTargetCount; DECLARE_ZERO(VkDynamicState, dyn_states[5]); dyn_states[0] = VK_DYNAMIC_STATE_VIEWPORT; dyn_states[1] = VK_DYNAMIC_STATE_SCISSOR; dyn_states[2] = VK_DYNAMIC_STATE_DEPTH_BIAS; dyn_states[3] = VK_DYNAMIC_STATE_BLEND_CONSTANTS; dyn_states[4] = VK_DYNAMIC_STATE_DEPTH_BOUNDS; DECLARE_ZERO(VkPipelineDynamicStateCreateInfo, dy); dy.sType = VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO; dy.pNext = NULL; dy.flags = 0; dy.dynamicStateCount = 5; dy.pDynamicStates = dyn_states; DECLARE_ZERO(VkGraphicsPipelineCreateInfo, add_info); add_info.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO; add_info.pNext = NULL; add_info.flags = 0; add_info.stageCount = stage_count; add_info.pStages = stages; add_info.pVertexInputState = &vi; add_info.pInputAssemblyState = &ia; if ((pShaderProgram->mStages & SHADER_STAGE_TESC) && (pShaderProgram->mStages & SHADER_STAGE_TESE)) add_info.pTessellationState = &ts; else add_info.pTessellationState = NULL; // set tessellation state to null if we have no tessellation add_info.pViewportState = &vs; add_info.pRasterizationState = &rs; add_info.pMultisampleState = &ms; add_info.pDepthStencilState = &ds; add_info.pColorBlendState = &cb; add_info.pDynamicState = &dy; add_info.layout = pDesc->pRootSignature->pPipelineLayout; add_info.renderPass = pRenderPass->pRenderPass; add_info.subpass = 0; add_info.basePipelineHandle = VK_NULL_HANDLE; add_info.basePipelineIndex = -1; VkResult vk_res = vkCreateGraphicsPipelines(pRenderer->pVkDevice, VK_NULL_HANDLE, 1, &add_info, NULL, &(pPipeline->pVkPipeline)); ASSERT(VK_SUCCESS == vk_res); remove_render_pass(pRenderer, pRenderPass); } *ppPipeline = pPipeline; } static void addComputePipelineImpl(Renderer* pRenderer, const ComputePipelineDesc* pDesc, Pipeline** ppPipeline) { ASSERT(pRenderer); ASSERT(ppPipeline); ASSERT(pDesc); ASSERT(pDesc->pShaderProgram); ASSERT(pDesc->pRootSignature); ASSERT(pRenderer->pVkDevice != VK_NULL_HANDLE); ASSERT(pDesc->pShaderProgram->pShaderModules[0] != VK_NULL_HANDLE); Pipeline* pPipeline = (Pipeline*)conf_calloc(1, sizeof(Pipeline)); ASSERT(pPipeline); pPipeline->mType = PIPELINE_TYPE_COMPUTE; // Pipeline { DECLARE_ZERO(VkPipelineShaderStageCreateInfo, stage); stage.sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO; stage.pNext = NULL; stage.flags = 0; stage.stage = VK_SHADER_STAGE_COMPUTE_BIT; stage.module = pDesc->pShaderProgram->pShaderModules[0]; stage.pName = pDesc->pShaderProgram->pReflection->mStageReflections[0].pEntryPoint; stage.pSpecializationInfo = NULL; DECLARE_ZERO(VkComputePipelineCreateInfo, create_info); create_info.sType = VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO; create_info.pNext = NULL; create_info.flags = 0; create_info.stage = stage; create_info.layout = pDesc->pRootSignature->pPipelineLayout; create_info.basePipelineHandle = 0; create_info.basePipelineIndex = 0; VkResult vk_res = vkCreateComputePipelines(pRenderer->pVkDevice, VK_NULL_HANDLE, 1, &create_info, NULL, &(pPipeline->pVkPipeline)); ASSERT(VK_SUCCESS == vk_res); } *ppPipeline = pPipeline; } void addPipeline(Renderer* pRenderer, const PipelineDesc* pDesc, Pipeline** ppPipeline) { switch (pDesc->mType) { case(PIPELINE_TYPE_COMPUTE): { addComputePipelineImpl(pRenderer, &pDesc->mComputeDesc, ppPipeline); break; } case(PIPELINE_TYPE_GRAPHICS): { addGraphicsPipelineImpl(pRenderer, &pDesc->mGraphicsDesc, ppPipeline); break; } #ifdef ENABLE_RAYTRACING case(PIPELINE_TYPE_RAYTRACING): { addRaytracingPipelineImpl(&pDesc->mRaytracingDesc, ppPipeline); break; } #endif default: { ASSERT(false); *ppPipeline = {}; break; } } } void removePipeline(Renderer* pRenderer, Pipeline* pPipeline) { ASSERT(pRenderer); ASSERT(pPipeline); ASSERT(VK_NULL_HANDLE != pRenderer->pVkDevice); ASSERT(VK_NULL_HANDLE != pPipeline->pVkPipeline); #ifdef ENABLE_RAYTRACING SAFE_FREE(pPipeline->ppShaderStageNames); #endif vkDestroyPipeline(pRenderer->pVkDevice, pPipeline->pVkPipeline, NULL); SAFE_FREE(pPipeline); } /************************************************************************/ // Command buffer functions /************************************************************************/ void beginCmd(Cmd* pCmd) { ASSERT(pCmd); ASSERT(VK_NULL_HANDLE != pCmd->pVkCmdBuf); // reset buffer to conf_free memory vkResetCommandBuffer(pCmd->pVkCmdBuf, 0); DECLARE_ZERO(VkCommandBufferBeginInfo, begin_info); begin_info.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO; begin_info.pNext = NULL; begin_info.flags = VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT; begin_info.pInheritanceInfo = NULL; VkDeviceGroupCommandBufferBeginInfoKHR deviceGroupBeginInfo = { VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO_KHR }; deviceGroupBeginInfo.pNext = NULL; if (pCmd->pRenderer->mGpuMode == GPU_MODE_LINKED) { deviceGroupBeginInfo.deviceMask = (1 << pCmd->mNodeIndex); begin_info.pNext = &deviceGroupBeginInfo; } VkResult vk_res = vkBeginCommandBuffer(pCmd->pVkCmdBuf, &begin_info); ASSERT(VK_SUCCESS == vk_res); // Reset CPU side data pCmd->pBoundPipelineLayout = NULL; } void endCmd(Cmd* pCmd) { ASSERT(pCmd); ASSERT(VK_NULL_HANDLE != pCmd->pVkCmdBuf); if (pCmd->pVkActiveRenderPass) { vkCmdEndRenderPass(pCmd->pVkCmdBuf); } pCmd->pVkActiveRenderPass = VK_NULL_HANDLE; VkResult vk_res = vkEndCommandBuffer(pCmd->pVkCmdBuf); ASSERT(VK_SUCCESS == vk_res); } void cmdBindRenderTargets( Cmd* pCmd, uint32_t renderTargetCount, RenderTarget** ppRenderTargets, RenderTarget* pDepthStencil, const LoadActionsDesc* pLoadActions /* = NULL*/, uint32_t* pColorArraySlices, uint32_t* pColorMipSlices, uint32_t depthArraySlice, uint32_t depthMipSlice) { ASSERT(pCmd); ASSERT(VK_NULL_HANDLE != pCmd->pVkCmdBuf); if (pCmd->pVkActiveRenderPass) { vkCmdEndRenderPass(pCmd->pVkCmdBuf); pCmd->pVkActiveRenderPass = VK_NULL_HANDLE; } if (!renderTargetCount && !pDepthStencil) return; uint64_t renderPassHash = 0; uint64_t frameBufferHash = 0; // Generate hash for render pass and frame buffer // NOTE: // Render pass does not care about underlying VkImageView. It only cares about the format and sample count of the attachments. // We hash those two values to generate render pass hash // Frame buffer is the actual array of all the VkImageViews // We hash the texture id associated with the render target to generate frame buffer hash for (uint32_t i = 0; i < renderTargetCount; ++i) { uint32_t hashValues[] = { (uint32_t)ppRenderTargets[i]->mFormat, (uint32_t)ppRenderTargets[i]->mSampleCount, pLoadActions ? (uint32_t)pLoadActions->mLoadActionsColor[i] : 0, }; renderPassHash = eastl::mem_hash<uint32_t>()(hashValues, 3, renderPassHash); frameBufferHash = eastl::mem_hash<uint64_t>()(&ppRenderTargets[i]->mId, 1, frameBufferHash); } if (pDepthStencil) { uint32_t hashValues[] = { (uint32_t)pDepthStencil->mFormat, (uint32_t)pDepthStencil->mSampleCount, pLoadActions ? (uint32_t)pLoadActions->mLoadActionDepth : 0, pLoadActions ? (uint32_t)pLoadActions->mLoadActionStencil : 0, }; renderPassHash = eastl::mem_hash<uint32_t>()(hashValues, 4, renderPassHash); frameBufferHash = eastl::mem_hash<uint64_t>()(&pDepthStencil->mId, 1, frameBufferHash); } if (pColorArraySlices) frameBufferHash = eastl::mem_hash<uint32_t>()(pColorArraySlices, renderTargetCount, frameBufferHash); if (pColorMipSlices) frameBufferHash = eastl::mem_hash<uint32_t>()(pColorMipSlices, renderTargetCount, frameBufferHash); if (depthArraySlice != -1) frameBufferHash = eastl::mem_hash<uint32_t>()(&depthArraySlice, 1, frameBufferHash); if (depthMipSlice != -1) frameBufferHash = eastl::mem_hash<uint32_t>()(&depthMipSlice, 1, frameBufferHash); SampleCount sampleCount = renderTargetCount ? ppRenderTargets[0]->mSampleCount : pDepthStencil->mSampleCount; RenderPassMap& renderPassMap = get_render_pass_map(); FrameBufferMap& frameBufferMap = get_frame_buffer_map(); const RenderPassMapIt pNode = renderPassMap.find(renderPassHash); const FrameBufferMapIt pFrameBufferNode = frameBufferMap.find(frameBufferHash); RenderPass* pRenderPass = NULL; FrameBuffer* pFrameBuffer = NULL; // If a render pass of this combination already exists just use it or create a new one if (pNode != renderPassMap.end()) { pRenderPass = pNode->second; } else { TinyImageFormat colorFormats[MAX_RENDER_TARGET_ATTACHMENTS] = {}; TinyImageFormat depthStencilFormat = TinyImageFormat_UNDEFINED; for (uint32_t i = 0; i < renderTargetCount; ++i) { colorFormats[i] = ppRenderTargets[i]->mFormat; } if (pDepthStencil) { depthStencilFormat = pDepthStencil->mFormat; } RenderPassDesc renderPassDesc = {}; renderPassDesc.mRenderTargetCount = renderTargetCount; renderPassDesc.mSampleCount = sampleCount; renderPassDesc.pColorFormats = colorFormats; renderPassDesc.mDepthStencilFormat = depthStencilFormat; renderPassDesc.pLoadActionsColor = pLoadActions ? pLoadActions->mLoadActionsColor : NULL; renderPassDesc.mLoadActionDepth = pLoadActions ? pLoadActions->mLoadActionDepth : LOAD_ACTION_DONTCARE; renderPassDesc.mLoadActionStencil = pLoadActions ? pLoadActions->mLoadActionStencil : LOAD_ACTION_DONTCARE; add_render_pass(pCmd->pRenderer, &renderPassDesc, &pRenderPass); // No need of a lock here since this map is per thread renderPassMap.insert({{ renderPassHash, pRenderPass }}); } // If a frame buffer of this combination already exists just use it or create a new one if (pFrameBufferNode != frameBufferMap.end()) { pFrameBuffer = pFrameBufferNode->second; } else { FrameBufferDesc desc = { 0 }; desc.mRenderTargetCount = renderTargetCount; desc.pDepthStencil = pDepthStencil; desc.ppRenderTargets = ppRenderTargets; desc.pRenderPass = pRenderPass; desc.pColorArraySlices = pColorArraySlices; desc.pColorMipSlices = pColorMipSlices; desc.mDepthArraySlice = depthArraySlice; desc.mDepthMipSlice = depthMipSlice; add_framebuffer(pCmd->pRenderer, &desc, &pFrameBuffer); // No need of a lock here since this map is per thread frameBufferMap.insert({{ frameBufferHash, pFrameBuffer }}); } DECLARE_ZERO(VkRect2D, render_area); render_area.offset.x = 0; render_area.offset.y = 0; render_area.extent.width = pFrameBuffer->mWidth; render_area.extent.height = pFrameBuffer->mHeight; uint32_t clearValueCount = renderTargetCount; VkClearValue clearValues[MAX_RENDER_TARGET_ATTACHMENTS + 1] = {}; if (pLoadActions) { for (uint32_t i = 0; i < renderTargetCount; ++i) { ClearValue clearValue = pLoadActions->mClearColorValues[i]; clearValues[i].color = {{ clearValue.r, clearValue.g, clearValue.b, clearValue.a }}; } if (pDepthStencil) { clearValues[renderTargetCount].depthStencil = { pLoadActions->mClearDepth.depth, pLoadActions->mClearDepth.stencil }; ++clearValueCount; } } DECLARE_ZERO(VkRenderPassBeginInfo, begin_info); begin_info.sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO; begin_info.pNext = NULL; begin_info.renderPass = pRenderPass->pRenderPass; begin_info.framebuffer = pFrameBuffer->pFramebuffer; begin_info.renderArea = render_area; begin_info.clearValueCount = clearValueCount; begin_info.pClearValues = clearValues; vkCmdBeginRenderPass(pCmd->pVkCmdBuf, &begin_info, VK_SUBPASS_CONTENTS_INLINE); pCmd->pVkActiveRenderPass = pRenderPass->pRenderPass; } void cmdSetViewport(Cmd* pCmd, float x, float y, float width, float height, float minDepth, float maxDepth) { ASSERT(pCmd); ASSERT(VK_NULL_HANDLE != pCmd->pVkCmdBuf); DECLARE_ZERO(VkViewport, viewport); viewport.x = x; viewport.y = y + height; viewport.width = width; viewport.height = -height; viewport.minDepth = minDepth; viewport.maxDepth = maxDepth; vkCmdSetViewport(pCmd->pVkCmdBuf, 0, 1, &viewport); } void cmdSetScissor(Cmd* pCmd, uint32_t x, uint32_t y, uint32_t width, uint32_t height) { ASSERT(pCmd); ASSERT(VK_NULL_HANDLE != pCmd->pVkCmdBuf); DECLARE_ZERO(VkRect2D, rect); rect.offset.x = x; rect.offset.y = y; rect.extent.width = width; rect.extent.height = height; vkCmdSetScissor(pCmd->pVkCmdBuf, 0, 1, &rect); } void cmdBindPipeline(Cmd* pCmd, Pipeline* pPipeline) { ASSERT(pCmd); ASSERT(pPipeline); ASSERT(pCmd->pVkCmdBuf != VK_NULL_HANDLE); VkPipelineBindPoint pipeline_bind_point = gPipelineBindPoint[pPipeline->mType]; vkCmdBindPipeline(pCmd->pVkCmdBuf, pipeline_bind_point, pPipeline->pVkPipeline); } void cmdBindIndexBuffer(Cmd* pCmd, Buffer* pBuffer, uint32_t indexType, uint64_t offset) { ASSERT(pCmd); ASSERT(pBuffer); ASSERT(VK_NULL_HANDLE != pCmd->pVkCmdBuf); VkIndexType vk_index_type = (INDEX_TYPE_UINT16 == indexType) ? VK_INDEX_TYPE_UINT16 : VK_INDEX_TYPE_UINT32; vkCmdBindIndexBuffer(pCmd->pVkCmdBuf, pBuffer->pVkBuffer, offset, vk_index_type); } void cmdBindVertexBuffer(Cmd* pCmd, uint32_t bufferCount, Buffer** ppBuffers, const uint32_t* pStrides, const uint64_t* pOffsets) { UNREF_PARAM(pStrides); ASSERT(pCmd); ASSERT(0 != bufferCount); ASSERT(ppBuffers); ASSERT(VK_NULL_HANDLE != pCmd->pVkCmdBuf); ASSERT(pStrides); const uint32_t max_buffers = pCmd->pRenderer->pVkActiveGPUProperties->properties.limits.maxVertexInputBindings; uint32_t capped_buffer_count = bufferCount > max_buffers ? max_buffers : bufferCount; // No upper bound for this, so use 64 for now ASSERT(capped_buffer_count < 64); DECLARE_ZERO(VkBuffer, buffers[64]); DECLARE_ZERO(VkDeviceSize, offsets[64]); for (uint32_t i = 0; i < capped_buffer_count; ++i) { buffers[i] = ppBuffers[i]->pVkBuffer; offsets[i] = (pOffsets ? pOffsets[i] : 0); } vkCmdBindVertexBuffers(pCmd->pVkCmdBuf, 0, capped_buffer_count, buffers, offsets); } void cmdDraw(Cmd* pCmd, uint32_t vertex_count, uint32_t first_vertex) { ASSERT(pCmd); ASSERT(VK_NULL_HANDLE != pCmd->pVkCmdBuf); vkCmdDraw(pCmd->pVkCmdBuf, vertex_count, 1, first_vertex, 0); } void cmdDrawInstanced(Cmd* pCmd, uint32_t vertexCount, uint32_t firstVertex, uint32_t instanceCount, uint32_t firstInstance) { ASSERT(pCmd); ASSERT(VK_NULL_HANDLE != pCmd->pVkCmdBuf); vkCmdDraw(pCmd->pVkCmdBuf, vertexCount, instanceCount, firstVertex, firstInstance); } void cmdDrawIndexed(Cmd* pCmd, uint32_t index_count, uint32_t first_index, uint32_t first_vertex) { ASSERT(pCmd); ASSERT(VK_NULL_HANDLE != pCmd->pVkCmdBuf); vkCmdDrawIndexed(pCmd->pVkCmdBuf, index_count, 1, first_index, first_vertex, 0); } void cmdDrawIndexedInstanced( Cmd* pCmd, uint32_t indexCount, uint32_t firstIndex, uint32_t instanceCount, uint32_t firstInstance, uint32_t firstVertex) { ASSERT(pCmd); ASSERT(VK_NULL_HANDLE != pCmd->pVkCmdBuf); vkCmdDrawIndexed(pCmd->pVkCmdBuf, indexCount, instanceCount, firstIndex, firstVertex, firstInstance); } void cmdDispatch(Cmd* pCmd, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ) { ASSERT(pCmd); ASSERT(pCmd->pVkCmdBuf != VK_NULL_HANDLE); vkCmdDispatch(pCmd->pVkCmdBuf, groupCountX, groupCountY, groupCountZ); } void cmdResourceBarrier(Cmd* pCmd, uint32_t numBufferBarriers, BufferBarrier* pBufferBarriers, uint32_t numTextureBarriers, TextureBarrier* pTextureBarriers, uint32_t numRtBarriers, RenderTargetBarrier* pRtBarriers) { VkImageMemoryBarrier* imageBarriers = (numTextureBarriers + numRtBarriers) ? (VkImageMemoryBarrier*)alloca((numTextureBarriers + numRtBarriers) * sizeof(VkImageMemoryBarrier)) : NULL; uint32_t imageBarrierCount = 0; VkBufferMemoryBarrier* bufferBarriers = numBufferBarriers ? (VkBufferMemoryBarrier*)alloca(numBufferBarriers * sizeof(VkBufferMemoryBarrier)) : NULL; uint32_t bufferBarrierCount = 0; VkAccessFlags srcAccessFlags = 0; VkAccessFlags dstAccessFlags = 0; for (uint32_t i = 0; i < numBufferBarriers; ++i) { BufferBarrier* pTrans = &pBufferBarriers[i]; Buffer* pBuffer = pTrans->pBuffer; if (!(pTrans->mNewState & pBuffer->mCurrentState)) { VkBufferMemoryBarrier* pBufferBarrier = &bufferBarriers[bufferBarrierCount++]; pBufferBarrier->sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER; pBufferBarrier->pNext = NULL; pBufferBarrier->buffer = pBuffer->pVkBuffer; pBufferBarrier->size = VK_WHOLE_SIZE; pBufferBarrier->offset = 0; pBufferBarrier->srcAccessMask = util_to_vk_access_flags((ResourceState)pBuffer->mCurrentState); pBufferBarrier->dstAccessMask = util_to_vk_access_flags(pTrans->mNewState); pBufferBarrier->srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; pBufferBarrier->dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; pBuffer->mCurrentState = pTrans->mNewState; srcAccessFlags |= pBufferBarrier->srcAccessMask; dstAccessFlags |= pBufferBarrier->dstAccessMask; } else if (pTrans->mNewState == RESOURCE_STATE_UNORDERED_ACCESS) { VkBufferMemoryBarrier* pBufferBarrier = &bufferBarriers[bufferBarrierCount++]; pBufferBarrier->sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER; pBufferBarrier->pNext = NULL; pBufferBarrier->buffer = pBuffer->pVkBuffer; pBufferBarrier->size = VK_WHOLE_SIZE; pBufferBarrier->offset = 0; pBufferBarrier->srcAccessMask = VK_ACCESS_SHADER_WRITE_BIT; pBufferBarrier->dstAccessMask = VK_ACCESS_SHADER_WRITE_BIT | VK_ACCESS_SHADER_READ_BIT; pBufferBarrier->srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; pBufferBarrier->dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; srcAccessFlags |= pBufferBarrier->srcAccessMask; dstAccessFlags |= pBufferBarrier->dstAccessMask; } } for (uint32_t i = 0; i < numTextureBarriers; ++i) { TextureBarrier* pTrans = &pTextureBarriers[i]; Texture* pTexture = pTrans->pTexture; if (!(pTrans->mNewState & pTexture->mCurrentState)) { VkImageMemoryBarrier* pImageBarrier = &imageBarriers[imageBarrierCount++]; pImageBarrier->sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER; pImageBarrier->pNext = NULL; pImageBarrier->image = pTexture->pVkImage; pImageBarrier->subresourceRange.aspectMask = (VkImageAspectFlags)pTexture->mAspectMask; pImageBarrier->subresourceRange.baseMipLevel = 0; pImageBarrier->subresourceRange.levelCount = VK_REMAINING_MIP_LEVELS; pImageBarrier->subresourceRange.baseArrayLayer = 0; pImageBarrier->subresourceRange.layerCount = VK_REMAINING_ARRAY_LAYERS; pImageBarrier->srcAccessMask = util_to_vk_access_flags((ResourceState)pTexture->mCurrentState); pImageBarrier->dstAccessMask = util_to_vk_access_flags(pTrans->mNewState); pImageBarrier->oldLayout = util_to_vk_image_layout((ResourceState)pTexture->mCurrentState); pImageBarrier->newLayout = util_to_vk_image_layout(pTrans->mNewState); pImageBarrier->srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; pImageBarrier->dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; pTexture->mCurrentState = pTrans->mNewState; srcAccessFlags |= pImageBarrier->srcAccessMask; dstAccessFlags |= pImageBarrier->dstAccessMask; } else if (pTrans->mNewState == RESOURCE_STATE_UNORDERED_ACCESS) { VkImageMemoryBarrier* pImageBarrier = &imageBarriers[imageBarrierCount++]; pImageBarrier->sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER; pImageBarrier->pNext = NULL; pImageBarrier->image = pTexture->pVkImage; pImageBarrier->subresourceRange.aspectMask = (VkImageAspectFlags)pTexture->mAspectMask; pImageBarrier->subresourceRange.baseMipLevel = 0; pImageBarrier->subresourceRange.levelCount = VK_REMAINING_MIP_LEVELS; pImageBarrier->subresourceRange.baseArrayLayer = 0; pImageBarrier->subresourceRange.layerCount = VK_REMAINING_ARRAY_LAYERS; pImageBarrier->srcAccessMask = VK_ACCESS_SHADER_WRITE_BIT; pImageBarrier->dstAccessMask = VK_ACCESS_SHADER_WRITE_BIT | VK_ACCESS_SHADER_READ_BIT; pImageBarrier->oldLayout = VK_IMAGE_LAYOUT_GENERAL; pImageBarrier->newLayout = VK_IMAGE_LAYOUT_GENERAL; pImageBarrier->srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; pImageBarrier->dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; srcAccessFlags |= pImageBarrier->srcAccessMask; dstAccessFlags |= pImageBarrier->dstAccessMask; } } for (uint32_t i = 0; i < numRtBarriers; ++i) { RenderTargetBarrier* pTrans = &pRtBarriers[i]; Texture* pTexture = pTrans->pRenderTarget->pTexture; if (!(pTrans->mNewState & pTexture->mCurrentState)) { VkImageMemoryBarrier* pImageBarrier = &imageBarriers[imageBarrierCount++]; pImageBarrier->sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER; pImageBarrier->pNext = NULL; pImageBarrier->image = pTexture->pVkImage; pImageBarrier->subresourceRange.aspectMask = (VkImageAspectFlags)pTexture->mAspectMask; pImageBarrier->subresourceRange.baseMipLevel = 0; pImageBarrier->subresourceRange.levelCount = VK_REMAINING_MIP_LEVELS; pImageBarrier->subresourceRange.baseArrayLayer = 0; pImageBarrier->subresourceRange.layerCount = VK_REMAINING_ARRAY_LAYERS; pImageBarrier->srcAccessMask = util_to_vk_access_flags((ResourceState)pTexture->mCurrentState); pImageBarrier->dstAccessMask = util_to_vk_access_flags(pTrans->mNewState); pImageBarrier->oldLayout = util_to_vk_image_layout((ResourceState)pTexture->mCurrentState); pImageBarrier->newLayout = util_to_vk_image_layout(pTrans->mNewState); pImageBarrier->srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; pImageBarrier->dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; pTexture->mCurrentState = pTrans->mNewState; srcAccessFlags |= pImageBarrier->srcAccessMask; dstAccessFlags |= pImageBarrier->dstAccessMask; } else if (pTrans->mNewState == RESOURCE_STATE_UNORDERED_ACCESS) { VkImageMemoryBarrier* pImageBarrier = &imageBarriers[imageBarrierCount++]; pImageBarrier->sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER; pImageBarrier->pNext = NULL; pImageBarrier->image = pTexture->pVkImage; pImageBarrier->subresourceRange.aspectMask = (VkImageAspectFlags)pTexture->mAspectMask; pImageBarrier->subresourceRange.baseMipLevel = 0; pImageBarrier->subresourceRange.levelCount = VK_REMAINING_MIP_LEVELS; pImageBarrier->subresourceRange.baseArrayLayer = 0; pImageBarrier->subresourceRange.layerCount = VK_REMAINING_ARRAY_LAYERS; pImageBarrier->srcAccessMask = VK_ACCESS_SHADER_WRITE_BIT; pImageBarrier->dstAccessMask = VK_ACCESS_SHADER_WRITE_BIT | VK_ACCESS_SHADER_READ_BIT; pImageBarrier->oldLayout = VK_IMAGE_LAYOUT_GENERAL; pImageBarrier->newLayout = VK_IMAGE_LAYOUT_GENERAL; pImageBarrier->srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; pImageBarrier->dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; srcAccessFlags |= pImageBarrier->srcAccessMask; dstAccessFlags |= pImageBarrier->dstAccessMask; } } VkPipelineStageFlags srcStageMask = util_determine_pipeline_stage_flags(srcAccessFlags, (QueueType)pCmd->mType); VkPipelineStageFlags dstStageMask = util_determine_pipeline_stage_flags(dstAccessFlags, (QueueType)pCmd->mType); if (bufferBarrierCount || imageBarrierCount) { vkCmdPipelineBarrier( pCmd->pVkCmdBuf, srcStageMask, dstStageMask, 0, 0, NULL, bufferBarrierCount, bufferBarriers, imageBarrierCount, imageBarriers); } } void cmdUpdateBuffer(Cmd* pCmd, Buffer* pBuffer, uint64_t dstOffset, Buffer* pSrcBuffer, uint64_t srcOffset, uint64_t size) { ASSERT(pCmd); ASSERT(pSrcBuffer); ASSERT(pSrcBuffer->pVkBuffer); ASSERT(pBuffer); ASSERT(pBuffer->pVkBuffer); ASSERT(srcOffset + size <= pSrcBuffer->mSize); ASSERT(dstOffset + size <= pBuffer->mSize); DECLARE_ZERO(VkBufferCopy, region); region.srcOffset = srcOffset; region.dstOffset = dstOffset; region.size = (VkDeviceSize)size; vkCmdCopyBuffer(pCmd->pVkCmdBuf, pSrcBuffer->pVkBuffer, pBuffer->pVkBuffer, 1, &region); } void cmdUpdateSubresource(Cmd* pCmd, Texture* pTexture, Buffer* pSrcBuffer, SubresourceDataDesc* pSubresourceDesc) { VkBufferImageCopy pCopy; pCopy.bufferOffset = pSubresourceDesc->mBufferOffset; pCopy.bufferRowLength = 0; pCopy.bufferImageHeight = 0; pCopy.imageSubresource.aspectMask = (VkImageAspectFlags)pTexture->mAspectMask; pCopy.imageSubresource.mipLevel = pSubresourceDesc->mMipLevel; pCopy.imageSubresource.baseArrayLayer = pSubresourceDesc->mArrayLayer; pCopy.imageSubresource.layerCount = 1; pCopy.imageOffset.x = pSubresourceDesc->mRegion.mXOffset; pCopy.imageOffset.y = pSubresourceDesc->mRegion.mYOffset; pCopy.imageOffset.z = pSubresourceDesc->mRegion.mZOffset; pCopy.imageExtent.width = pSubresourceDesc->mRegion.mWidth; pCopy.imageExtent.height = pSubresourceDesc->mRegion.mHeight; pCopy.imageExtent.depth = pSubresourceDesc->mRegion.mDepth; vkCmdCopyBufferToImage(pCmd->pVkCmdBuf, pSrcBuffer->pVkBuffer, pTexture->pVkImage, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 1, &pCopy); } /************************************************************************/ // Queue Fence Semaphore Functions /************************************************************************/ void acquireNextImage(Renderer* pRenderer, SwapChain* pSwapChain, Semaphore* pSignalSemaphore, Fence* pFence, uint32_t* pImageIndex) { ASSERT(pRenderer); ASSERT(VK_NULL_HANDLE != pRenderer->pVkDevice); ASSERT(VK_NULL_HANDLE != pSwapChain->pSwapChain); ASSERT(pSignalSemaphore || pFence); VkResult vk_res = {}; if (pFence != NULL) { vk_res = vkAcquireNextImageKHR(pRenderer->pVkDevice, pSwapChain->pSwapChain, UINT64_MAX, VK_NULL_HANDLE, pFence->pVkFence, pImageIndex); // If swapchain is out of date, let caller know by setting image index to -1 if (vk_res == VK_ERROR_OUT_OF_DATE_KHR) { *pImageIndex = -1; vkResetFences(pRenderer->pVkDevice, 1, &pFence->pVkFence); pFence->mSubmitted = false; return; } pFence->mSubmitted = true; } else { vk_res = vkAcquireNextImageKHR( pRenderer->pVkDevice, pSwapChain->pSwapChain, UINT64_MAX, pSignalSemaphore->pVkSemaphore, VK_NULL_HANDLE, pImageIndex); // If swapchain is out of date, let caller know by setting image index to -1 if (vk_res == VK_ERROR_OUT_OF_DATE_KHR) { *pImageIndex = -1; pSignalSemaphore->mSignaled = false; return; } ASSERT(VK_SUCCESS == vk_res); pSignalSemaphore->mSignaled = true; } } void queueSubmit(Queue* pQueue, const QueueSubmitDesc* pDesc) { ASSERT(pQueue); ASSERT(pDesc); uint32_t cmdCount = pDesc->mCmdCount; Cmd** ppCmds = pDesc->ppCmds; Fence* pFence = pDesc->pSignalFence; uint32_t waitSemaphoreCount = pDesc->mWaitSemaphoreCount; Semaphore** ppWaitSemaphores = pDesc->ppWaitSemaphores; uint32_t signalSemaphoreCount = pDesc->mSignalSemaphoreCount; Semaphore** ppSignalSemaphores = pDesc->ppSignalSemaphores; ASSERT(cmdCount > 0); ASSERT(ppCmds); if (waitSemaphoreCount > 0) { ASSERT(ppWaitSemaphores); } if (signalSemaphoreCount > 0) { ASSERT(ppSignalSemaphores); } ASSERT(VK_NULL_HANDLE != pQueue->pVkQueue); cmdCount = cmdCount > MAX_SUBMIT_CMDS ? MAX_SUBMIT_CMDS : cmdCount; waitSemaphoreCount = waitSemaphoreCount > MAX_SUBMIT_WAIT_SEMAPHORES ? MAX_SUBMIT_WAIT_SEMAPHORES : waitSemaphoreCount; signalSemaphoreCount = signalSemaphoreCount > MAX_SUBMIT_SIGNAL_SEMAPHORES ? MAX_SUBMIT_SIGNAL_SEMAPHORES : signalSemaphoreCount; VkCommandBuffer* cmds = (VkCommandBuffer*)alloca(cmdCount * sizeof(VkCommandBuffer)); for (uint32_t i = 0; i < cmdCount; ++i) { cmds[i] = ppCmds[i]->pVkCmdBuf; } VkSemaphore* wait_semaphores = waitSemaphoreCount ? (VkSemaphore*)alloca(waitSemaphoreCount * sizeof(VkSemaphore)) : NULL; VkPipelineStageFlags* wait_masks = (VkPipelineStageFlags*)alloca(waitSemaphoreCount * sizeof(VkPipelineStageFlags)); uint32_t waitCount = 0; for (uint32_t i = 0; i < waitSemaphoreCount; ++i) { if (ppWaitSemaphores[i]->mSignaled) { wait_semaphores[waitCount] = ppWaitSemaphores[i]->pVkSemaphore; wait_masks[waitCount] = VK_PIPELINE_STAGE_ALL_COMMANDS_BIT; ++waitCount; ppWaitSemaphores[i]->mSignaled = false; } } VkSemaphore* signal_semaphores = signalSemaphoreCount ? (VkSemaphore*)alloca(signalSemaphoreCount * sizeof(VkSemaphore)) : NULL; uint32_t signalCount = 0; for (uint32_t i = 0; i < signalSemaphoreCount; ++i) { if (!ppSignalSemaphores[i]->mSignaled) { signal_semaphores[signalCount] = ppSignalSemaphores[i]->pVkSemaphore; ppSignalSemaphores[i]->mCurrentNodeIndex = pQueue->mNodeIndex; ppSignalSemaphores[signalCount]->mSignaled = true; ++signalCount; } } DECLARE_ZERO(VkSubmitInfo, submit_info); submit_info.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO; submit_info.pNext = NULL; submit_info.waitSemaphoreCount = waitCount; submit_info.pWaitSemaphores = wait_semaphores; submit_info.pWaitDstStageMask = wait_masks; submit_info.commandBufferCount = cmdCount; submit_info.pCommandBuffers = cmds; submit_info.signalSemaphoreCount = signalCount; submit_info.pSignalSemaphores = signal_semaphores; VkDeviceGroupSubmitInfo deviceGroupSubmitInfo = { VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO_KHR }; if (pQueue->mGpuMode == GPU_MODE_LINKED) { uint32_t* pVkDeviceMasks = NULL; uint32_t* pSignalIndices = NULL; uint32_t* pWaitIndices = NULL; deviceGroupSubmitInfo.pNext = NULL; deviceGroupSubmitInfo.commandBufferCount = submit_info.commandBufferCount; deviceGroupSubmitInfo.signalSemaphoreCount = submit_info.signalSemaphoreCount; deviceGroupSubmitInfo.waitSemaphoreCount = submit_info.waitSemaphoreCount; pVkDeviceMasks = (uint32_t*)alloca(deviceGroupSubmitInfo.commandBufferCount * sizeof(uint32_t)); pSignalIndices = (uint32_t*)alloca(deviceGroupSubmitInfo.signalSemaphoreCount * sizeof(uint32_t)); pWaitIndices = (uint32_t*)alloca(deviceGroupSubmitInfo.waitSemaphoreCount * sizeof(uint32_t)); for (uint32_t i = 0; i < deviceGroupSubmitInfo.commandBufferCount; ++i) { pVkDeviceMasks[i] = (1 << ppCmds[i]->mNodeIndex); } for (uint32_t i = 0; i < deviceGroupSubmitInfo.signalSemaphoreCount; ++i) { pSignalIndices[i] = pQueue->mNodeIndex; } for (uint32_t i = 0; i < deviceGroupSubmitInfo.waitSemaphoreCount; ++i) { pWaitIndices[i] = ppWaitSemaphores[i]->mCurrentNodeIndex; } deviceGroupSubmitInfo.pCommandBufferDeviceMasks = pVkDeviceMasks; deviceGroupSubmitInfo.pSignalSemaphoreDeviceIndices = pSignalIndices; deviceGroupSubmitInfo.pWaitSemaphoreDeviceIndices = pWaitIndices; submit_info.pNext = &deviceGroupSubmitInfo; } VkResult vk_res = vkQueueSubmit(pQueue->pVkQueue, 1, &submit_info, pFence ? pFence->pVkFence : VK_NULL_HANDLE); ASSERT(VK_SUCCESS == vk_res); if (pFence) pFence->mSubmitted = true; } void queuePresent(Queue* pQueue, const QueuePresentDesc* pDesc) { ASSERT(pQueue); ASSERT(pDesc); uint32_t waitSemaphoreCount = pDesc->mWaitSemaphoreCount; Semaphore** ppWaitSemaphores = pDesc->ppWaitSemaphores; if (pDesc->pSwapChain) { SwapChain* pSwapChain = pDesc->pSwapChain; ASSERT(pQueue); if (waitSemaphoreCount > 0) { ASSERT(ppWaitSemaphores); } ASSERT(VK_NULL_HANDLE != pQueue->pVkQueue); VkSemaphore* wait_semaphores = waitSemaphoreCount ? (VkSemaphore*)alloca(waitSemaphoreCount * sizeof(VkSemaphore)) : NULL; waitSemaphoreCount = waitSemaphoreCount > MAX_PRESENT_WAIT_SEMAPHORES ? MAX_PRESENT_WAIT_SEMAPHORES : waitSemaphoreCount; uint32_t waitCount = 0; for (uint32_t i = 0; i < waitSemaphoreCount; ++i) { if (ppWaitSemaphores[i]->mSignaled) { wait_semaphores[waitCount] = ppWaitSemaphores[i]->pVkSemaphore; ppWaitSemaphores[i]->mSignaled = false; ++waitCount; } } uint32_t presentIndex = pDesc->mIndex; DECLARE_ZERO(VkPresentInfoKHR, present_info); present_info.sType = VK_STRUCTURE_TYPE_PRESENT_INFO_KHR; present_info.pNext = NULL; present_info.waitSemaphoreCount = waitCount; present_info.pWaitSemaphores = wait_semaphores; present_info.swapchainCount = 1; present_info.pSwapchains = &(pSwapChain->pSwapChain); present_info.pImageIndices = &(presentIndex); present_info.pResults = NULL; VkResult vk_res = vkQueuePresentKHR(pSwapChain->pPresentQueue ? pSwapChain->pPresentQueue : pQueue->pVkQueue, &present_info); if (vk_res == VK_ERROR_OUT_OF_DATE_KHR) { // TODO : Fix bug where we get this error if window is closed before able to present queue. } else { ASSERT(VK_SUCCESS == vk_res); } } } void waitForFences(Renderer* pRenderer, uint32_t fenceCount, Fence** ppFences) { ASSERT(pRenderer); ASSERT(fenceCount); ASSERT(ppFences); VkFence* fences = (VkFence*)alloca(fenceCount * sizeof(VkFence)); uint32_t numValidFences = 0; for (uint32_t i = 0; i < fenceCount; ++i) { if (ppFences[i]->mSubmitted) fences[numValidFences++] = ppFences[i]->pVkFence; } if (numValidFences) { vkWaitForFences(pRenderer->pVkDevice, numValidFences, fences, VK_TRUE, UINT64_MAX); vkResetFences(pRenderer->pVkDevice, numValidFences, fences); } for (uint32_t i = 0; i < fenceCount; ++i) ppFences[i]->mSubmitted = false; } void waitQueueIdle(Queue* pQueue) { vkQueueWaitIdle(pQueue->pVkQueue); } void getFenceStatus(Renderer* pRenderer, Fence* pFence, FenceStatus* pFenceStatus) { *pFenceStatus = FENCE_STATUS_COMPLETE; if (pFence->mSubmitted) { VkResult vkRes = vkGetFenceStatus(pRenderer->pVkDevice, pFence->pVkFence); if (vkRes == VK_SUCCESS) { vkResetFences(pRenderer->pVkDevice, 1, &pFence->pVkFence); pFence->mSubmitted = false; } *pFenceStatus = vkRes == VK_SUCCESS ? FENCE_STATUS_COMPLETE : FENCE_STATUS_INCOMPLETE; } else { *pFenceStatus = FENCE_STATUS_NOTSUBMITTED; } } /************************************************************************/ // Utility functions /************************************************************************/ TinyImageFormat getRecommendedSwapchainFormat(bool hintHDR) { //TODO: figure out this properly. BGRA not supported on android #if !defined(VK_USE_PLATFORM_ANDROID_KHR) && !defined(VK_USE_PLATFORM_VI_NN) return TinyImageFormat_B8G8R8A8_UNORM; #else return TinyImageFormat_R8G8B8A8_UNORM; #endif } /************************************************************************/ // Indirect draw functions /************************************************************************/ void addIndirectCommandSignature(Renderer* pRenderer, const CommandSignatureDesc* pDesc, CommandSignature** ppCommandSignature) { ASSERT(pRenderer); ASSERT(pDesc); ASSERT(ppCommandSignature); CommandSignature* pCommandSignature = (CommandSignature*)conf_calloc(1, sizeof(CommandSignature)); ASSERT(pCommandSignature); for (uint32_t i = 0; i < pDesc->mIndirectArgCount; ++i) // counting for all types; { switch (pDesc->pArgDescs[i].mType) { case INDIRECT_DRAW: pCommandSignature->mDrawType = INDIRECT_DRAW; pCommandSignature->mStride += sizeof(IndirectDrawArguments); break; case INDIRECT_DRAW_INDEX: pCommandSignature->mDrawType = INDIRECT_DRAW_INDEX; pCommandSignature->mStride += sizeof(IndirectDrawIndexArguments); break; case INDIRECT_DISPATCH: pCommandSignature->mDrawType = INDIRECT_DISPATCH; pCommandSignature->mStride += sizeof(IndirectDispatchArguments); break; default: LOGF(LogLevel::eERROR, "Vulkan runtime only supports IndirectDraw, IndirectDrawIndex and IndirectDispatch at this point"); break; } } pCommandSignature->mStride = round_up(pCommandSignature->mStride, 16); *ppCommandSignature = pCommandSignature; } void removeIndirectCommandSignature(Renderer* pRenderer, CommandSignature* pCommandSignature) { pCommandSignature->mStride = 0; SAFE_FREE(pCommandSignature); } void cmdExecuteIndirect( Cmd* pCmd, CommandSignature* pCommandSignature, uint maxCommandCount, Buffer* pIndirectBuffer, uint64_t bufferOffset, Buffer* pCounterBuffer, uint64_t counterBufferOffset) { if (pCommandSignature->mDrawType == INDIRECT_DRAW) { #ifndef NX64 if (pCounterBuffer && pfnVkCmdDrawIndirectCountKHR) pfnVkCmdDrawIndirectCountKHR( pCmd->pVkCmdBuf, pIndirectBuffer->pVkBuffer, bufferOffset, pCounterBuffer->pVkBuffer, counterBufferOffset, maxCommandCount, pCommandSignature->mStride); else #endif vkCmdDrawIndirect( pCmd->pVkCmdBuf, pIndirectBuffer->pVkBuffer, bufferOffset, maxCommandCount, pCommandSignature->mStride); } else if (pCommandSignature->mDrawType == INDIRECT_DRAW_INDEX) { #ifndef NX64 if (pCounterBuffer && pfnVkCmdDrawIndexedIndirectCountKHR) pfnVkCmdDrawIndexedIndirectCountKHR( pCmd->pVkCmdBuf, pIndirectBuffer->pVkBuffer, bufferOffset, pCounterBuffer->pVkBuffer, counterBufferOffset, maxCommandCount, pCommandSignature->mStride); else #endif vkCmdDrawIndexedIndirect( pCmd->pVkCmdBuf, pIndirectBuffer->pVkBuffer, bufferOffset, maxCommandCount, pCommandSignature->mStride); } else if (pCommandSignature->mDrawType == INDIRECT_DISPATCH) { vkCmdDispatchIndirect(pCmd->pVkCmdBuf, pIndirectBuffer->pVkBuffer, bufferOffset); } } /************************************************************************/ // Query Heap Implementation /************************************************************************/ VkQueryType util_to_vk_query_type(QueryType type) { switch (type) { case QUERY_TYPE_TIMESTAMP: return VK_QUERY_TYPE_TIMESTAMP; case QUERY_TYPE_PIPELINE_STATISTICS: return VK_QUERY_TYPE_PIPELINE_STATISTICS; case QUERY_TYPE_OCCLUSION: return VK_QUERY_TYPE_OCCLUSION; default: ASSERT(false && "Invalid query heap type"); return VK_QUERY_TYPE_MAX_ENUM; } } void getTimestampFrequency(Queue* pQueue, double* pFrequency) { ASSERT(pQueue); ASSERT(pFrequency); // The framework is using ticks per sec as frequency. Vulkan is nano sec per tick. // Handle the conversion logic here. *pFrequency = 1.0f / ((double)pQueue->mTimestampPeriod /*ns/tick number of nanoseconds required for a timestamp query to be incremented by 1*/ * 1e-9); // convert to ticks/sec (DX12 standard) } void addQueryPool(Renderer* pRenderer, const QueryPoolDesc* pDesc, QueryPool** ppQueryPool) { ASSERT(pRenderer); ASSERT(pDesc); ASSERT(ppQueryPool); QueryPool* pQueryPool = (QueryPool*)conf_calloc(1, sizeof(QueryPool)); ASSERT(ppQueryPool); pQueryPool->mType = util_to_vk_query_type(pDesc->mType); pQueryPool->mCount = pDesc->mQueryCount; VkQueryPoolCreateInfo createInfo = {}; createInfo.sType = VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO; createInfo.pNext = NULL; createInfo.queryCount = pDesc->mQueryCount; createInfo.queryType = util_to_vk_query_type(pDesc->mType); createInfo.flags = 0; createInfo.pipelineStatistics = 0; vkCreateQueryPool(pRenderer->pVkDevice, &createInfo, NULL, &pQueryPool->pVkQueryPool); *ppQueryPool = pQueryPool; } void removeQueryPool(Renderer* pRenderer, QueryPool* pQueryPool) { ASSERT(pRenderer); ASSERT(pQueryPool); vkDestroyQueryPool(pRenderer->pVkDevice, pQueryPool->pVkQueryPool, NULL); SAFE_FREE(pQueryPool); } void cmdResetQueryPool(Cmd* pCmd, QueryPool* pQueryPool, uint32_t startQuery, uint32_t queryCount) { vkCmdResetQueryPool(pCmd->pVkCmdBuf, pQueryPool->pVkQueryPool, startQuery, queryCount); } void cmdBeginQuery(Cmd* pCmd, QueryPool* pQueryPool, QueryDesc* pQuery) { VkQueryType type = pQueryPool->mType; switch (type) { case VK_QUERY_TYPE_TIMESTAMP: vkCmdWriteTimestamp(pCmd->pVkCmdBuf, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, pQueryPool->pVkQueryPool, pQuery->mIndex); break; case VK_QUERY_TYPE_PIPELINE_STATISTICS: break; case VK_QUERY_TYPE_OCCLUSION: break; default: break; } } void cmdEndQuery(Cmd* pCmd, QueryPool* pQueryPool, QueryDesc* pQuery) { VkQueryType type = pQueryPool->mType; switch (type) { case VK_QUERY_TYPE_TIMESTAMP: vkCmdWriteTimestamp(pCmd->pVkCmdBuf, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, pQueryPool->pVkQueryPool, pQuery->mIndex); break; case VK_QUERY_TYPE_PIPELINE_STATISTICS: break; case VK_QUERY_TYPE_OCCLUSION: break; default: break; } } void cmdResolveQuery(Cmd* pCmd, QueryPool* pQueryPool, Buffer* pReadbackBuffer, uint32_t startQuery, uint32_t queryCount) { vkCmdCopyQueryPoolResults( pCmd->pVkCmdBuf, pQueryPool->pVkQueryPool, startQuery, queryCount, pReadbackBuffer->pVkBuffer, 0, sizeof(uint64_t), VK_QUERY_RESULT_64_BIT | VK_QUERY_RESULT_WAIT_BIT); } /************************************************************************/ // Memory Stats Implementation /************************************************************************/ void calculateMemoryStats(Renderer* pRenderer, char** stats) { vmaBuildStatsString(pRenderer->pVmaAllocator, stats, 0); } void freeMemoryStats(Renderer* pRenderer, char* stats) { vmaFreeStatsString(pRenderer->pVmaAllocator, stats); } /************************************************************************/ // Debug Marker Implementation /************************************************************************/ void cmdBeginDebugMarker(Cmd* pCmd, float r, float g, float b, const char* pName) { if (gDebugMarkerSupport) { #ifdef USE_DEBUG_UTILS_EXTENSION VkDebugUtilsLabelEXT markerInfo = {}; markerInfo.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT; markerInfo.color[0] = r; markerInfo.color[1] = g; markerInfo.color[2] = b; markerInfo.color[3] = 1.0f; markerInfo.pLabelName = pName; vkCmdBeginDebugUtilsLabelEXT(pCmd->pVkCmdBuf, &markerInfo); #elif !defined(NX64) || !defined(USE_RENDER_DOC) VkDebugMarkerMarkerInfoEXT markerInfo = {}; markerInfo.sType = VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT; markerInfo.color[0] = r; markerInfo.color[1] = g; markerInfo.color[2] = b; markerInfo.color[3] = 1.0f; markerInfo.pMarkerName = pName; vkCmdDebugMarkerBeginEXT(pCmd->pVkCmdBuf, &markerInfo); #endif } } void cmdEndDebugMarker(Cmd* pCmd) { if (gDebugMarkerSupport) { #ifdef USE_DEBUG_UTILS_EXTENSION vkCmdEndDebugUtilsLabelEXT(pCmd->pVkCmdBuf); #elif !defined(NX64) || !defined(USE_RENDER_DOC) vkCmdDebugMarkerEndEXT(pCmd->pVkCmdBuf); #endif } } void cmdAddDebugMarker(Cmd* pCmd, float r, float g, float b, const char* pName) { if (gDebugMarkerSupport) { #ifdef USE_DEBUG_UTILS_EXTENSION VkDebugUtilsLabelEXT markerInfo = {}; markerInfo.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT; markerInfo.color[0] = r; markerInfo.color[1] = g; markerInfo.color[2] = b; markerInfo.color[3] = 1.0f; markerInfo.pLabelName = pName; vkCmdInsertDebugUtilsLabelEXT(pCmd->pVkCmdBuf, &markerInfo); #else VkDebugMarkerMarkerInfoEXT markerInfo = {}; markerInfo.sType = VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT; markerInfo.color[0] = r; markerInfo.color[1] = g; markerInfo.color[2] = b; markerInfo.color[3] = 1.0f; markerInfo.pMarkerName = pName; vkCmdDebugMarkerInsertEXT(pCmd->pVkCmdBuf, &markerInfo); #endif } } /************************************************************************/ // Resource Debug Naming Interface /************************************************************************/ void setBufferName(Renderer* pRenderer, Buffer* pBuffer, const char* pName) { ASSERT(pRenderer); ASSERT(pBuffer); ASSERT(pName); if (gDebugMarkerSupport) { #ifdef USE_DEBUG_UTILS_EXTENSION VkDebugUtilsObjectNameInfoEXT nameInfo = {}; nameInfo.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT; nameInfo.objectType = VK_OBJECT_TYPE_BUFFER; nameInfo.objectHandle = (uint64_t)pBuffer->pVkBuffer; nameInfo.pObjectName = pName; vkSetDebugUtilsObjectNameEXT(pRenderer->pVkDevice, &nameInfo); #else VkDebugMarkerObjectNameInfoEXT nameInfo = {}; nameInfo.sType = VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT; nameInfo.objectType = VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT; nameInfo.object = (uint64_t)pBuffer->pVkBuffer; nameInfo.pObjectName = pName; vkDebugMarkerSetObjectNameEXT(pRenderer->pVkDevice, &nameInfo); #endif } } void setTextureName(Renderer* pRenderer, Texture* pTexture, const char* pName) { ASSERT(pRenderer); ASSERT(pTexture); ASSERT(pName); if (gDebugMarkerSupport) { #ifdef USE_DEBUG_UTILS_EXTENSION VkDebugUtilsObjectNameInfoEXT nameInfo = {}; nameInfo.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT; nameInfo.objectType = VK_OBJECT_TYPE_IMAGE; nameInfo.objectHandle = (uint64_t)pTexture->pVkImage; nameInfo.pObjectName = pName; vkSetDebugUtilsObjectNameEXT(pRenderer->pVkDevice, &nameInfo); #else VkDebugMarkerObjectNameInfoEXT nameInfo = {}; nameInfo.sType = VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT; nameInfo.objectType = VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT; nameInfo.object = (uint64_t)pTexture->pVkImage; nameInfo.pObjectName = pName; vkDebugMarkerSetObjectNameEXT(pRenderer->pVkDevice, &nameInfo); #endif } } uint32_t getMemoryType(uint32_t typeBits, VkPhysicalDeviceMemoryProperties memoryProperties, VkMemoryPropertyFlags properties, VkBool32 *memTypeFound = nullptr) { for (uint32_t i = 0; i < memoryProperties.memoryTypeCount; i++) { if ((typeBits & 1) == 1) { if ((memoryProperties.memoryTypes[i].propertyFlags & properties) == properties) { if (memTypeFound) { *memTypeFound = true; } return i; } } typeBits >>= 1; } if (memTypeFound) { *memTypeFound = false; return 0; } else { LOGF(LogLevel::eERROR, "Could not find a matching memory type"); ASSERT(0); return 0; } } /************************************************************************/ // Virtual Texture /************************************************************************/ void alignedDivision(const VkExtent3D& extent, const VkExtent3D& granularity, VkExtent3D* out) { out->width = (extent.width / granularity.width + ((extent.width % granularity.width) ? 1u : 0u)); out->height = (extent.height / granularity.height + ((extent.height % granularity.height) ? 1u : 0u)); out->depth = (extent.depth / granularity.depth + ((extent.depth % granularity.depth) ? 1u : 0u)); } // Allocate Vulkan memory for the virtual page bool allocateVirtualPage(Renderer* pRenderer, Texture* pTexture, VirtualTexturePage &virtualPage, uint32_t memoryTypeIndex) { if (virtualPage.imageMemoryBind.memory != VK_NULL_HANDLE) { //already filled return false; }; BufferDesc desc = {}; desc.mDescriptors = DESCRIPTOR_TYPE_RW_BUFFER; desc.mMemoryUsage = RESOURCE_MEMORY_USAGE_CPU_TO_GPU; desc.mFlags = BUFFER_CREATION_FLAG_PERSISTENT_MAP_BIT; desc.mFirstElement = 0; desc.mElementCount = pTexture->pSvt->mSparseVirtualTexturePageWidth * pTexture->pSvt->mSparseVirtualTexturePageHeight; desc.mStructStride = sizeof(uint32_t); desc.mSize = desc.mElementCount * desc.mStructStride; addBuffer(pRenderer, &desc, &virtualPage.pIntermediateBuffer); virtualPage.imageMemoryBind = {}; VkMemoryAllocateInfo allocInfo = {}; allocInfo.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO; allocInfo.allocationSize = virtualPage.size; allocInfo.memoryTypeIndex = memoryTypeIndex; VkResult vk_res = (VkResult)vkAllocateMemory(pRenderer->pVkDevice, &allocInfo, nullptr, &virtualPage.imageMemoryBind.memory); assert(vk_res == VK_SUCCESS); VkImageSubresource subResource{}; subResource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; subResource.mipLevel = virtualPage.mipLevel; subResource.arrayLayer = virtualPage.layer; // Sparse image memory binding virtualPage.imageMemoryBind.subresource = subResource; virtualPage.imageMemoryBind.extent = virtualPage.extent; virtualPage.imageMemoryBind.offset = virtualPage.offset; return true; } // Release Vulkan memory allocated for this page void releaseVirtualPage(Renderer* pRenderer, VirtualTexturePage &virtualPage, bool removeMemoryBind) { //TODO: This should be also removed if (removeMemoryBind && virtualPage.imageMemoryBind.memory != VK_NULL_HANDLE) { vkFreeMemory(pRenderer->pVkDevice, virtualPage.imageMemoryBind.memory, nullptr); virtualPage.imageMemoryBind.memory = VK_NULL_HANDLE; } if (virtualPage.pIntermediateBuffer) { removeBuffer(pRenderer, virtualPage.pIntermediateBuffer); virtualPage.pIntermediateBuffer = NULL; } } VirtualTexturePage* addPage(Renderer* pRenderer, Texture* pTexture, VkOffset3D offset, VkExtent3D extent, const VkDeviceSize size, const uint32_t mipLevel, uint32_t layer) { eastl::vector<VirtualTexturePage>* pPageTable = (eastl::vector<VirtualTexturePage>*)pTexture->pSvt->pPages; VirtualTexturePage newPage = {}; newPage.offset = offset; newPage.extent = extent; newPage.size = size; newPage.mipLevel = mipLevel; newPage.layer = layer; newPage.index = static_cast<uint32_t>(pPageTable->size()); pPageTable->push_back(newPage); return &pPageTable->back(); } // Call before sparse binding to update memory bind list etc. void updateSparseBindInfo(Texture* pTexture, Queue* pQueue) { eastl::vector<VirtualTexturePage>* pPageTable = (eastl::vector<VirtualTexturePage>*)pTexture->pSvt->pPages; eastl::vector<VkSparseImageMemoryBind>* pImageMemory = (eastl::vector<VkSparseImageMemoryBind>*)pTexture->pSvt->pSparseImageMemoryBinds; eastl::vector<VkSparseMemoryBind>* pOpaqueMemoryBinds = (eastl::vector<VkSparseMemoryBind>*)pTexture->pSvt->pOpaqueMemoryBinds; // Update list of memory-backed sparse image memory binds pImageMemory->resize(pPageTable->size()); uint32_t index = 0; for (int i = 0; i < (int)pPageTable->size(); i++) { (*pImageMemory)[index] = (*pPageTable)[i].imageMemoryBind; index++; } // Update sparse bind info pTexture->pSvt->mBindSparseInfo = {}; pTexture->pSvt->mBindSparseInfo.sType = VK_STRUCTURE_TYPE_BIND_SPARSE_INFO; // Image memory binds pTexture->pSvt->mImageMemoryBindInfo = {}; pTexture->pSvt->mImageMemoryBindInfo.image = pTexture->pVkImage; pTexture->pSvt->mImageMemoryBindInfo.bindCount = static_cast<uint32_t>(pImageMemory->size()); pTexture->pSvt->mImageMemoryBindInfo.pBinds = pImageMemory->data(); pTexture->pSvt->mBindSparseInfo.imageBindCount = (pTexture->pSvt->mImageMemoryBindInfo.bindCount > 0) ? 1 : 0; pTexture->pSvt->mBindSparseInfo.pImageBinds = &pTexture->pSvt->mImageMemoryBindInfo; // Opaque image memory binds (mip tail) pTexture->pSvt->mOpaqueMemoryBindInfo.image = pTexture->pVkImage; pTexture->pSvt->mOpaqueMemoryBindInfo.bindCount = static_cast<uint32_t>(pOpaqueMemoryBinds->size()); pTexture->pSvt->mOpaqueMemoryBindInfo.pBinds = pOpaqueMemoryBinds->data(); pTexture->pSvt->mBindSparseInfo.imageOpaqueBindCount = (pTexture->pSvt->mOpaqueMemoryBindInfo.bindCount > 0) ? 1 : 0; pTexture->pSvt->mBindSparseInfo.pImageOpaqueBinds = &pTexture->pSvt->mOpaqueMemoryBindInfo; } struct PageCounts { uint mAlivePageCount; uint mRemovePageCount; }; void releasePage(Cmd* pCmd, Texture* pTexture) { Renderer* pRenderer = pCmd->pRenderer; vkDeviceWaitIdle(pRenderer->pVkDevice); eastl::vector<VirtualTexturePage>* pPageTable = (eastl::vector<VirtualTexturePage>*)pTexture->pSvt->pPages; uint removePageCount = ((const PageCounts*)pTexture->pSvt->mPageCounts->pCpuMappedAddress)->mRemovePageCount; if (removePageCount == 0) return; eastl::vector<uint32_t> RemovePageTable; RemovePageTable.resize(removePageCount); memcpy(RemovePageTable.data(), pTexture->pSvt->mRemovePage->pCpuMappedAddress, sizeof(uint)); for (int i = 0; i < (int)removePageCount; ++i) { uint32_t RemoveIndex = RemovePageTable[i]; releaseVirtualPage(pRenderer, (*pPageTable)[RemoveIndex], false); } } // Fill a complete mip level // Need to get visibility info first then fill them void fillVirtualTexture(Cmd* pCmd, Texture* pTexture, Fence* pFence) { Renderer* pRenderer = pCmd->pRenderer; TextureBarrier barriers[] = { { pTexture, RESOURCE_STATE_COPY_DEST } }; cmdResourceBarrier(pCmd, 0, NULL, 1, barriers, 0, NULL); eastl::vector<VirtualTexturePage>* pPageTable = (eastl::vector<VirtualTexturePage>*)pTexture->pSvt->pPages; eastl::vector<VkSparseImageMemoryBind>* pImageMemory = (eastl::vector<VkSparseImageMemoryBind>*)pTexture->pSvt->pSparseImageMemoryBinds; eastl::vector<VkSparseMemoryBind>* pOpaqueMemoryBinds = (eastl::vector<VkSparseMemoryBind>*)pTexture->pSvt->pOpaqueMemoryBinds; pImageMemory->set_capacity(0); uint alivePageCount = ((const PageCounts*)pTexture->pSvt->mPageCounts->pCpuMappedAddress)->mAlivePageCount; eastl::vector<uint> VisibilityData; VisibilityData.resize(alivePageCount); memcpy(VisibilityData.data(), pTexture->pSvt->mAlivePage->pCpuMappedAddress, VisibilityData.size() * sizeof(uint)); for (int i = 0; i < (int)VisibilityData.size(); ++i) { uint pageIndex = VisibilityData[i]; VirtualTexturePage* pPage = &(*pPageTable)[pageIndex]; if (allocateVirtualPage(pRenderer, pTexture, *pPage, pTexture->pSvt->mSparseMemoryTypeIndex)) { void* pData = (void*)((unsigned char*)pTexture->pSvt->mVirtualImageData + (pageIndex * pPage->size)); memcpy(pPage->pIntermediateBuffer->pCpuMappedAddress, pData, pPage->size); //Copy image to VkImage VkBufferImageCopy region = {}; region.bufferOffset = 0; region.bufferRowLength = 0; region.bufferImageHeight = 0; region.imageSubresource.mipLevel = pPage->mipLevel; region.imageSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; region.imageSubresource.baseArrayLayer = 0; region.imageSubresource.layerCount = 1; region.imageOffset = { pPage->offset.x, pPage->offset.y, 0 }; region.imageExtent = { (uint32_t)pTexture->pSvt->mSparseVirtualTexturePageWidth, (uint32_t)pTexture->pSvt->mSparseVirtualTexturePageHeight, 1 }; vkCmdCopyBufferToImage( pCmd->pVkCmdBuf, pPage->pIntermediateBuffer->pVkBuffer, pTexture->pVkImage, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 1, &region); // Update list of memory-backed sparse image memory binds pImageMemory->push_back(pPage->imageMemoryBind); } } // Update sparse bind info if (pImageMemory->size() > 0) { pTexture->pSvt->mBindSparseInfo = {}; pTexture->pSvt->mBindSparseInfo.sType = VK_STRUCTURE_TYPE_BIND_SPARSE_INFO; // Image memory binds pTexture->pSvt->mImageMemoryBindInfo = {}; pTexture->pSvt->mImageMemoryBindInfo.image = pTexture->pVkImage; pTexture->pSvt->mImageMemoryBindInfo.bindCount = static_cast<uint32_t>(pImageMemory->size()); pTexture->pSvt->mImageMemoryBindInfo.pBinds = pImageMemory->data(); pTexture->pSvt->mBindSparseInfo.imageBindCount = (pTexture->pSvt->mImageMemoryBindInfo.bindCount > 0) ? 1 : 0; pTexture->pSvt->mBindSparseInfo.pImageBinds = &pTexture->pSvt->mImageMemoryBindInfo; // Opaque image memory binds (mip tail) pTexture->pSvt->mOpaqueMemoryBindInfo.image = pTexture->pVkImage; pTexture->pSvt->mOpaqueMemoryBindInfo.bindCount = static_cast<uint32_t>(pOpaqueMemoryBinds->size()); pTexture->pSvt->mOpaqueMemoryBindInfo.pBinds = pOpaqueMemoryBinds->data(); pTexture->pSvt->mBindSparseInfo.imageOpaqueBindCount = (pTexture->pSvt->mOpaqueMemoryBindInfo.bindCount > 0) ? 1 : 0; pTexture->pSvt->mBindSparseInfo.pImageOpaqueBinds = &pTexture->pSvt->mOpaqueMemoryBindInfo; VkResult vk_res = vkQueueBindSparse(pCmd->pQueue->pVkQueue, (uint32_t)1, &pTexture->pSvt->mBindSparseInfo, VK_NULL_HANDLE); ASSERT(VK_SUCCESS == vk_res); } } // Fill specific mipLevel void fillVirtualTextureLevel(Cmd* pCmd, Texture* pTexture, uint32_t mipLevel) { Renderer* pRenderer = pCmd->pRenderer; vkDeviceWaitIdle(pRenderer->pVkDevice); eastl::vector<VirtualTexturePage>* pPageTable = (eastl::vector<VirtualTexturePage>*)pTexture->pSvt->pPages; //Bind data eastl::vector<VkSparseImageMemoryBind>* pImageMemory = (eastl::vector<VkSparseImageMemoryBind>*)pTexture->pSvt->pSparseImageMemoryBinds; eastl::vector<VkSparseMemoryBind>* pOpaqueMemoryBinds = (eastl::vector<VkSparseMemoryBind>*)pTexture->pSvt->pOpaqueMemoryBinds; for (int i = 0; i < (int)pTexture->pSvt->mVirtualPageTotalCount; i++) { VirtualTexturePage* pPage = &(*pPageTable)[i]; uint32_t pageIndex = pPage->index; if ((pPage->mipLevel == mipLevel) && (pPage->imageMemoryBind.memory == VK_NULL_HANDLE)) { if (allocateVirtualPage(pRenderer, pTexture, *pPage, pTexture->pSvt->mSparseMemoryTypeIndex)) { void* pData = (void*)((unsigned char*)pTexture->pSvt->mVirtualImageData + (pageIndex * (uint32_t)pPage->size)); //CPU to GPU memcpy(pPage->pIntermediateBuffer->pCpuMappedAddress, pData, pPage->size); //Copy image to VkImage VkBufferImageCopy region = {}; region.bufferOffset = 0; region.bufferRowLength = 0; region.bufferImageHeight = 0; region.imageSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; region.imageSubresource.mipLevel = mipLevel; region.imageSubresource.baseArrayLayer = 0; region.imageSubresource.layerCount = 1; region.imageOffset = { pPage->offset.x, pPage->offset.y, 0 }; region.imageExtent = { (uint32_t)pTexture->pSvt->mSparseVirtualTexturePageWidth, (uint32_t)pTexture->pSvt->mSparseVirtualTexturePageHeight, 1 }; vkCmdCopyBufferToImage( pCmd->pVkCmdBuf, pPage->pIntermediateBuffer->pVkBuffer, pTexture->pVkImage, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 1, &region); } // Update list of memory-backed sparse image memory binds pImageMemory->push_back(pPage->imageMemoryBind); } } // Update sparse bind info { pTexture->pSvt->mBindSparseInfo = {}; pTexture->pSvt->mBindSparseInfo.sType = VK_STRUCTURE_TYPE_BIND_SPARSE_INFO; // Image memory binds pTexture->pSvt->mImageMemoryBindInfo = {}; pTexture->pSvt->mImageMemoryBindInfo.image = pTexture->pVkImage; pTexture->pSvt->mImageMemoryBindInfo.bindCount = static_cast<uint32_t>(pImageMemory->size()); pTexture->pSvt->mImageMemoryBindInfo.pBinds = pImageMemory->data(); pTexture->pSvt->mBindSparseInfo.imageBindCount = (pTexture->pSvt->mImageMemoryBindInfo.bindCount > 0) ? 1 : 0; pTexture->pSvt->mBindSparseInfo.pImageBinds = &pTexture->pSvt->mImageMemoryBindInfo; // Opaque image memory binds (mip tail) pTexture->pSvt->mOpaqueMemoryBindInfo.image = pTexture->pVkImage; pTexture->pSvt->mOpaqueMemoryBindInfo.bindCount = static_cast<uint32_t>(pOpaqueMemoryBinds->size()); pTexture->pSvt->mOpaqueMemoryBindInfo.pBinds = pOpaqueMemoryBinds->data(); pTexture->pSvt->mBindSparseInfo.imageOpaqueBindCount = (pTexture->pSvt->mOpaqueMemoryBindInfo.bindCount > 0) ? 1 : 0; pTexture->pSvt->mBindSparseInfo.pImageOpaqueBinds = &pTexture->pSvt->mOpaqueMemoryBindInfo; VkResult vk_res = vkQueueBindSparse(pCmd->pQueue->pVkQueue, (uint32_t)1, &pTexture->pSvt->mBindSparseInfo, VK_NULL_HANDLE); ASSERT(VK_SUCCESS == vk_res); } } void addVirtualTexture(Renderer * pRenderer, const TextureDesc * pDesc, Texture** ppTexture, void* pImageData) { ASSERT(pRenderer); Texture* pTexture = (Texture*)conf_calloc(1, sizeof(*pTexture) + sizeof(VirtualTexture)); ASSERT(pTexture); pTexture->pSvt = (VirtualTexture*)(pTexture + 1); uint32_t imageSize = 0; uint32_t mipSize = pDesc->mWidth * pDesc->mHeight * pDesc->mDepth; while (mipSize > 0) { imageSize += mipSize; mipSize /= 4; } pTexture->pSvt->mVirtualImageData = (char*)conf_malloc(imageSize * sizeof(uint32_t)); memcpy(pTexture->pSvt->mVirtualImageData, pImageData, imageSize * sizeof(uint32_t)); // Create command buffer to transition resources to the correct state Queue* graphicsQueue = NULL; CmdPool* cmdPool = NULL; Cmd* cmd = NULL; QueueDesc queueDesc = {}; queueDesc.mType = QUEUE_TYPE_GRAPHICS; addQueue(pRenderer, &queueDesc, &graphicsQueue); CmdPoolDesc cmdPoolDesc = {}; cmdPoolDesc.pQueue = graphicsQueue; cmdPoolDesc.mTransient = true; addCmdPool(pRenderer, &cmdPoolDesc, &cmdPool); CmdDesc cmdDesc = {}; cmdDesc.pPool = cmdPool; addCmd(pRenderer, &cmdDesc, &cmd); // Transition resources beginCmd(cmd); VkFormat format = VK_FORMAT_R8G8B8A8_UNORM; pTexture->mOwnsImage = true; VkImageCreateInfo add_info = {}; add_info.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO; add_info.flags = VK_IMAGE_CREATE_SPARSE_BINDING_BIT | VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT; add_info.imageType = VK_IMAGE_TYPE_2D; add_info.format = format; add_info.extent.width = pDesc->mWidth; add_info.extent.height = pDesc->mHeight; add_info.extent.depth = pDesc->mDepth; add_info.mipLevels = pDesc->mMipLevels; add_info.arrayLayers = 1; add_info.samples = VK_SAMPLE_COUNT_1_BIT; add_info.tiling = VK_IMAGE_TILING_OPTIMAL; add_info.usage = VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT; add_info.sharingMode = VK_SHARING_MODE_EXCLUSIVE; add_info.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED; VkResult vk_res = (VkResult)vkCreateImage(pRenderer->pVkDevice, &add_info, nullptr, &pTexture->pVkImage); assert(vk_res == VK_SUCCESS); // Get memory requirements VkMemoryRequirements sparseImageMemoryReqs; // Sparse image memory requirement counts vkGetImageMemoryRequirements(pRenderer->pVkDevice, pTexture->pVkImage, &sparseImageMemoryReqs); // Check requested image size against hardware sparse limit if (sparseImageMemoryReqs.size > pRenderer->pVkActiveGPUProperties->properties.limits.sparseAddressSpaceSize) { LOGF(LogLevel::eERROR, "Requested sparse image size exceeds supportes sparse address space size!"); return; } // Get sparse memory requirements // Count uint32_t sparseMemoryReqsCount = 32; eastl::vector<VkSparseImageMemoryRequirements> sparseMemoryReqs(sparseMemoryReqsCount); vkGetImageSparseMemoryRequirements(pRenderer->pVkDevice, pTexture->pVkImage, &sparseMemoryReqsCount, sparseMemoryReqs.data()); if (sparseMemoryReqsCount == 0) { LOGF(LogLevel::eERROR, "No memory requirements for the sparse image!"); return; } sparseMemoryReqs.resize(sparseMemoryReqsCount); // Get actual requirements vkGetImageSparseMemoryRequirements(pRenderer->pVkDevice, pTexture->pVkImage, &sparseMemoryReqsCount, sparseMemoryReqs.data()); pTexture->pSvt->mSparseVirtualTexturePageWidth = sparseMemoryReqs[0].formatProperties.imageGranularity.width; pTexture->pSvt->mSparseVirtualTexturePageHeight = sparseMemoryReqs[0].formatProperties.imageGranularity.height; pTexture->pSvt->mVirtualPageTotalCount = imageSize / (uint32_t)(pTexture->pSvt->mSparseVirtualTexturePageWidth * pTexture->pSvt->mSparseVirtualTexturePageHeight); uint32_t TiledMiplevel = pDesc->mMipLevels - (uint32_t)log2(min((uint32_t)pTexture->pSvt->mSparseVirtualTexturePageWidth, (uint32_t)pTexture->pSvt->mSparseVirtualTexturePageHeight)); LOGF(LogLevel::eINFO, "Sparse image memory requirements: %d", sparseMemoryReqsCount); for (int i = 0; i < (int)sparseMemoryReqs.size(); ++i) { VkSparseImageMemoryRequirements reqs = sparseMemoryReqs[i]; //todo:multiple reqs pTexture->pSvt->mMipTailStart = reqs.imageMipTailFirstLod; } pTexture->pSvt->mLastFilledMip = pTexture->pSvt->mMipTailStart - 1; // Get sparse image requirements for the color aspect VkSparseImageMemoryRequirements sparseMemoryReq; bool colorAspectFound = false; for (int i = 0; i < (int)sparseMemoryReqs.size(); ++i) { VkSparseImageMemoryRequirements reqs = sparseMemoryReqs[i]; if (reqs.formatProperties.aspectMask & VK_IMAGE_ASPECT_COLOR_BIT) { sparseMemoryReq = reqs; colorAspectFound = true; break; } } if (!colorAspectFound) { LOGF(LogLevel::eERROR, "Could not find sparse image memory requirements for color aspect bit!"); return; } VkPhysicalDeviceMemoryProperties memProps = {}; vkGetPhysicalDeviceMemoryProperties(pRenderer->pVkActiveGPU, &memProps); // todo: // Calculate number of required sparse memory bindings by alignment assert((sparseImageMemoryReqs.size % sparseImageMemoryReqs.alignment) == 0); pTexture->pSvt->mSparseMemoryTypeIndex = getMemoryType(sparseImageMemoryReqs.memoryTypeBits, memProps, VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT); // Get sparse bindings uint32_t sparseBindsCount = static_cast<uint32_t>(sparseImageMemoryReqs.size / sparseImageMemoryReqs.alignment); eastl::vector<VkSparseMemoryBind> sparseMemoryBinds(sparseBindsCount); // Check if the format has a single mip tail for all layers or one mip tail for each layer // The mip tail contains all mip levels > sparseMemoryReq.imageMipTailFirstLod bool singleMipTail = sparseMemoryReq.formatProperties.flags & VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT; pTexture->pSvt->pPages = (eastl::vector<VirtualTexturePage>*)conf_calloc(1, sizeof(eastl::vector<VirtualTexturePage>)); pTexture->pSvt->pSparseImageMemoryBinds = (eastl::vector<VkSparseImageMemoryBind>*)conf_calloc(1, sizeof(eastl::vector<VkSparseImageMemoryBind>)); pTexture->pSvt->pOpaqueMemoryBinds = (eastl::vector<VkSparseMemoryBind>*)conf_calloc(1, sizeof(eastl::vector<VkSparseMemoryBind>)); conf_placement_new<decltype(pTexture->pSvt->pPages)>(pTexture->pSvt->pPages); conf_placement_new<decltype(pTexture->pSvt->pSparseImageMemoryBinds)>(pTexture->pSvt->pSparseImageMemoryBinds); conf_placement_new<decltype(pTexture->pSvt->pOpaqueMemoryBinds)>(pTexture->pSvt->pOpaqueMemoryBinds); eastl::vector<VkSparseMemoryBind>* pOpaqueMemoryBinds = (eastl::vector<VkSparseMemoryBind>*)pTexture->pSvt->pOpaqueMemoryBinds; // Sparse bindings for each mip level of all layers outside of the mip tail for (uint32_t layer = 0; layer < 1; layer++) { // sparseMemoryReq.imageMipTailFirstLod is the first mip level that's stored inside the mip tail for (uint32_t mipLevel = 0; mipLevel < TiledMiplevel; mipLevel++) { VkExtent3D extent; extent.width = max(add_info.extent.width >> mipLevel, 1u); extent.height = max(add_info.extent.height >> mipLevel, 1u); extent.depth = max(add_info.extent.depth >> mipLevel, 1u); VkImageSubresource subResource{}; subResource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; subResource.mipLevel = mipLevel; subResource.arrayLayer = layer; // Aligned sizes by image granularity VkExtent3D imageGranularity = sparseMemoryReq.formatProperties.imageGranularity; VkExtent3D sparseBindCounts = {}; VkExtent3D lastBlockExtent = {}; alignedDivision(extent, imageGranularity, &sparseBindCounts); lastBlockExtent.width = ((extent.width % imageGranularity.width) ? extent.width % imageGranularity.width : imageGranularity.width); lastBlockExtent.height = ((extent.height % imageGranularity.height) ? extent.height % imageGranularity.height : imageGranularity.height); lastBlockExtent.depth = ((extent.depth % imageGranularity.depth) ? extent.depth % imageGranularity.depth : imageGranularity.depth); // Alllocate memory for some blocks uint32_t index = 0; for (uint32_t z = 0; z < sparseBindCounts.depth; z++) { for (uint32_t y = 0; y < sparseBindCounts.height; y++) { for (uint32_t x = 0; x < sparseBindCounts.width; x++) { // Offset VkOffset3D offset; offset.x = x * imageGranularity.width; offset.y = y * imageGranularity.height; offset.z = z * imageGranularity.depth; // Size of the page VkExtent3D extent; extent.width = (x == sparseBindCounts.width - 1) ? lastBlockExtent.width : imageGranularity.width; extent.height = (y == sparseBindCounts.height - 1) ? lastBlockExtent.height : imageGranularity.height; extent.depth = (z == sparseBindCounts.depth - 1) ? lastBlockExtent.depth : imageGranularity.depth; // Add new virtual page VirtualTexturePage *newPage = addPage(pRenderer, pTexture, offset, extent, pTexture->pSvt->mSparseVirtualTexturePageWidth * pTexture->pSvt->mSparseVirtualTexturePageHeight * sizeof(uint), mipLevel, layer); newPage->imageMemoryBind.subresource = subResource; index++; } } } } // Check if format has one mip tail per layer if ((!singleMipTail) && (sparseMemoryReq.imageMipTailFirstLod < pDesc->mMipLevels)) { // Allocate memory for the mip tail VkMemoryAllocateInfo allocInfo = {}; allocInfo.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO; allocInfo.allocationSize = sparseMemoryReq.imageMipTailSize; allocInfo.memoryTypeIndex = pTexture->pSvt->mSparseMemoryTypeIndex; VkDeviceMemory deviceMemory; vk_res = vkAllocateMemory(pRenderer->pVkDevice, &allocInfo, nullptr, &deviceMemory); assert(vk_res == VK_SUCCESS); // (Opaque) sparse memory binding VkSparseMemoryBind sparseMemoryBind{}; sparseMemoryBind.resourceOffset = sparseMemoryReq.imageMipTailOffset + layer * sparseMemoryReq.imageMipTailStride; sparseMemoryBind.size = sparseMemoryReq.imageMipTailSize; sparseMemoryBind.memory = deviceMemory; pOpaqueMemoryBinds->push_back(sparseMemoryBind); } } // end layers and mips LOGF(LogLevel::eINFO, "Virtual Texture info: Dim %d x %d Pages %d", pDesc->mWidth, pDesc->mHeight, (uint32_t)(((eastl::vector<VirtualTexturePage>*)pTexture->pSvt->pPages)->size())); // Check if format has one mip tail for all layers if ((sparseMemoryReq.formatProperties.flags & VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT) && (sparseMemoryReq.imageMipTailFirstLod < pDesc->mMipLevels)) { // Allocate memory for the mip tail VkMemoryAllocateInfo allocInfo = {}; allocInfo.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO; allocInfo.allocationSize = sparseMemoryReq.imageMipTailSize; allocInfo.memoryTypeIndex = pTexture->pSvt->mSparseMemoryTypeIndex; VkDeviceMemory deviceMemory; vk_res = vkAllocateMemory(pRenderer->pVkDevice, &allocInfo, nullptr, &deviceMemory); assert(vk_res == VK_SUCCESS); // (Opaque) sparse memory binding VkSparseMemoryBind sparseMemoryBind{}; sparseMemoryBind.resourceOffset = sparseMemoryReq.imageMipTailOffset; sparseMemoryBind.size = sparseMemoryReq.imageMipTailSize; sparseMemoryBind.memory = deviceMemory; pOpaqueMemoryBinds->push_back(sparseMemoryBind); } pTexture->pSvt->mLastFilledMip = pTexture->pSvt->mMipTailStart - 1; /************************************************************************/ // Create image view /************************************************************************/ VkImageViewCreateInfo view = {}; view.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO; view.image = pTexture->pVkImage; view.viewType = VK_IMAGE_VIEW_TYPE_2D; view.format = format; view.components = { VK_COMPONENT_SWIZZLE_R, VK_COMPONENT_SWIZZLE_G, VK_COMPONENT_SWIZZLE_B, VK_COMPONENT_SWIZZLE_A }; view.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; view.subresourceRange.baseMipLevel = 0; view.subresourceRange.baseArrayLayer = 0; view.subresourceRange.layerCount = 1; view.subresourceRange.levelCount = pDesc->mMipLevels; view.image = pTexture->pVkImage; pTexture->mAspectMask = VK_IMAGE_ASPECT_COLOR_BIT; vk_res = vkCreateImageView(pRenderer->pVkDevice, &view, NULL, &pTexture->pVkSRVDescriptor); ASSERT(VK_SUCCESS == vk_res); eastl::vector<TextureBarrier> textureBarriers; textureBarriers.push_back(TextureBarrier{ pTexture, RESOURCE_STATE_COPY_DEST }); uint32_t textureBarrierCount = (uint32_t)textureBarriers.size(); cmdResourceBarrier(cmd, 0, NULL, textureBarrierCount, textureBarriers.data(), 0, NULL); // Fill smallest (non-tail) mip map level fillVirtualTextureLevel(cmd, pTexture, TiledMiplevel - 1); endCmd(cmd); QueueSubmitDesc submitDesc = {}; submitDesc.mCmdCount = 1; submitDesc.ppCmds = &cmd; queueSubmit(graphicsQueue, &submitDesc); waitQueueIdle(graphicsQueue); // Delete command buffer removeCmd(pRenderer, cmd); removeCmdPool(pRenderer, cmdPool); removeQueue(pRenderer, graphicsQueue); pTexture->mOwnsImage = true; pTexture->mNodeIndex = pDesc->mNodeIndex; pTexture->mStartState = pDesc->mStartState; pTexture->mMipLevels = pDesc->mMipLevels; pTexture->mWidth = pDesc->mWidth; pTexture->mHeight = pDesc->mHeight; pTexture->mDepth = pDesc->mDepth; pTexture->mCurrentState = RESOURCE_STATE_UNDEFINED; *ppTexture = pTexture; } void removeVirtualTexture(Renderer* pRenderer, VirtualTexture* pSvt) { eastl::vector<VirtualTexturePage>* pPageTable = (eastl::vector<VirtualTexturePage>*)pSvt->pPages; if (pPageTable) { for (int i = 0; i < (int)pPageTable->size(); i++) { releaseVirtualPage(pRenderer, (*pPageTable)[i], true); } pPageTable->set_capacity(0); SAFE_FREE(pSvt->pPages); } eastl::vector<VkSparseImageMemoryBind>* pImageMemory = (eastl::vector<VkSparseImageMemoryBind>*)pSvt->pSparseImageMemoryBinds; if (pImageMemory) { pImageMemory->set_capacity(0); SAFE_FREE(pSvt->pSparseImageMemoryBinds); } eastl::vector<VkSparseMemoryBind>* pOpaqueMemory = (eastl::vector<VkSparseMemoryBind>*)pSvt->pOpaqueMemoryBinds; if (pOpaqueMemory) { for (int i = 0; i < (int)pOpaqueMemory->size(); i++) { vkFreeMemory(pRenderer->pVkDevice, (*pOpaqueMemory)[i].memory, nullptr); } pOpaqueMemory->set_capacity(0); SAFE_FREE(pSvt->pOpaqueMemoryBinds); } if (pSvt->mVisibility) removeBuffer(pRenderer, pSvt->mVisibility); if (pSvt->mPrevVisibility) removeBuffer(pRenderer, pSvt->mPrevVisibility); if (pSvt->mAlivePage) removeBuffer(pRenderer, pSvt->mAlivePage); if (pSvt->mRemovePage) removeBuffer(pRenderer, pSvt->mRemovePage); if (pSvt->mPageCounts) removeBuffer(pRenderer, pSvt->mPageCounts); if (pSvt->mVirtualImageData) conf_free(pSvt->mVirtualImageData); } void cmdUpdateVirtualTexture(Cmd* cmd, Texture* pTexture) { if (pTexture->pSvt->mVisibility) { releasePage(cmd, pTexture); fillVirtualTexture(cmd, pTexture, NULL); } } #endif #if defined(__cplusplus) && defined(ENABLE_RENDERER_RUNTIME_SWITCH) } // namespace RENDERER_CPP_NAMESPACE #endif #if !defined(NX64) #include "../../../Common_3/ThirdParty/OpenSource/volk/volk.c" #if defined(VK_USE_DISPATCH_TABLES) #include "../../../Common_3/ThirdParty/OpenSource/volk/volkForgeExt.c" #endif #endif #endif
37.782755
211
0.740918
5deaed3d605ec95b365f13ceacd32f9e2856eca6
1,240
h
C
qprintpreviewdialog_c.h
mariuszmaximus/qt5pas-aarch64-linux-gnu
c60bbcfa5b0d7c4fe18bb21e5f2f424a5b658c1b
[ "Apache-2.0" ]
null
null
null
qprintpreviewdialog_c.h
mariuszmaximus/qt5pas-aarch64-linux-gnu
c60bbcfa5b0d7c4fe18bb21e5f2f424a5b658c1b
[ "Apache-2.0" ]
null
null
null
qprintpreviewdialog_c.h
mariuszmaximus/qt5pas-aarch64-linux-gnu
c60bbcfa5b0d7c4fe18bb21e5f2f424a5b658c1b
[ "Apache-2.0" ]
null
null
null
//****************************************************************************** // Copyright (c) 2005-2013 by Jan Van hijfte // // See the included file COPYING.TXT for details about the copyright. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. //****************************************************************************** #ifndef QPRINTPREVIEWDIALOG_C_H #define QPRINTPREVIEWDIALOG_C_H #include <QtPrintSupport> #include "pascalbind.h" C_EXPORT QPrintPreviewDialogH QPrintPreviewDialog_Create(QWidgetH parent, unsigned int flags); C_EXPORT void QPrintPreviewDialog_Destroy(QPrintPreviewDialogH handle); C_EXPORT QPrintPreviewDialogH QPrintPreviewDialog_Create2(QPrinterH printer, QWidgetH parent, unsigned int flags); C_EXPORT void QPrintPreviewDialog_open(QPrintPreviewDialogH handle, QObjectH receiver, const char* member); C_EXPORT QPrinterH QPrintPreviewDialog_printer(QPrintPreviewDialogH handle); C_EXPORT void QPrintPreviewDialog_setVisible(QPrintPreviewDialogH handle, bool visible); C_EXPORT void QPrintPreviewDialog_done(QPrintPreviewDialogH handle, int result); #endif
45.925926
114
0.725806
e7561116b9a39f1e33367a14b3d0d228a216c000
2,374
js
JavaScript
Social Media Dashboard/js/index.js
varisha-025/Cool-Front-End-Templates
723ff036d1b9179b5614456ac6bbea0c2d320ccf
[ "MIT" ]
90
2021-09-12T23:11:36.000Z
2022-03-31T23:28:01.000Z
Social Media Dashboard/js/index.js
varisha-025/Cool-Front-End-Templates
723ff036d1b9179b5614456ac6bbea0c2d320ccf
[ "MIT" ]
367
2021-10-01T04:54:35.000Z
2022-03-31T21:09:28.000Z
Social Media Dashboard/js/index.js
varisha-025/Cool-Front-End-Templates
723ff036d1b9179b5614456ac6bbea0c2d320ccf
[ "MIT" ]
196
2021-09-30T18:03:10.000Z
2022-03-31T23:28:06.000Z
AOS.init({ duration: 800 }); function setLightMode() { document.getElementsByClassName("dark-theme")[0].classList.add("light-theme") var cardBoxes = document.getElementsByClassName("card-box"); for(var i = 0; i < cardBoxes.length; i++) { cardBoxes[i].classList.add("card-box-light"); } var statsBoxes = document.getElementsByClassName("stats-box"); for(var i = 0; i < statsBoxes.length; i++) { statsBoxes[i].classList.add("stats-box-light"); } var h1 = document.querySelectorAll("h1"); for(var i = 0; i < h1.length; i++) { h1[i].classList.add("h1-light"); } var h3 = document.querySelectorAll("h3"); for(var i = 0; i < h3.length; i++) { h3[i].classList.add("h3-light"); } var h4 = document.querySelectorAll("h4"); for(var i = 0; i < h4.length; i++) { h4[i].classList.add("h4-light"); } var statsCounts = document.getElementsByClassName("stats-count"); for(var i = 0; i < statsCounts.length; i++) { statsCounts[i].classList.add("stats-count-light"); } document.getElementsByClassName("mode-box")[0].classList.add("mode-box-light"); } function removeLightMode() { document.getElementsByClassName("dark-theme")[0].classList.remove("light-theme") var cardBoxes = document.getElementsByClassName("card-box"); for(var i = 0; i < cardBoxes.length; i++) { cardBoxes[i].classList.remove("card-box-light"); } var statsBoxes = document.getElementsByClassName("stats-box"); for(var i = 0; i < statsBoxes.length; i++) { statsBoxes[i].classList.remove("stats-box-light"); } var h1 = document.querySelectorAll("h1"); for(var i = 0; i < h1.length; i++) { h1[i].classList.remove("h1-light"); } var h3 = document.querySelectorAll("h3"); for(var i = 0; i < h3.length; i++) { h3[i].classList.remove("h3-light"); } var h4 = document.querySelectorAll("h4"); for(var i = 0; i < h4.length; i++) { h4[i].classList.remove("h4-light"); } var statsCounts = document.getElementsByClassName("stats-count"); for(var i = 0; i < statsCounts.length; i++) { statsCounts[i].classList.remove("stats-count-light"); } document.getElementsByClassName("mode-box")[0].classList.remove("mode-box-light"); } var switchInput = document.getElementsByClassName("form-check-input")[0]; switchInput.addEventListener("click" , function(event) { if(event.target.checked === true) { removeLightMode(); } else { setLightMode(); } });
26.977273
83
0.673968
3bc6b4b6243efe1bfe7e30af9159a37a3e1b8ec3
867,317
html
HTML
lists.whatwg.org/pipermail/commit-watchers-whatwg.org/2011/012918.html
zcorpan/whatwg.org
3374e69f013e5939abc5f3fffaae50bb6eaf0bd3
[ "CC-BY-4.0" ]
1
2022-02-14T23:44:51.000Z
2022-02-14T23:44:51.000Z
lists.whatwg.org/pipermail/commit-watchers-whatwg.org/2011/012918.html
Seanpm2001-Google/whatwg.org
33ad837c0dc53b68865f4a35ccdc1c68dc07fce6
[ "BSD-3-Clause" ]
1
2021-01-31T11:51:12.000Z
2021-01-31T11:51:12.000Z
lists.whatwg.org/pipermail/commit-watchers-whatwg.org/2011/012918.html
Seanpm2001-Google/whatwg.org
33ad837c0dc53b68865f4a35ccdc1c68dc07fce6
[ "BSD-3-Clause" ]
null
null
null
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <HTML> <HEAD> <TITLE> [html5] r6050 - [e] (0) make ids more consistent (this might break some links, sorry) Fixing htt [...] </TITLE> <LINK REL="Index" HREF="index.html" > <LINK REL="made" HREF="mailto:commit-watchers%40lists.whatwg.org?Subject=Re%3A%20%5Bhtml5%5D%20r6050%20-%20%5Be%5D%20%280%29%20make%20ids%20more%20consistent%20%28this%20might%20break%0A%09some%20links%2C%20sorry%29%20Fixing%20htt%20%5B...%5D&In-Reply-To=%3C20110503191857.8712011C7C007%40ps20323.dreamhostps.com%3E"> <META NAME="robots" CONTENT="index,nofollow"> <style type="text/css"> pre { white-space: pre-wrap; /* css-2.1, curent FF, Opera, Safari */ } </style> <META http-equiv="Content-Type" content="text/html; charset=us-ascii"> <LINK REL="Previous" HREF="012916.html"> <LINK REL="Next" HREF="012917.html"> </HEAD> <BODY BGCOLOR="#ffffff"> <H1>[html5] r6050 - [e] (0) make ids more consistent (this might break some links, sorry) Fixing htt [...]</H1> <!--htdig_noindex--> <B>whatwg at whatwg.org</B> <A HREF="mailto:commit-watchers%40lists.whatwg.org?Subject=Re%3A%20%5Bhtml5%5D%20r6050%20-%20%5Be%5D%20%280%29%20make%20ids%20more%20consistent%20%28this%20might%20break%0A%09some%20links%2C%20sorry%29%20Fixing%20htt%20%5B...%5D&In-Reply-To=%3C20110503191857.8712011C7C007%40ps20323.dreamhostps.com%3E" TITLE="[html5] r6050 - [e] (0) make ids more consistent (this might break some links, sorry) Fixing htt [...]">whatwg at whatwg.org </A><BR> <I>Tue May 3 12:18:57 PDT 2011</I> <P><UL> <LI>Previous message: <A HREF="012916.html">[html5] r6049 - [e] (0) Try to warn implementors about XSLT. Fixing http://www.w3.org/Bugs/Publi [...] </A></li> <LI>Next message: <A HREF="012917.html">[html5] r6051 - [e] (0) add a note to clarify interaction with rfc 2388 Fixing http://www.w3.org [...] </A></li> <LI> <B>Messages sorted by:</B> <a href="date.html#12918">[ date ]</a> <a href="thread.html#12918">[ thread ]</a> <a href="subject.html#12918">[ subject ]</a> <a href="author.html#12918">[ author ]</a> </LI> </UL> <HR> <!--/htdig_noindex--> <!--beginarticle--> <PRE>Author: ianh Date: 2011-05-03 12:18:56 -0700 (Tue, 03 May 2011) New Revision: 6050 Modified: complete.html index source Log: [e] (0) make ids more consistent (this might break some links, sorry) Fixing <A HREF="http://www.w3.org/Bugs/Public/show_bug.cgi?id=9593">http://www.w3.org/Bugs/Public/show_bug.cgi?id=9593</A> Modified: complete.html =================================================================== --- complete.html 2011-05-03 01:10:20 UTC (rev 6049) +++ complete.html 2011-05-03 19:18:56 UTC (rev 6050) @@ -460,14 +460,14 @@ &lt;ol&gt; &lt;li&gt;&lt;a href=#the-root-element&gt;&lt;span class=secno&gt;4.1 &lt;/span&gt;The root element&lt;/a&gt; &lt;ol&gt; - &lt;li&gt;&lt;a href=#the-html-element-0&gt;&lt;span class=secno&gt;4.1.1 &lt;/span&gt;The &lt;code&gt;html&lt;/code&gt; element&lt;/a&gt;&lt;/ol&gt;&lt;/li&gt; + &lt;li&gt;&lt;a href=#the-html-element&gt;&lt;span class=secno&gt;4.1.1 &lt;/span&gt;The &lt;code&gt;html&lt;/code&gt; element&lt;/a&gt;&lt;/ol&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=#document-metadata&gt;&lt;span class=secno&gt;4.2 &lt;/span&gt;Document metadata&lt;/a&gt; &lt;ol&gt; - &lt;li&gt;&lt;a href=#the-head-element-0&gt;&lt;span class=secno&gt;4.2.1 &lt;/span&gt;The &lt;code&gt;head&lt;/code&gt; element&lt;/a&gt;&lt;/li&gt; - &lt;li&gt;&lt;a href=#the-title-element-0&gt;&lt;span class=secno&gt;4.2.2 &lt;/span&gt;The &lt;code&gt;title&lt;/code&gt; element&lt;/a&gt;&lt;/li&gt; + &lt;li&gt;&lt;a href=#the-head-element&gt;&lt;span class=secno&gt;4.2.1 &lt;/span&gt;The &lt;code&gt;head&lt;/code&gt; element&lt;/a&gt;&lt;/li&gt; + &lt;li&gt;&lt;a href=#the-title-element&gt;&lt;span class=secno&gt;4.2.2 &lt;/span&gt;The &lt;code&gt;title&lt;/code&gt; element&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=#the-base-element&gt;&lt;span class=secno&gt;4.2.3 &lt;/span&gt;The &lt;code&gt;base&lt;/code&gt; element&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=#the-link-element&gt;&lt;span class=secno&gt;4.2.4 &lt;/span&gt;The &lt;code&gt;link&lt;/code&gt; element&lt;/a&gt;&lt;/li&gt; - &lt;li&gt;&lt;a href=#meta&gt;&lt;span class=secno&gt;4.2.5 &lt;/span&gt;The &lt;code&gt;meta&lt;/code&gt; element&lt;/a&gt; + &lt;li&gt;&lt;a href=#the-meta-element&gt;&lt;span class=secno&gt;4.2.5 &lt;/span&gt;The &lt;code&gt;meta&lt;/code&gt; element&lt;/a&gt; &lt;ol&gt; &lt;li&gt;&lt;a href=#standard-metadata-names&gt;&lt;span class=secno&gt;4.2.5.1 &lt;/span&gt;Standard metadata names&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=#other-metadata-names&gt;&lt;span class=secno&gt;4.2.5.2 &lt;/span&gt;Other metadata names&lt;/a&gt;&lt;/li&gt; @@ -478,7 +478,7 @@ &lt;li&gt;&lt;a href=#styling&gt;&lt;span class=secno&gt;4.2.7 &lt;/span&gt;Styling&lt;/a&gt;&lt;/ol&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=#scripting-1&gt;&lt;span class=secno&gt;4.3 &lt;/span&gt;Scripting&lt;/a&gt; &lt;ol&gt; - &lt;li&gt;&lt;a href=#script&gt;&lt;span class=secno&gt;4.3.1 &lt;/span&gt;The &lt;code&gt;script&lt;/code&gt; element&lt;/a&gt; + &lt;li&gt;&lt;a href=#the-script-element&gt;&lt;span class=secno&gt;4.3.1 &lt;/span&gt;The &lt;code&gt;script&lt;/code&gt; element&lt;/a&gt; &lt;ol&gt; &lt;li&gt;&lt;a href=#scriptingLanguages&gt;&lt;span class=secno&gt;4.3.1.1 &lt;/span&gt;Scripting languages&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=#restrictions-for-contents-of-script-elements&gt;&lt;span class=secno&gt;4.3.1.2 &lt;/span&gt;Restrictions for contents of &lt;code&gt;script&lt;/code&gt; elements&lt;/a&gt;&lt;/li&gt; @@ -492,10 +492,7 @@ &lt;li&gt;&lt;a href=#the-nav-element&gt;&lt;span class=secno&gt;4.4.3 &lt;/span&gt;The &lt;code&gt;nav&lt;/code&gt; element&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=#the-article-element&gt;&lt;span class=secno&gt;4.4.4 &lt;/span&gt;The &lt;code&gt;article&lt;/code&gt; element&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=#the-aside-element&gt;&lt;span class=secno&gt;4.4.5 &lt;/span&gt;The &lt;code&gt;aside&lt;/code&gt; element&lt;/a&gt;&lt;/li&gt; - &lt;li&gt;&lt;a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements&gt;&lt;span class=secno&gt;4.4.6 &lt;/span&gt;The &lt;code&gt;h1&lt;/code&gt;, &lt;code&gt;h2&lt;/code&gt;, - &lt;code&gt;h3&lt;/code&gt;, &lt;code&gt;h4&lt;/code&gt;, - &lt;code&gt;h5&lt;/code&gt;, and &lt;code&gt;h6&lt;/code&gt; - elements&lt;/a&gt;&lt;/li&gt; + &lt;li&gt;&lt;a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements&gt;&lt;span class=secno&gt;4.4.6 &lt;/span&gt;The &lt;code&gt;h1&lt;/code&gt;, &lt;code&gt;h2&lt;/code&gt;, &lt;code&gt;h3&lt;/code&gt;, &lt;code&gt;h4&lt;/code&gt;, &lt;code&gt;h5&lt;/code&gt;, and &lt;code&gt;h6&lt;/code&gt; elements&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=#the-hgroup-element&gt;&lt;span class=secno&gt;4.4.7 &lt;/span&gt;The &lt;code&gt;hgroup&lt;/code&gt; element&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=#the-header-element&gt;&lt;span class=secno&gt;4.4.8 &lt;/span&gt;The &lt;code&gt;header&lt;/code&gt; element&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=#the-footer-element&gt;&lt;span class=secno&gt;4.4.9 &lt;/span&gt;The &lt;code&gt;footer&lt;/code&gt; element&lt;/a&gt;&lt;/li&gt; @@ -579,8 +576,8 @@ &lt;li&gt;&lt;a href=#the-embed-element&gt;&lt;span class=secno&gt;4.8.3 &lt;/span&gt;The &lt;code&gt;embed&lt;/code&gt; element&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=#the-object-element&gt;&lt;span class=secno&gt;4.8.4 &lt;/span&gt;The &lt;code&gt;object&lt;/code&gt; element&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=#the-param-element&gt;&lt;span class=secno&gt;4.8.5 &lt;/span&gt;The &lt;code&gt;param&lt;/code&gt; element&lt;/a&gt;&lt;/li&gt; - &lt;li&gt;&lt;a href=#video&gt;&lt;span class=secno&gt;4.8.6 &lt;/span&gt;The &lt;code&gt;video&lt;/code&gt; element&lt;/a&gt;&lt;/li&gt; - &lt;li&gt;&lt;a href=#audio&gt;&lt;span class=secno&gt;4.8.7 &lt;/span&gt;The &lt;code&gt;audio&lt;/code&gt; element&lt;/a&gt;&lt;/li&gt; + &lt;li&gt;&lt;a href=#the-video-element&gt;&lt;span class=secno&gt;4.8.6 &lt;/span&gt;The &lt;code&gt;video&lt;/code&gt; element&lt;/a&gt;&lt;/li&gt; + &lt;li&gt;&lt;a href=#the-audio-element&gt;&lt;span class=secno&gt;4.8.7 &lt;/span&gt;The &lt;code&gt;audio&lt;/code&gt; element&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=#the-source-element&gt;&lt;span class=secno&gt;4.8.8 &lt;/span&gt;The &lt;code&gt;source&lt;/code&gt; element&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=#the-track-element&gt;&lt;span class=secno&gt;4.8.9 &lt;/span&gt;The &lt;code&gt;track&lt;/code&gt; element&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=#media-elements&gt;&lt;span class=secno&gt;4.8.10 &lt;/span&gt;Media elements&lt;/a&gt; @@ -770,8 +767,8 @@ &lt;ol&gt; &lt;li&gt;&lt;a href=#the-details-element&gt;&lt;span class=secno&gt;4.11.1 &lt;/span&gt;The &lt;code&gt;details&lt;/code&gt; element&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=#the-summary-element&gt;&lt;span class=secno&gt;4.11.2 &lt;/span&gt;The &lt;code&gt;summary&lt;/code&gt; element&lt;/a&gt;&lt;/li&gt; - &lt;li&gt;&lt;a href=#the-command&gt;&lt;span class=secno&gt;4.11.3 &lt;/span&gt;The &lt;code&gt;command&lt;/code&gt; element&lt;/a&gt;&lt;/li&gt; - &lt;li&gt;&lt;a href=#menus&gt;&lt;span class=secno&gt;4.11.4 &lt;/span&gt;The &lt;code&gt;menu&lt;/code&gt; element&lt;/a&gt; + &lt;li&gt;&lt;a href=#the-command-element&gt;&lt;span class=secno&gt;4.11.3 &lt;/span&gt;The &lt;code&gt;command&lt;/code&gt; element&lt;/a&gt;&lt;/li&gt; + &lt;li&gt;&lt;a href=#the-menu-element&gt;&lt;span class=secno&gt;4.11.4 &lt;/span&gt;The &lt;code&gt;menu&lt;/code&gt; element&lt;/a&gt; &lt;ol&gt; &lt;li&gt;&lt;a href=#menus-intro&gt;&lt;span class=secno&gt;4.11.4.1 &lt;/span&gt;Introduction&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=#building-menus-and-toolbars&gt;&lt;span class=secno&gt;4.11.4.2 &lt;/span&gt;Building menus and toolbars&lt;/a&gt;&lt;/li&gt; @@ -1898,9 +1895,9 @@ &lt;p&gt;The &lt;a href=#intro-early-example&gt;markup snippet at the top of this section&lt;/a&gt; would be turned into the following DOM tree:&lt;/p&gt; - &lt;ul class=domTree&gt;&lt;li class=t10&gt;DOCTYPE: &lt;code title=&quot;&quot;&gt;html&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;&#9166;&#9251;&#9251;&lt;/span&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;Sample page&lt;/span&gt;&lt;/ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;&#9166;&#9251;&lt;/span&gt;&lt;/ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;&#9166;&#9251;&lt;/span&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;&#9166;&#9251;&#9251;&lt;/span&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements&gt;h1&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;Sample page&lt;/span&gt;&lt;/ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;&#9166;&#9251;&#9251;&lt;/span&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;&lt;u l&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;This is a &lt;/span&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-a-element&gt;a&lt;/a&gt;&lt;/code&gt; &lt;span class=t2 title=&quot;&quot;&gt;&lt;code class=&quot;attribute name&quot;&gt;href&lt;/code&gt;=&quot;&lt;code class=&quot;attribute value&quot;&gt;demo.html&lt;/code&gt;&quot;&lt;/span&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;simple&lt;/span&gt;&lt;/ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt; sample.&lt;/span&gt;&lt;/ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;&#9166;&#9251;&#9251;&lt;/span&gt;&lt;li class=t8&gt;&lt;code&gt;#comment&lt;/code&gt;: &lt;span title=&quot;&quot;&gt; this is a comment &lt;/span&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;&#9166;&#9251;&#9166;&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;The &lt;a href=#root-element&gt;root element&lt;/a&gt; of this tree is the - &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element, which is the element always found at the - root of HTML documents. It contains two elements, &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; + &lt;ul class=domTree&gt;&lt;li class=t10&gt;DOCTYPE: &lt;code title=&quot;&quot;&gt;html&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;&#9166;&#9251;&#9251;&lt;/span&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;Sample page&lt;/span&gt;&lt;/ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;&#9166;&#9251;&lt;/span&gt;&lt;/ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;&#9166;&#9251;&lt;/span&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;&#9166;&#9251;&#9251;&lt;/span&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements&gt;h1&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;Sample page&lt;/span&gt;&lt;/ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;&#9166;&#9251;&#9251;&lt;/span&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;This is a &lt;/span&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-a-element&gt;a&lt;/a&gt;&lt;/code&gt; &lt;span class=t2 title=&quot;&quot;&gt;&lt;code class=&quot;attribute name&quot;&gt;href&lt;/code&gt;=&quot;&lt;code class=&quot;attribute value&quot;&gt;demo.html&lt;/code&gt;&quot;&lt;/span&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;simple&lt;/span&gt;&lt;/ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt; sample.&lt;/span&gt;&lt;/ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;&#9166;&#9251;&#9251;&lt;/span&gt;&lt;li class=t8&gt;&lt;code&gt;#comment&lt;/code&gt;: &lt;span title=&quot;&quot;&gt; this is a comment &lt;/span&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;&#9166;&#9251;&#9166;&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;The &lt;a href=#root-element&gt;root element&lt;/a&gt; of this tree is the + &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element, which is the element always found at the + root of HTML documents. It contains two elements, &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; and &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;, as well as a text node between them.&lt;/p&gt; &lt;p&gt;There are many more text nodes in the DOM tree than one would @@ -1909,11 +1906,11 @@ all end up as text nodes in the DOM. However, for historical reasons not all of the spaces and line breaks in the original markup appear in the DOM. In particular, all the whitespace before - &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; start tag ends up being dropped silently, and all + &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; start tag ends up being dropped silently, and all the whitespace after the &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt; end tag ends up placed at the end of the &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;.&lt;/p&gt; - &lt;p&gt;The &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element contains a &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt; + &lt;p&gt;The &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element contains a &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt; element, which itself contains a text node with the text &quot;Sample page&quot;. Similarly, the &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt; element contains an &lt;code&gt;&lt;a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements&gt;h1&lt;/a&gt;&lt;/code&gt; element, a &lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt; element, and a @@ -1921,14 +1918,14 @@ &lt;hr&gt;&lt;p&gt;This DOM tree can be manipulated from scripts in the page. Scripts (typically in JavaScript) are small programs that can - be embedded using the &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element or using + be embedded using the &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element or using &lt;a href=#event-handler-content-attributes&gt;event handler content attributes&lt;/a&gt;. For example, here is a form with a script that sets the value of the form's &lt;code&gt;&lt;a href=#the-output-element&gt;output&lt;/a&gt;&lt;/code&gt; element to say &quot;Hello World&quot;:&lt;/p&gt; &lt;pre&gt;&lt;&lt;a href=#the-form-element&gt;form&lt;/a&gt; &lt;a href=#attr-form-name title=attr-form-name&gt;name&lt;/a&gt;=&quot;main&quot;&gt; Result: &lt;&lt;a href=#the-output-element&gt;output&lt;/a&gt; &lt;a href=#attr-fe-name title=attr-fe-name&gt;name&lt;/a&gt;=&quot;result&quot;&gt;&lt;/output&gt; - &lt;&lt;a href=#script&gt;script&lt;/a&gt;&gt; + &lt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&gt; &lt;a href=#htmldocument title=HTMLDocument&gt;document&lt;/a&gt;.&lt;a href=#dom-document-forms title=dom-document-forms&gt;forms&lt;/a&gt;.main.&lt;a href=#dom-form-elements title=dom-form-elements&gt;elements&lt;/a&gt;.result.&lt;a href=#dom-output-value title=dom-output-value&gt;value&lt;/a&gt; = 'Hello World'; &lt;/script&gt; &lt;/form&gt;&lt;/pre&gt; @@ -2505,14 +2502,14 @@ encouraging authors to avoid making them, authors can save time in future efforts.&lt;/p&gt; - &lt;p class=example&gt;For example, a &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element's + &lt;p class=example&gt;For example, a &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element's &lt;code title=attr-script-src&gt;&lt;a href=#attr-script-src&gt;src&lt;/a&gt;&lt;/code&gt; attribute causes the element's contents to be ignored. However, this isn't obvious, especially if the element's contents appear to be executable script &mdash; which can lead to authors spending a lot of time trying to debug the inline script without realizing that it is not executing. To reduce this problem, this specification makes it - non-conforming to have executable script in a &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; + non-conforming to have executable script in a &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element when the &lt;code title=attr-script-src&gt;&lt;a href=#attr-script-src&gt;src&lt;/a&gt;&lt;/code&gt; attribute is present. This means that authors who are validating their documents are less likely to waste time with this kind of @@ -2855,7 +2852,7 @@ described in the DOM Core specification. For example, the &lt;code title=dom-cloneNode&gt;cloneNode()&lt;/code&gt; and &lt;code title=dom-importNode&gt;importNode()&lt;/code&gt; methods of the &lt;code&gt;&lt;a href=#node&gt;Node&lt;/a&gt;&lt;/code&gt; interface both clone nodes, as do a number of algorithms in this specification. Certain &lt;a href=#html-elements&gt;HTML elements&lt;/a&gt; - (in particular, &lt;code&gt;&lt;a href=#the-input-element&gt;input&lt;/a&gt;&lt;/code&gt; and &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt;) apply + (in particular, &lt;code&gt;&lt;a href=#the-input-element&gt;input&lt;/a&gt;&lt;/code&gt; and &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt;) apply additional requirements on how they are cloned. &lt;a href=#refsDOMCORE&gt;[DOMCORE]&lt;/a&gt;&lt;/p&gt; @@ -3052,11 +3049,11 @@ specifications.&lt;/p&gt; &lt;p class=example&gt;A conforming XHTML processor would, upon - finding an XHTML &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element in an XML document, + finding an XHTML &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element in an XML document, execute the script contained in that element. However, if the element is found within a transformation expressed in XSLT (assuming the user agent also supports XSLT), then the processor - would instead treat the &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element as an opaque + would instead treat the &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element as an opaque element that forms part of the transform.&lt;/p&gt; &lt;p&gt;Web browsers that support &lt;a href=#syntax&gt;the HTML syntax&lt;/a&gt; must @@ -3071,7 +3068,7 @@ &lt;p class=note&gt;Unless explicitly stated, specifications that override the semantics of HTML elements do not override the requirements on DOM objects representing those elements. For - example, the &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element in the example above + example, the &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element in the example above would still implement the &lt;code&gt;&lt;a href=#htmlscriptelement&gt;HTMLScriptElement&lt;/a&gt;&lt;/code&gt; interface.&lt;/p&gt; @@ -3533,7 +3530,7 @@ include data on HTML elements that scripts can then look for and process.&lt;/li&gt; - &lt;li&gt;Authors can use the &lt;code title=meta&gt;&lt;a href=#meta&gt;&lt;meta name=&quot;&quot; + &lt;li&gt;Authors can use the &lt;code title=meta&gt;&lt;a href=#the-meta-element&gt;&lt;meta name=&quot;&quot; content=&quot;&quot;&gt;&lt;/a&gt;&lt;/code&gt; mechanism to include page-wide metadata by registering &lt;a href=#concept-meta-extensions title=concept-meta-extensions&gt;extensions to the predefined set of metadata names&lt;/a&gt;.&lt;/li&gt; @@ -3542,7 +3539,7 @@ links with specific meanings by registering &lt;a href=#concept-rel-extensions title=concept-rel-extensions&gt;extensions to the predefined set of link types&lt;/a&gt;. This is also used by Microformats.&lt;/li&gt; - &lt;li&gt;Authors can embed raw data using the &lt;code title=script&gt;&lt;a href=#script&gt;&lt;script type=&quot;&quot;&gt;&lt;/a&gt;&lt;/code&gt; mechanism with a custom + &lt;li&gt;Authors can embed raw data using the &lt;code title=script&gt;&lt;a href=#the-script-element&gt;&lt;script type=&quot;&quot;&gt;&lt;/a&gt;&lt;/code&gt; mechanism with a custom type, for further handling by inline or server-side scripts.&lt;/li&gt; &lt;li&gt;Authors can create &lt;a href=#plugin title=plugin&gt;plugins&lt;/a&gt; and @@ -7061,7 +7058,7 @@ specification. &lt;a href=#refsMIMESNIFF&gt;[MIMESNIFF]&lt;/a&gt;&lt;/p&gt; - &lt;h4 id=extracting-encodings-from-meta-elements&gt;&lt;span class=secno&gt;2.7.4 &lt;/span&gt;Extracting encodings from &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; elements&lt;/h4&gt; + &lt;h4 id=extracting-encodings-from-meta-elements&gt;&lt;span class=secno&gt;2.7.4 &lt;/span&gt;Extracting encodings from &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; elements&lt;/h4&gt; &lt;p&gt;The &lt;dfn id=algorithm-for-extracting-an-encoding-from-a-meta-element&gt;algorithm for extracting an encoding from a &lt;code&gt;meta&lt;/code&gt; element&lt;/dfn&gt;, given a string &lt;var title=&quot;&quot;&gt;s&lt;/var&gt;, is as follows. It either returns an encoding or @@ -8980,43 +8977,43 @@ &lt;h4 id=dom-tree-accessors&gt;&lt;span class=secno&gt;3.1.4 &lt;/span&gt;&lt;dfn&gt;DOM tree accessors&lt;/dfn&gt;&lt;/h4&gt; - &lt;p&gt;&lt;dfn id=the-html-element&gt;The &lt;code&gt;html&lt;/code&gt; element&lt;/dfn&gt; of a document is the + &lt;p&gt;&lt;dfn id=the-html-element-0&gt;The &lt;code&gt;html&lt;/code&gt; element&lt;/dfn&gt; of a document is the document's root element, if there is one and it's an - &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element, or null otherwise.&lt;/p&gt; + &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element, or null otherwise.&lt;/p&gt; &lt;hr&gt;&lt;dl class=domintro&gt;&lt;dt&gt;&lt;var title=&quot;&quot;&gt;document&lt;/var&gt; . &lt;code title=dom-document-head&gt;&lt;a href=#dom-document-head&gt;head&lt;/a&gt;&lt;/code&gt;&lt;/dt&gt; &lt;dd&gt; - &lt;p&gt;Returns &lt;a href=#the-head-element&gt;the &lt;code&gt;head&lt;/code&gt; element&lt;/a&gt;.&lt;/p&gt; + &lt;p&gt;Returns &lt;a href=#the-head-element-0&gt;the &lt;code&gt;head&lt;/code&gt; element&lt;/a&gt;.&lt;/p&gt; &lt;/dd&gt; - &lt;/dl&gt;&lt;p&gt;&lt;dfn id=the-head-element&gt;The &lt;code&gt;head&lt;/code&gt; element&lt;/dfn&gt; of a document is the - first &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element that is a child of &lt;a href=#the-html-element&gt;the + &lt;/dl&gt;&lt;p&gt;&lt;dfn id=the-head-element-0&gt;The &lt;code&gt;head&lt;/code&gt; element&lt;/dfn&gt; of a document is the + first &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element that is a child of &lt;a href=#the-html-element-0&gt;the &lt;code&gt;html&lt;/code&gt; element&lt;/a&gt;, if there is one, or null otherwise.&lt;/p&gt; &lt;div class=impl&gt; &lt;p&gt;The &lt;dfn id=dom-document-head title=dom-document-head&gt;&lt;code&gt;head&lt;/code&gt;&lt;/dfn&gt; - attribute, on getting, must return &lt;a href=#the-head-element&gt;the &lt;code&gt;head&lt;/code&gt; - element&lt;/a&gt; of the document (a &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element or + attribute, on getting, must return &lt;a href=#the-head-element-0&gt;the &lt;code&gt;head&lt;/code&gt; + element&lt;/a&gt; of the document (a &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element or null).&lt;/p&gt; &lt;/div&gt; &lt;hr&gt;&lt;dl class=domintro&gt;&lt;dt&gt;&lt;var title=&quot;&quot;&gt;document&lt;/var&gt; . &lt;code title=dom-document-title&gt;&lt;a href=#document.title&gt;title&lt;/a&gt;&lt;/code&gt; [ = &lt;var title=&quot;&quot;&gt;value&lt;/var&gt; ]&lt;/dt&gt; &lt;dd&gt; - &lt;p&gt;Returns the document's title, as given by &lt;a href=#the-title-element&gt;the + &lt;p&gt;Returns the document's title, as given by &lt;a href=#the-title-element-0&gt;the &lt;code&gt;title&lt;/code&gt; element&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;Can be set, to update the document's title. If there is no - &lt;a href=#the-head-element title=&quot;the head element&quot;&gt;&lt;code&gt;head&lt;/code&gt; element&lt;/a&gt;, + &lt;a href=#the-head-element-0 title=&quot;the head element&quot;&gt;&lt;code&gt;head&lt;/code&gt; element&lt;/a&gt;, the new value is ignored.&lt;/p&gt; &lt;p&gt;In SVG documents, the &lt;code&gt;SVGDocument&lt;/code&gt; interface's &lt;code title=dom-svg-title&gt;title&lt;/code&gt; attribute takes precedence.&lt;/p&gt; &lt;/dd&gt; - &lt;/dl&gt;&lt;p&gt;&lt;dfn id=the-title-element&gt;The &lt;code&gt;title&lt;/code&gt; element&lt;/dfn&gt; of a document is the - first &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt; element in the document (in tree order), if + &lt;/dl&gt;&lt;p&gt;&lt;dfn id=the-title-element-0&gt;The &lt;code&gt;title&lt;/code&gt; element&lt;/dfn&gt; of a document is the + first &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt; element in the document (in tree order), if there is one, or null otherwise.&lt;/p&gt; &lt;div class=impl&gt; @@ -9032,8 +9029,8 @@ &lt;li&gt;&lt;p&gt;Otherwise, let &lt;var title=&quot;&quot;&gt;value&lt;/var&gt; be a concatenation of the data of all the child &lt;a href=#text-node title=&quot;text node&quot;&gt;text - nodes&lt;/a&gt; of &lt;a href=#the-title-element&gt;the &lt;code&gt;title&lt;/code&gt; element&lt;/a&gt;, in - &lt;a href=#tree-order&gt;tree order&lt;/a&gt;, or the empty string if &lt;a href=#the-title-element&gt;the + nodes&lt;/a&gt; of &lt;a href=#the-title-element-0&gt;the &lt;code&gt;title&lt;/code&gt; element&lt;/a&gt;, in + &lt;a href=#tree-order&gt;tree order&lt;/a&gt;, or the empty string if &lt;a href=#the-title-element-0&gt;the &lt;code&gt;title&lt;/code&gt; element&lt;/a&gt; is null.&lt;/li&gt; &lt;li&gt;&lt;p&gt;Replace any sequence of one or more consecutive &lt;a href=#space-character title=&quot;space character&quot;&gt;space characters&lt;/a&gt; in &lt;var title=&quot;&quot;&gt;value&lt;/var&gt; with a single U+0020 SPACE character.&lt;/li&gt; @@ -9053,13 +9050,13 @@ &lt;code&gt;SVGDocument&lt;/code&gt; interface (if it is readonly, then this will raise an exception). Stop the algorithm here. &lt;a href=#refsSVG&gt;[SVG]&lt;/a&gt;&lt;/li&gt; - &lt;li&gt;If &lt;a href=#the-title-element&gt;the &lt;code&gt;title&lt;/code&gt; element&lt;/a&gt; is null and - &lt;a href=#the-head-element&gt;the &lt;code&gt;head&lt;/code&gt; element&lt;/a&gt; is null, then the + &lt;li&gt;If &lt;a href=#the-title-element-0&gt;the &lt;code&gt;title&lt;/code&gt; element&lt;/a&gt; is null and + &lt;a href=#the-head-element-0&gt;the &lt;code&gt;head&lt;/code&gt; element&lt;/a&gt; is null, then the attribute must do nothing. Stop the algorithm here.&lt;/li&gt; - &lt;li&gt;If &lt;a href=#the-title-element&gt;the &lt;code&gt;title&lt;/code&gt; element&lt;/a&gt; is null, then a - new &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt; element must be created and appended to - &lt;a href=#the-head-element&gt;the &lt;code&gt;head&lt;/code&gt; element&lt;/a&gt;. Let &lt;var title=&quot;&quot;&gt;element&lt;/var&gt; be that element. Otherwise, let &lt;var title=&quot;&quot;&gt;element&lt;/var&gt; be &lt;a href=#the-title-element&gt;the &lt;code&gt;title&lt;/code&gt; + &lt;li&gt;If &lt;a href=#the-title-element-0&gt;the &lt;code&gt;title&lt;/code&gt; element&lt;/a&gt; is null, then a + new &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt; element must be created and appended to + &lt;a href=#the-head-element-0&gt;the &lt;code&gt;head&lt;/code&gt; element&lt;/a&gt;. Let &lt;var title=&quot;&quot;&gt;element&lt;/var&gt; be that element. Otherwise, let &lt;var title=&quot;&quot;&gt;element&lt;/var&gt; be &lt;a href=#the-title-element-0&gt;the &lt;code&gt;title&lt;/code&gt; element&lt;/a&gt;.&lt;/li&gt; &lt;li&gt;The children of &lt;var title=&quot;&quot;&gt;element&lt;/var&gt; (if any) must all @@ -9083,7 +9080,7 @@ &lt;/dd&gt; &lt;/dl&gt;&lt;p&gt;&lt;dfn id=the-body-element&gt;The body element&lt;/dfn&gt; of a document is the first child of - &lt;a href=#the-html-element&gt;the &lt;code&gt;html&lt;/code&gt; element&lt;/a&gt; that is either a + &lt;a href=#the-html-element-0&gt;the &lt;code&gt;html&lt;/code&gt; element&lt;/a&gt; that is either a &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt; element or a &lt;code&gt;&lt;a href=#frameset&gt;frameset&lt;/a&gt;&lt;/code&gt; element. If there is no such element, it is null. &lt;span class=impl&gt;If the body element is null, then when the specification requires that events be @@ -9148,7 +9145,7 @@ &lt;dt&gt;&lt;var title=&quot;&quot;&gt;document&lt;/var&gt; . &lt;code title=dom-document-scripts&gt;&lt;a href=#dom-document-scripts&gt;scripts&lt;/a&gt;&lt;/code&gt;&lt;/dt&gt; &lt;dd&gt; - &lt;p&gt;Return an &lt;code&gt;&lt;a href=#htmlcollection&gt;HTMLCollection&lt;/a&gt;&lt;/code&gt; of the &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; elements in the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt;.&lt;/p&gt; + &lt;p&gt;Return an &lt;code&gt;&lt;a href=#htmlcollection&gt;HTMLCollection&lt;/a&gt;&lt;/code&gt; of the &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements in the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt;.&lt;/p&gt; &lt;/dd&gt; &lt;/dl&gt;&lt;div class=impl&gt; @@ -9183,7 +9180,7 @@ &lt;p&gt;The &lt;dfn id=dom-document-scripts title=dom-document-scripts&gt;&lt;code&gt;scripts&lt;/code&gt;&lt;/dfn&gt; attribute must return an &lt;code&gt;&lt;a href=#htmlcollection&gt;HTMLCollection&lt;/a&gt;&lt;/code&gt; rooted at the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt; node, whose filter matches only - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; elements.&lt;/p&gt; + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements.&lt;/p&gt; &lt;hr&gt;&lt;/div&gt; @@ -9308,7 +9305,7 @@ &lt;p&gt;Each entry in the &lt;a href=#css-id-overrides-list&gt;CSS ID overrides list&lt;/a&gt;, while it is in the list and is either &lt;a href=#in-a-document title=&quot;in a Document&quot;&gt;in the &lt;code&gt;Document&lt;/code&gt;&lt;/a&gt; or is an &lt;code&gt;&lt;a href=#the-img-element&gt;img&lt;/a&gt;&lt;/code&gt;, - &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt;, or &lt;code&gt;&lt;a href=#the-canvas-element&gt;canvas&lt;/a&gt;&lt;/code&gt; element, defines a + &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt;, or &lt;code&gt;&lt;a href=#the-canvas-element&gt;canvas&lt;/a&gt;&lt;/code&gt; element, defines a &lt;span&gt;CSS element reference identifier&lt;/span&gt; mapping the given name to the given &lt;code&gt;&lt;a href=#element&gt;Element&lt;/a&gt;&lt;/code&gt;. &lt;a href=#refsCSSIMAGES&gt;[CSSIMAGES]&lt;/a&gt;&lt;/p&gt; @@ -9476,7 +9473,7 @@ &lt;dd&gt; &lt;p&gt;Returns a new &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt;, with a basic DOM already - constructed with an appropriate &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt; element.&lt;/p&gt; + constructed with an appropriate &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt; element.&lt;/p&gt; &lt;/dd&gt; @@ -9496,20 +9493,20 @@ and empty lists, as appropriate. Append the newly created node to &lt;var title=&quot;&quot;&gt;doc&lt;/var&gt;.&lt;/li&gt; - &lt;li&gt;&lt;p&gt;Create an &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element, and append it to &lt;var title=&quot;&quot;&gt;doc&lt;/var&gt;.&lt;/li&gt; + &lt;li&gt;&lt;p&gt;Create an &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element, and append it to &lt;var title=&quot;&quot;&gt;doc&lt;/var&gt;.&lt;/li&gt; - &lt;li&gt;&lt;p&gt;Create a &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element, and append it to the - &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element created in the previous step.&lt;/p&gt; + &lt;li&gt;&lt;p&gt;Create a &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element, and append it to the + &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element created in the previous step.&lt;/p&gt; - &lt;li&gt;&lt;p&gt;Create a &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt; element, and append it to the - &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element created in the previous step.&lt;/p&gt; + &lt;li&gt;&lt;p&gt;Create a &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt; element, and append it to the + &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element created in the previous step.&lt;/p&gt; &lt;li&gt;&lt;p&gt;Create a &lt;code&gt;&lt;a href=#text&gt;Text&lt;/a&gt;&lt;/code&gt; node, and set its &lt;code title=&quot;&quot;&gt;data&lt;/code&gt; attribute to the string given by the method's argument (which could be the empty string). Append it to the - &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt; element created in the previous step.&lt;/p&gt; + &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt; element created in the previous step.&lt;/p&gt; &lt;li&gt;&lt;p&gt;Create a &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt; element, and append it to the - &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element created in the earlier step.&lt;/p&gt; + &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element created in the earlier step.&lt;/p&gt; &lt;li&gt;&lt;p&gt;Return &lt;var title=&quot;&quot;&gt;doc&lt;/var&gt;.&lt;/li&gt; @@ -10330,7 +10327,7 @@ determined and that is either:&lt;/p&gt; &lt;ul class=brief&gt;&lt;li&gt;A &lt;code&gt;&lt;a href=#the-bdi-element&gt;bdi&lt;/a&gt;&lt;/code&gt; element. - &lt;li&gt;A &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element. + &lt;li&gt;A &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element. &lt;li&gt;A &lt;code&gt;&lt;a href=#the-style-element&gt;style&lt;/a&gt;&lt;/code&gt; element. &lt;li&gt;An element with a &lt;code title=attr-dir&gt;&lt;a href=#the-dir-attribute&gt;dir&lt;/a&gt;&lt;/code&gt; attribute in a defined state. &lt;/ul&gt;&lt;/li&gt; @@ -10367,9 +10364,9 @@ &lt;hr&gt;&lt;dl class=domintro&gt;&lt;dt&gt;&lt;var title=&quot;&quot;&gt;document&lt;/var&gt; . &lt;code title=dom-dir&gt;&lt;a href=#dom-dir&gt;dir&lt;/a&gt;&lt;/code&gt; [ = &lt;var title=&quot;&quot;&gt;value&lt;/var&gt; ]&lt;/dt&gt; &lt;dd&gt; - &lt;p&gt;Returns &lt;a href=#the-html-element&gt;the &lt;code&gt;html&lt;/code&gt; element&lt;/a&gt;'s &lt;code title=attr-dir&gt;&lt;a href=#the-dir-attribute&gt;dir&lt;/a&gt;&lt;/code&gt; attribute's value, if any.&lt;/p&gt; - &lt;p&gt;Can be set, to either &quot;&lt;code title=&quot;&quot;&gt;ltr&lt;/code&gt;&quot;, &quot;&lt;code title=&quot;&quot;&gt;rtl&lt;/code&gt;&quot;, or &quot;&lt;code title=&quot;&quot;&gt;auto&lt;/code&gt;&quot; to replace &lt;a href=#the-html-element&gt;the &lt;code&gt;html&lt;/code&gt; element&lt;/a&gt;'s &lt;code title=attr-dir&gt;&lt;a href=#the-dir-attribute&gt;dir&lt;/a&gt;&lt;/code&gt; attribute's value.&lt;/p&gt; - &lt;p&gt;If there is no &lt;a href=#the-html-element title=&quot;the html element&quot;&gt;&lt;code&gt;html&lt;/code&gt; element&lt;/a&gt;, returns the empty string and ignores new values.&lt;/p&gt; + &lt;p&gt;Returns &lt;a href=#the-html-element-0&gt;the &lt;code&gt;html&lt;/code&gt; element&lt;/a&gt;'s &lt;code title=attr-dir&gt;&lt;a href=#the-dir-attribute&gt;dir&lt;/a&gt;&lt;/code&gt; attribute's value, if any.&lt;/p&gt; + &lt;p&gt;Can be set, to either &quot;&lt;code title=&quot;&quot;&gt;ltr&lt;/code&gt;&quot;, &quot;&lt;code title=&quot;&quot;&gt;rtl&lt;/code&gt;&quot;, or &quot;&lt;code title=&quot;&quot;&gt;auto&lt;/code&gt;&quot; to replace &lt;a href=#the-html-element-0&gt;the &lt;code&gt;html&lt;/code&gt; element&lt;/a&gt;'s &lt;code title=attr-dir&gt;&lt;a href=#the-dir-attribute&gt;dir&lt;/a&gt;&lt;/code&gt; attribute's value.&lt;/p&gt; + &lt;p&gt;If there is no &lt;a href=#the-html-element-0 title=&quot;the html element&quot;&gt;&lt;code&gt;html&lt;/code&gt; element&lt;/a&gt;, returns the empty string and ignores new values.&lt;/p&gt; &lt;/dd&gt; &lt;/dl&gt;&lt;div class=impl&gt; @@ -10381,7 +10378,7 @@ &lt;p&gt;The &lt;dfn id=dom-document-dir title=dom-document-dir&gt;&lt;code&gt;dir&lt;/code&gt;&lt;/dfn&gt; IDL attribute on &lt;code&gt;&lt;a href=#htmldocument&gt;HTMLDocument&lt;/a&gt;&lt;/code&gt; objects must &lt;a href=#reflect&gt;reflect&lt;/a&gt; the &lt;code title=attr-dir&gt;&lt;a href=#the-dir-attribute&gt;dir&lt;/a&gt;&lt;/code&gt; content - attribute of &lt;a href=#the-html-element&gt;the &lt;code&gt;html&lt;/code&gt; element&lt;/a&gt;, if any, + attribute of &lt;a href=#the-html-element-0&gt;the &lt;code&gt;html&lt;/code&gt; element&lt;/a&gt;, if any, &lt;a href=#limited-to-only-known-values&gt;limited to only known values&lt;/a&gt;. If there is no such element, then the attribute must return the empty string and do nothing on setting.&lt;/p&gt; @@ -10912,13 +10909,13 @@ &lt;!-- when updating this also update the category index --&gt; &lt;ul class=&quot;brief category-list&quot;&gt;&lt;li&gt;&lt;code&gt;&lt;a href=#the-base-element&gt;base&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; - &lt;li&gt;&lt;code&gt;&lt;a href=#the-command&gt;command&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; + &lt;li&gt;&lt;code&gt;&lt;a href=#the-command-element&gt;command&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-link-element&gt;link&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; - &lt;li&gt;&lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; + &lt;li&gt;&lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; - &lt;li&gt;&lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; + &lt;li&gt;&lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-style-element&gt;style&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; - &lt;li&gt;&lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; + &lt;li&gt;&lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;/ul&gt;&lt;p&gt;Elements from other namespaces whose semantics are primarily metadata-related (e.g. RDF) are also &lt;a href=#metadata-content&gt;metadata content&lt;/a&gt;.&lt;/p&gt; @@ -10964,7 +10961,7 @@ &lt;li&gt;&lt;code&gt;&lt;a href=#the-area-element&gt;area&lt;/a&gt;&lt;/code&gt; (if it is a descendant of a &lt;code&gt;&lt;a href=#the-map-element&gt;map&lt;/a&gt;&lt;/code&gt; element)&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-article-element&gt;article&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-aside-element&gt;aside&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; - &lt;li&gt;&lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; + &lt;li&gt;&lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-bdi-element&gt;bdi&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-bdo-element&gt;bdo&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; @@ -10974,7 +10971,7 @@ &lt;li&gt;&lt;code&gt;&lt;a href=#the-canvas-element&gt;canvas&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-cite-element&gt;cite&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-code-element&gt;code&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; - &lt;li&gt;&lt;code&gt;&lt;a href=#the-command&gt;command&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; + &lt;li&gt;&lt;code&gt;&lt;a href=#the-command-element&gt;command&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-datalist-element&gt;datalist&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-del-element&gt;del&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-details-element&gt;details&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; @@ -11010,9 +11007,9 @@ &lt;li&gt;&lt;code&gt;&lt;a href=#the-map-element&gt;map&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-mark-element&gt;mark&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#math&gt;math&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; - &lt;li&gt;&lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; + &lt;li&gt;&lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;!--MD--&gt; - &lt;li&gt;&lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-itemprop&gt;&lt;a href=#names:-the-itemprop-attribute&gt;itemprop&lt;/a&gt;&lt;/code&gt; attribute is present)&lt;/li&gt; + &lt;li&gt;&lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-itemprop&gt;&lt;a href=#names:-the-itemprop-attribute&gt;itemprop&lt;/a&gt;&lt;/code&gt; attribute is present)&lt;/li&gt; &lt;!--MD--&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-meter-element&gt;meter&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-nav-element&gt;nav&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; @@ -11027,7 +11024,7 @@ &lt;li&gt;&lt;code&gt;&lt;a href=#the-ruby-element&gt;ruby&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-s-element&gt;s&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-samp-element&gt;samp&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; - &lt;li&gt;&lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; + &lt;li&gt;&lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-section-element&gt;section&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-select-element&gt;select&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-small-element&gt;small&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; @@ -11043,7 +11040,7 @@ &lt;li&gt;&lt;code&gt;&lt;a href=#the-u-element&gt;u&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-ul-element&gt;ul&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-var-element&gt;var&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; - &lt;li&gt;&lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; + &lt;li&gt;&lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-wbr-element&gt;wbr&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=#text-content title=&quot;text content&quot;&gt;Text&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;&lt;p&gt;As a general rule, elements whose content model allows any @@ -11105,7 +11102,7 @@ &lt;ul class=&quot;brief category-list&quot;&gt;&lt;li&gt;&lt;code&gt;&lt;a href=#the-a-element&gt;a&lt;/a&gt;&lt;/code&gt; (if it contains only &lt;a href=#phrasing-content&gt;phrasing content&lt;/a&gt;)&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-abbr-element&gt;abbr&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-area-element&gt;area&lt;/a&gt;&lt;/code&gt; (if it is a descendant of a &lt;code&gt;&lt;a href=#the-map-element&gt;map&lt;/a&gt;&lt;/code&gt; element)&lt;/li&gt; - &lt;li&gt;&lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; + &lt;li&gt;&lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-bdi-element&gt;bdi&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-bdo-element&gt;bdo&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; @@ -11114,7 +11111,7 @@ &lt;li&gt;&lt;code&gt;&lt;a href=#the-canvas-element&gt;canvas&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-cite-element&gt;cite&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-code-element&gt;code&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; - &lt;li&gt;&lt;code&gt;&lt;a href=#the-command&gt;command&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; + &lt;li&gt;&lt;code&gt;&lt;a href=#the-command-element&gt;command&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-datalist-element&gt;datalist&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-del-element&gt;del&lt;/a&gt;&lt;/code&gt; (if it contains only &lt;a href=#phrasing-content&gt;phrasing content&lt;/a&gt;)&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-dfn-element&gt;dfn&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; @@ -11135,7 +11132,7 @@ &lt;li&gt;&lt;code&gt;&lt;a href=#the-mark-element&gt;mark&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#math&gt;math&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;!--MD--&gt; - &lt;li&gt;&lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-itemprop&gt;&lt;a href=#names:-the-itemprop-attribute&gt;itemprop&lt;/a&gt;&lt;/code&gt; attribute is present)&lt;/li&gt; + &lt;li&gt;&lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-itemprop&gt;&lt;a href=#names:-the-itemprop-attribute&gt;itemprop&lt;/a&gt;&lt;/code&gt; attribute is present)&lt;/li&gt; &lt;!--MD--&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-meter-element&gt;meter&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; @@ -11146,7 +11143,7 @@ &lt;li&gt;&lt;code&gt;&lt;a href=#the-ruby-element&gt;ruby&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-s-element&gt;s&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-samp-element&gt;samp&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; - &lt;li&gt;&lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; + &lt;li&gt;&lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-select-element&gt;select&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-small-element&gt;small&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-span-element&gt;span&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; @@ -11158,7 +11155,7 @@ &lt;li&gt;&lt;code&gt;&lt;a href=#the-time-element&gt;time&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-u-element&gt;u&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-var-element&gt;var&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; - &lt;li&gt;&lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; + &lt;li&gt;&lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-wbr-element&gt;wbr&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=#text-content title=&quot;text content&quot;&gt;Text&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;&lt;p&gt;As a general rule, elements whose content model allows any @@ -11190,7 +11187,7 @@ is inserted into the document.&lt;/p&gt; &lt;!-- when updating this also update the category index --&gt; - &lt;ul class=&quot;brief category-list&quot;&gt;&lt;li&gt;&lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; + &lt;ul class=&quot;brief category-list&quot;&gt;&lt;li&gt;&lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-canvas-element&gt;canvas&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-embed-element&gt;embed&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-iframe-element&gt;iframe&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; @@ -11198,7 +11195,7 @@ &lt;li&gt;&lt;code&gt;&lt;a href=#math&gt;math&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-object-element&gt;object&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#svg&gt;svg&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; - &lt;li&gt;&lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; + &lt;li&gt;&lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;/ul&gt;&lt;p&gt;Elements that are from namespaces other than the &lt;a href=#html-namespace-0&gt;HTML namespace&lt;/a&gt; and that convey content but not metadata, are &lt;a href=#embedded-content&gt;embedded content&lt;/a&gt; for the purposes of the content models @@ -11228,7 +11225,7 @@ &lt;!-- when updating this also update the category index --&gt; &lt;ul class=&quot;brief category-list&quot;&gt;&lt;li&gt;&lt;code&gt;&lt;a href=#the-a-element&gt;a&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; - &lt;li&gt;&lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-media-controls&gt;&lt;a href=#attr-media-controls&gt;controls&lt;/a&gt;&lt;/code&gt; attribute is present)&lt;/li&gt; + &lt;li&gt;&lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-media-controls&gt;&lt;a href=#attr-media-controls&gt;controls&lt;/a&gt;&lt;/code&gt; attribute is present)&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-button-element&gt;button&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-details-element&gt;details&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-embed-element&gt;embed&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; @@ -11237,11 +11234,11 @@ &lt;li&gt;&lt;code&gt;&lt;a href=#the-input-element&gt;input&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-input-type&gt;&lt;a href=#attr-input-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute is &lt;em&gt;not&lt;/em&gt; in the &lt;a href=#hidden-state title=attr-input-type-hidden&gt;Hidden&lt;/a&gt; state)&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-keygen-element&gt;keygen&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-label-element&gt;label&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; - &lt;li&gt;&lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute is in the &lt;a href=#toolbar-state title=&quot;toolbar state&quot;&gt;toolbar&lt;/a&gt; state)&lt;/li&gt; + &lt;li&gt;&lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute is in the &lt;a href=#toolbar-state title=&quot;toolbar state&quot;&gt;toolbar&lt;/a&gt; state)&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-object-element&gt;object&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-hyperlink-usemap&gt;&lt;a href=#attr-hyperlink-usemap&gt;usemap&lt;/a&gt;&lt;/code&gt; attribute is present)&lt;!-- see also comment in &lt;object&gt; section --&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-select-element&gt;select&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-textarea-element&gt;textarea&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; - &lt;li&gt;&lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-media-controls&gt;&lt;a href=#attr-media-controls&gt;controls&lt;/a&gt;&lt;/code&gt; attribute is present)&lt;/li&gt; + &lt;li&gt;&lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-media-controls&gt;&lt;a href=#attr-media-controls&gt;controls&lt;/a&gt;&lt;/code&gt; attribute is present)&lt;/li&gt; &lt;/ul&gt;&lt;p&gt;Certain elements in HTML have an &lt;a href=#activation-behavior&gt;activation behavior&lt;/a&gt;, which means that the user can activate them. This triggers a sequence of events dependent on the activation mechanism, @@ -11486,7 +11483,7 @@ &lt;p&gt;Conformance checkers may warn authors of cases where they have paragraphs that overlap each other (this can happen with - &lt;code&gt;&lt;a href=#the-object-element&gt;object&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt;, and + &lt;code&gt;&lt;a href=#the-object-element&gt;object&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt;, and &lt;code&gt;&lt;a href=#the-canvas-element&gt;canvas&lt;/a&gt;&lt;/code&gt; elements, and indirectly through elements in other namespaces that allow HTML to be further embedded therein, like &lt;code&gt;&lt;a href=#svg&gt;svg&lt;/a&gt;&lt;/code&gt; or &lt;code&gt;&lt;a href=#math&gt;math&lt;/a&gt;&lt;/code&gt;).&lt;/p&gt; &lt;!-- example below @@ -11724,7 +11721,7 @@ &lt;td&gt;&lt;code title=&quot;attr-aria-role-heading&quot;&gt;heading&lt;/code&gt; role, with the &lt;code title=&quot;attr-aria-level&quot;&gt;aria-level&lt;/code&gt; property set to the element's &lt;span&gt;outline depth&lt;/span&gt; --&gt; - &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element + &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element &lt;td&gt;No role &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#the-hgroup-element&gt;hgroup&lt;/a&gt;&lt;/code&gt; element @@ -11733,7 +11730,7 @@ &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#the-hr-element&gt;hr&lt;/a&gt;&lt;/code&gt; element &lt;td&gt;&lt;code title=attr-aria-role-separator&gt;separator&lt;/code&gt; role - &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element + &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element &lt;td&gt;No role &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#the-img-element&gt;img&lt;/a&gt;&lt;/code&gt; element whose &lt;code title=attr-img-alt&gt;&lt;a href=#attr-img-alt&gt;alt&lt;/a&gt;&lt;/code&gt; attribute's value is empty @@ -11817,16 +11814,16 @@ &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#the-link-element&gt;link&lt;/a&gt;&lt;/code&gt; element that creates a &lt;a href=#hyperlink&gt;hyperlink&lt;/a&gt; &lt;td&gt;&lt;code title=attr-aria-role-link&gt;link&lt;/code&gt; role - &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute in the &lt;a href=#context-menu-state title=&quot;context menu state&quot;&gt;context menu&lt;/a&gt; state + &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute in the &lt;a href=#context-menu-state title=&quot;context menu state&quot;&gt;context menu&lt;/a&gt; state &lt;td&gt;No role - &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute in the &lt;a href=#list-state title=&quot;list state&quot;&gt;list&lt;/a&gt; state + &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute in the &lt;a href=#list-state title=&quot;list state&quot;&gt;list&lt;/a&gt; state &lt;td&gt;&lt;code title=attr-aria-role-menu&gt;menu&lt;/code&gt; role - &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute in the &lt;a href=#toolbar-state title=&quot;toolbar state&quot;&gt;toolbar&lt;/a&gt; state + &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute in the &lt;a href=#toolbar-state title=&quot;toolbar state&quot;&gt;toolbar&lt;/a&gt; state &lt;td&gt;&lt;code title=attr-aria-role-toolbar&gt;toolbar&lt;/code&gt; role - &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element + &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element &lt;td&gt;No role &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#the-meter-element&gt;meter&lt;/a&gt;&lt;/code&gt; element @@ -11850,7 +11847,7 @@ &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#the-progress-element&gt;progress&lt;/a&gt;&lt;/code&gt; element &lt;td&gt;&lt;code title=attr-aria-role-progressbar&gt;progressbar&lt;/code&gt; role, with, if the progress bar is determinate, the &lt;code title=attr-aria-valuemax&gt;aria-valuemax&lt;/code&gt; property set to the maximum value of the progress bar, the &lt;code title=attr-aria-valuemin&gt;aria-valuemin&lt;/code&gt; property set to zero, and the &lt;code title=attr-aria-valuenow&gt;aria-valuenow&lt;/code&gt; property set to the current value of the progress bar - &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element + &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element &lt;td&gt;No role &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#the-select-element&gt;select&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-select-multiple&gt;&lt;a href=#attr-select-multiple&gt;multiple&lt;/a&gt;&lt;/code&gt; attribute @@ -11877,16 +11874,16 @@ &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#the-textarea-element&gt;textarea&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-textarea-required&gt;&lt;a href=#attr-textarea-required&gt;required&lt;/a&gt;&lt;/code&gt; attribute &lt;td&gt;The &lt;code title=title-aria-required&gt;aria-required&lt;/code&gt; state set to &quot;true&quot; - &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt; element + &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt; element &lt;td&gt;No role - &lt;tr&gt;&lt;td&gt;An element that &lt;a href=#concept-command title=concept-command&gt;defines a command&lt;/a&gt;, whose &lt;a href=#command-facet-type title=command-facet-type&gt;Type&lt;/a&gt; facet is &quot;checkbox&quot;, and that is a descendant of a &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; element whose &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute in the &lt;a href=#list-state title=&quot;list state&quot;&gt;list&lt;/a&gt; state + &lt;tr&gt;&lt;td&gt;An element that &lt;a href=#concept-command title=concept-command&gt;defines a command&lt;/a&gt;, whose &lt;a href=#command-facet-type title=command-facet-type&gt;Type&lt;/a&gt; facet is &quot;checkbox&quot;, and that is a descendant of a &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; element whose &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute in the &lt;a href=#list-state title=&quot;list state&quot;&gt;list&lt;/a&gt; state &lt;td&gt;&lt;code title=attr-aria-role-menuitemcheckbox&gt;menuitemcheckbox&lt;/code&gt; role, with the &lt;code title=attr-aria-checked&gt;aria-checked&lt;/code&gt; state set to &quot;true&quot; if the command's &lt;a href=#command-facet-checkedstate title=command-facet-checkedstate&gt;Checked State&lt;/a&gt; facet is true, and &quot;false&quot; otherwise - &lt;tr&gt;&lt;td&gt;An element that &lt;a href=#concept-command title=concept-command&gt;defines a command&lt;/a&gt;, whose &lt;a href=#command-facet-type title=command-facet-type&gt;Type&lt;/a&gt; facet is &quot;command&quot;, and that is a descendant of a &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; element whose &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute in the &lt;a href=#list-state title=&quot;list state&quot;&gt;list&lt;/a&gt; state + &lt;tr&gt;&lt;td&gt;An element that &lt;a href=#concept-command title=concept-command&gt;defines a command&lt;/a&gt;, whose &lt;a href=#command-facet-type title=command-facet-type&gt;Type&lt;/a&gt; facet is &quot;command&quot;, and that is a descendant of a &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; element whose &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute in the &lt;a href=#list-state title=&quot;list state&quot;&gt;list&lt;/a&gt; state &lt;td&gt;&lt;code title=attr-aria-role-menuitem&gt;menuitem&lt;/code&gt; role - &lt;tr&gt;&lt;td&gt;An element that &lt;a href=#concept-command title=concept-command&gt;defines a command&lt;/a&gt;, whose &lt;a href=#command-facet-type title=command-facet-type&gt;Type&lt;/a&gt; facet is &quot;radio&quot;, and that is a descendant of a &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; element whose &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute in the &lt;a href=#list-state title=&quot;list state&quot;&gt;list&lt;/a&gt; state + &lt;tr&gt;&lt;td&gt;An element that &lt;a href=#concept-command title=concept-command&gt;defines a command&lt;/a&gt;, whose &lt;a href=#command-facet-type title=command-facet-type&gt;Type&lt;/a&gt; facet is &quot;radio&quot;, and that is a descendant of a &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; element whose &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute in the &lt;a href=#list-state title=&quot;list state&quot;&gt;list&lt;/a&gt; state &lt;td&gt;&lt;code title=attr-aria-role-menuitemradio&gt;menuitemradio&lt;/code&gt; role, with the &lt;code title=attr-aria-checked&gt;aria-checked&lt;/code&gt; state set to &quot;true&quot; if the command's &lt;a href=#command-facet-checkedstate title=command-facet-checkedstate&gt;Checked State&lt;/a&gt; facet is true, and &quot;false&quot; otherwise &lt;tr&gt;&lt;td&gt;Element that is &lt;a href=#concept-fe-disabled title=concept-fe-disabled&gt;disabled&lt;/a&gt; @@ -11930,7 +11927,7 @@ &lt;td&gt;&lt;code title=attr-aria-role-note&gt;note&lt;/code&gt; role &lt;td&gt;Role must be either &lt;code title=attr-aria-role-note&gt;note&lt;/code&gt;, &lt;code title=attr-aria-role-complementary&gt;complementary&lt;/code&gt;, or &lt;code title=attr-aria-role-search&gt;search&lt;/code&gt; - &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; element + &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; element &lt;td&gt;No role &lt;td&gt;If specified, role must be &lt;code title=attr-aria-role-application&gt;application&lt;/code&gt; @@ -12044,7 +12041,7 @@ &lt;td&gt;&lt;code title=attr-aria-role-list&gt;list&lt;/code&gt; role &lt;td&gt;Role must be either &lt;code title=attr-aria-role-directory&gt;directory&lt;/code&gt;, &lt;code title=attr-aria-role-list&gt;list&lt;/code&gt;, &lt;code title=attr-aria-role-listbox&gt;listbox&lt;/code&gt;, &lt;code title=attr-aria-role-menu&gt;menu&lt;/code&gt;, &lt;code title=attr-aria-role-menubar&gt;menubar&lt;/code&gt;, &lt;code title=attr-aria-role-tablist&gt;tablist&lt;/code&gt;, &lt;code title=&quot;attr-aria-role-toolbar &quot;&gt;toolbar&lt;/code&gt;, &lt;code title=attr-aria-role-tree&gt;tree&lt;/code&gt; - &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element + &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element &lt;td&gt;No role &lt;td&gt;If specified, role must be &lt;code title=attr-aria-role-application&gt;application&lt;/code&gt; @@ -12618,7 +12615,7 @@ &lt;p&gt;&lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt; objects have an &lt;dfn id=ignore-destructive-writes-counter&gt;ignore-destructive-writes counter&lt;/dfn&gt;, which is used in - conjunction with the processing of &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; elements to + conjunction with the processing of &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements to prevent external scripts from being able to use &lt;code title=dom-document-write&gt;&lt;a href=#dom-document-write&gt;document.write()&lt;/a&gt;&lt;/code&gt; to blow away the document by implicitly calling &lt;code title=dom-document-open&gt;&lt;a href=#dom-document-open&gt;document.open()&lt;/a&gt;&lt;/code&gt;. Initially, the counter must be set to zero.&lt;/p&gt; @@ -12682,12 +12679,12 @@ at a time, processing resulting tokens as they are emitted, and stopping when the tokenizer reaches the insertion point or when the processing of the tokenizer is aborted by the tree - construction stage (this can happen if a &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; end + construction stage (this can happen if a &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; end tag token is emitted by the tokenizer). &lt;p class=note&gt;If the &lt;code title=dom-document-write&gt;&lt;a href=#dom-document-write&gt;document.write()&lt;/a&gt;&lt;/code&gt; method was called from script executing inline (i.e. executing because the - parser parsed a set of &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; tags), then this is a + parser parsed a set of &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; tags), then this is a &lt;a href=#nestedParsing&gt;reentrant invocation of the parser&lt;/a&gt;.&lt;/p&gt; @@ -13139,7 +13136,7 @@ &lt;h3 id=the-root-element&gt;&lt;span class=secno&gt;4.1 &lt;/span&gt;The root element&lt;/h3&gt; - &lt;h4 id=the-html-element-0&gt;&lt;span class=secno&gt;4.1.1 &lt;/span&gt;The &lt;dfn&gt;&lt;code&gt;html&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; + &lt;h4 id=the-html-element&gt;&lt;span class=secno&gt;4.1.1 &lt;/span&gt;The &lt;dfn&gt;&lt;code&gt;html&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; &lt;dl class=element&gt;&lt;dt&gt;Categories&lt;/dt&gt; &lt;dd&gt;None.&lt;/dd&gt; @@ -13147,7 +13144,7 @@ &lt;dd&gt;As the root element of a document.&lt;/dd&gt; &lt;dd&gt;Wherever a subdocument fragment is allowed in a compound document.&lt;/dd&gt; &lt;dt&gt;Content model:&lt;/dt&gt; - &lt;dd&gt;A &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element followed by a &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt; element.&lt;/dd&gt; + &lt;dd&gt;A &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element followed by a &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt; element.&lt;/dd&gt; &lt;dt&gt;Content attributes:&lt;/dt&gt; &lt;dd&gt;&lt;a href=#global-attributes&gt;Global attributes&lt;/a&gt;&lt;/dd&gt; &lt;dd&gt;&lt;code title=attr-html-manifest&gt;&lt;a href=#attr-html-manifest&gt;manifest&lt;/a&gt;&lt;/code&gt;&lt;/dd&gt; @@ -13155,7 +13152,7 @@ &lt;dd&gt; &lt;pre class=idl&gt;interface &lt;dfn id=htmlhtmlelement&gt;HTMLHtmlElement&lt;/dfn&gt; : &lt;a href=#htmlelement&gt;HTMLElement&lt;/a&gt; {};&lt;/pre&gt; &lt;/dd&gt; - &lt;/dl&gt;&lt;p&gt;The &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element &lt;a href=#represents&gt;represents&lt;/a&gt; the root of + &lt;/dl&gt;&lt;p&gt;The &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element &lt;a href=#represents&gt;represents&lt;/a&gt; the root of an HTML document.&lt;/p&gt; &lt;p&gt;The &lt;dfn id=attr-html-manifest title=attr-html-manifest&gt;&lt;code&gt;manifest&lt;/code&gt;&lt;/dfn&gt; @@ -13181,7 +13178,7 @@ &lt;div class=example&gt; - &lt;p&gt;The &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element in the following example declares + &lt;p&gt;The &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element in the following example declares that the document's language is English.&lt;/p&gt; &lt;pre&gt;&lt;!DOCTYPE html&gt; @@ -13203,27 +13200,27 @@ &lt;h3 id=document-metadata&gt;&lt;span class=secno&gt;4.2 &lt;/span&gt;Document metadata&lt;/h3&gt; - &lt;h4 id=the-head-element-0&gt;&lt;span class=secno&gt;4.2.1 &lt;/span&gt;The &lt;dfn&gt;&lt;code&gt;head&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; + &lt;h4 id=the-head-element&gt;&lt;span class=secno&gt;4.2.1 &lt;/span&gt;The &lt;dfn&gt;&lt;code&gt;head&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; &lt;dl class=element&gt;&lt;dt&gt;Categories&lt;/dt&gt; &lt;dd&gt;None.&lt;/dd&gt; &lt;dt&gt;Contexts in which this element can be used:&lt;/dt&gt; - &lt;dd&gt;As the first element in an &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element.&lt;/dd&gt; + &lt;dd&gt;As the first element in an &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element.&lt;/dd&gt; &lt;dt&gt;Content model:&lt;/dt&gt; &lt;dd&gt;If the document is &lt;a href=#an-iframe-srcdoc-document&gt;an &lt;code&gt;iframe&lt;/code&gt; &lt;code title=attr-iframe-srcdoc&gt;srcdoc&lt;/code&gt; document&lt;/a&gt; or if title information is available from a higher-level protocol: Zero or more elements of &lt;a href=#metadata-content&gt;metadata content&lt;/a&gt;.&lt;/dd&gt; - &lt;dd&gt;Otherwise: One or more elements of &lt;a href=#metadata-content&gt;metadata content&lt;/a&gt;, of which exactly one is a &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt; element.&lt;/dd&gt; + &lt;dd&gt;Otherwise: One or more elements of &lt;a href=#metadata-content&gt;metadata content&lt;/a&gt;, of which exactly one is a &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt; element.&lt;/dd&gt; &lt;dt&gt;Content attributes:&lt;/dt&gt; &lt;dd&gt;&lt;a href=#global-attributes&gt;Global attributes&lt;/a&gt;&lt;/dd&gt; &lt;dt&gt;DOM interface:&lt;/dt&gt; &lt;dd&gt; &lt;pre class=idl&gt;interface &lt;dfn id=htmlheadelement&gt;HTMLHeadElement&lt;/dfn&gt; : &lt;a href=#htmlelement&gt;HTMLElement&lt;/a&gt; {};&lt;/pre&gt; &lt;/dd&gt; - &lt;/dl&gt;&lt;p&gt;The &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element &lt;a href=#represents&gt;represents&lt;/a&gt; a + &lt;/dl&gt;&lt;p&gt;The &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element &lt;a href=#represents&gt;represents&lt;/a&gt; a collection of metadata for the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt;.&lt;/p&gt; &lt;div class=example&gt; - &lt;p&gt;The collection of metadata in a &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element can be + &lt;p&gt;The collection of metadata in a &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element can be large or small. Here is an example of a very short one:&lt;/p&gt; &lt;pre&gt;&lt;!doctype html&gt; @@ -13252,20 +13249,20 @@ &lt;/div&gt; - &lt;p class=note&gt;The &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt; element is a required child + &lt;p class=note&gt;The &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt; element is a required child in most situations, but when a higher-level protocol provides title information, e.g. in the Subject line of an e-mail when HTML is used - as an e-mail authoring format, the &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt; element can be + as an e-mail authoring format, the &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt; element can be omitted.&lt;/p&gt; - &lt;h4 id=the-title-element-0&gt;&lt;span class=secno&gt;4.2.2 &lt;/span&gt;The &lt;dfn&gt;&lt;code&gt;title&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; + &lt;h4 id=the-title-element&gt;&lt;span class=secno&gt;4.2.2 &lt;/span&gt;The &lt;dfn&gt;&lt;code&gt;title&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; &lt;dl class=element&gt;&lt;dt&gt;Categories&lt;/dt&gt; &lt;dd&gt;&lt;a href=#metadata-content&gt;Metadata content&lt;/a&gt;.&lt;/dd&gt; &lt;dt&gt;Contexts in which this element can be used:&lt;/dt&gt; - &lt;dd&gt;In a &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element containing no other &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt; elements.&lt;/dd&gt; + &lt;dd&gt;In a &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element containing no other &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt; elements.&lt;/dd&gt; &lt;dt&gt;Content model:&lt;/dt&gt; &lt;dd&gt;&lt;a href=#text-content title=&quot;text content&quot;&gt;Text&lt;/a&gt;.&lt;/dd&gt; &lt;dt&gt;Content attributes:&lt;/dt&gt; @@ -13276,7 +13273,7 @@ attribute DOMString &lt;a href=#dom-title-text title=dom-title-text&gt;text&lt;/a&gt;; };&lt;/pre&gt; &lt;/dd&gt; - &lt;/dl&gt;&lt;p&gt;The &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt; element &lt;a href=#represents&gt;represents&lt;/a&gt; the + &lt;/dl&gt;&lt;p&gt;The &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt; element &lt;a href=#represents&gt;represents&lt;/a&gt; the document's title or name. Authors should use titles that identify their documents even when they are used out of context, for example in a user's history or bookmarks, or in search results. The @@ -13284,7 +13281,7 @@ first heading does not have to stand alone when taken out of context.&lt;/p&gt; - &lt;p&gt;There must be no more than one &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt; element per + &lt;p&gt;There must be no more than one &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt; element per document.&lt;/p&gt; &lt;dl class=domintro&gt;&lt;dt&gt;&lt;var title=&quot;&quot;&gt;title&lt;/var&gt; . &lt;code title=dom-title-text&gt;&lt;a href=#dom-title-text&gt;text&lt;/a&gt;&lt;/code&gt; [ = &lt;var title=&quot;&quot;&gt;value&lt;/var&gt; ]&lt;/dt&gt; @@ -13304,7 +13301,7 @@ &lt;p&gt;The IDL attribute &lt;dfn id=dom-title-text title=dom-title-text&gt;&lt;code&gt;text&lt;/code&gt;&lt;/dfn&gt; must return a concatenation of the contents of all the &lt;a href=#text-node title=&quot;text node&quot;&gt;text nodes&lt;/a&gt; that are direct children of the - &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt; element (ignoring any other nodes such as + &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt; element (ignoring any other nodes such as comments or elements), in tree order. On setting, it must act the same way as the &lt;code&gt;&lt;a href=#textcontent&gt;textContent&lt;/a&gt;&lt;/code&gt; IDL attribute.&lt;/p&gt; @@ -13338,8 +13335,8 @@ &lt;p&gt;User agents should use the document's title when referring to the document in their user interface. When the contents of a - &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt; element are used in this way, &lt;a href=#the-directionality&gt;the - directionality&lt;/a&gt; of that &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt; element should be + &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt; element are used in this way, &lt;a href=#the-directionality&gt;the + directionality&lt;/a&gt; of that &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt; element should be used to set the directionality of the document's title in the user interface.&lt;/p&gt; @@ -13351,7 +13348,7 @@ &lt;dl class=element&gt;&lt;dt&gt;Categories&lt;/dt&gt; &lt;dd&gt;&lt;a href=#metadata-content&gt;Metadata content&lt;/a&gt;.&lt;/dd&gt; &lt;dt&gt;Contexts in which this element can be used:&lt;/dt&gt; - &lt;dd&gt;In a &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element containing no other &lt;code&gt;&lt;a href=#the-base-element&gt;base&lt;/a&gt;&lt;/code&gt; elements.&lt;/dd&gt; + &lt;dd&gt;In a &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element containing no other &lt;code&gt;&lt;a href=#the-base-element&gt;base&lt;/a&gt;&lt;/code&gt; elements.&lt;/dd&gt; &lt;dt&gt;Content model:&lt;/dt&gt; &lt;dd&gt;Empty.&lt;/dd&gt; &lt;dt&gt;Content attributes:&lt;/dt&gt; @@ -13382,7 +13379,7 @@ &lt;p&gt;A &lt;code&gt;&lt;a href=#the-base-element&gt;base&lt;/a&gt;&lt;/code&gt; element, if it has an &lt;code title=attr-base-href&gt;&lt;a href=#attr-base-href&gt;href&lt;/a&gt;&lt;/code&gt; attribute, must come before any other elements in the tree that have attributes defined as taking - &lt;a href=#url title=URL&gt;URLs&lt;/a&gt;, except the &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element + &lt;a href=#url title=URL&gt;URLs&lt;/a&gt;, except the &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element (its &lt;code title=attr-html-manifest&gt;&lt;a href=#attr-html-manifest&gt;manifest&lt;/a&gt;&lt;/code&gt; attribute isn't affected by &lt;code&gt;&lt;a href=#the-base-element&gt;base&lt;/a&gt;&lt;/code&gt; elements).&lt;/p&gt; @@ -13452,7 +13449,7 @@ &lt;!--MD--&gt; &lt;dt&gt;Contexts in which this element can be used:&lt;/dt&gt; &lt;dd&gt;Where &lt;a href=#metadata-content&gt;metadata content&lt;/a&gt; is expected.&lt;/dd&gt; - &lt;dd&gt;In a &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt; element that is a child of a &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element.&lt;/dd&gt; + &lt;dd&gt;In a &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt; element that is a child of a &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element.&lt;/dd&gt; &lt;!--MD--&gt; &lt;dd&gt;If the &lt;code title=attr-itemprop&gt;&lt;a href=#names:-the-itemprop-attribute&gt;itemprop&lt;/a&gt;&lt;/code&gt; attribute is present: where &lt;a href=#phrasing-content&gt;phrasing content&lt;/a&gt; is expected.&lt;/dd&gt; &lt;!--MD--&gt; @@ -13816,7 +13813,7 @@ - &lt;h4 id=meta&gt;&lt;span class=secno&gt;4.2.5 &lt;/span&gt;The &lt;dfn&gt;&lt;code&gt;meta&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; + &lt;h4 id=the-meta-element&gt;&lt;span class=secno&gt;4.2.5 &lt;/span&gt;The &lt;dfn id=meta&gt;&lt;code&gt;meta&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; &lt;dl class=element&gt;&lt;dt&gt;Categories&lt;/dt&gt; &lt;dd&gt;&lt;a href=#metadata-content&gt;Metadata content&lt;/a&gt;.&lt;/dd&gt; @@ -13825,9 +13822,9 @@ &lt;dd&gt;If the &lt;code title=attr-itemprop&gt;&lt;a href=#names:-the-itemprop-attribute&gt;itemprop&lt;/a&gt;&lt;/code&gt; attribute is present: &lt;a href=#phrasing-content&gt;phrasing content&lt;/a&gt;.&lt;/dd&gt; &lt;!--MD--&gt; &lt;dt&gt;Contexts in which this element can be used:&lt;/dt&gt; - &lt;dd&gt;If the &lt;code title=attr-meta-charset&gt;&lt;a href=#attr-meta-charset&gt;charset&lt;/a&gt;&lt;/code&gt; attribute is present, or if the element's &lt;code title=attr-meta-http-equiv&gt;&lt;a href=#attr-meta-http-equiv&gt;http-equiv&lt;/a&gt;&lt;/code&gt; attribute is in the &lt;a href=#attr-meta-http-equiv-content-type title=attr-meta-http-equiv-content-type&gt;Encoding declaration state&lt;/a&gt;: in a &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element.&lt;/dd&gt; - &lt;dd&gt;If the &lt;code title=attr-meta-http-equiv&gt;&lt;a href=#attr-meta-http-equiv&gt;http-equiv&lt;/a&gt;&lt;/code&gt; attribute is present but not in the &lt;a href=#attr-meta-http-equiv-content-type title=attr-meta-http-equiv-content-type&gt;Encoding declaration state&lt;/a&gt;: in a &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element.&lt;/dd&gt; - &lt;dd&gt;If the &lt;code title=attr-meta-http-equiv&gt;&lt;a href=#attr-meta-http-equiv&gt;http-equiv&lt;/a&gt;&lt;/code&gt; attribute is present but not in the &lt;a href=#attr-meta-http-equiv-content-type title=attr-meta-http-equiv-content-type&gt;Encoding declaration state&lt;/a&gt;: in a &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt; element that is a child of a &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element.&lt;/dd&gt; + &lt;dd&gt;If the &lt;code title=attr-meta-charset&gt;&lt;a href=#attr-meta-charset&gt;charset&lt;/a&gt;&lt;/code&gt; attribute is present, or if the element's &lt;code title=attr-meta-http-equiv&gt;&lt;a href=#attr-meta-http-equiv&gt;http-equiv&lt;/a&gt;&lt;/code&gt; attribute is in the &lt;a href=#attr-meta-http-equiv-content-type title=attr-meta-http-equiv-content-type&gt;Encoding declaration state&lt;/a&gt;: in a &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element.&lt;/dd&gt; + &lt;dd&gt;If the &lt;code title=attr-meta-http-equiv&gt;&lt;a href=#attr-meta-http-equiv&gt;http-equiv&lt;/a&gt;&lt;/code&gt; attribute is present but not in the &lt;a href=#attr-meta-http-equiv-content-type title=attr-meta-http-equiv-content-type&gt;Encoding declaration state&lt;/a&gt;: in a &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element.&lt;/dd&gt; + &lt;dd&gt;If the &lt;code title=attr-meta-http-equiv&gt;&lt;a href=#attr-meta-http-equiv&gt;http-equiv&lt;/a&gt;&lt;/code&gt; attribute is present but not in the &lt;a href=#attr-meta-http-equiv-content-type title=attr-meta-http-equiv-content-type&gt;Encoding declaration state&lt;/a&gt;: in a &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt; element that is a child of a &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element.&lt;/dd&gt; &lt;dd&gt;If the &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; attribute is present: where &lt;a href=#metadata-content&gt;metadata content&lt;/a&gt; is expected.&lt;/dd&gt; &lt;!--MD--&gt; &lt;dd&gt;If the &lt;code title=attr-itemprop&gt;&lt;a href=#names:-the-itemprop-attribute&gt;itemprop&lt;/a&gt;&lt;/code&gt; attribute is present: where &lt;a href=#metadata-content&gt;metadata content&lt;/a&gt; is expected.&lt;/dd&gt; @@ -13849,12 +13846,12 @@ attribute DOMString &lt;a href=#dom-meta-content title=dom-meta-content&gt;content&lt;/a&gt;; };&lt;/pre&gt; &lt;/dd&gt; - &lt;/dl&gt;&lt;p&gt;The &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element &lt;a href=#represents&gt;represents&lt;/a&gt; various + &lt;/dl&gt;&lt;p&gt;The &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element &lt;a href=#represents&gt;represents&lt;/a&gt; various kinds of metadata that cannot be expressed using the - &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-base-element&gt;base&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-link-element&gt;link&lt;/a&gt;&lt;/code&gt;, - &lt;code&gt;&lt;a href=#the-style-element&gt;style&lt;/a&gt;&lt;/code&gt;, and &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; elements.&lt;/p&gt; + &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-base-element&gt;base&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-link-element&gt;link&lt;/a&gt;&lt;/code&gt;, + &lt;code&gt;&lt;a href=#the-style-element&gt;style&lt;/a&gt;&lt;/code&gt;, and &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements.&lt;/p&gt; - &lt;p&gt;The &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element can represent document-level + &lt;p&gt;The &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element can represent document-level metadata with the &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; attribute, pragma directives with the &lt;code title=attr-meta-http-equiv&gt;&lt;a href=#attr-meta-http-equiv&gt;http-equiv&lt;/a&gt;&lt;/code&gt; attribute, and the file's &lt;a href=#character-encoding-declaration&gt;character encoding declaration&lt;/a&gt; when an HTML @@ -13878,11 +13875,11 @@ UTF-8 as its encoding).&lt;/p&gt; &lt;p class=note&gt;The &lt;code title=attr-meta-charset&gt;&lt;a href=#attr-meta-charset&gt;charset&lt;/a&gt;&lt;/code&gt; - attribute on the &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element has no effect in XML + attribute on the &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element has no effect in XML documents, and is only allowed in order to facilitate migration to and from XHTML.&lt;/p&gt; - &lt;p&gt;There must not be more than one &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element with a + &lt;p&gt;There must not be more than one &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-meta-charset&gt;&lt;a href=#attr-meta-charset&gt;charset&lt;/a&gt;&lt;/code&gt; attribute per document.&lt;/p&gt; @@ -13892,14 +13889,14 @@ values depend on the exact context, as described in subsequent sections of this specification.&lt;/p&gt; - &lt;p&gt;If a &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element has a &lt;dfn id=attr-meta-name title=attr-meta-name&gt;&lt;code&gt;name&lt;/code&gt;&lt;/dfn&gt; attribute, it sets + &lt;p&gt;If a &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element has a &lt;dfn id=attr-meta-name title=attr-meta-name&gt;&lt;code&gt;name&lt;/code&gt;&lt;/dfn&gt; attribute, it sets document metadata. Document metadata is expressed in terms of name/value pairs, the &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; - attribute on the &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element giving the name, and the + attribute on the &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element giving the name, and the &lt;code title=attr-meta-content&gt;&lt;a href=#attr-meta-content&gt;content&lt;/a&gt;&lt;/code&gt; attribute on the same element giving the value. The name specifies what aspect of metadata is being set; valid names and the meaning of their values are - described in the following sections. If a &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element + described in the following sections. If a &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element has no &lt;code title=attr-meta-content&gt;&lt;a href=#attr-meta-content&gt;content&lt;/a&gt;&lt;/code&gt; attribute, then the value part of the metadata name/value pair is the empty string.&lt;/p&gt; @@ -13917,7 +13914,7 @@ &lt;h5 id=standard-metadata-names&gt;&lt;span class=secno&gt;4.2.5.1 &lt;/span&gt;Standard metadata names&lt;/h5&gt; &lt;p&gt;This specification defines a few names for the &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; attribute of the - &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element.&lt;/p&gt; + &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element.&lt;/p&gt; &lt;p&gt;Names are case-insensitive&lt;span class=impl&gt;, and must be compared in an &lt;a href=#ascii-case-insensitive&gt;ASCII case-insensitive&lt;/a&gt; manner&lt;/span&gt;.&lt;/p&gt; @@ -13927,11 +13924,11 @@ &lt;dd&gt;&lt;p&gt;The value must be a short free-form string giving the name of the Web application that the page represents. If the page is not a Web application, the &lt;code title=meta-application-name&gt;&lt;a href=#meta-application-name&gt;application-name&lt;/a&gt;&lt;/code&gt; metadata name - must not be used. There must not be more than one &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; + must not be used. There must not be more than one &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element with its &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; attribute set to the value &lt;code title=meta-application-name&gt;&lt;a href=#meta-application-name&gt;application-name&lt;/a&gt;&lt;/code&gt; per document. &lt;span class=impl&gt;User agents may use the application - name in UI in preference to the page's &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt;, since + name in UI in preference to the page's &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt;, since the title might include status messages and the like relevant to the status of the page at a particular moment in time instead of just being the name of the application.&lt;/span&gt;&lt;/dd&gt; @@ -13946,7 +13943,7 @@ &lt;dd&gt;&lt;p&gt;The value must be a free-form string that describes the page. The value must be appropriate for use in a directory of pages, e.g. in a search engine. There must not be more than one - &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element with its &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; attribute set to the value &lt;code title=meta-description&gt;&lt;a href=#meta-description&gt;description&lt;/a&gt;&lt;/code&gt; per document.&lt;/dd&gt; + &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element with its &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; attribute set to the value &lt;code title=meta-description&gt;&lt;a href=#meta-description&gt;description&lt;/a&gt;&lt;/code&gt; per document.&lt;/dd&gt; &lt;dt&gt;&lt;dfn id=meta-generator title=meta-generator&gt;&lt;code&gt;generator&lt;/code&gt;&lt;/dfn&gt;&lt;/dt&gt; @@ -13959,7 +13956,7 @@ &lt;div class=example&gt; &lt;p&gt;Here is what a tool called &quot;Frontweaver&quot; could include in its - output, in the page's &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element, to identify + output, in the page's &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element, to identify itself as the tool used to generate the page:&lt;/p&gt; &lt;pre&gt;&lt;meta name=generator content=&quot;Frontweaver 8.2&quot;&gt;&lt;/pre&gt; @@ -13978,7 +13975,7 @@ &lt;div class=example&gt; &lt;p&gt;This page about typefaces on British motorways uses a - &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element to specify some keywords that users + &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element to specify some keywords that users might use to look for the page:&lt;/p&gt; &lt;pre&gt;&lt;!DOCTYPE HTML&gt; @@ -14008,7 +14005,7 @@ &lt;li&gt; - &lt;p&gt;For each &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; attribute and a &lt;code title=attr-meta-content&gt;&lt;a href=#attr-meta-content&gt;content&lt;/a&gt;&lt;/code&gt; attribute and whose + &lt;p&gt;For each &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; attribute and a &lt;code title=attr-meta-content&gt;&lt;a href=#attr-meta-content&gt;content&lt;/a&gt;&lt;/code&gt; attribute and whose &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; attribute's value is &lt;code title=meta-keywords&gt;&lt;a href=#meta-keywords&gt;keywords&lt;/a&gt;&lt;/code&gt;, run the following substeps:&lt;/p&gt; @@ -14149,14 +14146,14 @@ &lt;p&gt;Metadata names whose values are to be &lt;a href=#url title=URL&gt;URLs&lt;/a&gt; must not be proposed or accepted. Links must be represented using the &lt;code&gt;&lt;a href=#the-link-element&gt;link&lt;/a&gt;&lt;/code&gt; element, not the - &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element.&lt;/p&gt; + &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element.&lt;/p&gt; &lt;h5 id=pragma-directives&gt;&lt;span class=secno&gt;4.2.5.3 &lt;/span&gt;Pragma directives&lt;/h5&gt; &lt;p&gt;When the &lt;dfn id=attr-meta-http-equiv title=attr-meta-http-equiv&gt;&lt;code&gt;http-equiv&lt;/code&gt;&lt;/dfn&gt; attribute - is specified on a &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element, the element is a pragma + is specified on a &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element, the element is a pragma directive.&lt;/p&gt; &lt;p&gt;The &lt;code title=attr-meta-http-equiv&gt;&lt;a href=#attr-meta-http-equiv&gt;http-equiv&lt;/a&gt;&lt;/code&gt; @@ -14235,7 +14232,7 @@ people expect to have work and what is necessary. --&gt;&lt;div class=impl&gt; - &lt;p&gt;When a &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element is &lt;a href=#insert-an-element-into-a-document title=&quot;insert an + &lt;p&gt;When a &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element is &lt;a href=#insert-an-element-into-a-document title=&quot;insert an element into a document&quot;&gt;inserted into the document&lt;/a&gt;, if its &lt;code title=attr-meta-http-equiv&gt;&lt;a href=#attr-meta-http-equiv&gt;http-equiv&lt;/a&gt;&lt;/code&gt; attribute is present and represents one of the above states, then the user agent @@ -14256,14 +14253,14 @@ language&lt;/dfn&gt;. Until the pragma is successfully processed, there is no &lt;a href=#pragma-set-default-language&gt;pragma-set default language&lt;/a&gt;.&lt;/p&gt; - &lt;ol&gt;&lt;li&gt;&lt;p&gt;If another &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element with an &lt;code title=attr-meta-http-equiv&gt;&lt;a href=#attr-meta-http-equiv&gt;http-equiv&lt;/a&gt;&lt;/code&gt; attribute in the + &lt;ol&gt;&lt;li&gt;&lt;p&gt;If another &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element with an &lt;code title=attr-meta-http-equiv&gt;&lt;a href=#attr-meta-http-equiv&gt;http-equiv&lt;/a&gt;&lt;/code&gt; attribute in the &lt;a href=#attr-meta-http-equiv-content-language title=attr-meta-http-equiv-content-language&gt;Content Language state&lt;/a&gt; has already been successfully processed (i.e. when it was inserted the user agent processed it and reached the last step of this list of steps), then abort these steps.&lt;/li&gt; - &lt;li&gt;&lt;p&gt;If the &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element has no &lt;code title=attr-meta-content&gt;&lt;a href=#attr-meta-content&gt;content&lt;/a&gt;&lt;/code&gt; attribute, or if that + &lt;li&gt;&lt;p&gt;If the &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element has no &lt;code title=attr-meta-content&gt;&lt;a href=#attr-meta-content&gt;content&lt;/a&gt;&lt;/code&gt; attribute, or if that attribute's value is the empty string, then abort these steps.&lt;/li&gt; @@ -14303,7 +14300,7 @@ &lt;a href=#character-encoding-declaration&gt;character encoding declaration&lt;/a&gt;. &lt;span class=impl&gt;This state's user agent requirements are all handled by the parsing section of the specification.&lt;/span&gt;&lt;/p&gt; - &lt;p&gt;For &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; elements with an &lt;code title=attr-meta-http-equiv&gt;&lt;a href=#attr-meta-http-equiv&gt;http-equiv&lt;/a&gt;&lt;/code&gt; attribute in the + &lt;p&gt;For &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; elements with an &lt;code title=attr-meta-http-equiv&gt;&lt;a href=#attr-meta-http-equiv&gt;http-equiv&lt;/a&gt;&lt;/code&gt; attribute in the &lt;a href=#attr-meta-http-equiv-content-type title=attr-meta-http-equiv-content-type&gt;Encoding declaration state&lt;/a&gt;, the &lt;code title=attr-meta-content&gt;&lt;a href=#attr-meta-content&gt;content&lt;/a&gt;&lt;/code&gt; attribute must have a value that is an &lt;a href=#ascii-case-insensitive&gt;ASCII case-insensitive&lt;/a&gt; match for a @@ -14313,11 +14310,11 @@ the character encoding name of the &lt;a href=#character-encoding-declaration&gt;character encoding declaration&lt;/a&gt;.&lt;/p&gt; - &lt;p&gt;If the document contains a &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element with an + &lt;p&gt;If the document contains a &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element with an &lt;code title=attr-meta-http-equiv&gt;&lt;a href=#attr-meta-http-equiv&gt;http-equiv&lt;/a&gt;&lt;/code&gt; attribute in the &lt;a href=#attr-meta-http-equiv-content-type title=attr-meta-http-equiv-content-type&gt;Encoding declaration state&lt;/a&gt;, then the document must not contain a - &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element with the &lt;code title=attr-meta-charset&gt;&lt;a href=#attr-meta-charset&gt;charset&lt;/a&gt;&lt;/code&gt; attribute present.&lt;/p&gt; + &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element with the &lt;code title=attr-meta-charset&gt;&lt;a href=#attr-meta-charset&gt;charset&lt;/a&gt;&lt;/code&gt; attribute present.&lt;/p&gt; &lt;p&gt;The &lt;a href=#attr-meta-http-equiv-content-type title=attr-meta-http-equiv-content-type&gt;Encoding declaration state&lt;/a&gt; may be used in &lt;a href=#html-documents&gt;HTML @@ -14335,7 +14332,7 @@ &lt;div class=impl&gt; - &lt;ol&gt;&lt;li&gt;&lt;p&gt;If the &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element has no &lt;code title=attr-meta-content&gt;&lt;a href=#attr-meta-content&gt;content&lt;/a&gt;&lt;/code&gt; attribute, or if that + &lt;ol&gt;&lt;li&gt;&lt;p&gt;If the &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element has no &lt;code title=attr-meta-content&gt;&lt;a href=#attr-meta-content&gt;content&lt;/a&gt;&lt;/code&gt; attribute, or if that attribute's value is the empty string, then abort these steps.&lt;/li&gt; @@ -14354,13 +14351,13 @@ &lt;div class=impl&gt; - &lt;ol&gt;&lt;!-- TESTS: <A HREF="http://www.hixie.ch/tests/adhoc/html/meta/refresh/">http://www.hixie.ch/tests/adhoc/html/meta/refresh/</A> --&gt;&lt;!-- <A HREF="http://software.hixie.ch/utilities/js/live-dom-viewer/saved/734">http://software.hixie.ch/utilities/js/live-dom-viewer/saved/734</A> --&gt;&lt;li&gt;&lt;p&gt;If another &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element with an &lt;code title=attr-meta-http-equiv&gt;&lt;a href=#attr-meta-http-equiv&gt;http-equiv&lt;/a&gt;&lt;/code&gt; attribute in the + &lt;ol&gt;&lt;!-- TESTS: <A HREF="http://www.hixie.ch/tests/adhoc/html/meta/refresh/">http://www.hixie.ch/tests/adhoc/html/meta/refresh/</A> --&gt;&lt;!-- <A HREF="http://software.hixie.ch/utilities/js/live-dom-viewer/saved/734">http://software.hixie.ch/utilities/js/live-dom-viewer/saved/734</A> --&gt;&lt;li&gt;&lt;p&gt;If another &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element with an &lt;code title=attr-meta-http-equiv&gt;&lt;a href=#attr-meta-http-equiv&gt;http-equiv&lt;/a&gt;&lt;/code&gt; attribute in the &lt;a href=#attr-meta-http-equiv-refresh title=attr-meta-http-equiv-refresh&gt;Refresh state&lt;/a&gt; has already been successfully processed (i.e. when it was inserted the user agent processed it and reached the last step of this list of steps), then abort these steps.&lt;/li&gt; - &lt;li&gt;&lt;p&gt;If the &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element has no &lt;code title=attr-meta-content&gt;&lt;a href=#attr-meta-content&gt;content&lt;/a&gt;&lt;/code&gt; attribute, or if that + &lt;li&gt;&lt;p&gt;If the &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element has no &lt;code title=attr-meta-content&gt;&lt;a href=#attr-meta-content&gt;content&lt;/a&gt;&lt;/code&gt; attribute, or if that attribute's value is the empty string, then abort these steps.&lt;/li&gt; @@ -14444,7 +14441,7 @@ (LF), and U+000D CARRIAGE RETURN (CR) characters from &lt;var title=&quot;&quot;&gt;url&lt;/var&gt;.&lt;/li&gt; &lt;li&gt;&lt;p&gt;&lt;a href=#resolve-a-url title=&quot;resolve a url&quot;&gt;Resolve&lt;/a&gt; the &lt;var title=&quot;&quot;&gt;url&lt;/var&gt; value to an &lt;a href=#absolute-url&gt;absolute URL&lt;/a&gt;, - relative to the &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element. If this fails, abort + relative to the &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element. If this fails, abort these steps.&lt;/li&gt; &lt;li&gt; @@ -14455,7 +14452,7 @@ &lt;p&gt;After the refresh has come due (as defined below), if the user has not canceled the redirect and if the - &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element's &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt;'s + &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element's &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt;'s &lt;a href=#browsing-context&gt;browsing context&lt;/a&gt; did not have the &lt;a href=#sandboxed-automatic-features-browsing-context-flag&gt;sandboxed automatic features browsing context flag&lt;/a&gt; set when the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt; was created, &lt;a href=#navigate title=navigate&gt;navigate&lt;/a&gt;&lt;!--DONAV meta refresh--&gt; the @@ -14474,7 +14471,7 @@ &lt;!-- <A HREF="http://software.hixie.ch/utilities/js/live-dom-viewer/saved/774">http://software.hixie.ch/utilities/js/live-dom-viewer/saved/774</A> --&gt; &lt;li&gt;At least &lt;var title=&quot;&quot;&gt;time&lt;/var&gt; seconds have elapsed - since the &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element was &lt;a href=#insert-an-element-into-a-document title=&quot;insert + since the &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element was &lt;a href=#insert-an-element-into-a-document title=&quot;insert an element into a document&quot;&gt;inserted into the &lt;code&gt;Document&lt;/code&gt;&lt;/a&gt;, adjusted to take into account user or user agent preferences.&lt;/li&gt; @@ -14498,7 +14495,7 @@ &lt;/ol&gt;&lt;/div&gt; - &lt;p&gt;For &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; elements with an &lt;code title=attr-meta-http-equiv&gt;&lt;a href=#attr-meta-http-equiv&gt;http-equiv&lt;/a&gt;&lt;/code&gt; attribute in the + &lt;p&gt;For &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; elements with an &lt;code title=attr-meta-http-equiv&gt;&lt;a href=#attr-meta-http-equiv&gt;http-equiv&lt;/a&gt;&lt;/code&gt; attribute in the &lt;a href=#attr-meta-http-equiv-refresh title=attr-meta-http-equiv-refresh&gt;Refresh state&lt;/a&gt;, the &lt;code title=attr-meta-content&gt;&lt;a href=#attr-meta-content&gt;content&lt;/a&gt;&lt;/code&gt; attribute must have a value consisting either of:&lt;/p&gt; @@ -14521,7 +14518,7 @@ &lt;div class=example&gt; &lt;p&gt;A news organization's front page could include the following - markup in the page's &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element, to ensure that + markup in the page's &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element, to ensure that the page automatically reloads from the server every five minutes:&lt;/p&gt; @@ -14549,7 +14546,7 @@ &lt;p&gt;It is non-conforming. Real HTTP headers should be used instead.&lt;/p&gt; - &lt;ol&gt;&lt;li&gt;&lt;p&gt;If the &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element has no &lt;code title=attr-meta-content&gt;&lt;a href=#attr-meta-content&gt;content&lt;/a&gt;&lt;/code&gt; attribute, or if that + &lt;ol&gt;&lt;li&gt;&lt;p&gt;If the &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element has no &lt;code title=attr-meta-content&gt;&lt;a href=#attr-meta-content&gt;content&lt;/a&gt;&lt;/code&gt; attribute, or if that attribute's value is the empty string, then abort these steps.&lt;/li&gt; @@ -14563,7 +14560,7 @@ &lt;/ol&gt;&lt;/dd&gt; - &lt;/dl&gt;&lt;p&gt;There must not be more than one &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element with + &lt;/dl&gt;&lt;p&gt;There must not be more than one &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element with any particular state in the document at a time.&lt;/p&gt; @@ -14670,8 +14667,8 @@ character encoding used must be an &lt;a href=#ascii-compatible-character-encoding&gt;ASCII-compatible character encoding&lt;/a&gt;, and, in addition, if that encoding isn't US-ASCII itself, then the encoding must be specified using a - &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-meta-charset&gt;&lt;a href=#attr-meta-charset&gt;charset&lt;/a&gt;&lt;/code&gt; attribute or a - &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element with an &lt;code title=attr-meta-http-equiv&gt;&lt;a href=#attr-meta-http-equiv&gt;http-equiv&lt;/a&gt;&lt;/code&gt; attribute in the + &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-meta-charset&gt;&lt;a href=#attr-meta-charset&gt;charset&lt;/a&gt;&lt;/code&gt; attribute or a + &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element with an &lt;code title=attr-meta-http-equiv&gt;&lt;a href=#attr-meta-http-equiv&gt;http-equiv&lt;/a&gt;&lt;/code&gt; attribute in the &lt;a href=#attr-meta-http-equiv-content-type title=attr-meta-http-equiv-content-type&gt;Encoding declaration state&lt;/a&gt;.&lt;/p&gt; @@ -14682,8 +14679,8 @@ &lt;code&gt;&lt;a href=#the-iframe-element&gt;iframe&lt;/a&gt;&lt;/code&gt;.)&lt;/p&gt; &lt;p&gt;If an &lt;a href=#html-documents title=&quot;HTML documents&quot;&gt;HTML document&lt;/a&gt; contains - a &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-meta-charset&gt;&lt;a href=#attr-meta-charset&gt;charset&lt;/a&gt;&lt;/code&gt; attribute or a - &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element with an &lt;code title=attr-meta-http-equiv&gt;&lt;a href=#attr-meta-http-equiv&gt;http-equiv&lt;/a&gt;&lt;/code&gt; attribute in the + a &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-meta-charset&gt;&lt;a href=#attr-meta-charset&gt;charset&lt;/a&gt;&lt;/code&gt; attribute or a + &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element with an &lt;code title=attr-meta-http-equiv&gt;&lt;a href=#attr-meta-http-equiv&gt;http-equiv&lt;/a&gt;&lt;/code&gt; attribute in the &lt;a href=#attr-meta-http-equiv-content-type title=attr-meta-http-equiv-content-type&gt;Encoding declaration state&lt;/a&gt;, then the character encoding used must be an &lt;a href=#ascii-compatible-character-encoding&gt;ASCII-compatible character encoding&lt;/a&gt;.&lt;/p&gt; @@ -14748,7 +14745,7 @@ &lt;p&gt;In HTML, to declare that the character encoding is UTF-8, the author could include the following markup near the top of the - document (in the &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element):&lt;/p&gt; + document (in the &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element):&lt;/p&gt; &lt;pre&gt;&lt;meta charset=&quot;utf-8&quot;&gt;&lt;/pre&gt; @@ -14767,7 +14764,7 @@ &lt;dd&gt;If the &lt;code title=attr-style-scoped&gt;&lt;a href=#attr-style-scoped&gt;scoped&lt;/a&gt;&lt;/code&gt; attribute is present: &lt;a href=#flow-content&gt;flow content&lt;/a&gt;.&lt;/dd&gt; &lt;dt&gt;Contexts in which this element can be used:&lt;/dt&gt; &lt;dd&gt;If the &lt;code title=attr-style-scoped&gt;&lt;a href=#attr-style-scoped&gt;scoped&lt;/a&gt;&lt;/code&gt; attribute is absent: where &lt;a href=#metadata-content&gt;metadata content&lt;/a&gt; is expected.&lt;/dd&gt; - &lt;dd&gt;If the &lt;code title=attr-style-scoped&gt;&lt;a href=#attr-style-scoped&gt;scoped&lt;/a&gt;&lt;/code&gt; attribute is absent: in a &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt; element that is a child of a &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element.&lt;/dd&gt; + &lt;dd&gt;If the &lt;code title=attr-style-scoped&gt;&lt;a href=#attr-style-scoped&gt;scoped&lt;/a&gt;&lt;/code&gt; attribute is absent: in a &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt; element that is a child of a &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element.&lt;/dd&gt; &lt;dd&gt;If the &lt;code title=attr-style-scoped&gt;&lt;a href=#attr-style-scoped&gt;scoped&lt;/a&gt;&lt;/code&gt; attribute is present: where &lt;a href=#flow-content&gt;flow content&lt;/a&gt; is expected, but before any other &lt;a href=#flow-content&gt;flow content&lt;/a&gt; other than other &lt;code&gt;&lt;a href=#the-style-element&gt;style&lt;/a&gt;&lt;/code&gt; elements and &lt;a href=#inter-element-whitespace&gt;inter-element whitespace&lt;/a&gt;.&lt;/dd&gt; &lt;dt&gt;Content model:&lt;/dt&gt; &lt;dd&gt;Depends on the value of the &lt;code title=attr-style-type&gt;&lt;a href=#attr-style-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute, but must match requirements described in prose below.&lt;/dd&gt; @@ -15148,7 +15145,7 @@ &lt;/div&gt; - &lt;h4 id=script&gt;&lt;span class=secno&gt;4.3.1 &lt;/span&gt;The &lt;dfn&gt;&lt;code&gt;script&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; + &lt;h4 id=the-script-element&gt;&lt;span class=secno&gt;4.3.1 &lt;/span&gt;The &lt;dfn id=script&gt;&lt;code&gt;script&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; &lt;dl class=element&gt;&lt;dt&gt;Categories&lt;/dt&gt; &lt;dd&gt;&lt;a href=#metadata-content&gt;Metadata content&lt;/a&gt;.&lt;/dd&gt; @@ -15183,7 +15180,7 @@ attribute DOMString &lt;a href=#dom-script-text title=dom-script-text&gt;text&lt;/a&gt;; };&lt;/pre&gt; &lt;/dd&gt; - &lt;/dl&gt;&lt;p&gt;The &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element allows authors to include dynamic + &lt;/dl&gt;&lt;p&gt;The &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element allows authors to include dynamic script and data blocks in their documents. The element does not &lt;a href=#represents title=represents&gt;represent&lt;/a&gt; content for the user.&lt;/p&gt; @@ -15193,14 +15190,14 @@ is not that described by &quot;&lt;code title=&quot;&quot;&gt;text/javascript&lt;/code&gt;&quot;, then the &lt;code title=attr-script-type&gt;&lt;a href=#attr-script-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute must be present, as described below. Whatever language is used, the - contents of the &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element must conform with the + contents of the &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element must conform with the requirements of that language's specification.&lt;/p&gt; &lt;p&gt;When used to include data blocks (as opposed to scripts), the data must be embedded inline, the format of the data must be given using the &lt;code title=attr-script-type&gt;&lt;a href=#attr-script-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute, the &lt;code title=attr-script-src&gt;&lt;a href=#attr-script-src&gt;src&lt;/a&gt;&lt;/code&gt; attribute must not be - specified, and the contents of the &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element must + specified, and the contents of the &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element must conform to the requirements defined for the format used.&lt;/p&gt; &lt;p&gt;The &lt;dfn id=attr-script-type title=attr-script-type&gt;&lt;code&gt;type&lt;/code&gt;&lt;/dfn&gt; @@ -15253,7 +15250,7 @@ therefore by necessity scattered throughout the specification. The algorithms below (in this section) describe the core of this processing, but these algorithms reference and are referenced by the - parsing rules for &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; &lt;a href=#scriptTag&gt;start&lt;/a&gt; + parsing rules for &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; &lt;a href=#scriptTag&gt;start&lt;/a&gt; and &lt;a href=#scriptEndTag&gt;end&lt;/a&gt; tags in HTML, &lt;a href=#scriptForeignEndTag&gt;in foreign content&lt;/a&gt;, and &lt;a href=#scriptTagXML&gt;in XML&lt;/a&gt;, the rules for the &lt;code title=dom-document-write&gt;&lt;a href=#dom-document-write&gt;document.write()&lt;/a&gt;&lt;/code&gt; method, the handling of &lt;a href=#scripting&gt;scripting&lt;/a&gt;, etc.&lt;/p&gt; @@ -15270,28 +15267,28 @@ &lt;div class=impl&gt; - &lt;p&gt;A &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element has several associated pieces of + &lt;p&gt;A &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element has several associated pieces of state.&lt;/p&gt; &lt;p&gt;The first is a flag indicating whether or not the script block has been &lt;dfn id=already-started&gt;&quot;already started&quot;&lt;/dfn&gt;. Initially, - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; elements must have this flag unset (script + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements must have this flag unset (script blocks, when created, are not &quot;already started&quot;). When a - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element is &lt;a href=#concept-clone title=concept-clone&gt;cloned&lt;/a&gt;, the &quot;already started&quot; flag, if + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element is &lt;a href=#concept-clone title=concept-clone&gt;cloned&lt;/a&gt;, the &quot;already started&quot; flag, if set, must be propagated to the clone when it is created.&lt;/p&gt; &lt;p&gt;The second is a flag indicating whether the element was - &lt;dfn id=parser-inserted&gt;&quot;parser-inserted&quot;&lt;/dfn&gt;. Initially, &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; + &lt;dfn id=parser-inserted&gt;&quot;parser-inserted&quot;&lt;/dfn&gt;. Initially, &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements must have this flag unset. It is set by the &lt;a href=#html-parser&gt;HTML - parser&lt;/a&gt; and the &lt;a href=#xml-parser&gt;XML parser&lt;/a&gt; on &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; + parser&lt;/a&gt; and the &lt;a href=#xml-parser&gt;XML parser&lt;/a&gt; on &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements they insert and affects the processing of those elements.&lt;/p&gt; &lt;p&gt;The third is a flag indicating whether the element will - &lt;dfn id=force-async&gt;&quot;force-async&quot;&lt;/dfn&gt;. Initially, &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; elements + &lt;dfn id=force-async&gt;&quot;force-async&quot;&lt;/dfn&gt;. Initially, &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements must have this flag set. It is unset by the &lt;a href=#html-parser&gt;HTML parser&lt;/a&gt; - and the &lt;a href=#xml-parser&gt;XML parser&lt;/a&gt; on &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; elements they - insert. In addition, whenever a &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element whose + and the &lt;a href=#xml-parser&gt;XML parser&lt;/a&gt; on &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements they + insert. In addition, whenever a &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element whose &lt;a href=#force-async&gt;&quot;force-async&quot;&lt;/a&gt; flag is set has a &lt;code title=attr-script-async&gt;&lt;a href=#attr-script-async&gt;async&lt;/a&gt;&lt;/code&gt; content attribute added, the element's &lt;a href=#force-async&gt;&quot;force-async&quot;&lt;/a&gt; flag must be unset.&lt;/p&gt; &lt;!-- there's no need to unset it when the attribute is removed since you @@ -15299,7 +15296,7 @@ &lt;p&gt;The fourth is a flag indicating whether or not the script block is &lt;dfn id=ready-to-be-parser-executed&gt;&quot;ready to be parser-executed&quot;&lt;/dfn&gt;. Initially, - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; elements must have this flag unset (script + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements must have this flag unset (script blocks, when created, are not &quot;ready to be parser-executed&quot;). This flag is used only for elements that are also &lt;a href=#parser-inserted&gt;&quot;parser-inserted&quot;&lt;/a&gt;, to let the parser know when to @@ -15310,21 +15307,21 @@ encoding&lt;/var&gt;&lt;/dfn&gt;, and &lt;dfn id=&quot;the-script-block's-fallback-character-encoding&quot;&gt;&lt;var&gt;the script block's fallback character encoding&lt;/var&gt;&lt;/dfn&gt;. They are determined when the script is prepared, based on the attributes on the element at that time, - and the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt; of the &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; + and the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt; of the &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element.&lt;/p&gt; - &lt;p&gt;When a &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element that is not marked as being + &lt;p&gt;When a &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element that is not marked as being &lt;a href=#parser-inserted&gt;&quot;parser-inserted&quot;&lt;/a&gt; experiences one of the events listed - in the following list, the user agent must synchronously &lt;a href=#prepare-a-script title=&quot;prepare a script&quot;&gt;prepare&lt;/a&gt; the &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; + in the following list, the user agent must synchronously &lt;a href=#prepare-a-script title=&quot;prepare a script&quot;&gt;prepare&lt;/a&gt; the &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element:&lt;/p&gt; - &lt;ul&gt;&lt;li&gt;The &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element gets &lt;a href=#insert-an-element-into-a-document title=&quot;insert an + &lt;ul&gt;&lt;li&gt;The &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element gets &lt;a href=#insert-an-element-into-a-document title=&quot;insert an element into a document&quot;&gt;inserted into a document&lt;/a&gt;.&lt;/li&gt; - &lt;li&gt;The &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element is &lt;a href=#in-a-document&gt;in a + &lt;li&gt;The &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element is &lt;a href=#in-a-document&gt;in a &lt;code&gt;Document&lt;/code&gt;&lt;/a&gt; and its child nodes are changed.&lt;/li&gt; - &lt;li&gt;The &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element is &lt;a href=#in-a-document&gt;in a + &lt;li&gt;The &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element is &lt;a href=#in-a-document&gt;in a &lt;code&gt;Document&lt;/code&gt;&lt;/a&gt; and has a &lt;code title=attr-script-src&gt;&lt;a href=#attr-script-src&gt;src&lt;/a&gt;&lt;/code&gt; attribute set where previously the element had no such attribute.&lt;/li&gt; @@ -15333,7 +15330,7 @@ &lt;ol&gt;&lt;li&gt; - &lt;p&gt;If the &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element is marked as having + &lt;p&gt;If the &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element is marked as having &lt;a href=#already-started&gt;&quot;already started&quot;&lt;/a&gt;, then the user agent must abort these steps at this point. The script is not executed.&lt;/p&gt; @@ -15347,7 +15344,7 @@ &lt;var title=&quot;&quot;&gt;was-parser-inserted&lt;/var&gt; to false.&lt;/p&gt; &lt;p class=note&gt;This is done so that if parser-inserted - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; elements fail to run when the parser tries to + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements fail to run when the parser tries to run them, e.g. because they are empty or specify an unsupported scripting language, another script can later mutate them and cause them to run again.&lt;/p&gt; @@ -15363,7 +15360,7 @@ element's &lt;a href=#force-async&gt;&quot;force-async&quot;&lt;/a&gt; flag to true.&lt;/p&gt; &lt;p class=note&gt;This is done so that if a parser-inserted - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element fails to run when the parser tries to + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element fails to run when the parser tries to run it, but it is later executed after a script dynamically updates it, it will execute asynchronously even if the &lt;code title=attr-script-async&gt;&lt;a href=#attr-script-async&gt;async&lt;/a&gt;&lt;/code&gt; attribute isn't @@ -15393,25 +15390,25 @@ &lt;p&gt;If either:&lt;/p&gt; - &lt;ul class=brief&gt;&lt;li&gt;the &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element has a &lt;code title=attr-script-type&gt;&lt;a href=#attr-script-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute and its value is + &lt;ul class=brief&gt;&lt;li&gt;the &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element has a &lt;code title=attr-script-type&gt;&lt;a href=#attr-script-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute and its value is the empty string, or&lt;/li&gt; - &lt;li&gt;the &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element has no &lt;code title=attr-script-type&gt;&lt;a href=#attr-script-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute but it has a &lt;code title=attr-script-language&gt;&lt;a href=#attr-script-language&gt;language&lt;/a&gt;&lt;/code&gt; attribute and + &lt;li&gt;the &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element has no &lt;code title=attr-script-type&gt;&lt;a href=#attr-script-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute but it has a &lt;code title=attr-script-language&gt;&lt;a href=#attr-script-language&gt;language&lt;/a&gt;&lt;/code&gt; attribute and &lt;em&gt;that&lt;/em&gt; attribute's value is the empty string, or&lt;/li&gt; - &lt;li&gt;the &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element has neither a &lt;code title=attr-script-type&gt;&lt;a href=#attr-script-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute nor a &lt;code title=attr-script-language&gt;&lt;a href=#attr-script-language&gt;language&lt;/a&gt;&lt;/code&gt; attribute, then&lt;/li&gt; + &lt;li&gt;the &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element has neither a &lt;code title=attr-script-type&gt;&lt;a href=#attr-script-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute nor a &lt;code title=attr-script-language&gt;&lt;a href=#attr-script-language&gt;language&lt;/a&gt;&lt;/code&gt; attribute, then&lt;/li&gt; &lt;/ul&gt;&lt;p&gt;...let &lt;var&gt;&lt;a href=&quot;#the-script-block's-type&quot;&gt;the script block's type&lt;/a&gt;&lt;/var&gt; for this - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element be &quot;&lt;code title=&quot;&quot;&gt;text/javascript&lt;/code&gt;&quot;.&lt;/p&gt; + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element be &quot;&lt;code title=&quot;&quot;&gt;text/javascript&lt;/code&gt;&quot;.&lt;/p&gt; - &lt;p&gt;Otherwise, if the &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element has a &lt;code title=attr-script-type&gt;&lt;a href=#attr-script-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute, let &lt;var&gt;&lt;a href=&quot;#the-script-block's-type&quot;&gt;the - script block's type&lt;/a&gt;&lt;/var&gt; for this &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element be + &lt;p&gt;Otherwise, if the &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element has a &lt;code title=attr-script-type&gt;&lt;a href=#attr-script-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute, let &lt;var&gt;&lt;a href=&quot;#the-script-block's-type&quot;&gt;the + script block's type&lt;/a&gt;&lt;/var&gt; for this &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element be the value of that attribute with any leading or trailing sequences of &lt;a href=#space-character title=&quot;space character&quot;&gt;space characters&lt;/a&gt; removed.&lt;/p&gt; &lt;p&gt;Otherwise, the element has a non-empty &lt;code title=attr-script-language&gt;&lt;a href=#attr-script-language&gt;language&lt;/a&gt;&lt;/code&gt; attribute; let - &lt;var&gt;&lt;a href=&quot;#the-script-block's-type&quot;&gt;the script block's type&lt;/a&gt;&lt;/var&gt; for this &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; + &lt;var&gt;&lt;a href=&quot;#the-script-block's-type&quot;&gt;the script block's type&lt;/a&gt;&lt;/var&gt; for this &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element be the concatenation of the string &quot;&lt;code title=&quot;&quot;&gt;text/&lt;/code&gt;&quot; followed by the value of the &lt;code title=attr-script-language&gt;&lt;a href=#attr-script-language&gt;language&lt;/a&gt;&lt;/code&gt; attribute.&lt;/p&gt; &lt;!-- user agents already support, e.g., type=&quot;text/javascript1.3&quot;, so we don't have to support that separately. --&gt; @@ -15425,7 +15422,7 @@ &lt;p&gt;If the user agent does not &lt;a href=#support-the-scripting-language&gt;support the scripting language&lt;/a&gt; given by &lt;var&gt;&lt;a href=&quot;#the-script-block's-type&quot;&gt;the script block's type&lt;/a&gt;&lt;/var&gt; for - this &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element, then the user agent must abort + this &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element, then the user agent must abort these steps at this point. The script is not executed.&lt;/p&gt; &lt;/li&gt; @@ -15460,7 +15457,7 @@ &lt;li id=script-processing-noscript&gt; &lt;p&gt;If &lt;a href=#concept-n-noscript title=concept-n-noscript&gt;scripting is - disabled&lt;/a&gt; for the &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element, then the user + disabled&lt;/a&gt; for the &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element, then the user agent must abort these steps at this point. The script is not executed.&lt;/p&gt; @@ -15479,7 +15476,7 @@ &lt;li id=script-processing-for&gt; - &lt;p&gt;If the &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element has an &lt;code title=attr-script-event&gt;&lt;a href=#attr-script-event&gt;event&lt;/a&gt;&lt;/code&gt; attribute and a &lt;code title=attr-script-for&gt;&lt;a href=#attr-script-for&gt;for&lt;/a&gt;&lt;/code&gt; attribute, then run these + &lt;p&gt;If the &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element has an &lt;code title=attr-script-event&gt;&lt;a href=#attr-script-event&gt;event&lt;/a&gt;&lt;/code&gt; attribute and a &lt;code title=attr-script-for&gt;&lt;a href=#attr-script-for&gt;for&lt;/a&gt;&lt;/code&gt; attribute, then run these substeps:&lt;/p&gt; &lt;ol&gt;&lt;li&gt;&lt;p&gt;Let &lt;var title=&quot;&quot;&gt;for&lt;/var&gt; be the value of the &lt;code title=attr-script-for&gt;&lt;a href=#attr-script-for&gt;for&lt;/a&gt;&lt;/code&gt; attribute.&lt;/li&gt; @@ -15501,12 +15498,12 @@ &lt;li id=script-processing-encoding&gt; - &lt;p&gt;If the &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element has a &lt;code title=attr-script-charset&gt;&lt;a href=#attr-script-charset&gt;charset&lt;/a&gt;&lt;/code&gt; attribute, then let + &lt;p&gt;If the &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element has a &lt;code title=attr-script-charset&gt;&lt;a href=#attr-script-charset&gt;charset&lt;/a&gt;&lt;/code&gt; attribute, then let &lt;var&gt;&lt;a href=&quot;#the-script-block's-character-encoding&quot;&gt;the script block's character encoding&lt;/a&gt;&lt;/var&gt; for this - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element be the encoding given by the &lt;code title=attr-script-charset&gt;&lt;a href=#attr-script-charset&gt;charset&lt;/a&gt;&lt;/code&gt; attribute.&lt;/p&gt; + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element be the encoding given by the &lt;code title=attr-script-charset&gt;&lt;a href=#attr-script-charset&gt;charset&lt;/a&gt;&lt;/code&gt; attribute.&lt;/p&gt; &lt;p&gt;Otherwise, let &lt;var&gt;&lt;a href=&quot;#the-script-block's-fallback-character-encoding&quot;&gt;the script block's fallback character - encoding&lt;/a&gt;&lt;/var&gt; for this &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element be the same as + encoding&lt;/a&gt;&lt;/var&gt; for this &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element be the same as &lt;a href=&quot;#document's-character-encoding&quot; title=&quot;document's character encoding&quot;&gt;the encoding of the document itself&lt;/a&gt;.&lt;/p&gt; @@ -15606,7 +15603,7 @@ have a &lt;code title=attr-script-src&gt;&lt;a href=#attr-script-src&gt;src&lt;/a&gt;&lt;/code&gt; attribute, and the element has been flagged as &lt;a href=#parser-inserted&gt;&quot;parser-inserted&quot;&lt;/a&gt;, and the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt; of the &lt;a href=#html-parser&gt;HTML parser&lt;/a&gt; or - &lt;a href=#xml-parser&gt;XML parser&lt;/a&gt; that created the &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; + &lt;a href=#xml-parser&gt;XML parser&lt;/a&gt; that created the &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element &lt;a href=#has-a-style-sheet-that-is-blocking-scripts&gt;has a style sheet that is blocking scripts&lt;/a&gt;&lt;/dt&gt; @@ -15632,7 +15629,7 @@ &lt;p&gt;The element must be added to the end of the &lt;dfn id=list-of-scripts-that-will-execute-in-order-as-soon-as-possible&gt;list of scripts that will execute in order as soon as possible&lt;/dfn&gt; associated with the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt; of the - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element at the time the &lt;a href=#prepare-a-script&gt;prepare a + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element at the time the &lt;a href=#prepare-a-script&gt;prepare a script&lt;/a&gt; algorithm started.&lt;/p&gt; &lt;p&gt;The &lt;a href=#concept-task title=concept-task&gt;task&lt;/a&gt; that the @@ -15668,7 +15665,7 @@ &lt;p&gt;The element must be added to the &lt;dfn id=set-of-scripts-that-will-execute-as-soon-as-possible&gt;set of scripts that will execute as soon as possible&lt;/dfn&gt; of the - &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt; of the &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element at the + &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt; of the &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element at the time the &lt;a href=#prepare-a-script&gt;prepare a script&lt;/a&gt; algorithm started.&lt;/p&gt; &lt;p&gt;The &lt;a href=#concept-task title=concept-task&gt;task&lt;/a&gt; that the @@ -15698,7 +15695,7 @@ &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt; is used by the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt;'s parser(s).&lt;/p&gt; - &lt;p class=note&gt;If a &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element that blocks a + &lt;p class=note&gt;If a &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element that blocks a parser gets moved to another &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt; before it would normally have stopped blocking that parser, it nonetheless continues blocking that parser until the condition that causes it to be @@ -15750,7 +15747,7 @@ following steps. For the purposes of these steps, the script is considered to be from an &lt;i&gt;external file&lt;/i&gt; if, while the &lt;a href=#prepare-a-script&gt;prepare a script&lt;/a&gt; algorithm above was running for - this script, the &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element had a &lt;code title=attr-script-src&gt;&lt;a href=#attr-script-src&gt;src&lt;/a&gt;&lt;/code&gt; attribute specified.&lt;/p&gt; + this script, the &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element had a &lt;code title=attr-script-src&gt;&lt;a href=#attr-script-src&gt;src&lt;/a&gt;&lt;/code&gt; attribute specified.&lt;/p&gt; &lt;ol&gt;&lt;li id=establish-script-block-source&gt; @@ -15853,7 +15850,7 @@ &lt;dd&gt; - &lt;p&gt;The child nodes of the &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element at the + &lt;p&gt;The child nodes of the &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element at the time the element's &lt;a href=#already-started&gt;&quot;already started&quot;&lt;/a&gt; flag was last set are the script source.&lt;/p&gt; @@ -15865,7 +15862,7 @@ &lt;p&gt;If the script is from an external file, then increment the &lt;a href=#ignore-destructive-writes-counter&gt;ignore-destructive-writes counter&lt;/a&gt; of the - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element's &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt;. Let &lt;var title=&quot;&quot;&gt;neutralized doc&lt;/var&gt; be that + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element's &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt;. Let &lt;var title=&quot;&quot;&gt;neutralized doc&lt;/var&gt; be that &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt;.&lt;/p&gt; &lt;/li&gt; @@ -15873,7 +15870,7 @@ &lt;li&gt; &lt;p&gt;&lt;a href=#create-a-script-from-a-node title=&quot;create a script from a node&quot;&gt;Create a - script&lt;/a&gt; from the &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element node, using + script&lt;/a&gt; from the &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element node, using &lt;var&gt;&lt;a href=&quot;#the-script-block's-source&quot;&gt;the script block's source&lt;/a&gt;&lt;/var&gt; and &lt;var&gt;&lt;a href=&quot;#the-script-block's-type&quot;&gt;the script block's type&lt;/a&gt;&lt;/var&gt;.&lt;/p&gt; @@ -15894,10 +15891,10 @@ &lt;p&gt;If the script is from an external file, &lt;a href=#fire-a-simple-event&gt;fire a simple event&lt;/a&gt; named &lt;code title=event-load&gt;load&lt;/code&gt; at the - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element.&lt;/p&gt; + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element.&lt;/p&gt; &lt;p&gt;Otherwise, the script is internal; &lt;a href=#queue-a-task&gt;queue a - task&lt;/a&gt; to &lt;a href=#fire-a-simple-event&gt;fire a simple event&lt;/a&gt; named &lt;code title=event-load&gt;load&lt;/code&gt; at the &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; + task&lt;/a&gt; to &lt;a href=#fire-a-simple-event&gt;fire a simple event&lt;/a&gt; named &lt;code title=event-load&gt;load&lt;/code&gt; at the &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element.&lt;/p&gt; &lt;/li&gt; @@ -15941,20 +15938,20 @@ &lt;p&gt;The IDL attribute &lt;dfn id=dom-script-text title=dom-script-text&gt;&lt;code&gt;text&lt;/code&gt;&lt;/dfn&gt; must return a concatenation of the contents of all the &lt;a href=#text-node title=&quot;text node&quot;&gt;text nodes&lt;/a&gt; that are direct children of the - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element (ignoring any other nodes such as + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element (ignoring any other nodes such as comments or elements), in tree order. On setting, it must act the same way as the &lt;code&gt;&lt;a href=#textcontent&gt;textContent&lt;/a&gt;&lt;/code&gt; IDL attribute.&lt;/p&gt; &lt;/div&gt; &lt;p class=note&gt;When inserted using the &lt;code title=dom-document-write&gt;&lt;a href=#dom-document-write&gt;document.write()&lt;/a&gt;&lt;/code&gt; method, - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; elements execute (typically synchronously), but + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements execute (typically synchronously), but when inserted using &lt;code title=dom-innerHTML&gt;&lt;a href=#dom-innerhtml&gt;innerHTML&lt;/a&gt;&lt;/code&gt; and &lt;code title=dom-outerHTML&gt;&lt;a href=#dom-outerhtml&gt;outerHTML&lt;/a&gt;&lt;/code&gt; attributes, they do not execute at all.&lt;/p&gt; &lt;div class=example&gt; - &lt;p&gt;In this example, two &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; elements are used. One + &lt;p&gt;In this example, two &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements are used. One embeds an external script, and the other includes some data.&lt;/p&gt; &lt;pre&gt;&lt;script src=&quot;game-engine.js&quot;&gt;&lt;/script&gt; @@ -15978,7 +15975,7 @@ &lt;p&gt;The following sample shows how a script element can be used to define a function that is then used by other parts of the - document. It also shows how a &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element can be + document. It also shows how a &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element can be used to invoke script while the document is being parsed, in this case to initialize the form's output.&lt;/p&gt; @@ -16070,7 +16067,7 @@ &lt;h5 id=restrictions-for-contents-of-script-elements&gt;&lt;span class=secno&gt;4.3.1.2 &lt;/span&gt;&lt;dfn title=&quot;script content restrictions&quot;&gt;Restrictions for contents of &lt;code&gt;script&lt;/code&gt; elements&lt;/dfn&gt;&lt;/h5&gt; - &lt;p&gt;The &lt;code&gt;&lt;a href=#textcontent&gt;textContent&lt;/a&gt;&lt;/code&gt; of a &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element + &lt;p&gt;The &lt;code&gt;&lt;a href=#textcontent&gt;textContent&lt;/a&gt;&lt;/code&gt; of a &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element must match the &lt;code title=&quot;&quot;&gt;script&lt;/code&gt; production in the following ABNF, the character set for which is Unicode. &lt;a href=#refsABNF&gt;[ABNF]&lt;/a&gt;&lt;/p&gt; @@ -16112,15 +16109,15 @@ tag-end =/ %x002F ; U+002F SOLIDUS (/) tag-end =/ %x003E ; U+003E GREATER-THAN SIGN (&gt;)&lt;/pre&gt; - &lt;p&gt;When a &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element contains &lt;a href=#inline-documentation-for-external-scripts&gt;script + &lt;p&gt;When a &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element contains &lt;a href=#inline-documentation-for-external-scripts&gt;script documentation&lt;/a&gt;, there are further restrictions on the contents of the element, as described in the section below.&lt;/p&gt; &lt;h5 id=inline-documentation-for-external-scripts&gt;&lt;span class=secno&gt;4.3.1.3 &lt;/span&gt;&lt;dfn title=&quot;script documentation&quot;&gt;Inline documentation for external scripts&lt;/dfn&gt;&lt;/h5&gt; - &lt;p&gt;If a &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element's &lt;code title=attr-script-src&gt;&lt;a href=#attr-script-src&gt;src&lt;/a&gt;&lt;/code&gt; attribute is specified, then the - contents of the &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element, if any, must be such + &lt;p&gt;If a &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element's &lt;code title=attr-script-src&gt;&lt;a href=#attr-script-src&gt;src&lt;/a&gt;&lt;/code&gt; attribute is specified, then the + contents of the &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element, if any, must be such that the value of the &lt;code title=dom-script-text&gt;&lt;a href=#dom-script-text&gt;text&lt;/a&gt;&lt;/code&gt; IDL attribute, which is derived from the element's contents, matches the &lt;code title=&quot;&quot;&gt;documentation&lt;/code&gt; production in the following @@ -16147,7 +16144,7 @@ element in JavaScript comments.&lt;/p&gt; &lt;p class=note&gt;This requirement is in addition to the earlier - restrictions on the syntax of contents of &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; + restrictions on the syntax of contents of &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements.&lt;/p&gt; &lt;div class=example&gt; @@ -16171,12 +16168,12 @@ &lt;div class=impl&gt; - &lt;h5 id=scriptTagXSLT&gt;&lt;span class=secno&gt;4.3.1.4 &lt;/span&gt;Interaction of &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; elements and XSLT&lt;/h5&gt; + &lt;h5 id=scriptTagXSLT&gt;&lt;span class=secno&gt;4.3.1.4 &lt;/span&gt;Interaction of &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements and XSLT&lt;/h5&gt; &lt;p&gt;&lt;i&gt;This section is non-normative.&lt;/i&gt;&lt;/p&gt; &lt;p&gt;This specification does not define how XSLT interacts with the - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element (or, indeed, how XSLT processing + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element (or, indeed, how XSLT processing triggers the &lt;a href=#stop-parsing&gt;stop parsing&lt;/a&gt; steps, how it interacts with the &lt;a href=#navigate title=navigate&gt;navigation&lt;/a&gt; algorithm, or how it fits in with the &lt;a href=#event-loop&gt;event loop&lt;/a&gt;). However, in the absence @@ -16185,7 +16182,7 @@ &lt;ul&gt;&lt;li&gt;&lt;p&gt;When an XSLT transformation program is triggered by an &lt;code title=&quot;&quot;&gt;&lt;?xml-stylesheet?&gt;&lt;/code&gt; processing instruction and the browser implements a direct-to-DOM transformation, - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; elements created by the XSLT processor need to + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements created by the XSLT processor need to be marked &lt;a href=#parser-inserted&gt;&quot;parser-inserted&quot;&lt;/a&gt; and run in document order (modulo scripts marked &lt;code title=attr-script-defer&gt;&lt;a href=#attr-script-defer&gt;defer&lt;/a&gt;&lt;/code&gt; or &lt;code title=attr-script-async&gt;&lt;a href=#attr-script-async&gt;async&lt;/a&gt;&lt;/code&gt;), asynchronously @@ -16194,17 +16191,17 @@ &lt;li&gt;&lt;p&gt;The &lt;code title=dom-XSLTProcessor-transformToDocument&gt;XSLTProcessor.transformToDocument()&lt;/code&gt; method adds elements to a &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt; that is not in a &lt;a href=#browsing-context&gt;browsing context&lt;/a&gt;, and, accordingly, any - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; elements they create need to have their + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements they create need to have their &lt;a href=#already-started&gt;&quot;already started&quot;&lt;/a&gt; flag set in the &lt;a href=#prepare-a-script&gt;prepare a script&lt;/a&gt; algorithm and never get executed (&lt;a href=#concept-bc-noscript title=concept-bc-noscript&gt;scripting is disabled&lt;/a&gt;). Such - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; elements still need to be marked + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements still need to be marked &lt;a href=#parser-inserted&gt;&quot;parser-inserted&quot;&lt;/a&gt;, though, such that their &lt;code title=dom-script-async&gt;&lt;a href=#dom-script-async&gt;async&lt;/a&gt;&lt;/code&gt; IDL attribute will return false in the absence of an &lt;code title=attr-script-async&gt;&lt;a href=#attr-script-async&gt;async&lt;/a&gt;&lt;/code&gt; content attribute.&lt;/li&gt; &lt;li&gt;&lt;p&gt;The &lt;code title=dom-XSLTProcessor-transformToFragment&gt;XSLTProcessor.transformToFragment()&lt;/code&gt; method needs to create a fragment that is equivalent to one built manually by creating the elements using &lt;code title=dom-document-createElementNS&gt;&lt;a href=#dom-document-createelementns&gt;document.createElementNS()&lt;/a&gt;&lt;/code&gt;. - For instance, it needs to create &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; elements that + For instance, it needs to create &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements that aren't &lt;a href=#parser-inserted&gt;&quot;parser-inserted&quot;&lt;/a&gt; and that don't have their &lt;a href=#already-started&gt;&quot;already started&quot;&lt;/a&gt; flag set, so that they will execute when the fragment is inserted into a document.&lt;/li&gt; @@ -16224,11 +16221,11 @@ &lt;dd&gt;&lt;a href=#flow-content&gt;Flow content&lt;/a&gt;.&lt;/dd&gt; &lt;dd&gt;&lt;a href=#phrasing-content&gt;Phrasing content&lt;/a&gt;.&lt;/dd&gt; &lt;dt&gt;Contexts in which this element can be used:&lt;/dt&gt; - &lt;dd&gt;In a &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element of an &lt;a href=#html-documents title=&quot;HTML documents&quot;&gt;HTML document&lt;/a&gt;, if there are no ancestor &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt; elements.&lt;/dd&gt; + &lt;dd&gt;In a &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element of an &lt;a href=#html-documents title=&quot;HTML documents&quot;&gt;HTML document&lt;/a&gt;, if there are no ancestor &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt; elements.&lt;/dd&gt; &lt;dd&gt;Where &lt;a href=#phrasing-content&gt;phrasing content&lt;/a&gt; is expected in &lt;a href=#html-documents&gt;HTML documents&lt;/a&gt;, if there are no ancestor &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt; elements.&lt;/dd&gt; &lt;dt&gt;Content model:&lt;/dt&gt; - &lt;dd&gt;When &lt;a href=#concept-n-noscript title=concept-n-noscript&gt;scripting is disabled&lt;/a&gt;, in a &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element: in any order, zero or more &lt;code&gt;&lt;a href=#the-link-element&gt;link&lt;/a&gt;&lt;/code&gt; elements, zero or more &lt;code&gt;&lt;a href=#the-style-element&gt;style&lt;/a&gt;&lt;/code&gt; elements, and zero or more &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; elements.&lt;/dd&gt; - &lt;dd&gt;When &lt;a href=#concept-n-noscript title=concept-n-noscript&gt;scripting is disabled&lt;/a&gt;, not in a &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element: &lt;a href=#transparent&gt;transparent&lt;/a&gt;, but there must be no &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt; element descendants.&lt;/dd&gt; + &lt;dd&gt;When &lt;a href=#concept-n-noscript title=concept-n-noscript&gt;scripting is disabled&lt;/a&gt;, in a &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element: in any order, zero or more &lt;code&gt;&lt;a href=#the-link-element&gt;link&lt;/a&gt;&lt;/code&gt; elements, zero or more &lt;code&gt;&lt;a href=#the-style-element&gt;style&lt;/a&gt;&lt;/code&gt; elements, and zero or more &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; elements.&lt;/dd&gt; + &lt;dd&gt;When &lt;a href=#concept-n-noscript title=concept-n-noscript&gt;scripting is disabled&lt;/a&gt;, not in a &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element: &lt;a href=#transparent&gt;transparent&lt;/a&gt;, but there must be no &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt; element descendants.&lt;/dd&gt; &lt;dd&gt;Otherwise: text that conforms to the requirements given in the prose.&lt;/dd&gt; &lt;dt&gt;Content attributes:&lt;/dt&gt; &lt;dd&gt;&lt;a href=#global-attributes&gt;Global attributes&lt;/a&gt;&lt;/dd&gt; @@ -16244,14 +16241,14 @@ &lt;p&gt;When used in &lt;a href=#html-documents&gt;HTML documents&lt;/a&gt;, the allowed content model is as follows:&lt;/p&gt; - &lt;dl&gt;&lt;dt&gt;In a &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element, if &lt;a href=#concept-n-noscript title=concept-n-noscript&gt;scripting is disabled&lt;/a&gt; for the + &lt;dl&gt;&lt;dt&gt;In a &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element, if &lt;a href=#concept-n-noscript title=concept-n-noscript&gt;scripting is disabled&lt;/a&gt; for the &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt; element&lt;/dt&gt; &lt;dd&gt;&lt;p&gt;The &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt; element must contain only - &lt;code&gt;&lt;a href=#the-link-element&gt;link&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-style-element&gt;style&lt;/a&gt;&lt;/code&gt;, and &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; + &lt;code&gt;&lt;a href=#the-link-element&gt;link&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-style-element&gt;style&lt;/a&gt;&lt;/code&gt;, and &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; elements.&lt;/dd&gt; - &lt;dt&gt;In a &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element, if &lt;a href=#concept-n-script title=concept-n-script&gt;scripting is enabled&lt;/a&gt; for the + &lt;dt&gt;In a &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element, if &lt;a href=#concept-n-script title=concept-n-script&gt;scripting is enabled&lt;/a&gt; for the &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt; element&lt;/dt&gt; &lt;dd&gt;&lt;p&gt;The &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt; element must contain only text, @@ -16259,10 +16256,10 @@ algorithm&lt;/a&gt; &lt;!-- (which disables &lt;script&gt; execution) --&gt; with the &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt; element as the &lt;var title=&quot;&quot;&gt;context&lt;/var&gt; element and the text contents as the &lt;var title=&quot;&quot;&gt;input&lt;/var&gt; must result in a list of nodes that consists only of &lt;code&gt;&lt;a href=#the-link-element&gt;link&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-style-element&gt;style&lt;/a&gt;&lt;/code&gt;, and - &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; elements that would be conforming if they were + &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; elements that would be conforming if they were children of the &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt; element, and no &lt;a href=#parse-error title=&quot;parse error&quot;&gt;parse errors&lt;/a&gt;.&lt;/dd&gt; - &lt;dt&gt;Outside of &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; elements, if &lt;a href=#concept-n-noscript title=concept-n-noscript&gt;scripting is disabled&lt;/a&gt; for the + &lt;dt&gt;Outside of &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; elements, if &lt;a href=#concept-n-noscript title=concept-n-noscript&gt;scripting is disabled&lt;/a&gt; for the &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt; element&lt;/dt&gt; &lt;dd&gt;&lt;p&gt;The &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt; element's content model is @@ -16271,7 +16268,7 @@ element as an ancestor (that is, &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt; can't be nested).&lt;/dd&gt; - &lt;dt&gt;Outside of &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; elements, if &lt;a href=#concept-n-script title=concept-n-script&gt;scripting is enabled&lt;/a&gt; for the + &lt;dt&gt;Outside of &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; elements, if &lt;a href=#concept-n-script title=concept-n-script&gt;scripting is enabled&lt;/a&gt; for the &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt; element&lt;/dt&gt; &lt;dd&gt; @@ -16279,11 +16276,11 @@ &lt;p&gt;The &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt; element must contain only text, except that the text must be such that running the following algorithm results in a conforming document with no - &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt; elements and no &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; + &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt; elements and no &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements, and such that no step in the algorithm causes an &lt;a href=#html-parser&gt;HTML parser&lt;/a&gt; to flag a &lt;a href=#parse-error&gt;parse error&lt;/a&gt;:&lt;/p&gt; - &lt;ol&gt;&lt;li&gt;Remove every &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element from the + &lt;ol&gt;&lt;li&gt;Remove every &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element from the document.&lt;/li&gt; &lt;li&gt;Make a list of every &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt; element in the @@ -16419,7 +16416,7 @@ &lt;dl class=element&gt;&lt;dt&gt;Categories&lt;/dt&gt; &lt;dd&gt;&lt;a href=#sectioning-root&gt;Sectioning root&lt;/a&gt;.&lt;/dd&gt; &lt;dt&gt;Contexts in which this element can be used:&lt;/dt&gt; - &lt;dd&gt;As the second element in an &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element.&lt;/dd&gt; + &lt;dd&gt;As the second element in an &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element.&lt;/dd&gt; &lt;dt&gt;Content model:&lt;/dt&gt; &lt;dd&gt;&lt;a href=#flow-content&gt;Flow content&lt;/a&gt;.&lt;/dd&gt; &lt;dt&gt;Content attributes:&lt;/dt&gt; @@ -16502,11 +16499,11 @@ body element&lt;/a&gt; of a &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt; would first trigger the &lt;code title=handler-onerror&gt;&lt;a href=#handler-onerror&gt;onerror&lt;/a&gt;&lt;/code&gt; &lt;a href=#event-handler-content-attributes&gt;event handler content attributes&lt;/a&gt; of that element, then that of the root - &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element, and only &lt;em&gt;then&lt;/em&gt; would it trigger + &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element, and only &lt;em&gt;then&lt;/em&gt; would it trigger the &lt;code title=handler-window-onerror&gt;&lt;a href=#handler-window-onerror&gt;onerror&lt;/a&gt;&lt;/code&gt; &lt;a href=#event-handler-content-attributes title=&quot;event handler content attributes&quot;&gt;event handler content attribute&lt;/a&gt; on the &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt; element. This is because the event would bubble from the target, to the &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;, to - the &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;, to the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt;, to the + the &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;, to the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt;, to the &lt;code&gt;&lt;a href=#window&gt;Window&lt;/a&gt;&lt;/code&gt;, and the &lt;a href=#event-handlers title=&quot;event handlers&quot;&gt;event handler&lt;/a&gt; on the &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt; is watching the &lt;code&gt;&lt;a href=#window&gt;Window&lt;/a&gt;&lt;/code&gt; not the &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;. A regular event @@ -17072,10 +17069,7 @@ - &lt;h4 id=the-h1,-h2,-h3,-h4,-h5,-and-h6-elements&gt;&lt;span class=secno&gt;4.4.6 &lt;/span&gt;The &lt;dfn&gt;&lt;code&gt;h1&lt;/code&gt;&lt;/dfn&gt;, &lt;dfn&gt;&lt;code&gt;h2&lt;/code&gt;&lt;/dfn&gt;, - &lt;dfn&gt;&lt;code&gt;h3&lt;/code&gt;&lt;/dfn&gt;, &lt;dfn&gt;&lt;code&gt;h4&lt;/code&gt;&lt;/dfn&gt;, - &lt;dfn&gt;&lt;code&gt;h5&lt;/code&gt;&lt;/dfn&gt;, and &lt;dfn&gt;&lt;code&gt;h6&lt;/code&gt;&lt;/dfn&gt; - elements&lt;/h4&gt; + &lt;h4 id=the-h1,-h2,-h3,-h4,-h5,-and-h6-elements&gt;&lt;span class=secno&gt;4.4.6 &lt;/span&gt;The &lt;dfn id=the-h1-element&gt;&lt;code&gt;h1&lt;/code&gt;&lt;/dfn&gt;, &lt;dfn id=the-h2-element&gt;&lt;code&gt;h2&lt;/code&gt;&lt;/dfn&gt;, &lt;dfn id=the-h3-element&gt;&lt;code&gt;h3&lt;/code&gt;&lt;/dfn&gt;, &lt;dfn id=the-h4-element&gt;&lt;code&gt;h4&lt;/code&gt;&lt;/dfn&gt;, &lt;dfn id=the-h5-element&gt;&lt;code&gt;h5&lt;/code&gt;&lt;/dfn&gt;, and &lt;dfn id=the-h6-element&gt;&lt;code&gt;h6&lt;/code&gt;&lt;/dfn&gt; elements&lt;/h4&gt; &lt;dl class=element&gt;&lt;dt&gt;Categories&lt;/dt&gt; &lt;dd&gt;&lt;a href=#flow-content&gt;Flow content&lt;/a&gt;.&lt;/dd&gt; @@ -18678,7 +18672,7 @@ &lt;dt&gt;Contexts in which this element can be used:&lt;/dt&gt; &lt;dd&gt;Inside &lt;code&gt;&lt;a href=#the-ol-element&gt;ol&lt;/a&gt;&lt;/code&gt; elements.&lt;/dd&gt; &lt;dd&gt;Inside &lt;code&gt;&lt;a href=#the-ul-element&gt;ul&lt;/a&gt;&lt;/code&gt; elements.&lt;/dd&gt; - &lt;dd&gt;Inside &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; elements.&lt;/dd&gt; + &lt;dd&gt;Inside &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; elements.&lt;/dd&gt; &lt;dt&gt;Content model:&lt;/dt&gt; &lt;dd&gt;&lt;a href=#flow-content&gt;Flow content&lt;/a&gt;.&lt;/dd&gt; &lt;dt&gt;Content attributes:&lt;/dt&gt; @@ -18692,7 +18686,7 @@ &lt;/dd&gt; &lt;/dl&gt;&lt;p&gt;The &lt;code&gt;&lt;a href=#the-li-element&gt;li&lt;/a&gt;&lt;/code&gt; element &lt;a href=#represents&gt;represents&lt;/a&gt; a list item. If its parent element is an &lt;code&gt;&lt;a href=#the-ol-element&gt;ol&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-ul-element&gt;ul&lt;/a&gt;&lt;/code&gt;, - or &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; element, then the element is an item of the + or &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; element, then the element is an item of the parent element's list, as defined for those elements. Otherwise, the list item has no defined list-related relationship to any other &lt;code&gt;&lt;a href=#the-li-element&gt;li&lt;/a&gt;&lt;/code&gt; element.&lt;/p&gt; @@ -18765,7 +18759,7 @@ &lt;/div&gt; &lt;p class=note&gt;If the &lt;code&gt;&lt;a href=#the-li-element&gt;li&lt;/a&gt;&lt;/code&gt; element is the child of a - &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; element and itself has a child that defines a + &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; element and itself has a child that defines a &lt;a href=#concept-command title=concept-command&gt;command&lt;/a&gt;, then the &lt;code&gt;&lt;a href=#the-li-element&gt;li&lt;/a&gt;&lt;/code&gt; element will match the &lt;code title=selector-enabled&gt;&lt;a href=#selector-enabled&gt;:enabled&lt;/a&gt;&lt;/code&gt; and &lt;code title=selector-disabled&gt;&lt;a href=#selector-disabled&gt;:disabled&lt;/a&gt;&lt;/code&gt; pseudo-classes in the same way as the first such child element does.&lt;/p&gt; @@ -20581,7 +20575,7 @@ &lt;/div&gt; - &lt;h4 id=the-sub-and-sup-elements&gt;&lt;span class=secno&gt;4.6.15 &lt;/span&gt;The &lt;dfn&gt;&lt;code&gt;sub&lt;/code&gt;&lt;/dfn&gt; and &lt;dfn&gt;&lt;code&gt;sup&lt;/code&gt;&lt;/dfn&gt; elements&lt;/h4&gt; + &lt;h4 id=the-sub-and-sup-elements&gt;&lt;span class=secno&gt;4.6.15 &lt;/span&gt;The &lt;dfn id=the-sub-element&gt;&lt;code&gt;sub&lt;/code&gt;&lt;/dfn&gt; and &lt;dfn id=the-sup-element&gt;&lt;code&gt;sup&lt;/code&gt;&lt;/dfn&gt; elements&lt;/h4&gt; &lt;dl class=element&gt;&lt;dt&gt;Categories&lt;/dt&gt; &lt;dd&gt;&lt;a href=#flow-content&gt;Flow content&lt;/a&gt;.&lt;/dd&gt; @@ -23291,7 +23285,7 @@ who is known to be able to view images.&lt;/li&gt; &lt;!--FORK--&gt; - &lt;li&gt;The document has a &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; attribute whose value is an + &lt;li&gt;The document has a &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; attribute whose value is an &lt;a href=#ascii-case-insensitive&gt;ASCII case-insensitive&lt;/a&gt; match for the string &quot;&lt;code title=meta-generator&gt;&lt;a href=#meta-generator&gt;generator&lt;/a&gt;&lt;/code&gt;&quot;. (This case does not represent a case where the document is conforming, only that the generator could not determine appropriate alternative text &mdash; @@ -23364,7 +23358,7 @@ &lt;li&gt;Any number of &lt;a href=#syntax-comments title=syntax-comments&gt;comments&lt;/a&gt; and &lt;a href=#space-character title=&quot;space character&quot;&gt;space characters&lt;/a&gt;.&lt;/li&gt; - &lt;li&gt;The root element, in the form of an &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; &lt;a href=#syntax-elements title=syntax-elements&gt;element&lt;/a&gt;.&lt;/li&gt; + &lt;li&gt;The root element, in the form of an &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; &lt;a href=#syntax-elements title=syntax-elements&gt;element&lt;/a&gt;.&lt;/li&gt; &lt;li&gt;Any number of &lt;a href=#syntax-comments title=syntax-comments&gt;comments&lt;/a&gt; and &lt;a href=#space-character title=&quot;space character&quot;&gt;space characters&lt;/a&gt;.&lt;/li&gt; @@ -24092,7 +24086,7 @@ &lt;var title=&quot;&quot;&gt;input&lt;/var&gt; must result in a list of nodes that are all &lt;a href=#phrasing-content&gt;phrasing content&lt;/a&gt;, with no &lt;a href=#parse-error title=&quot;parse error&quot;&gt;parse errors&lt;/a&gt; having occurred, with no - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; elements being anywhere in the list or as + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements being anywhere in the list or as descendants of elements in the list, and with all the elements in the list (including their descendants) being themselves conforming.&lt;/p&gt; @@ -25139,10 +25133,10 @@ &lt;p&gt;The following example shows how a plugin can be used in HTML (in this case the Flash plugin, to show a video file). Fallback is provided for users who do not have Flash enabled, in this case - using the &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element to show the video for those - using user agents that support &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt;, and finally + using the &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element to show the video for those + using user agents that support &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt;, and finally providing a link to the video for those who have neither Flash nor - a &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt;-capable browser.&lt;/p&gt; + a &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt;-capable browser.&lt;/p&gt; &lt;pre&gt;&lt;p&gt;Look at my video: &lt;object type=&quot;application/x-shockwave-flash&quot;&gt; @@ -25245,7 +25239,7 @@ &lt;/div&gt; - &lt;h4 id=video&gt;&lt;span class=secno&gt;4.8.6 &lt;/span&gt;The &lt;dfn&gt;&lt;code&gt;video&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; + &lt;h4 id=the-video-element&gt;&lt;span class=secno&gt;4.8.6 &lt;/span&gt;The &lt;dfn id=video&gt;&lt;code&gt;video&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; &lt;dl class=element&gt;&lt;dt&gt;Categories&lt;/dt&gt; &lt;dd&gt;&lt;a href=#flow-content&gt;Flow content&lt;/a&gt;.&lt;/dd&gt; @@ -25283,13 +25277,13 @@ attribute DOMString &lt;a href=#dom-video-poster title=dom-video-poster&gt;poster&lt;/a&gt;; };&lt;/pre&gt; &lt;/dd&gt; - &lt;/dl&gt;&lt;p&gt;A &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element is used for playing videos or + &lt;/dl&gt;&lt;p&gt;A &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element is used for playing videos or movies, and audio files with captions.&lt;/p&gt; - &lt;p&gt;Content may be provided inside the &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; + &lt;p&gt;Content may be provided inside the &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element&lt;span class=impl&gt;. User agents should not show this content to the user&lt;/span&gt;; it is intended for older Web browsers which do - not support &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt;, so that legacy video plugins can be + not support &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt;, so that legacy video plugins can be tried, or to show text to the users of these older browsers informing them of how to access the video contents.&lt;/p&gt; @@ -25301,7 +25295,7 @@ subtitle tracks, audio description tracks, or sign-language overlays) into their media streams.&lt;/p&gt; - &lt;p&gt;The &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element is a &lt;a href=#media-element&gt;media element&lt;/a&gt; + &lt;p&gt;The &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element is a &lt;a href=#media-element&gt;media element&lt;/a&gt; whose &lt;a href=#media-data&gt;media data&lt;/a&gt; is ostensibly video data, possibly with associated audio data.&lt;/p&gt; @@ -25327,7 +25321,7 @@ URL. --&gt; &lt;ol&gt;&lt;li&gt;&lt;p&gt;If there is an existing instance of this algorithm running - for this &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element, abort that instance of this + for this &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element, abort that instance of this algorithm without changing the &lt;a href=#poster-frame&gt;poster frame&lt;/a&gt;.&lt;/li&gt; &lt;li&gt;&lt;p&gt;If the &lt;code title=attr-video-poster&gt;&lt;a href=#attr-video-poster&gt;poster&lt;/a&gt;&lt;/code&gt; @@ -25362,11 +25356,11 @@ &lt;code title=dom-media-HAVE_NOTHING&gt;&lt;a href=#dom-media-have_nothing&gt;HAVE_NOTHING&lt;/a&gt;&lt;/code&gt;, or &lt;code title=dom-media-HAVE_METADATA&gt;&lt;a href=#dom-media-have_metadata&gt;HAVE_METADATA&lt;/a&gt;&lt;/code&gt; but no video data has yet been obtained at all, or the element's &lt;code title=dom-media-readyState&gt;&lt;a href=#dom-media-readystate&gt;readyState&lt;/a&gt;&lt;/code&gt; attribute is any subsequent value but the &lt;a href=#media-resource&gt;media resource&lt;/a&gt; does not have a - video channel), the &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element + video channel), the &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element &lt;a href=#represents&gt;represents&lt;/a&gt; either the &lt;a href=#poster-frame&gt;poster frame&lt;/a&gt;, or nothing.&lt;/p&gt; - &lt;p&gt;When a &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element is &lt;a href=#dom-media-paused title=dom-media-paused&gt;paused&lt;/a&gt; and the &lt;a href=#current-playback-position title=&quot;current + &lt;p&gt;When a &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element is &lt;a href=#dom-media-paused title=dom-media-paused&gt;paused&lt;/a&gt; and the &lt;a href=#current-playback-position title=&quot;current playback position&quot;&gt;current playback position&lt;/a&gt; is the first frame of video, the element &lt;a href=#represents&gt;represents&lt;/a&gt; either the frame of video corresponding to the &lt;a href=#current-playback-position title=&quot;current playback @@ -25377,7 +25371,7 @@ be preferred over nothing, but the &lt;a href=#poster-frame&gt;poster frame&lt;/a&gt; should not be shown again after a frame of video has been shown.&lt;/p&gt; - &lt;p&gt;When a &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element is &lt;a href=#dom-media-paused title=dom-media-paused&gt;paused&lt;/a&gt; at any other position, and + &lt;p&gt;When a &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element is &lt;a href=#dom-media-paused title=dom-media-paused&gt;paused&lt;/a&gt; at any other position, and the &lt;a href=#media-resource&gt;media resource&lt;/a&gt; has a video channel, the element &lt;a href=#represents&gt;represents&lt;/a&gt; the frame of video corresponding to the &lt;a href=#current-playback-position title=&quot;current playback position&quot;&gt;current playback @@ -25385,7 +25379,7 @@ video is seeking or buffering), the last frame of the video to have been rendered.&lt;/p&gt; - &lt;p&gt;When a &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element whose &lt;a href=#media-resource&gt;media + &lt;p&gt;When a &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element whose &lt;a href=#media-resource&gt;media resource&lt;/a&gt; has a video channel is &lt;a href=#potentially-playing&gt;potentially playing&lt;/a&gt;, it &lt;a href=#represents&gt;represents&lt;/a&gt; the frame of video at the continuously increasing &lt;a href=#current-playback-position title=&quot;current playback @@ -25399,7 +25393,7 @@ playback position&lt;/a&gt;, at the element's &lt;a href=#effective-media-volume&gt;effective media volume&lt;/a&gt;.&lt;/p&gt; - &lt;p&gt;When a &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element whose &lt;a href=#media-resource&gt;media + &lt;p&gt;When a &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element whose &lt;a href=#media-resource&gt;media resource&lt;/a&gt; has a video channel is neither &lt;a href=#potentially-playing&gt;potentially playing&lt;/a&gt; nor &lt;a href=#dom-media-paused title=dom-media-paused&gt;paused&lt;/a&gt; (e.g. when seeking or stalled), the element &lt;a href=#represents&gt;represents&lt;/a&gt; @@ -25409,7 +25403,7 @@ particular playback position is defined by the video stream's format.&lt;/p&gt; - &lt;p&gt;The &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element also &lt;a href=#represents&gt;represents&lt;/a&gt; any + &lt;p&gt;The &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element also &lt;a href=#represents&gt;represents&lt;/a&gt; any &lt;a href=#text-track-cue title=&quot;text track cue&quot;&gt;text track cues&lt;/a&gt; whose &lt;a href=#text-track-cue-active-flag&gt;text track cue active flag&lt;/a&gt; is set and whose &lt;a href=#text-track&gt;text track&lt;/a&gt; is in the &lt;a href=#text-track-showing title=&quot;text track @@ -25460,7 +25454,7 @@ &lt;/div&gt; - &lt;p&gt;The &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element supports &lt;a href=#dimension-attributes&gt;dimension + &lt;p&gt;The &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element supports &lt;a href=#dimension-attributes&gt;dimension attributes&lt;/a&gt;.&lt;/p&gt; &lt;div class=impl&gt; @@ -25479,13 +25473,13 @@ requirement can be implemented by using the &lt;a href=#video-object-fit&gt;style rule suggested in the rendering section&lt;/a&gt;.&lt;/p&gt; - &lt;p&gt;The intrinsic width of a &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element's playback + &lt;p&gt;The intrinsic width of a &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element's playback area is the &lt;a href=#concept-video-intrinsic-width title=concept-video-intrinsic-width&gt;intrinsic width&lt;/a&gt; of the video resource, if that is available; otherwise it is the intrinsic width of the &lt;a href=#poster-frame&gt;poster frame&lt;/a&gt;, if that is available; otherwise it is 300 CSS pixels.&lt;/p&gt; - &lt;p&gt;The intrinsic height of a &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element's playback + &lt;p&gt;The intrinsic height of a &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element's playback area is the &lt;a href=#concept-video-intrinsic-height title=concept-video-intrinsic-height&gt;intrinsic height&lt;/a&gt; of the video resource, if that is available; otherwise it is the intrinsic height of the &lt;a href=#poster-frame&gt;poster frame&lt;/a&gt;, if that @@ -25578,7 +25572,7 @@ - &lt;h4 id=audio&gt;&lt;span class=secno&gt;4.8.7 &lt;/span&gt;The &lt;dfn&gt;&lt;code&gt;audio&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; + &lt;h4 id=the-audio-element&gt;&lt;span class=secno&gt;4.8.7 &lt;/span&gt;The &lt;dfn id=audio&gt;&lt;code&gt;audio&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; &lt;dl class=element&gt;&lt;dt&gt;Categories&lt;/dt&gt; &lt;dd&gt;&lt;a href=#flow-content&gt;Flow content&lt;/a&gt;.&lt;/dd&gt; @@ -25609,7 +25603,7 @@ NamedConstructor=&lt;a href=#dom-audio-s title=dom-Audio-s&gt;Audio&lt;/a&gt;(in DOMString src)] interface &lt;dfn id=htmlaudioelement&gt;HTMLAudioElement&lt;/dfn&gt; : &lt;a href=#htmlmediaelement&gt;HTMLMediaElement&lt;/a&gt; {};&lt;/pre&gt; &lt;/dd&gt; - &lt;/dl&gt;&lt;p&gt;An &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; element &lt;a href=#represents&gt;represents&lt;/a&gt; a sound or + &lt;/dl&gt;&lt;p&gt;An &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; element &lt;a href=#represents&gt;represents&lt;/a&gt; a sound or audio stream.&lt;/p&gt; &lt;!-- v2 (actually v3) suggestions: @@ -25629,10 +25623,10 @@ &gt; Support very simple audio codecs, and programmable synthesizers. --&gt; - &lt;p&gt;Content may be provided inside the &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; + &lt;p&gt;Content may be provided inside the &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; element&lt;span class=impl&gt;. User agents should not show this content to the user&lt;/span&gt;; it is intended for older Web browsers which do - not support &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt;, so that legacy audio plugins can be + not support &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt;, so that legacy audio plugins can be tried, or to show text to the users of these older browsers informing them of how to access the audio contents.&lt;/p&gt; @@ -25643,7 +25637,7 @@ embed accessibility aids (such as transcriptions) into their media streams.&lt;/p&gt; - &lt;p&gt;The &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; element is a &lt;a href=#media-element&gt;media element&lt;/a&gt; + &lt;p&gt;The &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; element is a &lt;a href=#media-element&gt;media element&lt;/a&gt; whose &lt;a href=#media-data&gt;media data&lt;/a&gt; is ostensibly audio data.&lt;/p&gt; &lt;p&gt;The &lt;code title=attr-media-src&gt;&lt;a href=#attr-media-src&gt;src&lt;/a&gt;&lt;/code&gt;, &lt;code title=attr-media-preload&gt;&lt;a href=#attr-media-preload&gt;preload&lt;/a&gt;&lt;/code&gt;, &lt;code title=attr-media-autoplay&gt;&lt;a href=#attr-media-autoplay&gt;autoplay&lt;/a&gt;&lt;/code&gt;, @@ -25654,12 +25648,12 @@ &lt;div class=impl&gt; - &lt;p&gt;When an &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; element is &lt;a href=#potentially-playing&gt;potentially + &lt;p&gt;When an &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; element is &lt;a href=#potentially-playing&gt;potentially playing&lt;/a&gt;, it must have its audio data played synchronized with the &lt;a href=#current-playback-position&gt;current playback position&lt;/a&gt;, at the element's &lt;a href=#effective-media-volume&gt;effective media volume&lt;/a&gt;.&lt;/p&gt; - &lt;p&gt;When an &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; element is not &lt;a href=#potentially-playing&gt;potentially + &lt;p&gt;When an &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; element is not &lt;a href=#potentially-playing&gt;potentially playing&lt;/a&gt;, audio must not play for the element.&lt;/p&gt; &lt;/div&gt; @@ -25668,7 +25662,7 @@ &lt;dd&gt; - &lt;p&gt;Returns a new &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; element, with the &lt;code title=attr-media-src&gt;&lt;a href=#attr-media-src&gt;src&lt;/a&gt;&lt;/code&gt; attribute set to the value + &lt;p&gt;Returns a new &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; element, with the &lt;code title=attr-media-src&gt;&lt;a href=#attr-media-src&gt;src&lt;/a&gt;&lt;/code&gt; attribute set to the value passed in the argument, if applicable.&lt;/p&gt; &lt;/dd&gt; @@ -25679,7 +25673,7 @@ &lt;code&gt;&lt;a href=#htmlaudioelement&gt;HTMLAudioElement&lt;/a&gt;&lt;/code&gt; objects (in addition to the factory methods from DOM Core such as &lt;code title=&quot;&quot;&gt;createElement()&lt;/code&gt;): &lt;dfn id=dom-audio title=dom-Audio&gt;&lt;code&gt;Audio()&lt;/code&gt;&lt;/dfn&gt; and &lt;dfn id=dom-audio-s title=dom-Audio-s&gt;&lt;code&gt;Audio(&lt;var title=&quot;&quot;&gt;src&lt;/var&gt;)&lt;/code&gt;&lt;/dfn&gt;. When invoked as constructors, these must return a new &lt;code&gt;&lt;a href=#htmlaudioelement&gt;HTMLAudioElement&lt;/a&gt;&lt;/code&gt; object (a new - &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; element). The element must have its &lt;code title=attr-media-preload&gt;&lt;a href=#attr-media-preload&gt;preload&lt;/a&gt;&lt;/code&gt; attribute set to the + &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; element). The element must have its &lt;code title=attr-media-preload&gt;&lt;a href=#attr-media-preload&gt;preload&lt;/a&gt;&lt;/code&gt; attribute set to the literal value &quot;&lt;code title=attr-media-preload-auto&gt;&lt;a href=#attr-media-preload-auto&gt;auto&lt;/a&gt;&lt;/code&gt;&quot;. If the &lt;var title=&quot;&quot;&gt;src&lt;/var&gt; argument is present, the object created must have its &lt;code title=attr-media-src&gt;&lt;a href=#attr-media-src&gt;src&lt;/a&gt;&lt;/code&gt; content attribute set to the provided value, and the user agent must invoke the object's @@ -25758,7 +25752,7 @@ &lt;p class=note&gt;Dynamically modifying a &lt;code&gt;&lt;a href=#the-source-element&gt;source&lt;/a&gt;&lt;/code&gt; element and its attribute when the element is already inserted in a - &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; or &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; element will have no + &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; or &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; element will have no effect. To change what is playing, either just use the &lt;code title=attr-media-src&gt;&lt;a href=#attr-media-src&gt;src&lt;/a&gt;&lt;/code&gt; attribute on the &lt;a href=#media-element&gt;media element&lt;/a&gt; directly, or call the &lt;code title=dom-media-load&gt;&lt;a href=#dom-media-load&gt;load()&lt;/a&gt;&lt;/code&gt; method on the &lt;a href=#media-element&gt;media element&lt;/a&gt; after manipulating the &lt;code&gt;&lt;a href=#the-source-element&gt;source&lt;/a&gt;&lt;/code&gt; @@ -26092,7 +26086,7 @@ &lt;h4 id=media-elements&gt;&lt;span class=secno&gt;4.8.10 &lt;/span&gt;Media elements&lt;/h4&gt; &lt;p&gt;&lt;dfn id=media-element title=&quot;media element&quot;&gt;Media elements&lt;/dfn&gt; - (&lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; and &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt;, in this specification) + (&lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; and &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt;, in this specification) implement the following interface:&lt;/p&gt; &lt;pre class=idl&gt;interface &lt;dfn id=htmlmediaelement&gt;HTMLMediaElement&lt;/dfn&gt; : &lt;a href=#htmlelement&gt;HTMLElement&lt;/a&gt; { @@ -26214,11 +26208,11 @@ element's &lt;code title=dom-media-audioTracks&gt;&lt;a href=#dom-media-audiotracks&gt;audioTracks&lt;/a&gt;&lt;/code&gt; attribute.&lt;/p&gt; - &lt;p class=note&gt;Both &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; and &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; + &lt;p class=note&gt;Both &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; and &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; elements can be used for both audio and video. The main difference - between the two is simply that the &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; element has no + between the two is simply that the &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; element has no playback area for visual content (such as video or captions), - whereas the &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element does.&lt;/p&gt; + whereas the &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element does.&lt;/p&gt; &lt;div class=impl&gt; @@ -26417,7 +26411,7 @@ agent knows it cannot render&lt;/a&gt; or is the type &quot;&lt;code&gt;application/octet-stream&lt;/code&gt;&quot;; it must return &quot;&lt;code title=&quot;&quot;&gt;probably&lt;/code&gt;&quot; if the user agent is confident that the type represents a &lt;a href=#media-resource&gt;media resource&lt;/a&gt; that it can render if - used in with this &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; or &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element; + used in with this &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; or &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element; and it must return &quot;&lt;code title=&quot;&quot;&gt;maybe&lt;/code&gt;&quot; otherwise. Implementors are encouraged to return &quot;&lt;code title=&quot;&quot;&gt;maybe&lt;/code&gt;&quot; unless the type can be confidently established as being supported or @@ -26430,7 +26424,7 @@ &lt;p&gt;This script tests to see if the user agent supports a (fictional) new format to dynamically decide whether to use a - &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element or a plugin:&lt;/p&gt; + &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element or a plugin:&lt;/p&gt; &lt;pre&gt;&lt;section id=&quot;video&quot;&gt; &lt;p&gt;&lt;a href=&quot;playing-cats.nfv&quot;&gt;Download video&lt;/a&gt;&lt;/p&gt; @@ -27061,7 +27055,7 @@ &lt;/li&gt; - &lt;li&gt;&lt;p&gt;For &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; elements, set the &lt;code title=dom-video-videoWidth&gt;&lt;a href=#dom-video-videowidth&gt;videoWidth&lt;/a&gt;&lt;/code&gt; and &lt;code title=dom-video-videoHeight&gt;&lt;a href=#dom-video-videoheight&gt;videoHeight&lt;/a&gt;&lt;/code&gt; + &lt;li&gt;&lt;p&gt;For &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; elements, set the &lt;code title=dom-video-videoWidth&gt;&lt;a href=#dom-video-videowidth&gt;videoWidth&lt;/a&gt;&lt;/code&gt; and &lt;code title=dom-video-videoHeight&gt;&lt;a href=#dom-video-videoheight&gt;videoHeight&lt;/a&gt;&lt;/code&gt; attributes.&lt;/li&gt; &lt;li&gt; @@ -27725,7 +27719,7 @@ &lt;dt&gt;&lt;dfn id=dom-media-have_metadata title=dom-media-HAVE_METADATA&gt;&lt;code&gt;HAVE_METADATA&lt;/code&gt;&lt;/dfn&gt; (numeric value 1)&lt;/dt&gt; &lt;dd&gt;Enough of the resource has been obtained that the duration of - the resource is available. In the case of a &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; + the resource is available. In the case of a &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element, the dimensions of the video are also available. The API will no longer raise an exception when seeking. No &lt;a href=#media-data&gt;media data&lt;/a&gt; is available for the immediate &lt;a href=#current-playback-position&gt;current playback @@ -27791,7 +27785,7 @@ &lt;p class=note&gt;Before this task is run, as part of the event loop mechanism, the rendering will have been updated to resize - the &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element if appropriate.&lt;/p&gt; + the &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element if appropriate.&lt;/p&gt; &lt;/dd&gt; @@ -29746,7 +29740,7 @@ &lt;p&gt;In this example, a sign-languge interpreter track from a movie file is overlaid on the primary video track of that same video file - using two &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; elements, some CSS, and an implicit + using two &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; elements, some CSS, and an implicit &lt;code&gt;&lt;a href=#mediacontroller&gt;MediaController&lt;/a&gt;&lt;/code&gt;:&lt;/p&gt; &lt;pre&gt;&lt;article&gt; @@ -30986,7 +30980,7 @@ &lt;div class=example&gt; - &lt;p&gt;In this example, an &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; element is used to play a + &lt;p&gt;In this example, an &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; element is used to play a specific sound-effect from a sound file containing many sound effects. A cue is used to pause the audio, so that it ends exactly at the end of the clip, even if the browser is busy running some @@ -33240,7 +33234,7 @@ &lt;/ol&gt;&lt;/div&gt; &lt;p&gt;The &lt;dfn id=attr-media-muted title=attr-media-muted&gt;&lt;code&gt;muted&lt;/code&gt;&lt;/dfn&gt; - attribute on the &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element controls the default + attribute on the &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element controls the default state of the audio channel of the &lt;a href=#media-resource&gt;media resource&lt;/a&gt;, potentially overriding user preferences.&lt;/p&gt; @@ -33512,7 +33506,7 @@ &lt;h5 id=security-and-privacy-considerations&gt;&lt;span class=secno&gt;4.8.10.17 &lt;/span&gt;Security and privacy considerations&lt;/h5&gt; &lt;p&gt;The main security and privacy implications of the - &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; and &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; elements come from the + &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; and &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; elements come from the ability to embed media cross-origin. There are two directions that threats can flow: from hostile content to a victim page, and from a hostile page to victim content.&lt;/p&gt; @@ -33526,7 +33520,7 @@ own unrelated &lt;a href=#top-level-browsing-context&gt;top-level browsing context&lt;/a&gt;.&lt;/p&gt; &lt;p class=example&gt;For instance, if an SVG animation was embedded in - a &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element, the user agent would not give it + a &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element, the user agent would not give it access to the DOM of the outer page. From the perspective of scripts in the SVG resource, the SVG file would appear to be in a lone top-level browsing context with no parent.&lt;/p&gt; @@ -34811,7 +34805,7 @@ &lt;code title=&quot;&quot;&gt;repeat&lt;/code&gt; is used.&lt;/p&gt; &lt;p&gt;If the first argument isn't an &lt;code&gt;&lt;a href=#the-img-element&gt;img&lt;/a&gt;&lt;/code&gt;, - &lt;code&gt;&lt;a href=#the-canvas-element&gt;canvas&lt;/a&gt;&lt;/code&gt;, or &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element, throws a + &lt;code&gt;&lt;a href=#the-canvas-element&gt;canvas&lt;/a&gt;&lt;/code&gt;, or &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element, throws a &lt;code&gt;&lt;a href=#type_mismatch_err&gt;TYPE_MISMATCH_ERR&lt;/a&gt;&lt;/code&gt; exception. If the image has no image data, throws an &lt;code&gt;&lt;a href=#invalid_state_err&gt;INVALID_STATE_ERR&lt;/a&gt;&lt;/code&gt; exception. If the second argument isn't one of the allowed values, throws a @@ -36312,7 +36306,7 @@ &lt;p&gt;&lt;img alt=&quot;The sx and sy parameters give the x and y coordinates of the source rectangle; the sw and sh arguments give the width and height of the source rectangle; the dx and dy give the x and y coordinates of the destination rectangle; and the dw and dh arguments give the width and height of the destination rectangle.&quot; height=356 src=<A HREF="http://images.whatwg.org/drawImage.png">http://images.whatwg.org/drawImage.png</A> width=356&gt;&lt;/p&gt; &lt;p&gt;If the first argument isn't an &lt;code&gt;&lt;a href=#the-img-element&gt;img&lt;/a&gt;&lt;/code&gt;, - &lt;code&gt;&lt;a href=#the-canvas-element&gt;canvas&lt;/a&gt;&lt;/code&gt;, or &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element, throws a + &lt;code&gt;&lt;a href=#the-canvas-element&gt;canvas&lt;/a&gt;&lt;/code&gt;, or &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element, throws a &lt;code&gt;&lt;a href=#type_mismatch_err&gt;TYPE_MISMATCH_ERR&lt;/a&gt;&lt;/code&gt; exception. If the image has no image data, throws an &lt;code&gt;&lt;a href=#invalid_state_err&gt;INVALID_STATE_ERR&lt;/a&gt;&lt;/code&gt; exception. If the numeric arguments don't make sense (e.g. the destination is a @@ -37705,7 +37699,7 @@ &lt;p&gt;&lt;span class=impl&gt;&lt;strong&gt;Author requirements&lt;/strong&gt;:&lt;/span&gt; The &lt;dfn id=attr-dim-width title=attr-dim-width&gt;&lt;code&gt;width&lt;/code&gt;&lt;/dfn&gt; and &lt;dfn id=attr-dim-height title=attr-dim-height&gt;&lt;code&gt;height&lt;/code&gt;&lt;/dfn&gt; attributes on &lt;code&gt;&lt;a href=#the-img-element&gt;img&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-iframe-element&gt;iframe&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-embed-element&gt;embed&lt;/a&gt;&lt;/code&gt;, - &lt;code&gt;&lt;a href=#the-object-element&gt;object&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt;, and, when their &lt;code title=attr-input-type&gt;&lt;a href=#attr-input-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute is in the &lt;a href=#image-button-state title=attr-input-type-image&gt;Image Button&lt;/a&gt; state, + &lt;code&gt;&lt;a href=#the-object-element&gt;object&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt;, and, when their &lt;code title=attr-input-type&gt;&lt;a href=#attr-input-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute is in the &lt;a href=#image-button-state title=attr-input-type-image&gt;Image Button&lt;/a&gt; state, &lt;code&gt;&lt;a href=#the-input-element&gt;input&lt;/a&gt;&lt;/code&gt; elements may be specified to give the dimensions of the visual content of the element (the width and height respectively, relative to the nominal direction of the output @@ -37752,12 +37746,12 @@ &lt;p&gt;The &lt;dfn id=dom-dim-width title=dom-dim-width&gt;&lt;code&gt;width&lt;/code&gt;&lt;/dfn&gt; and &lt;dfn id=dom-dim-height title=dom-dim-height&gt;&lt;code&gt;height&lt;/code&gt;&lt;/dfn&gt; IDL attributes on the &lt;code&gt;&lt;a href=#the-iframe-element&gt;iframe&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-embed-element&gt;embed&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-object-element&gt;object&lt;/a&gt;&lt;/code&gt;, - and &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; elements must &lt;a href=#reflect&gt;reflect&lt;/a&gt; the + and &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; elements must &lt;a href=#reflect&gt;reflect&lt;/a&gt; the respective content attributes of the same name.&lt;/p&gt; &lt;p class=note&gt;For &lt;code&gt;&lt;a href=#the-iframe-element&gt;iframe&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-embed-element&gt;embed&lt;/a&gt;&lt;/code&gt;, and &lt;code&gt;&lt;a href=#the-object-element&gt;object&lt;/a&gt;&lt;/code&gt; the IDL attributes are &lt;code&gt;DOMString&lt;/code&gt;; - for &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; the IDL attributes are &lt;code&gt;unsigned + for &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; the IDL attributes are &lt;code&gt;unsigned long&lt;/code&gt;.&lt;/p&gt; &lt;/div&gt; @@ -46539,9 +46533,9 @@ something like &lt;samp&gt;The text you have entered does not match the required pattern. Birthday&lt;/samp&gt;, which is not useful.&lt;/p&gt; - &lt;p&gt;UAs may still show the &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt; in non-error situations + &lt;p&gt;UAs may still show the &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt; in non-error situations (for example, as a tooltip when hovering over the control), so - authors should be careful not to word &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt;s as if an + authors should be careful not to word &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt;s as if an error has necessarily occurred.&lt;/p&gt; @@ -51522,7 +51516,7 @@ - &lt;h4 id=the-command&gt;&lt;span class=secno&gt;4.11.3 &lt;/span&gt;The &lt;dfn&gt;&lt;code&gt;command&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; + &lt;h4 id=the-command-element&gt;&lt;span class=secno&gt;4.11.3 &lt;/span&gt;The &lt;dfn id=the-command&gt;&lt;code&gt;command&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; &lt;dl class=element&gt;&lt;dt&gt;Categories&lt;/dt&gt; &lt;dd&gt;&lt;a href=#metadata-content&gt;Metadata content&lt;/a&gt;.&lt;/dd&gt; @@ -51555,11 +51549,11 @@ attribute boolean &lt;span title=&quot;dom-command-default&quot;&gt;default&lt;/span&gt;;--&gt; };&lt;/pre&gt; &lt;/dd&gt; - &lt;/dl&gt;&lt;p&gt;The &lt;code&gt;&lt;a href=#the-command&gt;command&lt;/a&gt;&lt;/code&gt; element represents a command that the user + &lt;/dl&gt;&lt;p&gt;The &lt;code&gt;&lt;a href=#the-command-element&gt;command&lt;/a&gt;&lt;/code&gt; element represents a command that the user can invoke.&lt;/p&gt; &lt;p&gt;A command can be part of a context menu or toolbar, using the - &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; element, or can be put anywhere else in the page, + &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; element, or can be put anywhere else in the page, to define a keyboard shortcut.&lt;/p&gt; &lt;!-- in the future we'll also add a command=&quot;&quot; attribute to refer to a command, which can then be defined anywhere --&gt; @@ -51693,7 +51687,7 @@ &lt;dd&gt;&lt;p&gt;If the element has a parent, then the UA must walk the list of child nodes of that parent element, and for each node that is a - &lt;code&gt;&lt;a href=#the-command&gt;command&lt;/a&gt;&lt;/code&gt; element, if that element has a &lt;code title=attr-command-radiogroup&gt;&lt;a href=#attr-command-radiogroup&gt;radiogroup&lt;/a&gt;&lt;/code&gt; attribute whose + &lt;code&gt;&lt;a href=#the-command-element&gt;command&lt;/a&gt;&lt;/code&gt; element, if that element has a &lt;code title=attr-command-radiogroup&gt;&lt;a href=#attr-command-radiogroup&gt;radiogroup&lt;/a&gt;&lt;/code&gt; attribute whose value exactly matches the current element's (treating missing &lt;code title=attr-command-radiogroup&gt;&lt;a href=#attr-command-radiogroup&gt;radiogroup&lt;/a&gt;&lt;/code&gt; attributes as if they were the empty string), and has a &lt;code title=attr-command-checked&gt;&lt;a href=#attr-command-checked&gt;checked&lt;/a&gt;&lt;/code&gt; attribute, must remove that attribute.&lt;/p&gt; @@ -51719,8 +51713,8 @@ &lt;/div&gt; - &lt;p class=note&gt;&lt;code&gt;&lt;a href=#the-command&gt;command&lt;/a&gt;&lt;/code&gt; elements are not rendered - unless they &lt;a href=#menus title=menu&gt;form part of a menu&lt;/a&gt;.&lt;/p&gt; + &lt;p class=note&gt;&lt;code&gt;&lt;a href=#the-command-element&gt;command&lt;/a&gt;&lt;/code&gt; elements are not rendered + unless they &lt;a href=#the-menu-element title=menu&gt;form part of a menu&lt;/a&gt;.&lt;/p&gt; &lt;div class=example&gt; @@ -51746,7 +51740,7 @@ - &lt;h4 id=menus&gt;&lt;span class=secno&gt;4.11.4 &lt;/span&gt;The &lt;dfn&gt;&lt;code&gt;menu&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; + &lt;h4 id=the-menu-element&gt;&lt;span class=secno&gt;4.11.4 &lt;/span&gt;The &lt;dfn id=menus&gt;&lt;code&gt;menu&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; &lt;dl class=element&gt;&lt;dt&gt;Categories&lt;/dt&gt; &lt;dd&gt;&lt;a href=#flow-content&gt;Flow content&lt;/a&gt;.&lt;/dd&gt; @@ -51766,7 +51760,7 @@ attribute DOMString &lt;a href=#dom-menu-type title=dom-menu-type&gt;type&lt;/a&gt;; attribute DOMString &lt;a href=#dom-menu-label title=dom-menu-label&gt;label&lt;/a&gt;; };&lt;/pre&gt; - &lt;/dl&gt;&lt;p&gt;The &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; element represents a list of commands.&lt;/p&gt; + &lt;/dl&gt;&lt;p&gt;The &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; element represents a list of commands.&lt;/p&gt; &lt;!-- v2 idea: &lt;menu&gt; should get an icon, like &lt;command&gt; --&gt; @@ -51782,16 +51776,16 @@ a list of commands that is neither declaring a context menu nor defining a toolbar.&lt;/p&gt; - &lt;p&gt;If a &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; element's &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute is in the &lt;a href=#context-menu-state title=&quot;context menu state&quot;&gt;context menu&lt;/a&gt; state, then the + &lt;p&gt;If a &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; element's &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute is in the &lt;a href=#context-menu-state title=&quot;context menu state&quot;&gt;context menu&lt;/a&gt; state, then the element &lt;a href=#represents&gt;represents&lt;/a&gt; the commands of a context menu, and the user can only interact with the commands if that context menu is activated.&lt;/p&gt; - &lt;p&gt;If a &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; element's &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute is in the &lt;a href=#toolbar-state title=&quot;toolbar state&quot;&gt;toolbar&lt;/a&gt; state, then the element + &lt;p&gt;If a &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; element's &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute is in the &lt;a href=#toolbar-state title=&quot;toolbar state&quot;&gt;toolbar&lt;/a&gt; state, then the element &lt;a href=#represents&gt;represents&lt;/a&gt; a list of active commands that the user can immediately interact with.&lt;/p&gt; - &lt;p&gt;If a &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; element's &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute is in the &lt;a href=#list-state title=&quot;list state&quot;&gt;list&lt;/a&gt; state, then the element either + &lt;p&gt;If a &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; element's &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute is in the &lt;a href=#list-state title=&quot;list state&quot;&gt;list&lt;/a&gt; state, then the element either &lt;a href=#represents&gt;represents&lt;/a&gt; an unordered list of items (each represented by an &lt;code&gt;&lt;a href=#the-li-element&gt;li&lt;/a&gt;&lt;/code&gt; element), each of which represents a command that the user can perform or activate, or, if the element has no @@ -51818,7 +51812,7 @@ &lt;p&gt;&lt;i&gt;This section is non-normative.&lt;/i&gt;&lt;/p&gt; - &lt;p&gt;The &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; element is used to define context menus and + &lt;p&gt;The &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; element is used to define context menus and toolbars.&lt;/p&gt; &lt;p&gt;For example, the following represents a toolbar with three menu @@ -51882,7 +51876,7 @@ above, but here the legacy behavior consists of a single &lt;code&gt;&lt;a href=#the-select-element&gt;select&lt;/a&gt;&lt;/code&gt; element with a submit button. The submit button doesn't appear in the toolbar, because it is not a direct child of - the &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; element or of its &lt;code&gt;&lt;a href=#the-li-element&gt;li&lt;/a&gt;&lt;/code&gt; + the &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; element or of its &lt;code&gt;&lt;a href=#the-li-element&gt;li&lt;/a&gt;&lt;/code&gt; children.&lt;/p&gt; @@ -51897,7 +51891,7 @@ &lt;ul class=brief&gt;&lt;li&gt;&lt;a href=#concept-command title=concept-command&gt;Commands&lt;/a&gt;, which can be marked as default commands&lt;/li&gt; &lt;li&gt;Separators&lt;/li&gt; &lt;li&gt;Other menus (which allows the list to be nested)&lt;/li&gt; - &lt;/ul&gt;&lt;p&gt;The list corresponding to a particular &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; element + &lt;/ul&gt;&lt;p&gt;The list corresponding to a particular &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; element is built by iterating over its child nodes. For each child node in &lt;a href=#tree-order&gt;tree order&lt;/a&gt;, the required behavior depends on what the node is, as follows:&lt;/p&gt; @@ -51933,17 +51927,17 @@ &lt;dd&gt;Iterate over the children of the element.&lt;/dd&gt; - &lt;dt&gt;A &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; element with no &lt;code title=attr-menu-label&gt;&lt;a href=#attr-menu-label&gt;label&lt;/a&gt;&lt;/code&gt; attribute&lt;/dt&gt; + &lt;dt&gt;A &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; element with no &lt;code title=attr-menu-label&gt;&lt;a href=#attr-menu-label&gt;label&lt;/a&gt;&lt;/code&gt; attribute&lt;/dt&gt; &lt;dt&gt;A &lt;code&gt;&lt;a href=#the-select-element&gt;select&lt;/a&gt;&lt;/code&gt; element&lt;/dt&gt; &lt;dd&gt;Append a separator to the menu, then iterate over the children - of the &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; or &lt;code&gt;&lt;a href=#the-select-element&gt;select&lt;/a&gt;&lt;/code&gt; element, then + of the &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; or &lt;code&gt;&lt;a href=#the-select-element&gt;select&lt;/a&gt;&lt;/code&gt; element, then append another separator.&lt;/dd&gt; &lt;!-- v2: we might want to support &lt;select&gt; in &lt;label&gt; as giving a named submenu --&gt; - &lt;dt&gt;A &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-menu-label&gt;&lt;a href=#attr-menu-label&gt;label&lt;/a&gt;&lt;/code&gt; attribute&lt;/dt&gt; + &lt;dt&gt;A &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-menu-label&gt;&lt;a href=#attr-menu-label&gt;label&lt;/a&gt;&lt;/code&gt; attribute&lt;/dt&gt; &lt;dt&gt;An &lt;code&gt;&lt;a href=#the-optgroup-element&gt;optgroup&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-menu-label&gt;&lt;a href=#attr-menu-label&gt;label&lt;/a&gt;&lt;/code&gt; attribute&lt;/dt&gt; &lt;dd&gt;Append a submenu to the menu, using the value of the element's @@ -51978,11 +51972,11 @@ &lt;p&gt;The &lt;dfn id=attr-contextmenu title=attr-contextmenu&gt;&lt;code&gt;contextmenu&lt;/code&gt;&lt;/dfn&gt; attribute gives the element's &lt;a href=#context-menus title=&quot;context menus&quot;&gt;context - menu&lt;/a&gt;. The value must be the &lt;a href=#concept-id title=concept-id&gt;ID&lt;/a&gt; of a &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; element + menu&lt;/a&gt;. The value must be the &lt;a href=#concept-id title=concept-id&gt;ID&lt;/a&gt; of a &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; element in the DOM. &lt;span class=impl&gt;If the node that would be obtained by the invoking the &lt;code title=dom-Document-getElementById&gt;&lt;a href=#dom-document-getelementbyid&gt;getElementById()&lt;/a&gt;&lt;/code&gt; method using the attribute's value as the only argument is null or not a - &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; element, then the element has no assigned context + &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; element, then the element has no assigned context menu. Otherwise, the element's assigned context menu is the element so identified.&lt;/span&gt;&lt;/p&gt; @@ -52023,13 +52017,13 @@ &lt;p&gt;If the element or one of its ancestors &lt;em&gt;does&lt;/em&gt; have a context menu assigned, then the user agent must &lt;a href=#fire-a-simple-event&gt;fire a simple event&lt;/a&gt; named &lt;code title=event-show&gt;show&lt;/code&gt; at the - &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; element of the context menu of the nearest + &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; element of the context menu of the nearest ancestor (including the element itself) with one assigned.&lt;/p&gt; &lt;!-- v2: include modifier key information --&gt; &lt;p&gt;The default action of &lt;em&gt;this&lt;/em&gt; event is that the user agent must show a context menu &lt;a href=#building-menus-and-toolbars title=&quot;building menus and - toolbars&quot;&gt;built&lt;/a&gt; from the &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; element.&lt;/p&gt; + toolbars&quot;&gt;built&lt;/a&gt; from the &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; element.&lt;/p&gt; &lt;p&gt;The user agent may also provide access to its default context menu, if any, with the context menu shown. For example, it could @@ -52083,13 +52077,13 @@ &lt;h5 id=toolbars&gt;&lt;span class=secno&gt;4.11.4.4 &lt;/span&gt;&lt;dfn&gt;Toolbars&lt;/dfn&gt;&lt;/h5&gt; - &lt;p&gt;When a &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; element has a &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute in the &lt;a href=#toolbar-state title=&quot;toolbar state&quot;&gt;toolbar&lt;/a&gt; state, then the user agent + &lt;p&gt;When a &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; element has a &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute in the &lt;a href=#toolbar-state title=&quot;toolbar state&quot;&gt;toolbar&lt;/a&gt; state, then the user agent must &lt;a href=#building-menus-and-toolbars title=&quot;building menus and toolbars&quot;&gt;build&lt;/a&gt; the - menu for that &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; element, and use the result in the + menu for that &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; element, and use the result in the rendering.&lt;/p&gt; &lt;p&gt;The user agent must reflect changes made to the - &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt;'s DOM, by immediately &lt;a href=#building-menus-and-toolbars title=&quot;building menus + &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt;'s DOM, by immediately &lt;a href=#building-menus-and-toolbars title=&quot;building menus and toolbars&quot;&gt;rebuilding&lt;/a&gt; the menu.&lt;/p&gt; &lt;/div&gt; @@ -52289,7 +52283,7 @@ not specify an icon, or if the element does not define a command, then the attribute must return null. This attribute will be shadowed by the &lt;code title=dom-command-icon&gt;&lt;a href=#dom-command-icon&gt;icon&lt;/a&gt;&lt;/code&gt; IDL attribute on - &lt;code&gt;&lt;a href=#the-command&gt;command&lt;/a&gt;&lt;/code&gt; elements.&lt;/p&gt; + &lt;code&gt;&lt;a href=#the-command-element&gt;command&lt;/a&gt;&lt;/code&gt; elements.&lt;/p&gt; &lt;p&gt;The &lt;dfn id=dom-command-ro-disabled title=dom-command-ro-disabled&gt;&lt;code&gt;disabled&lt;/code&gt;&lt;/dfn&gt; attribute must return true if the command's &lt;a href=#command-facet-disabledstate title=command-facet-DisabledState&gt;Disabled State&lt;/a&gt; is that @@ -52303,7 +52297,7 @@ command is checked, and false if it is that the command is not checked. If the element does not define a command, the attribute must return false. This attribute will be shadowed by the &lt;code title=&quot;&quot;&gt;checked&lt;/code&gt; IDL attribute on &lt;code&gt;&lt;a href=#the-input-element&gt;input&lt;/a&gt;&lt;/code&gt; and - &lt;code&gt;&lt;a href=#the-command&gt;command&lt;/a&gt;&lt;/code&gt; elements.&lt;/p&gt; + &lt;code&gt;&lt;a href=#the-command-element&gt;command&lt;/a&gt;&lt;/code&gt; elements.&lt;/p&gt; &lt;!--v2COMMAND &lt;p&gt;The &lt;dfn @@ -52533,10 +52527,10 @@ &lt;h5 id=using-the-command-element-to-define-a-command&gt;&lt;span class=secno&gt;4.11.5.5 &lt;/span&gt;Using the &lt;dfn title=command-element&gt;&lt;code&gt;command&lt;/code&gt;&lt;/dfn&gt; element to define a command&lt;/h5&gt; - &lt;p&gt;A &lt;code&gt;&lt;a href=#the-command&gt;command&lt;/a&gt;&lt;/code&gt; element &lt;a href=#concept-command title=concept-command&gt;defines a command&lt;/a&gt;.&lt;/p&gt; + &lt;p&gt;A &lt;code&gt;&lt;a href=#the-command-element&gt;command&lt;/a&gt;&lt;/code&gt; element &lt;a href=#concept-command title=concept-command&gt;defines a command&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;The &lt;a href=#command-facet-type title=command-facet-Type&gt;Type&lt;/a&gt; of the command - is &quot;radio&quot; if the &lt;code&gt;&lt;a href=#the-command&gt;command&lt;/a&gt;&lt;/code&gt;'s &lt;code title=attr-command-type&gt;&lt;a href=#attr-command-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute is + is &quot;radio&quot; if the &lt;code&gt;&lt;a href=#the-command-element&gt;command&lt;/a&gt;&lt;/code&gt;'s &lt;code title=attr-command-type&gt;&lt;a href=#attr-command-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute is &quot;&lt;code&gt;radio&lt;/code&gt;&quot;, &quot;checkbox&quot; if the attribute's value is &quot;&lt;code&gt;checkbox&lt;/code&gt;&quot;, and &quot;command&quot; otherwise.&lt;/p&gt; @@ -54518,7 +54512,7 @@ &lt;li&gt;&lt;code&gt;&lt;a href=#the-input-element&gt;input&lt;/a&gt;&lt;/code&gt; elements whose &lt;code title=attr-input-type&gt;&lt;a href=#attr-input-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute is in the &lt;a href=#submit-button-state title=attr-input-type-submit&gt;Submit Button&lt;/a&gt;, &lt;a href=#image-button-state title=attr-input-type-image&gt;Image Button&lt;/a&gt;, &lt;a href=#reset-button-state title=attr-input-type-reset&gt;Reset Button&lt;/a&gt;, or &lt;a href=#button-state title=attr-input-type-button&gt;Button&lt;/a&gt; state&lt;/li&gt; - &lt;li&gt;&lt;code&gt;&lt;a href=#the-command&gt;command&lt;/a&gt;&lt;/code&gt; elements that do not have a &lt;code title=attr-command-disabled&gt;&lt;a href=#attr-command-disabled&gt;disabled&lt;/a&gt;&lt;/code&gt; attribute&lt;/li&gt; + &lt;li&gt;&lt;code&gt;&lt;a href=#the-command-element&gt;command&lt;/a&gt;&lt;/code&gt; elements that do not have a &lt;code title=attr-command-disabled&gt;&lt;a href=#attr-command-disabled&gt;disabled&lt;/a&gt;&lt;/code&gt; attribute&lt;/li&gt; &lt;li&gt;elements that are &lt;a href=#specially-focusable&gt;specially focusable&lt;/a&gt;&lt;/li&gt; @@ -54577,10 +54571,10 @@ &lt;li&gt;&lt;code&gt;&lt;a href=#the-option-element&gt;option&lt;/a&gt;&lt;/code&gt; elements that are not &lt;a href=#concept-option-disabled title=concept-option-disabled&gt;disabled&lt;/a&gt;&lt;/li&gt; - &lt;li&gt;&lt;code&gt;&lt;a href=#the-command&gt;command&lt;/a&gt;&lt;/code&gt; elements that do not have a &lt;code title=attr-command-disabled&gt;&lt;a href=#attr-command-disabled&gt;disabled&lt;/a&gt;&lt;/code&gt; attribute&lt;/li&gt; + &lt;li&gt;&lt;code&gt;&lt;a href=#the-command-element&gt;command&lt;/a&gt;&lt;/code&gt; elements that do not have a &lt;code title=attr-command-disabled&gt;&lt;a href=#attr-command-disabled&gt;disabled&lt;/a&gt;&lt;/code&gt; attribute&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-li-element&gt;li&lt;/a&gt;&lt;/code&gt; elements that are children of - &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; elements, and that have a child element that + &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; elements, and that have a child element that defines a &lt;a href=#concept-command title=concept-command&gt;command&lt;/a&gt;, if the first such element's &lt;a href=#command-facet-disabledstate title=command-facet-disabledstate&gt;Disabled State&lt;/a&gt; facet is false (not disabled)&lt;/li&gt; @@ -54610,10 +54604,10 @@ &lt;li&gt;&lt;code&gt;&lt;a href=#the-option-element&gt;option&lt;/a&gt;&lt;/code&gt; elements that are &lt;a href=#concept-option-disabled title=concept-option-disabled&gt;disabled&lt;/a&gt;&lt;/li&gt; - &lt;li&gt;&lt;code&gt;&lt;a href=#the-command&gt;command&lt;/a&gt;&lt;/code&gt; elements that have a &lt;code title=attr-command-disabled&gt;&lt;a href=#attr-command-disabled&gt;disabled&lt;/a&gt;&lt;/code&gt; attribute&lt;/li&gt; + &lt;li&gt;&lt;code&gt;&lt;a href=#the-command-element&gt;command&lt;/a&gt;&lt;/code&gt; elements that have a &lt;code title=attr-command-disabled&gt;&lt;a href=#attr-command-disabled&gt;disabled&lt;/a&gt;&lt;/code&gt; attribute&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-li-element&gt;li&lt;/a&gt;&lt;/code&gt; elements that are children of - &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; elements, and that have a child element that + &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; elements, and that have a child element that defines a &lt;a href=#concept-command title=concept-command&gt;command&lt;/a&gt;, if the first such element's &lt;a href=#command-facet-disabledstate title=command-facet-disabledstate&gt;Disabled State&lt;/a&gt; facet is true (disabled)&lt;/li&gt; @@ -54642,11 +54636,11 @@ &lt;li&gt;&lt;code&gt;&lt;a href=#the-option-element&gt;option&lt;/a&gt;&lt;/code&gt; elements whose &lt;a href=#concept-option-selectedness title=concept-option-selectedness&gt;selectedness&lt;/a&gt; is true&lt;/li&gt; - &lt;li&gt;&lt;code&gt;&lt;a href=#the-command&gt;command&lt;/a&gt;&lt;/code&gt; elements whose &lt;code title=attr-command-type&gt;&lt;a href=#attr-command-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute is in the &lt;a href=#attr-command-type-state-checkbox title=attr-command-type-state-checkbox&gt;Checkbox&lt;/a&gt; state + &lt;li&gt;&lt;code&gt;&lt;a href=#the-command-element&gt;command&lt;/a&gt;&lt;/code&gt; elements whose &lt;code title=attr-command-type&gt;&lt;a href=#attr-command-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute is in the &lt;a href=#attr-command-type-state-checkbox title=attr-command-type-state-checkbox&gt;Checkbox&lt;/a&gt; state and that have a &lt;code title=attr-command-checked&gt;&lt;a href=#attr-command-checked&gt;checked&lt;/a&gt;&lt;/code&gt; attribute&lt;/li&gt; - &lt;li&gt;&lt;code&gt;&lt;a href=#the-command&gt;command&lt;/a&gt;&lt;/code&gt; elements whose &lt;code title=attr-command-type&gt;&lt;a href=#attr-command-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute is in the &lt;a href=#attr-command-type-state-radio title=attr-command-type-state-radio&gt;Radio&lt;/a&gt; state and that + &lt;li&gt;&lt;code&gt;&lt;a href=#the-command-element&gt;command&lt;/a&gt;&lt;/code&gt; elements whose &lt;code title=attr-command-type&gt;&lt;a href=#attr-command-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute is in the &lt;a href=#attr-command-type-state-radio title=attr-command-type-state-radio&gt;Radio&lt;/a&gt; state and that have a &lt;code title=attr-command-checked&gt;&lt;a href=#attr-command-checked&gt;checked&lt;/a&gt;&lt;/code&gt; attribute&lt;/li&gt; @@ -55621,15 +55615,15 @@ created by the element.&lt;/dd&gt; - &lt;dt&gt;If the element is a &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element&lt;/dt&gt; + &lt;dt&gt;If the element is a &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element&lt;/dt&gt; &lt;dd&gt;&lt;p&gt;The value is the value of the element's &lt;code title=attr-content&gt;content&lt;/code&gt; attribute, if any, or the empty string if there is no such attribute.&lt;/dd&gt; - &lt;dt&gt;If the element is an &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-embed-element&gt;embed&lt;/a&gt;&lt;/code&gt;, + &lt;dt&gt;If the element is an &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-embed-element&gt;embed&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-iframe-element&gt;iframe&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-img-element&gt;img&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-source-element&gt;source&lt;/a&gt;&lt;/code&gt;, - &lt;code&gt;&lt;a href=#the-track-element&gt;track&lt;/a&gt;&lt;/code&gt;, or &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element&lt;/dt&gt; + &lt;code&gt;&lt;a href=#the-track-element&gt;track&lt;/a&gt;&lt;/code&gt;, or &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element&lt;/dt&gt; &lt;dd&gt;&lt;p&gt;The value is the &lt;a href=#absolute-url&gt;absolute URL&lt;/a&gt; that results from &lt;a href=#resolve-a-url title=&quot;resolve a url&quot;&gt;resolving&lt;/a&gt; the value of the @@ -55671,10 +55665,10 @@ &lt;code&gt;&lt;a href=#textcontent&gt;textContent&lt;/a&gt;&lt;/code&gt;.&lt;/dd&gt; &lt;/dl&gt;&lt;p&gt;The &lt;dfn id=url-property-elements&gt;URL property elements&lt;/dfn&gt; are the &lt;code&gt;&lt;a href=#the-a-element&gt;a&lt;/a&gt;&lt;/code&gt;, - &lt;code&gt;&lt;a href=#the-area-element&gt;area&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-embed-element&gt;embed&lt;/a&gt;&lt;/code&gt;, + &lt;code&gt;&lt;a href=#the-area-element&gt;area&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-embed-element&gt;embed&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-iframe-element&gt;iframe&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-img-element&gt;img&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-link-element&gt;link&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-object-element&gt;object&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-source-element&gt;source&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-track-element&gt;track&lt;/a&gt;&lt;/code&gt;, and - &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; elements.&lt;/p&gt; + &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; elements.&lt;/p&gt; &lt;p&gt;If a property's &lt;a href=#concept-property-value title=concept-property-value&gt;value&lt;/a&gt; is an &lt;a href=#absolute-url&gt;absolute URL&lt;/a&gt;, the property must be specified @@ -55932,15 +55926,15 @@ setting.&lt;/p&gt; - &lt;dt&gt;If the element is a &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element&lt;/dt&gt; + &lt;dt&gt;If the element is a &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element&lt;/dt&gt; &lt;dd&gt;&lt;p&gt;The attribute must act as it would if it was &lt;a href=#reflect title=reflect&gt;reflecting&lt;/a&gt; the element's &lt;code title=attr-meta-content&gt;&lt;a href=#attr-meta-content&gt;content&lt;/a&gt;&lt;/code&gt; content attribute.&lt;/dd&gt; - &lt;dt&gt;If the element is an &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-embed-element&gt;embed&lt;/a&gt;&lt;/code&gt;, + &lt;dt&gt;If the element is an &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-embed-element&gt;embed&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-iframe-element&gt;iframe&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-img-element&gt;img&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-source-element&gt;source&lt;/a&gt;&lt;/code&gt;, - &lt;code&gt;&lt;a href=#the-track-element&gt;track&lt;/a&gt;&lt;/code&gt;, or &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element&lt;/dt&gt; + &lt;code&gt;&lt;a href=#the-track-element&gt;track&lt;/a&gt;&lt;/code&gt;, or &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element&lt;/dt&gt; &lt;dd&gt;&lt;p&gt;The attribute must act as it would if it was &lt;a href=#reflect title=reflect&gt;reflecting&lt;/a&gt; the element's &lt;code title=&quot;&quot;&gt;src&lt;/code&gt; content attribute.&lt;/dd&gt; @@ -57116,10 +57110,10 @@ text string&lt;/a&gt; that is &lt;a href=&quot;#the-document's-current-address&quot;&gt;the document's current address&lt;/a&gt; as the value to &lt;var title=&quot;&quot;&gt;output&lt;/var&gt;.&lt;/li&gt; - &lt;li&gt;&lt;p&gt;If &lt;a href=#the-title-element&gt;the &lt;code&gt;title&lt;/code&gt; element&lt;/a&gt; is not null, + &lt;li&gt;&lt;p&gt;If &lt;a href=#the-title-element-0&gt;the &lt;code&gt;title&lt;/code&gt; element&lt;/a&gt; is not null, &lt;a href=#add-a-vcard-line&gt;add a vCard line&lt;/a&gt; with the type &quot;&lt;code title=&quot;&quot;&gt;NAME&lt;/code&gt;&quot; and with the result of &lt;a href=#escaping-the-vcard-text-string&gt;escaping the vCard text string&lt;/a&gt; obtained from the &lt;code&gt;&lt;a href=#textcontent&gt;textContent&lt;/a&gt;&lt;/code&gt; - of &lt;a href=#the-title-element&gt;the &lt;code&gt;title&lt;/code&gt; element&lt;/a&gt; as the value to &lt;var title=&quot;&quot;&gt;output&lt;/var&gt;.&lt;/li&gt; + of &lt;a href=#the-title-element-0&gt;the &lt;code&gt;title&lt;/code&gt; element&lt;/a&gt; as the value to &lt;var title=&quot;&quot;&gt;output&lt;/var&gt;.&lt;/li&gt; &lt;li&gt;&lt;p&gt;If &lt;var title=&quot;&quot;&gt;node&lt;/var&gt; has a &lt;a href=#global-identifier&gt;global identifier&lt;/a&gt;, &lt;a href=#add-a-vcard-line&gt;add a vCard line&lt;/a&gt; with the type @@ -58632,12 +58626,12 @@ &lt;ol&gt;&lt;li&gt; - &lt;p&gt;If &lt;a href=#the-title-element&gt;the &lt;code&gt;title&lt;/code&gt; element&lt;/a&gt; is not null, + &lt;p&gt;If &lt;a href=#the-title-element-0&gt;the &lt;code&gt;title&lt;/code&gt; element&lt;/a&gt; is not null, then generate the following triple:&lt;/p&gt; &lt;dl class=triple&gt;&lt;dt&gt;subject &lt;dd&gt; &lt;a href=&quot;#the-document's-current-address&quot;&gt;the document's current address&lt;/a&gt; &lt;dt&gt;predicate &lt;dd&gt; &lt;code title=&quot;&quot;&gt;<A HREF="http://purl.org/dc/terms/title&lt;/code">http://purl.org/dc/terms/title&lt;/code</A>&gt; - &lt;dt&gt;object &lt;dd&gt; the concatenation of the data of all the child &lt;a href=#text-node title=&quot;text node&quot;&gt;text nodes&lt;/a&gt; of &lt;a href=#the-title-element&gt;the &lt;code&gt;title&lt;/code&gt; element&lt;/a&gt;, in &lt;a href=#tree-order&gt;tree order&lt;/a&gt;, as a plain literal, with the language information set from the &lt;a href=#language&gt;language&lt;/a&gt; of &lt;a href=#the-title-element&gt;the &lt;code&gt;title&lt;/code&gt; element&lt;/a&gt;, if it is not unknown. + &lt;dt&gt;object &lt;dd&gt; the concatenation of the data of all the child &lt;a href=#text-node title=&quot;text node&quot;&gt;text nodes&lt;/a&gt; of &lt;a href=#the-title-element-0&gt;the &lt;code&gt;title&lt;/code&gt; element&lt;/a&gt;, in &lt;a href=#tree-order&gt;tree order&lt;/a&gt;, as a plain literal, with the language information set from the &lt;a href=#language&gt;language&lt;/a&gt; of &lt;a href=#the-title-element-0&gt;the &lt;code&gt;title&lt;/code&gt; element&lt;/a&gt;, if it is not unknown. &lt;/dl&gt;&lt;/li&gt; @@ -58692,7 +58686,7 @@ &lt;li&gt; - &lt;p&gt;For each &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element in the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt; + &lt;p&gt;For each &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element in the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt; that has a &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; attribute and a &lt;code title=attr-meta-content&gt;&lt;a href=#attr-meta-content&gt;content&lt;/a&gt;&lt;/code&gt; attribute, if the value of the &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; attribute @@ -58702,7 +58696,7 @@ &lt;dl class=triple&gt;&lt;dt&gt;subject &lt;dd&gt; &lt;a href=&quot;#the-document's-current-address&quot;&gt;the document's current address&lt;/a&gt; &lt;dt&gt;predicate &lt;dd&gt; the concatenation of the string &quot;&lt;code title=&quot;&quot;&gt;<A HREF="http://www.w3.org/1999/xhtml/vocab#&lt;/code">http://www.w3.org/1999/xhtml/vocab#&lt;/code</A>&gt;&quot; and the value of the element's &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; attribute, &lt;a href=#converted-to-ascii-lowercase&gt;converted to ASCII lowercase&lt;/a&gt;, with any characters in the value that are not valid in the &lt;ifragment&gt; production of the IRI syntax being %-escaped &lt;a href=#refsRFC3987&gt;[RFC3987]&lt;/a&gt; &lt;dt&gt;object &lt;dd&gt; the value of the element's &lt;code title=attr-meta-content&gt;&lt;a href=#attr-meta-content&gt;content&lt;/a&gt;&lt;/code&gt; attribute, as a plain literal, with the language information set from the &lt;a href=#language&gt;language&lt;/a&gt; of the element, if it is not unknown - &lt;/dl&gt;&lt;p&gt;For each &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element in the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt; + &lt;/dl&gt;&lt;p&gt;For each &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element in the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt; that has a &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; attribute and a &lt;code title=attr-meta-content&gt;&lt;a href=#attr-meta-content&gt;content&lt;/a&gt;&lt;/code&gt; attribute, if the value of the &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; attribute is @@ -59052,7 +59046,7 @@ &lt;li&gt; - &lt;p&gt;For each &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; attribute and a &lt;code title=attr-meta-content&gt;&lt;a href=#attr-meta-content&gt;content&lt;/a&gt;&lt;/code&gt; attribute and whose &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; attribute's value is &lt;code title=meta-author&gt;&lt;a href=#meta-author&gt;author&lt;/a&gt;&lt;/code&gt;, run the following substeps:&lt;/p&gt; + &lt;p&gt;For each &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; attribute and a &lt;code title=attr-meta-content&gt;&lt;a href=#attr-meta-content&gt;content&lt;/a&gt;&lt;/code&gt; attribute and whose &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; attribute's value is &lt;code title=meta-author&gt;&lt;a href=#meta-author&gt;author&lt;/a&gt;&lt;/code&gt;, run the following substeps:&lt;/p&gt; &lt;ol&gt;&lt;li&gt;&lt;p&gt;Append an &lt;code title=&quot;&quot;&gt;author&lt;/code&gt; element in the &lt;a href=#atom-namespace&gt;Atom namespace&lt;/a&gt; to the root element of &lt;var title=&quot;&quot;&gt;R&lt;/var&gt;.&lt;/li&gt; @@ -59062,7 +59056,7 @@ previous step.&lt;/p&gt; &lt;li&gt;&lt;p&gt;Append a text node whose data is the value of the - &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element's &lt;code title=attr-meta-content&gt;&lt;a href=#attr-meta-content&gt;content&lt;/a&gt;&lt;/code&gt; attribute to the element + &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element's &lt;code title=attr-meta-content&gt;&lt;a href=#attr-meta-content&gt;content&lt;/a&gt;&lt;/code&gt; attribute to the element created in the previous step.&lt;/li&gt; &lt;/ol&gt;&lt;!-- could use vCards instead, and get &lt;atom:email&gt; and &lt;atom:uri&gt; @@ -59145,7 +59139,7 @@ &lt;dd&gt; &lt;p&gt;Let &lt;var title=&quot;&quot;&gt;heading content&lt;/var&gt; be the descendants of - &lt;a href=#the-title-element&gt;the &lt;code&gt;title&lt;/code&gt; element&lt;/a&gt;, if there is one, or + &lt;a href=#the-title-element-0&gt;the &lt;code&gt;title&lt;/code&gt; element&lt;/a&gt;, if there is one, or an empty list otherwise.&lt;/p&gt; &lt;/dd&gt; @@ -59681,7 +59675,7 @@ whose &lt;a href=&quot;#the-document's-address&quot; title=&quot;the document's address&quot;&gt;address&lt;/a&gt; is &lt;code&gt;&lt;a href=#about:blank&gt;about:blank&lt;/a&gt;&lt;/code&gt;, which is marked as being an &lt;a href=#html-documents title=&quot;HTML documents&quot;&gt;HTML document&lt;/a&gt;, and whose &lt;a href=&quot;#document's-character-encoding&quot; title=&quot;document's character encoding&quot;&gt;character encoding&lt;/a&gt; is UTF-8. The &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt; must have a single child - &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; node, which itself has a single child + &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; node, which itself has a single child &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt; node.&lt;/p&gt; &lt;p class=note&gt;If the &lt;a href=#browsing-context&gt;browsing context&lt;/a&gt; is created @@ -60991,10 +60985,10 @@ origin&lt;/a&gt; of a script are determined from another resource, called the &lt;i&gt;owner&lt;/i&gt;:&lt;/p&gt; - &lt;dl class=switch&gt;&lt;dt&gt;If a script is in a &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element&lt;/dt&gt; + &lt;dl class=switch&gt;&lt;dt&gt;If a script is in a &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element&lt;/dt&gt; &lt;dd&gt;The owner is the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt; to which the - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element belongs.&lt;/dd&gt; + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element belongs.&lt;/dd&gt; &lt;dt&gt;If a script is in an &lt;a href=#event-handler-content-attributes title=&quot;event handler content @@ -61148,7 +61142,7 @@ &lt;/dd&gt; - &lt;dt&gt;For &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; and &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; elements&lt;/dt&gt; + &lt;dt&gt;For &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; and &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; elements&lt;/dt&gt; &lt;dd&gt; @@ -61463,7 +61457,7 @@ &lt;p class=note&gt;Titles associated with &lt;a href=#session-history-entry title=&quot;session history entry&quot;&gt;session history entries&lt;/a&gt; need not have any relation - with the current &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt; of the + with the current &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt; of the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt;. The title of a &lt;a href=#session-history-entry&gt;session history entry&lt;/a&gt; is intended to explain the state of the document at that point, so that the user can navigate the document's @@ -61921,8 +61915,8 @@ &lt;p&gt;Applications might not use the same title for a &lt;a href=#session-history-entry&gt;session history entry&lt;/a&gt; as the value of the document's - &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt; element at that time. For example, here is a - simple page that shows a block in the &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt; element. + &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt; element at that time. For example, here is a + simple page that shows a block in the &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt; element. Clearly, when navigating backwards to a previous state the user does not go back in time, and therefore it would be inappropriate to put the time in the session history title.&lt;/p&gt; @@ -62800,7 +62794,7 @@ character encoding.&lt;/p&gt; &lt;p&gt;If the root element, as parsed according to the XML - specifications cited above, is found to be an &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; + specifications cited above, is found to be an &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element with an attribute &lt;code title=attr-html-manifest&gt;&lt;a href=#attr-html-manifest&gt;manifest&lt;/a&gt;&lt;/code&gt; whose value is not the empty string, then, as soon as the element is &lt;a href=#insert-an-element-into-a-document title=&quot;insert an element into a document&quot;&gt;inserted into the document&lt;/a&gt;, the user @@ -62887,9 +62881,9 @@ before the page has finished parsing, the user agent must &lt;a href=#update-the-session-history-with-the-new-page&gt;update the session history with the new page&lt;/a&gt;.&lt;/p&gt; - &lt;p&gt;User agents may add content to the &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element of + &lt;p&gt;User agents may add content to the &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element of the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt;, e.g. linking to a style sheet or an XBL - binding, providing script, giving the document a &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt;, + binding, providing script, giving the document a &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt;, etc.&lt;/p&gt; &lt;p class=note&gt;In particular, if the user agent supports the &lt;code title=&quot;&quot;&gt;Format=Flowed&lt;/code&gt; feature of RFC 3676 then the user @@ -62906,9 +62900,9 @@ &lt;p&gt;When an image resource is to be loaded in a &lt;a href=#browsing-context&gt;browsing context&lt;/a&gt;, the user agent should &lt;a href=#create-a-document-object&gt;create a &lt;code&gt;Document&lt;/code&gt; object&lt;/a&gt;, mark it as being an &lt;a href=#html-documents title=&quot;HTML documents&quot;&gt;HTML document&lt;/a&gt;, append an - &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element to the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt;, append a - &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element and a &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt; element to the - &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element, append an &lt;code&gt;&lt;a href=#the-img-element&gt;img&lt;/a&gt;&lt;/code&gt; to the + &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element to the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt;, append a + &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element and a &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt; element to the + &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element, append an &lt;code&gt;&lt;a href=#the-img-element&gt;img&lt;/a&gt;&lt;/code&gt; to the &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt; element, and set the &lt;code title=attr-img-src&gt;&lt;a href=#attr-img-src&gt;src&lt;/a&gt;&lt;/code&gt; attribute of the &lt;code&gt;&lt;a href=#the-img-element&gt;img&lt;/a&gt;&lt;/code&gt; element to the address of the image.&lt;/p&gt; @@ -62927,10 +62921,10 @@ before the page has finished fully loading, the user agent must &lt;a href=#update-the-session-history-with-the-new-page&gt;update the session history with the new page&lt;/a&gt;.&lt;/p&gt; - &lt;p&gt;User agents may add content to the &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element of + &lt;p&gt;User agents may add content to the &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element of the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt;, or attributes to the &lt;code&gt;&lt;a href=#the-img-element&gt;img&lt;/a&gt;&lt;/code&gt; element, e.g. to link to a style sheet or an XBL binding, to provide - a script, to give the document a &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt;, etc.&lt;/p&gt; + a script, to give the document a &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt;, etc.&lt;/p&gt; &lt;h4 id=read-plugin&gt;&lt;span class=secno&gt;6.5.6 &lt;/span&gt;&lt;dfn title=navigate-plugin&gt;Page load processing model for content that uses plugins&lt;/dfn&gt;&lt;/h4&gt; @@ -62939,9 +62933,9 @@ is to be loaded in a &lt;a href=#browsing-context&gt;browsing context&lt;/a&gt;, the user agent should &lt;a href=#create-a-document-object&gt;create a &lt;code&gt;Document&lt;/code&gt; object&lt;/a&gt;, mark it as being an &lt;a href=#html-documents title=&quot;HTML documents&quot;&gt;HTML document&lt;/a&gt;, - append an &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element to the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt;, - append a &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element and a &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt; element - to the &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element, append an &lt;code&gt;&lt;a href=#the-embed-element&gt;embed&lt;/a&gt;&lt;/code&gt; to + append an &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element to the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt;, + append a &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element and a &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt; element + to the &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element, append an &lt;code&gt;&lt;a href=#the-embed-element&gt;embed&lt;/a&gt;&lt;/code&gt; to the &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt; element, and set the &lt;code title=attr-embed-src&gt;&lt;a href=#attr-embed-src&gt;src&lt;/a&gt;&lt;/code&gt; attribute of the &lt;code&gt;&lt;a href=#the-embed-element&gt;embed&lt;/a&gt;&lt;/code&gt; element to the address of the resource.&lt;/p&gt; @@ -62960,10 +62954,10 @@ before the page has finished fully loading, the user agent must &lt;a href=#update-the-session-history-with-the-new-page&gt;update the session history with the new page&lt;/a&gt;.&lt;/p&gt; - &lt;p&gt;User agents may add content to the &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element of + &lt;p&gt;User agents may add content to the &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element of the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt;, or attributes to the &lt;code&gt;&lt;a href=#the-embed-element&gt;embed&lt;/a&gt;&lt;/code&gt; element, e.g. to link to a style sheet or an XBL binding, or to give - the document a &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt;.&lt;/p&gt; + the document a &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt;.&lt;/p&gt; &lt;p class=note id=sandboxPluginNavigate&gt;If the &lt;a href=#sandboxed-plugins-browsing-context-flag&gt;sandboxed plugins browsing context flag&lt;/a&gt; was set on the &lt;a href=#browsing-context&gt;browsing @@ -63806,7 +63800,7 @@ &lt;dt&gt;&lt;dfn id=concept-appcache-manifest title=concept-appcache-manifest&gt;The manifest&lt;/dfn&gt; &lt;dd&gt;&lt;p class=note&gt;This is the resource corresponding to the URL - that was given in a master entry's &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element's + that was given in a master entry's &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element's &lt;code title=attr-html-manifest&gt;&lt;a href=#attr-html-manifest&gt;manifest&lt;/a&gt;&lt;/code&gt; attribute. The manifest is fetched and processed during the &lt;a href=#application-cache-download-process&gt;application cache download process&lt;/a&gt;. All the &lt;a href=#concept-appcache-master title=concept-appcache-master&gt;master entries&lt;/a&gt; have the @@ -65015,7 +65009,7 @@ entry&lt;/a&gt;.&lt;/li&gt; &lt;li&gt;&lt;p&gt;As an optimization, if the resource is an HTML or XML file - whose root element is an &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-html-manifest&gt;&lt;a href=#attr-html-manifest&gt;manifest&lt;/a&gt;&lt;/code&gt; attribute whose value + whose root element is an &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-html-manifest&gt;&lt;a href=#attr-html-manifest&gt;manifest&lt;/a&gt;&lt;/code&gt; attribute whose value doesn't match the manifest URL of the application cache being processed, then the user agent should mark the entry as being &lt;a href=#concept-appcache-foreign title=concept-appcache-foreign&gt;foreign&lt;/a&gt;.&lt;/p&gt; @@ -65770,7 +65764,7 @@ run in the context of a document. These mechanisms include, but are probably not limited to:&lt;/p&gt; - &lt;ul&gt;&lt;li&gt;Processing of &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; elements.&lt;/li&gt; + &lt;ul&gt;&lt;li&gt;Processing of &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements.&lt;/li&gt; &lt;li&gt;Processing of inline &lt;code title=&quot;javascript protocol&quot;&gt;&lt;a href=#javascript-protocol&gt;javascript:&lt;/a&gt;&lt;/code&gt; URLs (e.g. the &lt;code title=attr-img-src&gt;&lt;a href=#attr-img-src&gt;src&lt;/a&gt;&lt;/code&gt; attribute of &lt;code&gt;&lt;a href=#the-img-element&gt;img&lt;/a&gt;&lt;/code&gt; @@ -68802,7 +68796,7 @@ &lt;li&gt;&lt;code&gt;&lt;a href=#the-textarea-element&gt;textarea&lt;/a&gt;&lt;/code&gt; elements that are not &lt;a href=#concept-fe-disabled title=concept-fe-disabled&gt;disabled&lt;/a&gt;&lt;/li&gt; - &lt;li&gt;&lt;code&gt;&lt;a href=#the-command&gt;command&lt;/a&gt;&lt;/code&gt; elements that do not have a &lt;code title=attr-command-disabled&gt;&lt;a href=#attr-command-disabled&gt;disabled&lt;/a&gt;&lt;/code&gt; attribute&lt;/li&gt; + &lt;li&gt;&lt;code&gt;&lt;a href=#the-command-element&gt;command&lt;/a&gt;&lt;/code&gt; elements that do not have a &lt;code title=attr-command-disabled&gt;&lt;a href=#attr-command-disabled&gt;disabled&lt;/a&gt;&lt;/code&gt; attribute&lt;/li&gt; &lt;li&gt;Elements with a &lt;code title=attr-draggable&gt;&lt;a href=#the-draggable-attribute&gt;draggable&lt;/a&gt;&lt;/code&gt; attribute set, if that would enable the user agent to allow the @@ -72983,8 +72977,8 @@ receiving streams from remote peers.&lt;/li&gt; &lt;li&gt;Displaying such streams (both the locally-produced ones and the - remotely-obtained ones) locally using the &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; or - &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; elements.&lt;/li&gt; + remotely-obtained ones) locally using the &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; or + &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; elements.&lt;/li&gt; &lt;li&gt;Sending arbitrary data to remote peers.&lt;/li&gt; @@ -73535,8 +73529,8 @@ &lt;li&gt;&lt;p&gt;Return, and run the remaining steps asynchronously.&lt;/li&gt; &lt;li&gt;&lt;p&gt;Generate a file that containing &lt;var title=&quot;&quot;&gt;data&lt;/var&gt; in - a format supported by the user agent for use in &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; - and &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; elements.&lt;/li&gt; + a format supported by the user agent for use in &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; + and &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; elements.&lt;/li&gt; &lt;li&gt;&lt;p&gt;Let &lt;var title=&quot;&quot;&gt;blob&lt;/var&gt; be a &lt;code&gt;Blob&lt;/code&gt; object representing the contents of the file generated in the previous @@ -73634,7 +73628,7 @@ &lt;p&gt;For audio and video streams, the data exposed on that stream must be in a format supported by the user agent for use in - &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; and &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; elements.&lt;/p&gt; + &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; and &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; elements.&lt;/p&gt; &lt;p class=bookkeeping&gt;A &lt;dfn id=blob-url&gt;Blob URL&lt;/dfn&gt; is the same as what the File API specification calls a &lt;span&gt;Blob URI&lt;/span&gt;, except that @@ -74086,13 +74080,13 @@ &lt;p&gt;User agents may negotiate any codec and any resolution, bitrate, or other quality metric. User agents are encouraged to initially negotiate for the native resolution of the stream. For streams that - are then rendered (using a &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element), user agents + are then rendered (using a &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element), user agents are encouraged to renegotiate for a resolution that matches the rendered display size.&lt;/p&gt; &lt;p class=note&gt;Starting with the native resolution means that if the Web application notifies its peer of the native resolution as it - starts sending data, and the peer prepares its &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; + starts sending data, and the peer prepares its &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element accordingly, there will be no need for a renegotiation once the stream is flowing.&lt;/p&gt; @@ -75998,8 +75992,8 @@ &lt;p&gt;Let &lt;var title=&quot;&quot;&gt;language&lt;/var&gt; be JavaScript.&lt;/p&gt; - &lt;p class=note&gt;As with &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; elements, the MIME - type of the script is ignored. Unlike with &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; + &lt;p class=note&gt;As with &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements, the MIME + type of the script is ignored. Unlike with &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements, there is no way to override the type. It's always assumed to be JavaScript.&lt;/p&gt; @@ -79630,7 +79624,7 @@ &lt;li&gt;Any number of &lt;a href=#syntax-comments title=syntax-comments&gt;comments&lt;/a&gt; and &lt;a href=#space-character title=&quot;space character&quot;&gt;space characters&lt;/a&gt;.&lt;/li&gt; - &lt;li&gt;The root element, in the form of an &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; &lt;a href=#syntax-elements title=syntax-elements&gt;element&lt;/a&gt;.&lt;/li&gt; + &lt;li&gt;The root element, in the form of an &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; &lt;a href=#syntax-elements title=syntax-elements&gt;element&lt;/a&gt;.&lt;/li&gt; &lt;li&gt;Any number of &lt;a href=#syntax-comments title=syntax-comments&gt;comments&lt;/a&gt; and &lt;a href=#space-character title=&quot;space character&quot;&gt;space characters&lt;/a&gt;.&lt;/li&gt; @@ -79644,19 +79638,19 @@ &lt;div class=note&gt; - &lt;p&gt;Space characters before the root &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element, and - space characters at the start of the &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element and - before the &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element, will be dropped when the + &lt;p&gt;Space characters before the root &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element, and + space characters at the start of the &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element and + before the &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element, will be dropped when the document is parsed; space characters &lt;em&gt;after&lt;/em&gt; the root - &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element will be parsed as if they were at the end + &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element will be parsed as if they were at the end of the &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt; element. Thus, space characters around the root element do not round-trip.&lt;/p&gt; &lt;p&gt;It is suggested that newlines be inserted after the DOCTYPE, after any comments that are before the root element, after the - &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element's start tag (if it is not &lt;a href=#syntax-tag-omission title=syntax-tag-omission&gt;omitted&lt;/a&gt;), and after any comments - that are inside the &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element but before the - &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element.&lt;/p&gt; + &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element's start tag (if it is not &lt;a href=#syntax-tag-omission title=syntax-tag-omission&gt;omitted&lt;/a&gt;), and after any comments + that are inside the &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element but before the + &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element.&lt;/p&gt; &lt;/div&gt; @@ -79761,21 +79755,21 @@ &lt;dl&gt;&lt;dt&gt;&lt;dfn id=void-elements&gt;Void elements&lt;/dfn&gt;&lt;/dt&gt; &lt;dd&gt;&lt;code&gt;&lt;a href=#the-area-element&gt;area&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-base-element&gt;base&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-br-element&gt;br&lt;/a&gt;&lt;/code&gt;, - &lt;code&gt;&lt;a href=#the-col-element&gt;col&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-command&gt;command&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-embed-element&gt;embed&lt;/a&gt;&lt;/code&gt;, + &lt;code&gt;&lt;a href=#the-col-element&gt;col&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-command-element&gt;command&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-embed-element&gt;embed&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-hr-element&gt;hr&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-img-element&gt;img&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-input-element&gt;input&lt;/a&gt;&lt;/code&gt;, - &lt;code&gt;&lt;a href=#the-keygen-element&gt;keygen&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-link-element&gt;link&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt;, + &lt;code&gt;&lt;a href=#the-keygen-element&gt;keygen&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-link-element&gt;link&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-param-element&gt;param&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-source-element&gt;source&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-track-element&gt;track&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-wbr-element&gt;wbr&lt;/a&gt;&lt;/code&gt;&lt;/dd&gt; &lt;!-- see also other places that say VOIDLIST --&gt; &lt;dt&gt;&lt;dfn id=raw-text-elements&gt;Raw text elements&lt;/dfn&gt;&lt;/dt&gt; - &lt;dd&gt;&lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-style-element&gt;style&lt;/a&gt;&lt;/code&gt;&lt;/dd&gt; &lt;!-- iframe and + &lt;dd&gt;&lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-style-element&gt;style&lt;/a&gt;&lt;/code&gt;&lt;/dd&gt; &lt;!-- iframe and noscript don't count as raw text for syntax purposes --&gt; &lt;dt&gt;&lt;dfn id=rcdata-elements&gt;RCDATA elements&lt;/dfn&gt;&lt;/dt&gt; - &lt;dd&gt;&lt;code&gt;&lt;a href=#the-textarea-element&gt;textarea&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt;&lt;/dd&gt; + &lt;dd&gt;&lt;code&gt;&lt;a href=#the-textarea-element&gt;textarea&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt;&lt;/dd&gt; &lt;dt&gt;&lt;dfn id=foreign-elements&gt;Foreign elements&lt;/dfn&gt;&lt;/dt&gt; @@ -80129,34 +80123,34 @@ &lt;p class=note&gt;Omitting an element's &lt;a href=#syntax-start-tag title=syntax-start-tag&gt;start tag&lt;/a&gt; does not mean the element is not present; it is implied, but it is still there. An HTML - document always has a root &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element, even if the + document always has a root &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element, even if the string &lt;code title=&quot;&quot;&gt;&lt;html&gt;&lt;/code&gt; doesn't appear anywhere in the markup.&lt;/p&gt; &lt;!-- &lt;html&gt; --&gt; - &lt;p&gt;An &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element's &lt;a href=#syntax-start-tag title=syntax-start-tag&gt;start tag&lt;/a&gt; may be omitted if the - first thing inside the &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element is not a &lt;a href=#syntax-comments title=syntax-comments&gt;comment&lt;/a&gt;.&lt;/p&gt; + &lt;p&gt;An &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element's &lt;a href=#syntax-start-tag title=syntax-start-tag&gt;start tag&lt;/a&gt; may be omitted if the + first thing inside the &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element is not a &lt;a href=#syntax-comments title=syntax-comments&gt;comment&lt;/a&gt;.&lt;/p&gt; &lt;!-- &lt;/html&gt; --&gt; - &lt;p&gt;An &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element's &lt;a href=#syntax-end-tag title=syntax-end-tag&gt;end - tag&lt;/a&gt; may be omitted if the &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element is not + &lt;p&gt;An &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element's &lt;a href=#syntax-end-tag title=syntax-end-tag&gt;end + tag&lt;/a&gt; may be omitted if the &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element is not immediately followed by a &lt;a href=#syntax-comments title=syntax-comments&gt;comment&lt;/a&gt;.&lt;/p&gt; &lt;!-- &lt;head&gt; --&gt; - &lt;p&gt;A &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element's &lt;a href=#syntax-start-tag title=syntax-start-tag&gt;start tag&lt;/a&gt; may be omitted if the + &lt;p&gt;A &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element's &lt;a href=#syntax-start-tag title=syntax-start-tag&gt;start tag&lt;/a&gt; may be omitted if the element is empty, or if the first thing inside the - &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element is an element.&lt;/p&gt; + &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element is an element.&lt;/p&gt; &lt;!-- &lt;/head&gt; --&gt; - &lt;p&gt;A &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element's &lt;a href=#syntax-end-tag title=syntax-end-tag&gt;end - tag&lt;/a&gt; may be omitted if the &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element is not + &lt;p&gt;A &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element's &lt;a href=#syntax-end-tag title=syntax-end-tag&gt;end + tag&lt;/a&gt; may be omitted if the &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element is not immediately followed by a &lt;a href=#space-character&gt;space character&lt;/a&gt; or a &lt;a href=#syntax-comments title=syntax-comments&gt;comment&lt;/a&gt;.&lt;/p&gt; &lt;!-- &lt;body&gt; --&gt; &lt;p&gt;A &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt; element's &lt;a href=#syntax-start-tag title=syntax-start-tag&gt;start tag&lt;/a&gt; may be omitted if the element is empty, or if the first thing inside the &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt; element is not a &lt;a href=#space-character&gt;space character&lt;/a&gt; or a &lt;a href=#syntax-comments title=syntax-comments&gt;comment&lt;/a&gt;, except if the first thing - inside the &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt; element is a &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; or + inside the &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt; element is a &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; or &lt;code&gt;&lt;a href=#the-style-element&gt;style&lt;/a&gt;&lt;/code&gt; element. &lt;!-- Note that even if the &lt;/head&gt; end tag is present, the parser makes &lt;style&gt; and &lt;script&gt; elements between &lt;/head&gt; and &lt;body&gt; end up in the &lt;head&gt; instead of implying @@ -80195,7 +80189,7 @@ &lt;code&gt;&lt;a href=#the-fieldset-element&gt;fieldset&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-footer-element&gt;footer&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-form-element&gt;form&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements&gt;h1&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements&gt;h2&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements&gt;h3&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements&gt;h4&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements&gt;h5&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements&gt;h6&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-header-element&gt;header&lt;/a&gt;&lt;/code&gt;, - &lt;code&gt;&lt;a href=#the-hgroup-element&gt;hgroup&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-hr-element&gt;hr&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt;, + &lt;code&gt;&lt;a href=#the-hgroup-element&gt;hgroup&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-hr-element&gt;hr&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-nav-element&gt;nav&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-ol-element&gt;ol&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-pre-element&gt;pre&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-section-element&gt;section&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt;, or &lt;code&gt;&lt;a href=#the-ul-element&gt;ul&lt;/a&gt;&lt;/code&gt;, element, or if there is no more content in the parent element and @@ -81479,7 +81473,7 @@ then switch the &lt;a href=#insertion-mode&gt;insertion mode&lt;/a&gt; to &quot;&lt;a href=#parsing-main-intable title=&quot;insertion mode: in table&quot;&gt;in table&lt;/a&gt;&quot; and abort these steps.&lt;/li&gt; - &lt;li&gt;If &lt;var title=&quot;&quot;&gt;node&lt;/var&gt; is a &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element, + &lt;li&gt;If &lt;var title=&quot;&quot;&gt;node&lt;/var&gt; is a &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element, then switch the &lt;a href=#insertion-mode&gt;insertion mode&lt;/a&gt; to &quot;&lt;a href=#parsing-main-inbody title=&quot;insertion mode: in body&quot;&gt;in body&lt;/a&gt;&quot; (&quot;&lt;a href=#parsing-main-inbody title=&quot;insertion mode: in body&quot;&gt;in body&lt;/a&gt;&quot;! &lt;em&gt; not &quot;&lt;a href=#parsing-main-inhead title=&quot;insertion mode: in head&quot;&gt;in head&lt;/a&gt;&quot;&lt;/em&gt;!) and abort these steps. (&lt;a href=#fragment-case&gt;fragment case&lt;/a&gt;)&lt;/li&gt; &lt;!-- This is only here for now in case people think that the spec accidentally @@ -81501,7 +81495,7 @@ then switch the &lt;a href=#insertion-mode&gt;insertion mode&lt;/a&gt; to &quot;&lt;a href=#parsing-main-inframeset title=&quot;insertion mode: in frameset&quot;&gt;in frameset&lt;/a&gt;&quot; and abort these steps. (&lt;a href=#fragment-case&gt;fragment case&lt;/a&gt;)&lt;/li&gt; - &lt;li&gt;If &lt;var title=&quot;&quot;&gt;node&lt;/var&gt; is an &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element, + &lt;li&gt;If &lt;var title=&quot;&quot;&gt;node&lt;/var&gt; is an &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element, then &lt;!--: if the &lt;span&gt;&lt;code title=&quot;&quot;&gt;head&lt;/code&gt; element pointer&lt;/span&gt; is null,--&gt; switch the &lt;a href=#insertion-mode&gt;insertion mode&lt;/a&gt; to &quot;&lt;a href=#the-before-head-insertion-mode title=&quot;insertion mode: before head&quot;&gt;before @@ -81532,17 +81526,17 @@ &lt;p&gt;The &quot;&lt;a href=#the-before-html-insertion-mode title=&quot;insertion mode: before html&quot;&gt;before html&lt;/a&gt;&quot; &lt;a href=#insertion-mode&gt;insertion mode&lt;/a&gt; creates the - &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; root element node, which is then added to the + &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; root element node, which is then added to the stack.&lt;/p&gt; &lt;p&gt;In the &lt;a href=#fragment-case&gt;fragment case&lt;/a&gt;, the &lt;a href=#stack-of-open-elements&gt;stack of open - elements&lt;/a&gt; is initialized to contain an &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; + elements&lt;/a&gt; is initialized to contain an &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element that is created as part of &lt;a href=#html-fragment-parsing-algorithm title=&quot;html fragment parsing algorithm&quot;&gt;that algorithm&lt;/a&gt;. (The &lt;a href=#fragment-case&gt;fragment case&lt;/a&gt; skips the &quot;&lt;a href=#the-before-html-insertion-mode title=&quot;insertion mode: before html&quot;&gt;before html&lt;/a&gt;&quot; &lt;a href=#insertion-mode&gt;insertion mode&lt;/a&gt;.)&lt;/p&gt; - &lt;p&gt;The &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; node, however it is created, is the topmost + &lt;p&gt;The &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; node, however it is created, is the topmost node of the stack. It only gets popped off the stack when the parser &lt;a href=#stop-parsing title=&quot;stop parsing&quot;&gt;finishes&lt;/a&gt;.&lt;/p&gt; @@ -81554,7 +81548,7 @@ one. If there is no &lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt; element in the &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt; (&lt;a href=#fragment-case&gt;fragment case&lt;/a&gt;), then the &lt;a href=#current-table&gt;current table&lt;/a&gt; is the first element in the &lt;a href=#stack-of-open-elements&gt;stack - of open elements&lt;/a&gt; (the &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element).&lt;/p&gt; + of open elements&lt;/a&gt; (the &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element).&lt;/p&gt; &lt;p&gt;Elements in the stack fall into the following categories:&lt;/p&gt; @@ -81565,28 +81559,28 @@ &lt;code&gt;&lt;a href=#the-base-element&gt;base&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#basefont&gt;basefont&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#bgsound&gt;bgsound&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-blockquote-element&gt;blockquote&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-br-element&gt;br&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-button-element&gt;button&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-caption-element&gt;caption&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#center&gt;center&lt;/a&gt;&lt;/code&gt;, - &lt;code&gt;&lt;a href=#the-col-element&gt;col&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-colgroup-element&gt;colgroup&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-command&gt;command&lt;/a&gt;&lt;/code&gt;, + &lt;code&gt;&lt;a href=#the-col-element&gt;col&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-colgroup-element&gt;colgroup&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-command-element&gt;command&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-dd-element&gt;dd&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-details-element&gt;details&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#dir&gt;dir&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-div-element&gt;div&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-dl-element&gt;dl&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-dt-element&gt;dt&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-embed-element&gt;embed&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-fieldset-element&gt;fieldset&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-figcaption-element&gt;figcaption&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-figure-element&gt;figure&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-footer-element&gt;footer&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-form-element&gt;form&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#frame&gt;frame&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#frameset&gt;frameset&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements&gt;h1&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements&gt;h2&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements&gt;h3&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements&gt;h4&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements&gt;h5&lt;/a&gt;&lt;/code&gt;, - &lt;code&gt;&lt;a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements&gt;h6&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-header-element&gt;header&lt;/a&gt;&lt;/code&gt;, - &lt;code&gt;&lt;a href=#the-hgroup-element&gt;hgroup&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-hr-element&gt;hr&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;, + &lt;code&gt;&lt;a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements&gt;h6&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-header-element&gt;header&lt;/a&gt;&lt;/code&gt;, + &lt;code&gt;&lt;a href=#the-hgroup-element&gt;hgroup&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-hr-element&gt;hr&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-iframe-element&gt;iframe&lt;/a&gt;&lt;/code&gt;, &lt;!-- &lt;code&gt;image&lt;/code&gt;, (commented out because this isn't an element that can end up on the stack, so it doesn't matter) --&gt; &lt;code&gt;&lt;a href=#the-img-element&gt;img&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-input-element&gt;input&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#isindex-0&gt;isindex&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-li-element&gt;li&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-link-element&gt;link&lt;/a&gt;&lt;/code&gt;, - &lt;code&gt;&lt;a href=#listing&gt;listing&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-marquee-element&gt;marquee&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt;, - &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-nav-element&gt;nav&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#noembed&gt;noembed&lt;/a&gt;&lt;/code&gt;, + &lt;code&gt;&lt;a href=#listing&gt;listing&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-marquee-element&gt;marquee&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt;, + &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-nav-element&gt;nav&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#noembed&gt;noembed&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#noframes&gt;noframes&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-object-element&gt;object&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-ol-element&gt;ol&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-param-element&gt;param&lt;/a&gt;&lt;/code&gt;, - &lt;code&gt;&lt;a href=#plaintext&gt;plaintext&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-pre-element&gt;pre&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt;, + &lt;code&gt;&lt;a href=#plaintext&gt;plaintext&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-pre-element&gt;pre&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-section-element&gt;section&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-select-element&gt;select&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-style-element&gt;style&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-summary-element&gt;summary&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-tbody-element&gt;tbody&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-td-element&gt;td&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-textarea-element&gt;textarea&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-tfoot-element&gt;tfoot&lt;/a&gt;&lt;/code&gt;, - &lt;code&gt;&lt;a href=#the-th-element&gt;th&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-thead-element&gt;thead&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt;, + &lt;code&gt;&lt;a href=#the-th-element&gt;th&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-thead-element&gt;thead&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-tr-element&gt;tr&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-ul-element&gt;ul&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-wbr-element&gt;wbr&lt;/a&gt;&lt;/code&gt;, and &lt;code&gt;&lt;a href=#xmp&gt;xmp&lt;/a&gt;&lt;/code&gt;; MathML's &lt;code title=&quot;&quot;&gt;mi&lt;/code&gt;, &lt;code title=&quot;&quot;&gt;mo&lt;/code&gt;, &lt;code title=&quot;&quot;&gt;mn&lt;/code&gt;, &lt;code title=&quot;&quot;&gt;ms&lt;/code&gt;, &lt;code title=&quot;&quot;&gt;mtext&lt;/code&gt;, and &lt;code title=&quot;&quot;&gt;annotation-xml&lt;/code&gt;; and SVG's &lt;code title=&quot;&quot;&gt;foreignObject&lt;/code&gt;, &lt;code title=&quot;&quot;&gt;desc&lt;/code&gt;, and &lt;code title=&quot;&quot;&gt;title&lt;/code&gt;.&lt;/dd&gt; &lt;!-- we could actually put @@ -81623,7 +81617,7 @@ entry in the &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt; and return to step 2. (This will never fail, since the loop will always terminate in the previous step if the top of the stack &mdash; an - &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element &mdash; is reached.)&lt;/li&gt; + &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element &mdash; is reached.)&lt;/li&gt; &lt;/ol&gt;&lt;p&gt;The &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt; is said to &lt;dfn id=has-an-element-in-scope title=&quot;has an element in scope&quot;&gt;have an element in scope&lt;/dfn&gt; when it &lt;a href=#has-an-element-in-the-specific-scope&gt;has an element in the specific scope&lt;/a&gt; consisting @@ -81631,7 +81625,7 @@ &lt;ul class=brief&gt;&lt;li&gt;&lt;code&gt;&lt;a href=#the-applet-element&gt;applet&lt;/a&gt;&lt;/code&gt; in the &lt;a href=#html-namespace-0&gt;HTML namespace&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-caption-element&gt;caption&lt;/a&gt;&lt;/code&gt; in the &lt;a href=#html-namespace-0&gt;HTML namespace&lt;/a&gt;&lt;/li&gt; - &lt;li&gt;&lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; in the &lt;a href=#html-namespace-0&gt;HTML namespace&lt;/a&gt;&lt;/li&gt; &lt;!-- (This can only happen if the &lt;var title=&quot;&quot;&gt;node&lt;/var&gt; is the topmost node of the &lt;span&gt;stack of open elements&lt;/span&gt;, and prevents the next step from being invoked if there are no more elements in the stack.) --&gt; + &lt;li&gt;&lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; in the &lt;a href=#html-namespace-0&gt;HTML namespace&lt;/a&gt;&lt;/li&gt; &lt;!-- (This can only happen if the &lt;var title=&quot;&quot;&gt;node&lt;/var&gt; is the topmost node of the &lt;span&gt;stack of open elements&lt;/span&gt;, and prevents the next step from being invoked if there are no more elements in the stack.) --&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt; in the &lt;a href=#html-namespace-0&gt;HTML namespace&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-td-element&gt;td&lt;/a&gt;&lt;/code&gt; in the &lt;a href=#html-namespace-0&gt;HTML namespace&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-th-element&gt;th&lt;/a&gt;&lt;/code&gt; in the &lt;a href=#html-namespace-0&gt;HTML namespace&lt;/a&gt;&lt;/li&gt; @@ -81665,7 +81659,7 @@ scope&lt;/dfn&gt; when it &lt;a href=#has-an-element-in-the-specific-scope&gt;has an element in the specific scope&lt;/a&gt; consisting of the following element types:&lt;/p&gt; - &lt;ul class=brief&gt;&lt;li&gt;&lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; in the &lt;a href=#html-namespace-0&gt;HTML namespace&lt;/a&gt;&lt;/li&gt; &lt;!-- (This can only happen if the &lt;var title=&quot;&quot;&gt;node&lt;/var&gt; is the topmost node of the &lt;span&gt;stack of open elements&lt;/span&gt;, and prevents the next step from being invoked if there are no more elements in the stack.) --&gt; + &lt;ul class=brief&gt;&lt;li&gt;&lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; in the &lt;a href=#html-namespace-0&gt;HTML namespace&lt;/a&gt;&lt;/li&gt; &lt;!-- (This can only happen if the &lt;var title=&quot;&quot;&gt;node&lt;/var&gt; is the topmost node of the &lt;span&gt;stack of open elements&lt;/span&gt;, and prevents the next step from being invoked if there are no more elements in the stack.) --&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt; in the &lt;a href=#html-namespace-0&gt;HTML namespace&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;&lt;p&gt;The &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt; is said to &lt;dfn id=has-an-element-in-select-scope title=&quot;has an element in select scope&quot;&gt;have an element in select scope&lt;/dfn&gt; when it &lt;a href=#has-an-element-in-the-specific-scope&gt;has an element in the specific @@ -81809,7 +81803,7 @@ pointer&lt;/dfn&gt; and the &lt;dfn id=form-element-pointer&gt;&lt;code title=&quot;&quot;&gt;form&lt;/code&gt; element pointer&lt;/dfn&gt; are both null.&lt;/p&gt; - &lt;p&gt;Once a &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element has been parsed (whether + &lt;p&gt;Once a &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element has been parsed (whether implicitly or explicitly) the &lt;a href=#head-element-pointer&gt;&lt;code title=&quot;&quot;&gt;head&lt;/code&gt; element pointer&lt;/a&gt; gets set to point to this node.&lt;/p&gt; @@ -81828,7 +81822,7 @@ &lt;p class=note&gt;The &lt;a href=#scripting-flag&gt;scripting flag&lt;/a&gt; can be enabled even when the parser was originally created for the &lt;a href=#html-fragment-parsing-algorithm&gt;HTML fragment - parsing algorithm&lt;/a&gt;, even though &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; elements + parsing algorithm&lt;/a&gt;, even though &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements don't execute in that case.&lt;/p&gt; &lt;p&gt;The &lt;dfn id=frameset-ok-flag&gt;frameset-ok flag&lt;/dfn&gt; is set to &quot;ok&quot; when the parser is @@ -81876,7 +81870,7 @@ &lt;a href=#tree-construction&gt;tree construction&lt;/a&gt; stage. The tree construction stage can affect the state of the tokenization stage, and can insert additional characters into the stream. (For example, the - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element can result in scripts executing and + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element can result in scripts executing and using the &lt;a href=#dynamic-markup-insertion&gt;dynamic markup insertion&lt;/a&gt; APIs to insert characters into the stream being tokenized.)&lt;/p&gt; @@ -84335,7 +84329,7 @@ &lt;p&gt;If there is no &lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt; element in the &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt; (&lt;a href=#fragment-case&gt;fragment case&lt;/a&gt;), then the &lt;i&gt;&lt;a href=#foster-parent-element&gt;foster parent element&lt;/a&gt;&lt;/i&gt; is the first element in the &lt;a href=#stack-of-open-elements&gt;stack - of open elements&lt;/a&gt; (the &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element). Otherwise, + of open elements&lt;/a&gt; (the &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element). Otherwise, if there is a &lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt; element in the &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt;, but the last &lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt; element in the &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt; has no parent, or its parent @@ -84612,7 +84606,7 @@ &lt;dt&gt;Anything else&lt;/dt&gt; &lt;dd&gt; - &lt;p&gt;Create an &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element. Append it to the + &lt;p&gt;Create an &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element. Append it to the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt; object. Put this element in the &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt;.&lt;/p&gt; @@ -84667,7 +84661,7 @@ &lt;p&gt;&lt;a href=#insert-an-html-element&gt;Insert an HTML element&lt;/a&gt; for the token.&lt;/p&gt; &lt;p&gt;Set the &lt;a href=#head-element-pointer&gt;&lt;code title=&quot;&quot;&gt;head&lt;/code&gt; element pointer&lt;/a&gt; - to the newly created &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element.&lt;/p&gt; + to the newly created &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element.&lt;/p&gt; &lt;p&gt;Switch the &lt;a href=#insertion-mode&gt;insertion mode&lt;/a&gt; to &quot;&lt;a href=#parsing-main-inhead title=&quot;insertion mode: in head&quot;&gt;in head&lt;/a&gt;&quot;.&lt;/p&gt; @@ -84814,7 +84808,7 @@ &lt;li&gt;&lt;p&gt;If the parser was originally created for the &lt;a href=#html-fragment-parsing-algorithm&gt;HTML fragment parsing algorithm&lt;/a&gt;, then mark the - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element as &lt;a href=#already-started&gt;&quot;already + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element as &lt;a href=#already-started&gt;&quot;already started&quot;&lt;/a&gt;. (&lt;a href=#fragment-case&gt;fragment case&lt;/a&gt;)&lt;/li&gt; &lt;li&gt;&lt;p&gt;Append the new element to the &lt;a href=#current-node&gt;current node&lt;/a&gt; @@ -84835,7 +84829,7 @@ &lt;dd&gt; &lt;p&gt;Pop the &lt;a href=#current-node&gt;current node&lt;/a&gt; (which will be the - &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element) off the &lt;a href=#stack-of-open-elements&gt;stack of open + &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element) off the &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;Switch the &lt;a href=#insertion-mode&gt;insertion mode&lt;/a&gt; to &quot;&lt;a href=#the-after-head-insertion-mode title=&quot;insertion mode: after head&quot;&gt;after head&lt;/a&gt;&quot;.&lt;/p&gt; @@ -84884,7 +84878,7 @@ &lt;p&gt;Pop the &lt;a href=#current-node&gt;current node&lt;/a&gt; (which will be a &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt; element) from the &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt;; the new &lt;a href=#current-node&gt;current node&lt;/a&gt; will be a - &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element.&lt;/p&gt; + &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element.&lt;/p&gt; &lt;p&gt;Switch the &lt;a href=#insertion-mode&gt;insertion mode&lt;/a&gt; to &quot;&lt;a href=#parsing-main-inhead title=&quot;insertion mode: in head&quot;&gt;in head&lt;/a&gt;&quot;.&lt;/p&gt; @@ -85124,7 +85118,7 @@ &lt;li&gt;&lt;p&gt;Pop all the nodes from the bottom of the &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt;, from the &lt;a href=#current-node&gt;current node&lt;/a&gt; up to, - but not including, the root &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element.&lt;/p&gt; + but not including, the root &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element.&lt;/p&gt; &lt;li&gt;&lt;p&gt;&lt;a href=#insert-an-html-element&gt;Insert an HTML element&lt;/a&gt; for the token.&lt;/li&gt; @@ -85142,7 +85136,7 @@ &lt;code&gt;&lt;a href=#the-tbody-element&gt;tbody&lt;/a&gt;&lt;/code&gt; element, a &lt;code&gt;&lt;a href=#the-td-element&gt;td&lt;/a&gt;&lt;/code&gt; element, a &lt;code&gt;&lt;a href=#the-tfoot-element&gt;tfoot&lt;/a&gt;&lt;/code&gt; element, a &lt;code&gt;&lt;a href=#the-th-element&gt;th&lt;/a&gt;&lt;/code&gt; element, a &lt;code&gt;&lt;a href=#the-thead-element&gt;thead&lt;/a&gt;&lt;/code&gt; element, a &lt;code&gt;&lt;a href=#the-tr-element&gt;tr&lt;/a&gt;&lt;/code&gt; element, the - &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt; element, or the &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element, then + &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt; element, or the &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element, then this is a &lt;a href=#parse-error&gt;parse error&lt;/a&gt;.&lt;/p&gt; &lt;!-- (some of those are fragment cases) --&gt; @@ -85169,7 +85163,7 @@ &lt;code&gt;&lt;a href=#the-td-element&gt;td&lt;/a&gt;&lt;/code&gt; element, a &lt;code&gt;&lt;a href=#the-tfoot-element&gt;tfoot&lt;/a&gt;&lt;/code&gt; element, a &lt;code&gt;&lt;a href=#the-th-element&gt;th&lt;/a&gt;&lt;/code&gt; element, a &lt;code&gt;&lt;a href=#the-thead-element&gt;thead&lt;/a&gt;&lt;/code&gt; element, a &lt;code&gt;&lt;a href=#the-tr-element&gt;tr&lt;/a&gt;&lt;/code&gt; element, the &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt; element, or the - &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element, then this is a &lt;a href=#parse-error&gt;parse + &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element, then this is a &lt;a href=#parse-error&gt;parse error&lt;/a&gt;.&lt;/p&gt; &lt;!-- (some of those are fragment cases, e.g. for &lt;tbody&gt; you'd have hit the first paragraph since the &lt;body&gt; wouldn't be in scope, unless it was a fragment case) --&gt; @@ -86297,8 +86291,8 @@ &lt;!-- can't be the fragment case --&gt; &lt;p&gt;&lt;a href=#parse-error&gt;Parse error&lt;/a&gt;.&lt;/p&gt; - &lt;p&gt;If the &lt;a href=#current-node&gt;current node&lt;/a&gt; is a &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; - element, mark the &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element as &lt;a href=#already-started&gt;&quot;already + &lt;p&gt;If the &lt;a href=#current-node&gt;current node&lt;/a&gt; is a &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; + element, mark the &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element as &lt;a href=#already-started&gt;&quot;already started&quot;&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;Pop the &lt;a href=#current-node&gt;current node&lt;/a&gt; off the &lt;a href=#stack-of-open-elements&gt;stack of open @@ -86315,7 +86309,7 @@ &lt;p&gt;&lt;a href=#provide-a-stable-state&gt;Provide a stable state&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;Let &lt;var title=&quot;&quot;&gt;script&lt;/var&gt; be the &lt;a href=#current-node&gt;current node&lt;/a&gt; - (which will be a &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element).&lt;/p&gt; + (which will be a &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element).&lt;/p&gt; &lt;p&gt;Pop the &lt;a href=#current-node&gt;current node&lt;/a&gt; off the &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt;.&lt;/p&gt; @@ -86595,7 +86589,7 @@ &lt;dd&gt; &lt;p&gt;If the &lt;a href=#current-node&gt;current node&lt;/a&gt; is not the root - &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element, then this is a &lt;a href=#parse-error&gt;parse + &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element, then this is a &lt;a href=#parse-error&gt;parse error&lt;/a&gt;.&lt;/p&gt; &lt;p class=note&gt;It can only be the &lt;a href=#current-node&gt;current node&lt;/a&gt; in @@ -86621,11 +86615,11 @@ &lt;/dl&gt;&lt;p&gt;When the steps above require the UA to &lt;dfn id=clear-the-stack-back-to-a-table-context&gt;clear the stack back to a table context&lt;/dfn&gt;, it means that the UA must, while the &lt;a href=#current-node&gt;current node&lt;/a&gt; is not a &lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt; - element or an &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element, pop elements from the + element or an &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element, pop elements from the &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt;.&lt;/p&gt; &lt;p class=note&gt;The &lt;a href=#current-node&gt;current node&lt;/a&gt; being an - &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element after this process is a &lt;a href=#fragment-case&gt;fragment + &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element after this process is a &lt;a href=#fragment-case&gt;fragment case&lt;/a&gt;.&lt;/p&gt; @@ -86774,7 +86768,7 @@ &lt;dd&gt; &lt;p&gt;If the &lt;a href=#current-node&gt;current node&lt;/a&gt; is the root - &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element, then this is a &lt;a href=#parse-error&gt;parse + &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element, then this is a &lt;a href=#parse-error&gt;parse error&lt;/a&gt;; ignore the token. (&lt;a href=#fragment-case&gt;fragment case&lt;/a&gt;)&lt;/p&gt; @@ -86793,7 +86787,7 @@ &lt;dt&gt;An end-of-file token&lt;/dt&gt; &lt;dd&gt; - &lt;p&gt;If the &lt;a href=#current-node&gt;current node&lt;/a&gt; is the root &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; + &lt;p&gt;If the &lt;a href=#current-node&gt;current node&lt;/a&gt; is the root &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element, then &lt;a href=#stop-parsing&gt;stop parsing&lt;/a&gt;. (&lt;a href=#fragment-case&gt;fragment case&lt;/a&gt;)&lt;/p&gt; @@ -86893,12 +86887,12 @@ &lt;/dl&gt;&lt;p&gt;When the steps above require the UA to &lt;dfn id=clear-the-stack-back-to-a-table-body-context&gt;clear the stack back to a table body context&lt;/dfn&gt;, it means that the UA must, while the &lt;a href=#current-node&gt;current node&lt;/a&gt; is not a &lt;code&gt;&lt;a href=#the-tbody-element&gt;tbody&lt;/a&gt;&lt;/code&gt;, - &lt;code&gt;&lt;a href=#the-tfoot-element&gt;tfoot&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-thead-element&gt;thead&lt;/a&gt;&lt;/code&gt;, or &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; + &lt;code&gt;&lt;a href=#the-tfoot-element&gt;tfoot&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-thead-element&gt;thead&lt;/a&gt;&lt;/code&gt;, or &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element, pop elements from the &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt;.&lt;/p&gt; &lt;p class=note&gt;The &lt;a href=#current-node&gt;current node&lt;/a&gt; being an - &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element after this process is a &lt;a href=#fragment-case&gt;fragment + &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element after this process is a &lt;a href=#fragment-case&gt;fragment case&lt;/a&gt;.&lt;/p&gt; @@ -86984,11 +86978,11 @@ &lt;/dl&gt;&lt;p&gt;When the steps above require the UA to &lt;dfn id=clear-the-stack-back-to-a-table-row-context&gt;clear the stack back to a table row context&lt;/dfn&gt;, it means that the UA must, while the &lt;a href=#current-node&gt;current node&lt;/a&gt; is not a &lt;code&gt;&lt;a href=#the-tr-element&gt;tr&lt;/a&gt;&lt;/code&gt; - element or an &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element, pop elements from the + element or an &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element, pop elements from the &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt;.&lt;/p&gt; &lt;p class=note&gt;The &lt;a href=#current-node&gt;current node&lt;/a&gt; being an - &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element after this process is a &lt;a href=#fragment-case&gt;fragment + &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element after this process is a &lt;a href=#fragment-case&gt;fragment case&lt;/a&gt;.&lt;/p&gt; @@ -87220,7 +87214,7 @@ &lt;dd&gt; &lt;p&gt;If the &lt;a href=#current-node&gt;current node&lt;/a&gt; is not the root - &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element, then this is a &lt;a href=#parse-error&gt;parse + &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element, then this is a &lt;a href=#parse-error&gt;parse error&lt;/a&gt;.&lt;/p&gt; &lt;p class=note&gt;It can only be the &lt;a href=#current-node&gt;current node&lt;/a&gt; in @@ -87281,7 +87275,7 @@ &lt;dt&gt;A comment token&lt;/dt&gt; &lt;dd&gt; &lt;p&gt;Append a &lt;code&gt;&lt;a href=#comment-0&gt;Comment&lt;/a&gt;&lt;/code&gt; node to the first element in - the &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt; (the &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; + the &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt; (the &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element), with the &lt;code title=&quot;&quot;&gt;data&lt;/code&gt; attribute set to the data given in the comment token.&lt;/p&gt; &lt;/dd&gt; @@ -87362,7 +87356,7 @@ &lt;dd&gt; &lt;p&gt;If the &lt;a href=#current-node&gt;current node&lt;/a&gt; is the root - &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element, then this is a &lt;a href=#parse-error&gt;parse + &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element, then this is a &lt;a href=#parse-error&gt;parse error&lt;/a&gt;; ignore the token. (&lt;a href=#fragment-case&gt;fragment case&lt;/a&gt;)&lt;/p&gt; @@ -87400,7 +87394,7 @@ &lt;dd&gt; &lt;p&gt;If the &lt;a href=#current-node&gt;current node&lt;/a&gt; is not the root - &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element, then this is a &lt;a href=#parse-error&gt;parse + &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element, then this is a &lt;a href=#parse-error&gt;parse error&lt;/a&gt;.&lt;/p&gt; &lt;p class=note&gt;It can only be the &lt;a href=#current-node&gt;current node&lt;/a&gt; in @@ -87777,17 +87771,17 @@ substeps:&lt;/p&gt; &lt;ol&gt;&lt;li&gt;&lt;p&gt;&lt;a href=#spin-the-event-loop&gt;Spin the event loop&lt;/a&gt; until the first - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; in the &lt;a href=#list-of-scripts-that-will-execute-when-the-document-has-finished-parsing&gt;list of scripts that will + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; in the &lt;a href=#list-of-scripts-that-will-execute-when-the-document-has-finished-parsing&gt;list of scripts that will execute when the document has finished parsing&lt;/a&gt; has its &lt;a href=#ready-to-be-parser-executed&gt;&quot;ready to be parser-executed&quot;&lt;/a&gt; flag set &lt;em&gt;and&lt;/em&gt; the parser's &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt; &lt;a href=#has-no-style-sheet-that-is-blocking-scripts&gt;has no style sheet that is blocking scripts&lt;/a&gt;.&lt;/li&gt; &lt;li&gt;&lt;p&gt;&lt;a href=#execute-the-script-block title=&quot;execute the script block&quot;&gt;Execute&lt;/a&gt; the - first &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; in the &lt;a href=#list-of-scripts-that-will-execute-when-the-document-has-finished-parsing&gt;list of scripts that will + first &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; in the &lt;a href=#list-of-scripts-that-will-execute-when-the-document-has-finished-parsing&gt;list of scripts that will execute when the document has finished parsing&lt;/a&gt;.&lt;/li&gt; - &lt;li&gt;&lt;p&gt;Remove the first &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element from the + &lt;li&gt;&lt;p&gt;Remove the first &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element from the &lt;a href=#list-of-scripts-that-will-execute-when-the-document-has-finished-parsing&gt;list of scripts that will execute when the document has finished parsing&lt;/a&gt; (i.e. shift out the first entry in the list).&lt;/li&gt; @@ -87987,8 +87981,8 @@ &lt;p&gt;The parsing of this markup is straightforward up to the &quot;3&quot;. At this point, the DOM looks like this:&lt;/p&gt; - &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;1&lt;/span&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;2&lt;/span&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-i-element&gt;i&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;3&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;Here, the &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt; has five elements - on it: &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;, + &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;1&lt;/span&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;2&lt;/span&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-i-element&gt;i&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;3&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;Here, the &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt; has five elements + on it: &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;, and &lt;code&gt;&lt;a href=#the-i-element&gt;i&lt;/a&gt;&lt;/code&gt;. The &lt;a href=#list-of-active-formatting-elements&gt;list of active formatting elements&lt;/a&gt; just has two: &lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; and &lt;code&gt;&lt;a href=#the-i-element&gt;i&lt;/a&gt;&lt;/code&gt;. The &lt;a href=#insertion-mode&gt;insertion mode&lt;/a&gt; is &quot;&lt;a href=#parsing-main-inbody title=&quot;insertion mode: in body&quot;&gt;in body&lt;/a&gt;&quot;.&lt;/p&gt; @@ -87997,7 +87991,7 @@ invoked. This is a simple case, in that the &lt;var title=&quot;&quot;&gt;formatting element&lt;/var&gt; is the &lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; element, and there is no &lt;var title=&quot;&quot;&gt;furthest block&lt;/var&gt;. Thus, the &lt;a href=#stack-of-open-elements&gt;stack of open - elements&lt;/a&gt; ends up with just three elements: &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;, + elements&lt;/a&gt; ends up with just three elements: &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;, and &lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;, while the &lt;a href=#list-of-active-formatting-elements&gt;list of active formatting elements&lt;/a&gt; has just one: &lt;code&gt;&lt;a href=#the-i-element&gt;i&lt;/a&gt;&lt;/code&gt;. The DOM tree is unmodified at this point.&lt;/p&gt; @@ -88009,7 +88003,7 @@ received, and the &quot;5&quot; text node is inserted, the DOM looks as follows:&lt;/p&gt; - &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;1&lt;/span&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;2&lt;/span&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-i-element&gt;i&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;3&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-i-element&gt;i&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;4&lt;/span&gt;&lt;/ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;5&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;h5 id=misnested-tags:-b-p-/b-/p&gt;&lt;span class=secno&gt;13.2.8.2 &lt;/span&gt;Misnested tags: &lt;b&gt;&lt;p&gt;&lt;/b&gt;&lt;/p&gt;&lt;/h5&gt; + &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;1&lt;/span&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;2&lt;/span&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-i-element&gt;i&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;3&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-i-element&gt;i&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;4&lt;/span&gt;&lt;/ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;5&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;h5 id=misnested-tags:-b-p-/b-/p&gt;&lt;span class=secno&gt;13.2.8.2 &lt;/span&gt;Misnested tags: &lt;b&gt;&lt;p&gt;&lt;/b&gt;&lt;/p&gt;&lt;/h5&gt; &lt;p&gt;&lt;i&gt;This section is non-normative.&lt;/i&gt;&lt;/p&gt; @@ -88019,11 +88013,11 @@ &lt;p&gt;Up to the &quot;2&quot; the parsing here is straightforward:&lt;/p&gt; - &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;1&lt;/span&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;2&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;The interesting part is when the end tag token with the tag name + &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;1&lt;/span&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;2&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;The interesting part is when the end tag token with the tag name &quot;b&quot; is parsed.&lt;/p&gt; &lt;p&gt;Before that token is seen, the &lt;a href=#stack-of-open-elements&gt;stack of open - elements&lt;/a&gt; has four elements on it: &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;, + elements&lt;/a&gt; has four elements on it: &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;, and &lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;. The &lt;a href=#list-of-active-formatting-elements&gt;list of active formatting elements&lt;/a&gt; just has the one: &lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;. The &lt;a href=#insertion-mode&gt;insertion mode&lt;/a&gt; is &quot;&lt;a href=#parsing-main-inbody title=&quot;insertion mode: in body&quot;&gt;in body&lt;/a&gt;&quot;.&lt;/p&gt; @@ -88047,18 +88041,18 @@ &lt;p&gt;The &lt;var title=&quot;&quot;&gt;last node&lt;/var&gt; gets appended (moved) to the &lt;var title=&quot;&quot;&gt;common ancestor&lt;/var&gt;, so that the DOM looks like:&lt;/p&gt; - &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;1&lt;/span&gt;&lt;/ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;2&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;A new &lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; element is created, and the children of the + &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;1&lt;/span&gt;&lt;/ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;2&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;A new &lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; element is created, and the children of the &lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt; element are moved to it:&lt;/p&gt; - &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;1&lt;/span&gt;&lt;/ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;2&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;Finally, the new &lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; element is appended to the + &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;1&lt;/span&gt;&lt;/ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;2&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;Finally, the new &lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; element is appended to the &lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt; element, so that the DOM looks like:&lt;/p&gt; - &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;1&lt;/span&gt;&lt;/ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;2&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;The &lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; element is removed from the &lt;a href=#list-of-active-formatting-elements&gt;list of + &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;1&lt;/span&gt;&lt;/ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;2&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;The &lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; element is removed from the &lt;a href=#list-of-active-formatting-elements&gt;list of active formatting elements&lt;/a&gt; and the &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt;, so that when the &quot;3&quot; is parsed, it is appended to the &lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt; element:&lt;/p&gt; - &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;1&lt;/span&gt;&lt;/ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;2&lt;/span&gt;&lt;/ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;3&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;h5 id=unexpected-markup-in-tables&gt;&lt;span class=secno&gt;13.2.8.3 &lt;/span&gt;Unexpected markup in tables&lt;/h5&gt; + &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;1&lt;/span&gt;&lt;/ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;2&lt;/span&gt;&lt;/ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;3&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;h5 id=unexpected-markup-in-tables&gt;&lt;span class=secno&gt;13.2.8.3 &lt;/span&gt;Unexpected markup in tables&lt;/h5&gt; &lt;p&gt;&lt;i&gt;This section is non-normative.&lt;/i&gt;&lt;/p&gt; @@ -88073,11 +88067,11 @@ examining the DOM tree as it stands just after the &lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt; element's start tag has been seen:&lt;/p&gt; - &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;...and then immediately after the &lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; element start + &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;...and then immediately after the &lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; element start tag has been seen:&lt;/p&gt; - &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;At this point, the &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt; has on it - the elements &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;, + &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;At this point, the &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt; has on it + the elements &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt;, and &lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; (in that order, despite the resulting DOM tree); the &lt;a href=#list-of-active-formatting-elements&gt;list of active formatting elements&lt;/a&gt; just has the &lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; element in it; and the @@ -88093,8 +88087,8 @@ row&lt;/a&gt;&quot; insertion modes, after which the DOM looks as follows:&lt;/p&gt; - &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-tbody-element&gt;tbody&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-tr-element&gt;tr&lt;/a&gt;&lt;/code&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;Here, the &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt; has on it the - elements &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt;, + &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-tbody-element&gt;tbody&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-tr-element&gt;tr&lt;/a&gt;&lt;/code&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;Here, the &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt; has on it the + elements &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-tbody-element&gt;tbody&lt;/a&gt;&lt;/code&gt;, and &lt;code&gt;&lt;a href=#the-tr-element&gt;tr&lt;/a&gt;&lt;/code&gt;; the &lt;a href=#list-of-active-formatting-elements&gt;list of active formatting elements&lt;/a&gt; still has the &lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; element in it; and the &lt;a href=#insertion-mode&gt;insertion mode&lt;/a&gt; is &quot;&lt;a href=#parsing-main-intr title=&quot;insertion @@ -88105,13 +88099,13 @@ of active formatting elements&lt;/a&gt; (it also switches to the &quot;&lt;a href=#parsing-main-intd title=&quot;insertion mode: in cell&quot;&gt;in cell&lt;/a&gt;&quot; &lt;a href=#insertion-mode&gt;insertion mode&lt;/a&gt;).&lt;/p&gt; - &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-tbody-element&gt;tbody&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-tr-element&gt;tr&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-td-element&gt;td&lt;/a&gt;&lt;/code&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;The marker means that when the &quot;aaa&quot; character tokens are seen, + &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-tbody-element&gt;tbody&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-tr-element&gt;tr&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-td-element&gt;td&lt;/a&gt;&lt;/code&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;The marker means that when the &quot;aaa&quot; character tokens are seen, no &lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; element is created to hold the resulting text node:&lt;/p&gt; - &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-tbody-element&gt;tbody&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-tr-element&gt;tr&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-td-element&gt;td&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;aaa&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;The end tags are handled in a straight-forward manner; after + &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-tbody-element&gt;tbody&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-tr-element&gt;tr&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-td-element&gt;td&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;aaa&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;The end tags are handled in a straight-forward manner; after handling them, the &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt; has on it the - elements &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt;, + elements &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt;, and &lt;code&gt;&lt;a href=#the-tbody-element&gt;tbody&lt;/a&gt;&lt;/code&gt;; the &lt;a href=#list-of-active-formatting-elements&gt;list of active formatting elements&lt;/a&gt; still has the &lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; element in it (the marker having been removed by the &quot;td&quot; end tag token); and the @@ -88136,8 +88130,8 @@ parent&quot;&gt;foster parented&lt;/a&gt;, and then the &quot;bbb&quot; text node is appended to it:&lt;/p&gt; - &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;bbb&lt;/span&gt;&lt;/ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-tbody-element&gt;tbody&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-tr-element&gt;tr&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-td-element&gt;td&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;aaa&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;The &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt; has on it the elements - &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt;, + &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;bbb&lt;/span&gt;&lt;/ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-tbody-element&gt;tbody&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-tr-element&gt;tr&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-td-element&gt;td&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;aaa&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;The &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt; has on it the elements + &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-tbody-element&gt;tbody&lt;/a&gt;&lt;/code&gt;, and the new &lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; (again, note that this doesn't match the resulting tree!); the &lt;a href=#list-of-active-formatting-elements&gt;list of active formatting elements&lt;/a&gt; has the new &lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; element in it; @@ -88157,7 +88151,7 @@ result in yet another &lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; element being created, this time after the table:&lt;/p&gt; - &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;bbb&lt;/span&gt;&lt;/ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-tbody-element&gt;tbody&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-tr-element&gt;tr&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-td-element&gt;td&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;aaa&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;ccc&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;h5 id=scripts-that-modify-the-page-as-it-is-being-parsed&gt;&lt;span class=secno&gt;13.2.8.4 &lt;/span&gt;Scripts that modify the page as it is bein g parsed&lt;/h5&gt; + &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;bbb&lt;/span&gt;&lt;/ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-tbody-element&gt;tbody&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-tr-element&gt;tr&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-td-element&gt;td&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;aaa&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;ccc&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;h5 id=scripts-that-modify-the-page-as-it-is-being-parsed&gt;&lt;span class=secno&gt;13.2.8.4 &lt;/span&gt;Scripts that modify the page as it is being pa rsed&lt;/h5&gt; &lt;p&gt;&lt;i&gt;This section is non-normative.&lt;/i&gt;&lt;/p&gt; @@ -88182,16 +88176,16 @@ &lt;p&gt;Up to the first &quot;script&quot; end tag, before the script is parsed, the result is relatively straightforward:&lt;/p&gt; - &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-div-element&gt;div&lt;/a&gt;&lt;/code&gt; &lt;span class=t2 title=&quot;&quot;&gt;&lt;code class=&quot;attribute name&quot;&gt;id&lt;/code&gt;=&quot;&lt;code class=&quot;attribute value&quot;&gt;&lt;a href=#the-a-element&gt;a&lt;/a&gt;&lt;/code&gt;&quot;&lt;/span&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt; - &lt;/span&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;var div = document.getElementById('a'); &#9166; parent.document.body.appendChild(div);&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;After the script is parsed, though, the &lt;code&gt;&lt;a href=#the-div-element&gt;div&lt;/a&gt;&lt;/code&gt; element - and its child &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element are gone:&lt;/p&gt; + &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-div-element&gt;div&lt;/a&gt;&lt;/code&gt; &lt;span class=t2 title=&quot;&quot;&gt;&lt;code class=&quot;attribute name&quot;&gt;id&lt;/code&gt;=&quot;&lt;code class=&quot;attribute value&quot;&gt;&lt;a href=#the-a-element&gt;a&lt;/a&gt;&lt;/code&gt;&quot;&lt;/span&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt; + &lt;/span&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;var div = document.getElementById('a'); &#9166; parent.document.body.appendChild(div);&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;After the script is parsed, though, the &lt;code&gt;&lt;a href=#the-div-element&gt;div&lt;/a&gt;&lt;/code&gt; element + and its child &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element are gone:&lt;/p&gt; - &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;They are, at this point, in the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt; of the + &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;They are, at this point, in the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt; of the aforementioned outer &lt;a href=#browsing-context&gt;browsing context&lt;/a&gt;. However, the &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt; &lt;em&gt;still contains the &lt;code&gt;&lt;a href=#the-div-element&gt;div&lt;/a&gt;&lt;/code&gt; element&lt;/em&gt;.&lt;/p&gt; - &lt;p&gt;Thus, when the second &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element is parsed, it + &lt;p&gt;Thus, when the second &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element is parsed, it is inserted &lt;em&gt;into the outer &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt; object&lt;/em&gt;.&lt;/p&gt; @@ -88209,9 +88203,9 @@ &lt;p&gt;Once the &lt;code&gt;&lt;a href=#the-div-element&gt;div&lt;/a&gt;&lt;/code&gt; element's end tag is parsed, the &lt;code&gt;&lt;a href=#the-div-element&gt;div&lt;/a&gt;&lt;/code&gt; element is popped off the stack, and so the next - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element is in the inner &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt;:&lt;/p&gt; + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element is in the inner &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt;:&lt;/p&gt; - &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;alert(document.URL);&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;This second alert will say &quot;<A HREF="http://example.com/inner">http://example.com/inner</A>&quot;.&lt;/p&gt; + &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;alert(document.URL);&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;This second alert will say &quot;<A HREF="http://example.com/inner">http://example.com/inner</A>&quot;.&lt;/p&gt; &lt;h5 id=the-execution-of-scripts-that-are-moving-across-multiple-documents&gt;&lt;span class=secno&gt;13.2.8.5 &lt;/span&gt;The execution of scripts that are moving across multiple documents&lt;/h5&gt; @@ -88219,7 +88213,7 @@ &lt;p&gt;&lt;i&gt;This section is non-normative.&lt;/i&gt;&lt;/p&gt; &lt;p&gt;Elaborating on the example in the previous section, consider a - case where a &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-script-src&gt;&lt;a href=#attr-script-src&gt;src&lt;/a&gt;&lt;/code&gt; attribute is parsed, but while + case where a &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-script-src&gt;&lt;a href=#attr-script-src&gt;src&lt;/a&gt;&lt;/code&gt; attribute is parsed, but while the external script is being downloaded, the element is moved to another document.&lt;/p&gt; @@ -88247,7 +88241,7 @@ &lt;p&gt;The resulting DOM tree is as follows:&lt;/p&gt; - &lt;ul class=domTree&gt;&lt;li class=t10&gt;DOCTYPE: &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; &lt;span class=t2 title=&quot;&quot;&gt;&lt;code class=&quot;attribute name&quot;&gt;class&lt;/code&gt;=&quot;&lt;code class=&quot;attribute value&quot;&gt;x&lt;/code&gt;&quot;&lt;/span&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; &lt;span class=t2 title=&quot;&quot;&gt;&lt;code class=&quot;attribute name&quot;&gt;class&lt;/code&gt;=&quot;&lt;code class=&quot;attribute value&quot;&gt;x&lt;/code&gt;&quot;&lt;/span&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; &lt;span class=t2 title=&quot;&quot;&gt;&lt;code class=&quot;attribute name&quot;&gt;class&lt;/code&gt;=&quot;&lt;code class=&quot;attribute value&quot;&gt;x&lt;/code&gt;&quot;&lt;/span&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; &lt;span class=t2 t itle=&quot;&quot;&gt;&lt;code class=&quot;attribute name&quot;&gt;class&lt;/code&gt;=&quot;&lt;code class=&quot;attribute value&quot;&gt;x&lt;/code&gt;&quot;&lt;/span&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;X&#9166;&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; &lt;span class=t2 title=&quot;&quot;&gt;&lt;code class=&quot;attribute name&quot;&gt;class&lt;/code&gt;=&quot;&lt;code class=&quot;attribute value&quot;&gt;x&lt;/code&gt;&quot;&lt;/span&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; &lt;span class=t2 title=&quot;&quot;&gt;&lt;code class=&quot;attribute name&quot;&gt;class&lt;/code&gt;=&quot;&lt;code class=&quot;attribute value&quot;&gt;x&lt;/code&gt;&quot;&lt;/span&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; &lt;span class=t2 title=&quot;&quot;&gt;&lt;code class=&quot;attribute name&quot;&gt;class&lt;/code&gt;=&quot;&lt;code class=&quot;attribute value&quot;&gt;x&lt;/code&gt;&quot;&lt;/span&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span tit le=&quot;&quot;&gt;X&#9166;&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; &lt;span class=t2 title=&quot;&quot;&gt;&lt;code class=&quot;attribute name&quot;&gt;class&lt;/code&gt;=&quot;&lt;code class=&quot;attribute value&quot;&gt;x&lt;/code&gt;&quot;&lt;/span&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; &lt;span class=t2 title=&quot;&quot;&gt;&lt;code class=&quot;attribute name&quot;&gt;class&lt;/code&gt;=&quot;&lt;code class=&quot;attribute value&quot;&gt;x&lt;/code&gt;&quot;&lt;/span&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; &lt;span class=t2 title=&quot;&quot;&gt;&lt;code class=&quot;attribute name&quot;&gt;class&lt;/code&gt;=&quot;&lt;code class=&quot;attribute value&quot;&gt;x&lt;/code&gt;&quot;&lt;/span&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; &lt;span class=t2 title=&quot;&quot;&gt;&lt;code class=&quot;attribute name&quot;&gt;class&lt;/code&gt;=&quot;&lt;code class=&quot;attribute value&quot;&gt;x&lt;/code&gt;&quot;&lt;/span&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code &gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;X&#9166;&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;X&#9166;&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;Note how the second &lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt; element in the markup has no + &lt;ul class=domTree&gt;&lt;li class=t10&gt;DOCTYPE: &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; &lt;span class=t2 title=&quot;&quot;&gt;&lt;code class=&quot;attribute name&quot;&gt;class&lt;/code&gt;=&quot;&lt;code class=&quot;attribute value&quot;&gt;x&lt;/code&gt;&quot;&lt;/span&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; &lt;span class=t2 title=&quot;&quot;&gt;&lt;code class=&quot;attribute name&quot;&gt;class&lt;/code&gt;=&quot;&lt;code class=&quot;attribute value&quot;&gt;x&lt;/code&gt;&quot;&lt;/span&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; &lt;span class=t2 title=&quot;&quot;&gt;&lt;code class=&quot;attribute name&quot;&gt;class&lt;/code&gt;=&quot;&lt;code class=&quot;attribute value&quot;&gt;x&lt;/code&gt;&quot;&lt;/span&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; &lt;span class=t2 title=&quot; &quot;&gt;&lt;code class=&quot;attribute name&quot;&gt;class&lt;/code&gt;=&quot;&lt;code class=&quot;attribute value&quot;&gt;x&lt;/code&gt;&quot;&lt;/span&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;X&#9166;&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; &lt;span class=t2 title=&quot;&quot;&gt;&lt;code class=&quot;attribute name&quot;&gt;class&lt;/code&gt;=&quot;&lt;code class=&quot;attribute value&quot;&gt;x&lt;/code&gt;&quot;&lt;/span&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; &lt;span class=t2 title=&quot;&quot;&gt;&lt;code class=&quot;attribute name&quot;&gt;class&lt;/code&gt;=&quot;&lt;code class=&quot;attribute value&quot;&gt;x&lt;/code&gt;&quot;&lt;/span&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; &lt;span class=t2 title=&quot;&quot;&gt;&lt;code class=&quot;attribute name&quot;&gt;class&lt;/code&gt;=&quot;&lt;code class=&quot;attribute value&quot;&gt;x&lt;/code&gt;&quot;&lt;/span&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt; X&#9166;&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; &lt;span class=t2 title=&quot;&quot;&gt;&lt;code class=&quot;attribute name&quot;&gt;class&lt;/code&gt;=&quot;&lt;code class=&quot;attribute value&quot;&gt;x&lt;/code&gt;&quot;&lt;/span&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; &lt;span class=t2 title=&quot;&quot;&gt;&lt;code class=&quot;attribute name&quot;&gt;class&lt;/code&gt;=&quot;&lt;code class=&quot;attribute value&quot;&gt;x&lt;/code&gt;&quot;&lt;/span&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; &lt;span class=t2 title=&quot;&quot;&gt;&lt;code class=&quot;attribute name&quot;&gt;class&lt;/code&gt;=&quot;&lt;code class=&quot;attribute value&quot;&gt;x&lt;/code&gt;&quot;&lt;/span&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; &lt;span class=t2 title=&quot;&quot;&gt;&lt;code class=&quot;attribute name&quot;&gt;class&lt;/code&gt;=&quot;&lt;code class=&quot;attribute value&quot;&gt;x&lt;/code&gt;&quot;&lt;/span&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a hr ef=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;X&#9166;&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;X&#9166;&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;Note how the second &lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt; element in the markup has no explicit &lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; elements, but in the resulting DOM, up to three of each kind of formatting element (in this case three &lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; elements with the class attribute, and two unadorned @@ -88370,9 +88364,9 @@ &lt;p&gt;If &lt;var title=&quot;&quot;&gt;current node&lt;/var&gt; is an &lt;code&gt;&lt;a href=#the-area-element&gt;area&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-base-element&gt;base&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#basefont&gt;basefont&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#bgsound&gt;bgsound&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-br-element&gt;br&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-col-element&gt;col&lt;/a&gt;&lt;/code&gt;, - &lt;code&gt;&lt;a href=#the-command&gt;command&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-embed-element&gt;embed&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#frame&gt;frame&lt;/a&gt;&lt;/code&gt;, + &lt;code&gt;&lt;a href=#the-command-element&gt;command&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-embed-element&gt;embed&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#frame&gt;frame&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-hr-element&gt;hr&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-img-element&gt;img&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-input-element&gt;input&lt;/a&gt;&lt;/code&gt;, - &lt;code&gt;&lt;a href=#the-keygen-element&gt;keygen&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-link-element&gt;link&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt;, + &lt;code&gt;&lt;a href=#the-keygen-element&gt;keygen&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-link-element&gt;link&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-param-element&gt;param&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-source-element&gt;source&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-track-element&gt;track&lt;/a&gt;&lt;/code&gt; or &lt;code&gt;&lt;a href=#the-wbr-element&gt;wbr&lt;/a&gt;&lt;/code&gt; element, then continue on to the next child node at this point.&lt;/p&gt; &lt;!-- VOIDLIST superset --&gt; @@ -88400,7 +88394,7 @@ &lt;dd&gt; &lt;p&gt;If the parent of &lt;var title=&quot;&quot;&gt;current node&lt;/var&gt; is a - &lt;code&gt;&lt;a href=#the-style-element&gt;style&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#xmp&gt;xmp&lt;/a&gt;&lt;/code&gt;, + &lt;code&gt;&lt;a href=#the-style-element&gt;style&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#xmp&gt;xmp&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-iframe-element&gt;iframe&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#noembed&gt;noembed&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#noframes&gt;noframes&lt;/a&gt;&lt;/code&gt;, or &lt;code&gt;&lt;a href=#plaintext&gt;plaintext&lt;/a&gt;&lt;/code&gt; element, or if the parent of &lt;var title=&quot;&quot;&gt;current node&lt;/var&gt; is @@ -88488,7 +88482,7 @@ literal string &quot;&lt;code title=&quot;&quot;&gt;--&gt;&lt;/code&gt;&quot;, then when the result of serializing the element is parsed, the comment will be truncated at that point and the rest of the comment will be interpreted as - markup. More examples would be making a &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element + markup. More examples would be making a &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element contain a text node with the text string &quot;&lt;code&gt;&lt;/script&gt;&lt;/code&gt;&quot;, or having a &lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt; element that contains a &lt;code&gt;&lt;a href=#the-ul-element&gt;ul&lt;/a&gt;&lt;/code&gt; element (as the &lt;code&gt;&lt;a href=#the-ul-element&gt;ul&lt;/a&gt;&lt;/code&gt; @@ -88504,7 +88498,7 @@ &quot;&lt;code&gt;&lt;/style&gt;&lt;script&gt;attack&lt;/script&gt;&lt;/code&gt;&quot; as a font name, &lt;code title=dom-innerHTML&gt;&lt;a href=#dom-innerhtml&gt;innerHTML&lt;/a&gt;&lt;/code&gt; will return markup that, if parsed in a different context, would contain a - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; node, even though no &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; node + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; node, even though no &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; node existed in the original DOM.&lt;/p&gt; &lt;/div&gt; @@ -88580,7 +88574,7 @@ &lt;p&gt;Set the state of the &lt;a href=#html-parser&gt;HTML parser&lt;/a&gt;'s &lt;a href=#tokenization&gt;tokenization&lt;/a&gt; stage as follows:&lt;/p&gt; - &lt;dl class=switch&gt;&lt;dt&gt;If it is a &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt; or &lt;code&gt;&lt;a href=#the-textarea-element&gt;textarea&lt;/a&gt;&lt;/code&gt; + &lt;dl class=switch&gt;&lt;dt&gt;If it is a &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt; or &lt;code&gt;&lt;a href=#the-textarea-element&gt;textarea&lt;/a&gt;&lt;/code&gt; element&lt;/dt&gt; &lt;dd&gt;Switch the tokenizer to the &lt;a href=#rcdata-state&gt;RCDATA state&lt;/a&gt;.&lt;/dd&gt; @@ -88593,7 +88587,7 @@ &lt;dd&gt;Switch the tokenizer to the &lt;a href=#rawtext-state&gt;RAWTEXT state&lt;/a&gt;.&lt;/dd&gt; - &lt;dt&gt;If it is a &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element&lt;/dt&gt; + &lt;dt&gt;If it is a &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element&lt;/dt&gt; &lt;dd&gt;Switch the tokenizer to the &lt;a href=#script-data-state&gt;script data state&lt;/a&gt;.&lt;/dd&gt; @@ -88628,7 +88622,7 @@ &lt;li&gt; - &lt;p&gt;Let &lt;var title=&quot;&quot;&gt;root&lt;/var&gt; be a new &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element + &lt;p&gt;Let &lt;var title=&quot;&quot;&gt;root&lt;/var&gt; be a new &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element with no attributes.&lt;/p&gt; &lt;/li&gt; @@ -88817,14 +88811,14 @@ handling external subsets. &lt;a href=#refsXML&gt;[XML]&lt;/a&gt;&lt;/p&gt; &lt;p id=scriptTagXML&gt;When an &lt;a href=#xml-parser&gt;XML parser&lt;/a&gt; creates a - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element, it must be marked as being + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element, it must be marked as being &lt;a href=#parser-inserted&gt;&quot;parser-inserted&quot;&lt;/a&gt; and its &lt;a href=#force-async&gt;&quot;force-async&quot;&lt;/a&gt; flag must be unset. If the parser was originally created for the &lt;a href=#xml-fragment-parsing-algorithm&gt;XML fragment parsing algorithm&lt;/a&gt;, then the element must be marked as &lt;a href=#already-started&gt;&quot;already started&quot;&lt;/a&gt; also. When the element's end tag is parsed, the user agent must &lt;a href=#provide-a-stable-state&gt;provide a stable state&lt;/a&gt;, and then &lt;a href=#prepare-a-script title=&quot;prepare a script&quot;&gt;prepare&lt;/a&gt; - the &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element. If this causes there to be a + the &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element. If this causes there to be a &lt;a href=#pending-parsing-blocking-script&gt;pending parsing-blocking script&lt;/a&gt;, then the user agent must run the following steps:&lt;/p&gt; @@ -90095,7 +90089,7 @@ &lt;h4 id=embedded-content-2&gt;&lt;span class=secno&gt;15.3.1 &lt;/span&gt;Embedded content&lt;/h4&gt; &lt;p&gt;The &lt;code&gt;&lt;a href=#the-embed-element&gt;embed&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-iframe-element&gt;iframe&lt;/a&gt;&lt;/code&gt;, and - &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; elements are expected to be treated as replaced + &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; elements are expected to be treated as replaced elements.&lt;/p&gt; &lt;p&gt;A &lt;code&gt;&lt;a href=#the-canvas-element&gt;canvas&lt;/a&gt;&lt;/code&gt; element that &lt;a href=#represents&gt;represents&lt;/a&gt; @@ -90114,43 +90108,43 @@ element. Other &lt;code&gt;&lt;a href=#the-applet-element&gt;applet&lt;/a&gt;&lt;/code&gt; elements are expected to be treated as ordinary elements in the rendering model.&lt;/p&gt; - &lt;p&gt;The &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; element, when it is &lt;a href=#expose-a-user-interface-to-the-user title=&quot;expose a + &lt;p&gt;The &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; element, when it is &lt;a href=#expose-a-user-interface-to-the-user title=&quot;expose a user interface to the user&quot;&gt;exposing a user interface&lt;/a&gt;, is expected to be treated as a replaced element about one line high, as wide as is necessary to expose the user agent's user interface - features. When an &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; element is not &lt;a href=#expose-a-user-interface-to-the-user title=&quot;expose a user interface to the user&quot;&gt;exposing a user + features. When an &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; element is not &lt;a href=#expose-a-user-interface-to-the-user title=&quot;expose a user interface to the user&quot;&gt;exposing a user interface&lt;/a&gt;, the user agent is expected to hide it, irrespective of CSS rules.&lt;/p&gt; - &lt;p&gt;Whether a &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element is &lt;a href=#expose-a-user-interface-to-the-user title=&quot;expose a + &lt;p&gt;Whether a &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element is &lt;a href=#expose-a-user-interface-to-the-user title=&quot;expose a user interface to the user&quot;&gt;exposing a user interface&lt;/a&gt; is not expected to affect the size of the rendering; controls are expected to be overlaid with the page content without causing any layout changes, and are expected to disappear when the user does not need them.&lt;/p&gt; - &lt;p&gt;When a &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element represents a poster frame or + &lt;p&gt;When a &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element represents a poster frame or frame of video, the poster frame or frame of video is expected to be rendered at the largest size that maintains the aspect ratio of that poster frame or frame of video without being taller or wider than - the &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element itself, and is expected to be - centered in the &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element.&lt;/p&gt; + the &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element itself, and is expected to be + centered in the &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element.&lt;/p&gt; &lt;p&gt;Any subtitles or captions are expected to be overlayed directly - on top of their &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element, as defined by the + on top of their &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element, as defined by the relevant rendering rules; for &lt;a href=#webvtt&gt;WebVTT&lt;/a&gt;, those are the &lt;a href=#webvtt-cue-text-rendering-rules&gt;WebVTT cue text rendering rules&lt;/a&gt; defined below.&lt;/p&gt; &lt;p&gt;When the user agent starts &lt;a href=#expose-a-user-interface-to-the-user title=&quot;expose a user interface to the user&quot;&gt;exposing a user interface&lt;/a&gt; for a - &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element, the user agent should run the &lt;a href=#rules-for-updating-the-text-track-rendering&gt;rules - for updating the text track rendering&lt;/a&gt; of each of the &lt;a href=#text-track title=&quot;text track&quot;&gt;text tracks&lt;/a&gt; in the &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; + &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element, the user agent should run the &lt;a href=#rules-for-updating-the-text-track-rendering&gt;rules + for updating the text track rendering&lt;/a&gt; of each of the &lt;a href=#text-track title=&quot;text track&quot;&gt;text tracks&lt;/a&gt; in the &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element's &lt;a href=#list-of-text-tracks&gt;list of text tracks&lt;/a&gt; that are &lt;a href=#text-track-showing title=&quot;text track showing&quot;&gt;showing&lt;/a&gt; or &lt;a href=#text-track-showing-by-default title=&quot;text track showing by default&quot;&gt;showing by default&lt;/a&gt; (e.g., for &lt;a href=#text-track title=&quot;text track&quot;&gt;text tracks&lt;/a&gt; based on &lt;a href=#webvtt&gt;WebVTT&lt;/a&gt;, the &lt;a href=#rules-for-updating-the-display-of-webvtt-text-tracks&gt;rules for updating the display of WebVTT text tracks&lt;/a&gt;).&lt;/p&gt; - &lt;p class=note&gt;Resizing &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; and &lt;code&gt;&lt;a href=#the-canvas-element&gt;canvas&lt;/a&gt;&lt;/code&gt; + &lt;p class=note&gt;Resizing &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; and &lt;code&gt;&lt;a href=#the-canvas-element&gt;canvas&lt;/a&gt;&lt;/code&gt; elements does not interrupt video playback or clear the canvas.&lt;/p&gt; &lt;hr&gt;&lt;p&gt;The following CSS rules are expected to apply:&lt;/p&gt; @@ -90177,7 +90171,7 @@ &lt;p&gt;The &lt;dfn id=rules-for-updating-the-display-of-webvtt-text-tracks&gt;rules for updating the display of WebVTT text tracks&lt;/dfn&gt; render the &lt;a href=#text-track title=&quot;text track&quot;&gt;text tracks&lt;/a&gt; of a &lt;a href=#media-element&gt;media element&lt;/a&gt; (specifically, a - &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element), or of another playback mechanism, by + &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element), or of another playback mechanism, by applying the steps below. All the &lt;a href=#text-track title=&quot;text track&quot;&gt;text tracks&lt;/a&gt; that use these rules for a given &lt;a href=#media-element&gt;media element&lt;/a&gt;, or other playback mechanism, are rendered together, @@ -90190,7 +90184,7 @@ &lt;p&gt;The rules are as follows:&lt;/p&gt; - &lt;ol&gt;&lt;li&gt;&lt;p&gt;If the &lt;a href=#media-element&gt;media element&lt;/a&gt; is an &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; + &lt;ol&gt;&lt;li&gt;&lt;p&gt;If the &lt;a href=#media-element&gt;media element&lt;/a&gt; is an &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; element, or is another playback mechanism with no rendering area, abort these steps. There is nothing to render.&lt;/li&gt; @@ -90803,7 +90797,7 @@ &lt;i&gt;matched element&lt;/i&gt;.&lt;/p&gt; &lt;p class=note&gt;If the &lt;i&gt;matched element&lt;/i&gt; is not a - &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element, the pseudo-elements defined below won't + &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element, the pseudo-elements defined below won't have any effect according to this specification.&lt;/p&gt; &lt;p&gt;A CSS user agent that implements the &lt;a href=#text-track title=&quot;text @@ -91153,7 +91147,7 @@ &lt;p id=dimRendering&gt;The &lt;code title=attr-dim-width&gt;&lt;a href=#attr-dim-width&gt;width&lt;/a&gt;&lt;/code&gt; and &lt;code title=attr-dim-height&gt;&lt;a href=#attr-dim-height&gt;height&lt;/a&gt;&lt;/code&gt; attributes on &lt;code&gt;&lt;a href=#the-applet-element&gt;applet&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-embed-element&gt;embed&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-iframe-element&gt;iframe&lt;/a&gt;&lt;/code&gt;, - &lt;code&gt;&lt;a href=#the-img-element&gt;img&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-object-element&gt;object&lt;/a&gt;&lt;/code&gt; or &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; + &lt;code&gt;&lt;a href=#the-img-element&gt;img&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-object-element&gt;object&lt;/a&gt;&lt;/code&gt; or &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; elements, and &lt;code&gt;&lt;a href=#the-input-element&gt;input&lt;/a&gt;&lt;/code&gt; elements with a &lt;code title=attr-input-type&gt;&lt;a href=#attr-input-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute in the &lt;a href=#image-button-state title=attr-input-type-image&gt;Image Button&lt;/a&gt; state, &lt;a href=#maps-to-the-dimension-property title=&quot;maps to the dimension property&quot;&gt;map to the dimension properties&lt;/a&gt; 'width' and 'height' on the element respectively.&lt;/p&gt; @@ -91193,7 +91187,7 @@ &lt;h4 id=toolbars-0&gt;&lt;span class=secno&gt;15.3.6 &lt;/span&gt;Toolbars&lt;/h4&gt; - &lt;p&gt;When a &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; element's &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute is in the &lt;a href=#toolbar-state title=&quot;toolbar state&quot;&gt;toolbar&lt;/a&gt; state, the element is + &lt;p&gt;When a &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; element's &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute is in the &lt;a href=#toolbar-state title=&quot;toolbar state&quot;&gt;toolbar&lt;/a&gt; state, the element is expected to be treated as a replaced element with a height about two lines high and a width derived from the contents of the element.&lt;/p&gt; @@ -91887,7 +91881,7 @@ &lt;h3 id=frames-and-framesets&gt;&lt;span class=secno&gt;15.5 &lt;/span&gt;Frames and framesets&lt;/h3&gt; - &lt;p&gt;When an &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element's second child element is a + &lt;p&gt;When an &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element's second child element is a &lt;code&gt;&lt;a href=#frameset&gt;frameset&lt;/a&gt;&lt;/code&gt; element, the user agent is expected to render the &lt;code&gt;&lt;a href=#frameset&gt;frameset&lt;/a&gt;&lt;/code&gt; element as described below across the surface of the viewport, instead of applying the usual CSS rendering @@ -92385,7 +92379,7 @@ instead.&lt;/p&gt; &lt;p&gt;Authors should not specify a &lt;code title=attr-script-language&gt;&lt;a href=#attr-script-language&gt;language&lt;/a&gt;&lt;/code&gt; attribute on a - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element. If the attribute is present, its value + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element. If the attribute is present, its value must be an &lt;a href=#ascii-case-insensitive&gt;ASCII case-insensitive&lt;/a&gt; match for the string &quot;&lt;code title=&quot;&quot;&gt;JavaScript&lt;/code&gt;&quot; and either the &lt;code title=attr-script-type&gt;&lt;a href=#attr-script-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute must be omitted or its value must be an &lt;a href=#ascii-case-insensitive&gt;ASCII case-insensitive&lt;/a&gt; match for @@ -92435,7 +92429,7 @@ &lt;code&gt;&lt;a href=#the-img-element&gt;img&lt;/a&gt;&lt;/code&gt; element if its value is the string &quot;&lt;code title=&quot;&quot;&gt;0&lt;/code&gt;&quot;.&lt;/li&gt; &lt;li&gt;&lt;p&gt;The presence of a &lt;code title=attr-script-language&gt;&lt;a href=#attr-script-language&gt;language&lt;/a&gt;&lt;/code&gt; attribute on a - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element if its value is an &lt;a href=#ascii-case-insensitive&gt;ASCII + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element if its value is an &lt;a href=#ascii-case-insensitive&gt;ASCII case-insensitive&lt;/a&gt; match for the string &quot;&lt;code title=&quot;&quot;&gt;JavaScript&lt;/code&gt;&quot; and if there is no &lt;code title=attr-script-type&gt;&lt;a href=#attr-script-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute or there is and its value is an &lt;a href=#ascii-case-insensitive&gt;ASCII case-insensitive&lt;/a&gt; match for the string &quot;&lt;code title=&quot;&quot;&gt;text/javascript&lt;/code&gt;&quot;.&lt;/li&gt; @@ -92467,7 +92461,7 @@ &lt;dd&gt;&lt;p&gt;Use &lt;code&gt;&lt;a href=#the-abbr-element&gt;abbr&lt;/a&gt;&lt;/code&gt; instead.&lt;/dd&gt; &lt;dt&gt;&lt;dfn id=bgsound&gt;&lt;code&gt;bgsound&lt;/code&gt;&lt;/dfn&gt;&lt;/dt&gt; - &lt;dd&gt;&lt;p&gt;Use &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; instead.&lt;/dd&gt; + &lt;dd&gt;&lt;p&gt;Use &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; instead.&lt;/dd&gt; &lt;dt&gt;&lt;dfn id=dir&gt;&lt;code&gt;dir&lt;/code&gt;&lt;/dfn&gt;&lt;/dt&gt; &lt;dd&gt;&lt;p&gt;Use &lt;code&gt;&lt;a href=#the-ul-element&gt;ul&lt;/a&gt;&lt;/code&gt; instead.&lt;/dd&gt; @@ -92568,13 +92562,13 @@ attribute is sufficient; the &lt;code title=attr-area-nohref&gt;&lt;a href=#attr-area-nohref&gt;nohref&lt;/a&gt;&lt;/code&gt; attribute is unnecessary. Omit it altogether.&lt;/dd&gt; - &lt;dt&gt;&lt;dfn id=attr-head-profile title=attr-head-profile&gt;&lt;code&gt;profile&lt;/code&gt;&lt;/dfn&gt; on &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; elements&lt;/dt&gt; - &lt;dd&gt;&lt;p&gt;When used for declaring which &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; terms are + &lt;dt&gt;&lt;dfn id=attr-head-profile title=attr-head-profile&gt;&lt;code&gt;profile&lt;/code&gt;&lt;/dfn&gt; on &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; elements&lt;/dt&gt; + &lt;dd&gt;&lt;p&gt;When used for declaring which &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; terms are used in the document, unnecessary; omit it altogether, and &lt;a href=#concept-meta-extensions title=concept-meta-extensions&gt;register the names&lt;/a&gt;.&lt;/dd&gt; &lt;dd&gt;&lt;p&gt;When used for triggering specific user agent behaviors: use a &lt;code&gt;&lt;a href=#the-link-element&gt;link&lt;/a&gt;&lt;/code&gt; element instead.&lt;/dd&gt; - &lt;dt&gt;&lt;dfn id=attr-html-version title=attr-html-version&gt;&lt;code&gt;version&lt;/code&gt;&lt;/dfn&gt; on &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; elements&lt;/dt&gt; + &lt;dt&gt;&lt;dfn id=attr-html-version title=attr-html-version&gt;&lt;code&gt;version&lt;/code&gt;&lt;/dfn&gt; on &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; elements&lt;/dt&gt; &lt;dd&gt;&lt;p&gt;Unnecessary. Omit it altogether.&lt;/dd&gt; &lt;dt&gt;&lt;dfn id=attr-input-usemap title=attr-input-usemap&gt;&lt;code&gt;usemap&lt;/code&gt;&lt;/dfn&gt; on &lt;code&gt;&lt;a href=#the-input-element&gt;input&lt;/a&gt;&lt;/code&gt; elements&lt;/dt&gt; @@ -92594,7 +92588,7 @@ &lt;dt&gt;&lt;dfn id=attr-link-target title=attr-link-target&gt;&lt;code&gt;target&lt;/code&gt;&lt;/dfn&gt; on &lt;code&gt;&lt;a href=#the-link-element&gt;link&lt;/a&gt;&lt;/code&gt; elements&lt;/dt&gt; &lt;dd&gt;&lt;p&gt;Unnecessary. Omit it altogether.&lt;/dd&gt; - &lt;dt&gt;&lt;dfn id=attr-meta-scheme title=attr-meta-scheme&gt;&lt;code&gt;scheme&lt;/code&gt;&lt;/dfn&gt; on &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; elements&lt;/dt&gt; + &lt;dt&gt;&lt;dfn id=attr-meta-scheme title=attr-meta-scheme&gt;&lt;code&gt;scheme&lt;/code&gt;&lt;/dfn&gt; on &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; elements&lt;/dt&gt; &lt;dd&gt;&lt;p&gt;Use only one scheme per field, or make the scheme declaration part of the value.&lt;/dd&gt; &lt;dt&gt;&lt;dfn id=attr-object-archive title=attr-object-archive&gt;&lt;code&gt;archive&lt;/code&gt;&lt;/dfn&gt; on &lt;code&gt;&lt;a href=#the-object-element&gt;object&lt;/a&gt;&lt;/code&gt; elements&lt;/dt&gt; @@ -92616,12 +92610,12 @@ &lt;dd&gt;&lt;p&gt;Use the &lt;code title=attr-param-name&gt;&lt;a href=#attr-param-name&gt;name&lt;/a&gt;&lt;/code&gt; and &lt;code title=attr-param-value&gt;&lt;a href=#attr-param-value&gt;value&lt;/a&gt;&lt;/code&gt; attributes without declaring value types.&lt;/dd&gt; - &lt;dt&gt;&lt;dfn id=attr-script-language title=attr-script-language&gt;&lt;code&gt;language&lt;/code&gt;&lt;/dfn&gt; on &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; elements (except as noted in the previous section)&lt;/dt&gt; + &lt;dt&gt;&lt;dfn id=attr-script-language title=attr-script-language&gt;&lt;code&gt;language&lt;/code&gt;&lt;/dfn&gt; on &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements (except as noted in the previous section)&lt;/dt&gt; &lt;dd&gt;&lt;p&gt;Use the &lt;code title=attr-script-type&gt;&lt;a href=#attr-script-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute instead.&lt;/dd&gt; - &lt;dt&gt;&lt;dfn id=attr-script-event title=attr-script-event&gt;&lt;code&gt;event&lt;/code&gt;&lt;/dfn&gt; on &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; elements&lt;/dt&gt; - &lt;dt&gt;&lt;dfn id=attr-script-for title=attr-script-for&gt;&lt;code&gt;for&lt;/code&gt;&lt;/dfn&gt; on &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; elements&lt;/dt&gt; + &lt;dt&gt;&lt;dfn id=attr-script-event title=attr-script-event&gt;&lt;code&gt;event&lt;/code&gt;&lt;/dfn&gt; on &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements&lt;/dt&gt; + &lt;dt&gt;&lt;dfn id=attr-script-for title=attr-script-for&gt;&lt;code&gt;for&lt;/code&gt;&lt;/dfn&gt; on &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements&lt;/dt&gt; &lt;dd&gt;&lt;p&gt;Use DOM Events mechanisms to register event listeners. &lt;a href=#refsDOMEVENTS&gt;[DOMEVENTS]&lt;/a&gt;&lt;/dd&gt; &lt;dt&gt;&lt;dfn id=attr-table-datapagesize title=attr-table-datapagesize&gt;&lt;code&gt;datapagesize&lt;/code&gt;&lt;/dfn&gt; on &lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt; elements&lt;/dt&gt; @@ -92689,7 +92683,7 @@ &lt;dt&gt;&lt;dfn id=attr-img-vspace title=attr-img-vspace&gt;&lt;code&gt;vspace&lt;/code&gt;&lt;/dfn&gt; on &lt;code&gt;&lt;a href=#the-img-element&gt;img&lt;/a&gt;&lt;/code&gt; elements&lt;/dt&gt; &lt;dt&gt;&lt;dfn id=attr-legend-align title=attr-legend-align&gt;&lt;code&gt;align&lt;/code&gt;&lt;/dfn&gt; on &lt;code&gt;&lt;a href=#the-legend-element&gt;legend&lt;/a&gt;&lt;/code&gt; elements&lt;/dt&gt; &lt;dt&gt;&lt;dfn id=attr-li-type title=attr-li-type&gt;&lt;code&gt;type&lt;/code&gt;&lt;/dfn&gt; on &lt;code&gt;&lt;a href=#the-li-element&gt;li&lt;/a&gt;&lt;/code&gt; elements&lt;/dt&gt; - &lt;dt&gt;&lt;dfn id=attr-menu-compact title=attr-menu-compact&gt;&lt;code&gt;compact&lt;/code&gt;&lt;/dfn&gt; on &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; elements&lt;/dt&gt; + &lt;dt&gt;&lt;dfn id=attr-menu-compact title=attr-menu-compact&gt;&lt;code&gt;compact&lt;/code&gt;&lt;/dfn&gt; on &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; elements&lt;/dt&gt; &lt;dt&gt;&lt;dfn id=attr-object-align title=attr-object-align&gt;&lt;code&gt;align&lt;/code&gt;&lt;/dfn&gt; on &lt;code&gt;&lt;a href=#the-object-element&gt;object&lt;/a&gt;&lt;/code&gt; elements&lt;/dt&gt; &lt;dt&gt;&lt;dfn id=attr-object-border title=attr-object-border&gt;&lt;code&gt;border&lt;/code&gt;&lt;/dfn&gt; on &lt;code&gt;&lt;a href=#the-object-element&gt;object&lt;/a&gt;&lt;/code&gt; elements&lt;/dt&gt; &lt;dt&gt;&lt;dfn id=attr-object-hspace title=attr-object-hspace&gt;&lt;code&gt;hspace&lt;/code&gt;&lt;/dfn&gt; on &lt;code&gt;&lt;a href=#the-object-element&gt;object&lt;/a&gt;&lt;/code&gt; elements&lt;/dt&gt; @@ -93371,7 +93365,7 @@ &lt;a href=#reflect&gt;reflect&lt;/a&gt; the content attribute of the same name.&lt;/p&gt; &lt;hr&gt;&lt;p class=note&gt;The &lt;dfn id=dom-head-profile title=dom-head-profile&gt;&lt;code&gt;profile&lt;/code&gt;&lt;/dfn&gt; IDL attribute on - &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; elements (with the &lt;code&gt;&lt;a href=#htmlheadelement&gt;HTMLHeadElement&lt;/a&gt;&lt;/code&gt; + &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; elements (with the &lt;code&gt;&lt;a href=#htmlheadelement&gt;HTMLHeadElement&lt;/a&gt;&lt;/code&gt; interface) is intentionally omitted. Unless so required by &lt;a href=#other-applicable-specifications title=&quot;other applicable specifications&quot;&gt;another applicable specification&lt;/a&gt;, implementations would therefore not support this attribute. (It is mentioned here as it was defined in a @@ -93401,7 +93395,7 @@ };&lt;/pre&gt; &lt;p&gt;The &lt;dfn id=dom-html-version title=dom-html-version&gt;&lt;code&gt;version&lt;/code&gt;&lt;/dfn&gt; IDL - attribute of the &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element must &lt;a href=#reflect&gt;reflect&lt;/a&gt; + attribute of the &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element must &lt;a href=#reflect&gt;reflect&lt;/a&gt; the content attribute of the same name.&lt;/p&gt; &lt;hr&gt;&lt;pre class=idl&gt;[Supplemental] @@ -93517,7 +93511,7 @@ };&lt;/pre&gt; &lt;p&gt;The &lt;dfn id=dom-menu-compact title=dom-menu-compact&gt;&lt;code&gt;compact&lt;/code&gt;&lt;/dfn&gt; IDL - attribute of the &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; element must &lt;a href=#reflect&gt;reflect&lt;/a&gt; + attribute of the &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; element must &lt;a href=#reflect&gt;reflect&lt;/a&gt; the content attribute of the same name.&lt;/p&gt; &lt;hr&gt;&lt;pre class=idl&gt;[Supplemental] @@ -93526,8 +93520,8 @@ };&lt;/pre&gt; &lt;p&gt;User agents may treat the &lt;code title=attr-meta-scheme&gt;&lt;a href=#attr-meta-scheme&gt;scheme&lt;/a&gt;&lt;/code&gt; content attribute on the - &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element as an extension of the element's &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; content attribute when processing - a &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; attribute whose value is one that + &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element as an extension of the element's &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; content attribute when processing + a &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; attribute whose value is one that the user agent recognizes as supporting the &lt;code title=attr-meta-scheme&gt;&lt;a href=#attr-meta-scheme&gt;scheme&lt;/a&gt;&lt;/code&gt; attribute.&lt;/p&gt; &lt;p&gt;User agents are encouraged to ignore the &lt;code title=attr-meta-scheme&gt;&lt;a href=#attr-meta-scheme&gt;scheme&lt;/a&gt;&lt;/code&gt; attribute and instead process @@ -93536,12 +93530,12 @@ &lt;div class=example&gt; - &lt;p&gt;For example, if the user agent acts on &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; + &lt;p&gt;For example, if the user agent acts on &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; elements with &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; attributes having the value &quot;eGMS.subject.keyword&quot;, and knows that the &lt;code title=attr-meta-scheme&gt;&lt;a href=#attr-meta-scheme&gt;scheme&lt;/a&gt;&lt;/code&gt; attribute is used with this metadata name, then it could take the &lt;code title=attr-meta-scheme&gt;&lt;a href=#attr-meta-scheme&gt;scheme&lt;/a&gt;&lt;/code&gt; attribute into account, acting as if it was an extension of the &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; attribute. Thus the following - two &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; elements could be treated as two elements + two &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; elements could be treated as two elements giving values for two different metadata names, one consisting of a combination of &quot;eGMS.subject.keyword&quot; and &quot;LGCL&quot;, and the other consisting of a combination of &quot;eGMS.subject.keyword&quot; and @@ -93560,7 +93554,7 @@ &lt;/div&gt; &lt;p&gt;The &lt;dfn id=dom-meta-scheme title=dom-meta-scheme&gt;&lt;code&gt;scheme&lt;/code&gt;&lt;/dfn&gt; IDL - attribute of the &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element must &lt;a href=#reflect&gt;reflect&lt;/a&gt; + attribute of the &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element must &lt;a href=#reflect&gt;reflect&lt;/a&gt; the content attribute of the same name.&lt;/p&gt; &lt;hr&gt;&lt;pre class=idl&gt;[Supplemental] @@ -93645,7 +93639,7 @@ &lt;p&gt;The &lt;dfn id=dom-script-event title=dom-script-event&gt;&lt;code&gt;event&lt;/code&gt;&lt;/dfn&gt; and &lt;dfn id=dom-script-htmlfor title=dom-script-htmlFor&gt;&lt;code&gt;htmlFor&lt;/code&gt;&lt;/dfn&gt; IDL - attributes of the &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element must return the empty + attributes of the &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element must return the empty string on getting, and do nothing on setting.&lt;/p&gt; &lt;hr&gt;&lt;pre class=idl&gt;[Supplemental] @@ -94667,7 +94661,7 @@ &lt;td&gt;&lt;a href=#flow-content title=&quot;Flow content&quot;&gt;flow&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;a href=#global-attributes title=&quot;global attributes&quot;&gt;globals&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;a href=#htmlelement&gt;HTMLElement&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; - &lt;tr&gt;&lt;th&gt;&lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt;&lt;/th&gt; + &lt;tr&gt;&lt;th&gt;&lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt;&lt;/th&gt; &lt;td&gt;Audio player&lt;/td&gt; &lt;td&gt;&lt;a href=#flow-content title=&quot;Flow content&quot;&gt;flow&lt;/a&gt;; &lt;a href=#phrasing-content title=&quot;Phrasing content&quot;&gt;phrasing&lt;/a&gt;; @@ -94695,7 +94689,7 @@ &lt;tr&gt;&lt;th&gt;&lt;code&gt;&lt;a href=#the-base-element&gt;base&lt;/a&gt;&lt;/code&gt;&lt;/th&gt; &lt;td&gt;Base URL and default target &lt;a href=#browsing-context&gt;browsing context&lt;/a&gt; for &lt;a href=#attr-hyperlink-target title=attr-hyperlink-target&gt;hyperlinks&lt;/a&gt; and &lt;a href=#attr-fs-target title=attr-fs-target&gt;forms&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;a href=#metadata-content title=&quot;Metadata content&quot;&gt;metadata&lt;/a&gt;&lt;/td&gt; - &lt;td&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; + &lt;td&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; &lt;td&gt;empty&lt;/td&gt; &lt;td&gt;&lt;a href=#global-attributes title=&quot;global attributes&quot;&gt;globals&lt;/a&gt;; &lt;code title=attr-base-href&gt;&lt;a href=#attr-base-href&gt;href&lt;/a&gt;&lt;/code&gt;; @@ -94730,7 +94724,7 @@ &lt;tr&gt;&lt;th&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;/th&gt; &lt;td&gt;Document body&lt;/td&gt; &lt;td&gt;&lt;a href=#sectioning-root title=&quot;Sectioning root&quot;&gt;sectioning root&lt;/a&gt;&lt;/td&gt; - &lt;td&gt;&lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; + &lt;td&gt;&lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; &lt;td&gt;&lt;a href=#flow-content title=&quot;Flow content&quot;&gt;flow&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;a href=#global-attributes title=&quot;global attributes&quot;&gt;globals&lt;/a&gt;; &lt;code title=handler-window-onafterprint&gt;&lt;a href=#handler-window-onafterprint&gt;onafterprint&lt;/a&gt;&lt;/code&gt;; @@ -94836,12 +94830,12 @@ &lt;td&gt;&lt;a href=#global-attributes title=&quot;global attributes&quot;&gt;globals&lt;/a&gt;; &lt;code title=attr-colgroup-span&gt;&lt;a href=#attr-colgroup-span&gt;span&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;a href=#htmltablecolelement&gt;HTMLTableColElement&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; - &lt;tr&gt;&lt;th&gt;&lt;code&gt;&lt;a href=#the-command&gt;command&lt;/a&gt;&lt;/code&gt;&lt;/th&gt; + &lt;tr&gt;&lt;th&gt;&lt;code&gt;&lt;a href=#the-command-element&gt;command&lt;/a&gt;&lt;/code&gt;&lt;/th&gt; &lt;td&gt;Menu command&lt;/td&gt; &lt;td&gt;&lt;a href=#metadata-content title=&quot;Metadata content&quot;&gt;metadata&lt;/a&gt;; &lt;a href=#flow-content title=&quot;Flow content&quot;&gt;flow&lt;/a&gt;; &lt;a href=#phrasing-content title=&quot;Phrasing content&quot;&gt;phrasing&lt;/a&gt;&lt;/td&gt; - &lt;td&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;; + &lt;td&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;; &lt;a href=#phrasing-content title=&quot;Phrasing content&quot;&gt;phrasing&lt;/a&gt;&lt;/td&gt; &lt;td&gt;empty&lt;/td&gt; &lt;td&gt;&lt;a href=#global-attributes title=&quot;global attributes&quot;&gt;globals&lt;/a&gt;; @@ -95006,10 +95000,10 @@ &lt;td&gt;&lt;a href=#phrasing-content title=&quot;Phrasing content&quot;&gt;phrasing&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;a href=#global-attributes title=&quot;global attributes&quot;&gt;globals&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;a href=#htmlheadingelement&gt;HTMLHeadingElement&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; - &lt;tr&gt;&lt;th&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;&lt;/th&gt; + &lt;tr&gt;&lt;th&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;&lt;/th&gt; &lt;td&gt;Container for document metadata&lt;/td&gt; &lt;td&gt;none&lt;/td&gt; - &lt;td&gt;&lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; + &lt;td&gt;&lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; &lt;td&gt;&lt;a href=#metadata-content title=&quot;Metadata content&quot;&gt;metadata content&lt;/a&gt;*&lt;/td&gt; &lt;td&gt;&lt;a href=#global-attributes title=&quot;global attributes&quot;&gt;globals&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;a href=#htmlheadelement&gt;HTMLHeadElement&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; @@ -95037,11 +95031,11 @@ &lt;td&gt;empty&lt;/td&gt; &lt;td&gt;&lt;a href=#global-attributes title=&quot;global attributes&quot;&gt;globals&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;a href=#htmlhrelement&gt;HTMLHRElement&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; - &lt;tr&gt;&lt;th&gt;&lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;&lt;/th&gt; + &lt;tr&gt;&lt;th&gt;&lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;&lt;/th&gt; &lt;td&gt;Root element&lt;/td&gt; &lt;td&gt;none&lt;/td&gt; &lt;td&gt;none*&lt;/td&gt; - &lt;td&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;*; + &lt;td&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;*; &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;*&lt;/td&gt; &lt;td&gt;&lt;a href=#global-attributes title=&quot;global attributes&quot;&gt;globals&lt;/a&gt;; &lt;code title=attr-html-manifest&gt;&lt;a href=#attr-html-manifest&gt;manifest&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; @@ -95191,7 +95185,7 @@ &lt;tr&gt;&lt;th&gt;&lt;code&gt;&lt;a href=#the-li-element&gt;li&lt;/a&gt;&lt;/code&gt;&lt;/th&gt; &lt;td&gt;List item&lt;/td&gt; &lt;td&gt;none&lt;/td&gt; - &lt;td&gt;&lt;code&gt;&lt;a href=#the-ol-element&gt;ol&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-ul-element&gt;ul&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; + &lt;td&gt;&lt;code&gt;&lt;a href=#the-ol-element&gt;ol&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-ul-element&gt;ul&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; &lt;td&gt;&lt;a href=#flow-content title=&quot;Flow content&quot;&gt;flow&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;a href=#global-attributes title=&quot;global attributes&quot;&gt;globals&lt;/a&gt;; &lt;code title=attr-li-value&gt;&lt;a href=#attr-li-value&gt;value&lt;/a&gt;&lt;/code&gt;*&lt;/td&gt; @@ -95201,7 +95195,7 @@ &lt;td&gt;&lt;a href=#metadata-content title=&quot;Metadata content&quot;&gt;metadata&lt;/a&gt;; &lt;a href=#flow-content title=&quot;Flow content&quot;&gt;flow&lt;/a&gt;*; &lt;a href=#phrasing-content title=&quot;Phrasing content&quot;&gt;phrasing&lt;/a&gt;*&lt;/td&gt; - &lt;td&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;; + &lt;td&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt;*; &lt;a href=#phrasing-content title=&quot;phrasing content&quot;&gt;phrasing&lt;/a&gt;*&lt;/td&gt; &lt;td&gt;empty&lt;/td&gt; @@ -95231,7 +95225,7 @@ &lt;td&gt;&lt;a href=#phrasing-content title=&quot;Phrasing content&quot;&gt;phrasing&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;a href=#global-attributes title=&quot;global attributes&quot;&gt;globals&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;a href=#htmlelement&gt;HTMLElement&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; - &lt;tr&gt;&lt;th&gt;&lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt;&lt;/th&gt; + &lt;tr&gt;&lt;th&gt;&lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt;&lt;/th&gt; &lt;td&gt;Menu of commands&lt;/td&gt; &lt;td&gt;&lt;a href=#flow-content title=&quot;Flow content&quot;&gt;flow&lt;/a&gt;; &lt;a href=#interactive-content title=&quot;Interactive content&quot;&gt;interactive&lt;/a&gt;*&lt;/td&gt; @@ -95242,12 +95236,12 @@ &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt;; &lt;code title=attr-menu-label&gt;&lt;a href=#attr-menu-label&gt;label&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;a href=#htmlmenuelement&gt;HTMLMenuElement&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; - &lt;tr&gt;&lt;th&gt;&lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt;&lt;/th&gt; + &lt;tr&gt;&lt;th&gt;&lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt;&lt;/th&gt; &lt;td&gt;Text metadata&lt;/td&gt; &lt;td&gt;&lt;a href=#metadata-content title=&quot;Metadata content&quot;&gt;metadata&lt;/a&gt;; &lt;a href=#flow-content title=&quot;Flow content&quot;&gt;flow&lt;/a&gt;*; &lt;a href=#phrasing-content title=&quot;Phrasing content&quot;&gt;phrasing&lt;/a&gt;*&lt;/td&gt; - &lt;td&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;; + &lt;td&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt;*; &lt;a href=#phrasing-content title=&quot;phrasing content&quot;&gt;phrasing&lt;/a&gt;*&lt;/td&gt; &lt;td&gt;empty&lt;/td&gt; @@ -95288,7 +95282,7 @@ &lt;td&gt;&lt;a href=#metadata-content title=&quot;Metadata content&quot;&gt;metadata&lt;/a&gt;; &lt;a href=#flow-content title=&quot;Flow content&quot;&gt;flow&lt;/a&gt;; &lt;a href=#phrasing-content title=&quot;Phrasing content&quot;&gt;phrasing&lt;/a&gt;&lt;/td&gt; - &lt;td&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;*; + &lt;td&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;*; &lt;a href=#phrasing-content title=&quot;Phrasing content&quot;&gt;phrasing&lt;/a&gt;*&lt;/td&gt; &lt;td&gt;varies*&lt;/td&gt; &lt;td&gt;&lt;a href=#global-attributes title=&quot;global attributes&quot;&gt;globals&lt;/a&gt;&lt;/td&gt; @@ -95447,12 +95441,12 @@ &lt;td&gt;&lt;a href=#phrasing-content title=&quot;Phrasing content&quot;&gt;phrasing&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;a href=#global-attributes title=&quot;global attributes&quot;&gt;globals&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;a href=#htmlelement&gt;HTMLElement&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; - &lt;tr&gt;&lt;th&gt;&lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt;&lt;/th&gt; + &lt;tr&gt;&lt;th&gt;&lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt;&lt;/th&gt; &lt;td&gt;Embedded script&lt;/td&gt; &lt;td&gt;&lt;a href=#metadata-content title=&quot;Metadata content&quot;&gt;metadata&lt;/a&gt;; &lt;a href=#flow-content title=&quot;Flow content&quot;&gt;flow&lt;/a&gt;; &lt;a href=#phrasing-content title=&quot;Phrasing content&quot;&gt;phrasing&lt;/a&gt;&lt;/td&gt; - &lt;td&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;; + &lt;td&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;; &lt;a href=#phrasing-content title=&quot;Phrasing content&quot;&gt;phrasing&lt;/a&gt;&lt;/td&gt; &lt;td&gt;script, data, or script documentation*&lt;/td&gt; &lt;td&gt;&lt;a href=#global-attributes title=&quot;global attributes&quot;&gt;globals&lt;/a&gt;; @@ -95501,10 +95495,10 @@ &lt;td&gt;&lt;a href=#global-attributes title=&quot;global attributes&quot;&gt;globals&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;a href=#htmlelement&gt;HTMLElement&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; &lt;tr&gt;&lt;th&gt;&lt;code&gt;&lt;a href=#the-source-element&gt;source&lt;/a&gt;&lt;/code&gt;&lt;/th&gt; - &lt;td&gt;Media source for &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; or &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; + &lt;td&gt;Media source for &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; or &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; &lt;td&gt;none&lt;/td&gt; - &lt;td&gt;&lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt;; - &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; + &lt;td&gt;&lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt;; + &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; &lt;td&gt;empty&lt;/td&gt; &lt;td&gt;&lt;a href=#global-attributes title=&quot;global attributes&quot;&gt;globals&lt;/a&gt;; &lt;code title=attr-source-src&gt;&lt;a href=#attr-source-src&gt;src&lt;/a&gt;&lt;/code&gt;; @@ -95531,7 +95525,7 @@ &lt;td&gt;Embedded styling information&lt;/td&gt; &lt;td&gt;&lt;a href=#metadata-content title=&quot;Metadata content&quot;&gt;metadata&lt;/a&gt;; &lt;a href=#flow-content title=&quot;Flow content&quot;&gt;flow&lt;/a&gt;&lt;/td&gt; - &lt;td&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;; + &lt;td&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt;*; &lt;a href=#flow-content title=&quot;flow content&quot;&gt;flow&lt;/a&gt;*&lt;/td&gt; &lt;td&gt;varies*&lt;/td&gt; @@ -95653,10 +95647,10 @@ &lt;code title=attr-time-datetime&gt;&lt;a href=#attr-time-datetime&gt;datetime&lt;/a&gt;&lt;/code&gt;; &lt;code title=attr-time-pubdate&gt;&lt;a href=#attr-time-pubdate&gt;pubdate&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;a href=#htmltimeelement&gt;HTMLTimeElement&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; - &lt;tr&gt;&lt;th&gt;&lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt;&lt;/th&gt; + &lt;tr&gt;&lt;th&gt;&lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt;&lt;/th&gt; &lt;td&gt;Document title&lt;/td&gt; &lt;td&gt;&lt;a href=#metadata-content title=&quot;Metadata content&quot;&gt;metadata&lt;/a&gt;&lt;/td&gt; - &lt;td&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; + &lt;td&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; &lt;td&gt;&lt;a href=#text-content title=&quot;text content&quot;&gt;text&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;a href=#global-attributes title=&quot;global attributes&quot;&gt;globals&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;a href=#htmltitleelement&gt;HTMLTitleElement&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; @@ -95674,8 +95668,8 @@ &lt;tr&gt;&lt;th&gt;&lt;code&gt;&lt;a href=#the-track-element&gt;track&lt;/a&gt;&lt;/code&gt;&lt;/th&gt; &lt;td&gt;Timed text track&lt;/td&gt; &lt;td&gt;none&lt;/td&gt; - &lt;td&gt;&lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt;; - &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; + &lt;td&gt;&lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt;; + &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; &lt;td&gt;empty&lt;/td&gt; &lt;td&gt;&lt;a href=#global-attributes title=&quot;global attributes&quot;&gt;globals&lt;/a&gt;; &lt;code title=attr-track-default&gt;&lt;a href=#attr-track-default&gt;default&lt;/a&gt;&lt;/code&gt;; @@ -95707,7 +95701,7 @@ &lt;td&gt;&lt;a href=#phrasing-content title=&quot;Phrasing content&quot;&gt;phrasing&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;a href=#global-attributes title=&quot;global attributes&quot;&gt;globals&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;a href=#htmlelement&gt;HTMLElement&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; - &lt;tr&gt;&lt;th&gt;&lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt;&lt;/th&gt; + &lt;tr&gt;&lt;th&gt;&lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt;&lt;/th&gt; &lt;td&gt;Video player&lt;/td&gt; &lt;td&gt;&lt;a href=#flow-content title=&quot;Flow content&quot;&gt;flow&lt;/a&gt;; &lt;a href=#phrasing-content title=&quot;Phrasing content&quot;&gt;phrasing&lt;/a&gt;; @@ -95753,13 +95747,13 @@ &lt;tbody&gt;&lt;tr&gt;&lt;td&gt; &lt;a href=#metadata-content&gt;Metadata content&lt;/a&gt; &lt;td&gt; &lt;code&gt;&lt;a href=#the-base-element&gt;base&lt;/a&gt;&lt;/code&gt;; - &lt;code&gt;&lt;a href=#the-command&gt;command&lt;/a&gt;&lt;/code&gt;; + &lt;code&gt;&lt;a href=#the-command-element&gt;command&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-link-element&gt;link&lt;/a&gt;&lt;/code&gt;; - &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt;; + &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt;; - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt;; + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-style-element&gt;style&lt;/a&gt;&lt;/code&gt;; - &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt; + &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt; &lt;td&gt; &mdash; @@ -95770,7 +95764,7 @@ &lt;code&gt;&lt;a href=#the-address-element&gt;address&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-article-element&gt;article&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-aside-element&gt;aside&lt;/a&gt;&lt;/code&gt;; - &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt;; + &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-bdi-element&gt;bdi&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-bdo-element&gt;bdo&lt;/a&gt;&lt;/code&gt;; @@ -95780,7 +95774,7 @@ &lt;code&gt;&lt;a href=#the-canvas-element&gt;canvas&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-cite-element&gt;cite&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-code-element&gt;code&lt;/a&gt;&lt;/code&gt;; - &lt;code&gt;&lt;a href=#the-command&gt;command&lt;/a&gt;&lt;/code&gt;; + &lt;code&gt;&lt;a href=#the-command-element&gt;command&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-datalist-element&gt;datalist&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-del-element&gt;del&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-details-element&gt;details&lt;/a&gt;&lt;/code&gt;; @@ -95813,7 +95807,7 @@ &lt;code&gt;&lt;a href=#the-map-element&gt;map&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-mark-element&gt;mark&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#math&gt;math&lt;/a&gt;&lt;/code&gt;; - &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt;; + &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-meter-element&gt;meter&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-nav-element&gt;nav&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt;; @@ -95827,7 +95821,7 @@ &lt;code&gt;&lt;a href=#the-ruby-element&gt;ruby&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-s-element&gt;s&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-samp-element&gt;samp&lt;/a&gt;&lt;/code&gt;; - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt;; + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-section-element&gt;section&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-select-element&gt;select&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-small-element&gt;small&lt;/a&gt;&lt;/code&gt;; @@ -95842,14 +95836,14 @@ &lt;code&gt;&lt;a href=#the-u-element&gt;u&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-ul-element&gt;ul&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-var-element&gt;var&lt;/a&gt;&lt;/code&gt;; - &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt;; + &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-wbr-element&gt;wbr&lt;/a&gt;&lt;/code&gt;; &lt;a href=#text-content title=&quot;text content&quot;&gt;Text&lt;/a&gt; &lt;td&gt; &lt;code&gt;&lt;a href=#the-area-element&gt;area&lt;/a&gt;&lt;/code&gt; (if it is a descendant of a &lt;code&gt;&lt;a href=#the-map-element&gt;map&lt;/a&gt;&lt;/code&gt; element); &lt;!--MD--&gt; &lt;code&gt;&lt;a href=#the-link-element&gt;link&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-itemprop&gt;&lt;a href=#names:-the-itemprop-attribute&gt;itemprop&lt;/a&gt;&lt;/code&gt; attribute is present); - &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-itemprop&gt;&lt;a href=#names:-the-itemprop-attribute&gt;itemprop&lt;/a&gt;&lt;/code&gt; attribute is present); + &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-itemprop&gt;&lt;a href=#names:-the-itemprop-attribute&gt;itemprop&lt;/a&gt;&lt;/code&gt; attribute is present); &lt;!--MD--&gt; &lt;code&gt;&lt;a href=#the-style-element&gt;style&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-style-scoped&gt;&lt;a href=#attr-style-scoped&gt;scoped&lt;/a&gt;&lt;/code&gt; attribute is present) @@ -95877,7 +95871,7 @@ &lt;tr&gt;&lt;td&gt; &lt;a href=#phrasing-content&gt;Phrasing content&lt;/a&gt; &lt;td&gt; &lt;code&gt;&lt;a href=#the-abbr-element&gt;abbr&lt;/a&gt;&lt;/code&gt;; - &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt;; + &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-bdi-element&gt;bdi&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-bdo-element&gt;bdo&lt;/a&gt;&lt;/code&gt;; @@ -95886,7 +95880,7 @@ &lt;code&gt;&lt;a href=#the-canvas-element&gt;canvas&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-cite-element&gt;cite&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-code-element&gt;code&lt;/a&gt;&lt;/code&gt;; - &lt;code&gt;&lt;a href=#the-command&gt;command&lt;/a&gt;&lt;/code&gt;; + &lt;code&gt;&lt;a href=#the-command-element&gt;command&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-datalist-element&gt;datalist&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-dfn-element&gt;dfn&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-em-element&gt;em&lt;/a&gt;&lt;/code&gt;; @@ -95909,7 +95903,7 @@ &lt;code&gt;&lt;a href=#the-ruby-element&gt;ruby&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-s-element&gt;s&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-samp-element&gt;samp&lt;/a&gt;&lt;/code&gt;; - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt;; + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-select-element&gt;select&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-small-element&gt;small&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-span-element&gt;span&lt;/a&gt;&lt;/code&gt;; @@ -95921,7 +95915,7 @@ &lt;code&gt;&lt;a href=#the-time-element&gt;time&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-u-element&gt;u&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-var-element&gt;var&lt;/a&gt;&lt;/code&gt;; - &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt;; + &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-wbr-element&gt;wbr&lt;/a&gt;&lt;/code&gt;; &lt;a href=#text-content title=&quot;text content&quot;&gt;Text&lt;/a&gt; &lt;td&gt; @@ -95934,13 +95928,13 @@ &lt;!--MD--&gt; &lt;code&gt;&lt;a href=#the-map-element&gt;map&lt;/a&gt;&lt;/code&gt; (if it contains only &lt;a href=#phrasing-content&gt;phrasing content&lt;/a&gt;)&lt;!-- --&gt;&lt;!--MD--&gt;&lt;!-- - --&gt;; &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-itemprop&gt;&lt;a href=#names:-the-itemprop-attribute&gt;itemprop&lt;/a&gt;&lt;/code&gt; attribute is present)&lt;!-- + --&gt;; &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-itemprop&gt;&lt;a href=#names:-the-itemprop-attribute&gt;itemprop&lt;/a&gt;&lt;/code&gt; attribute is present)&lt;!-- --&gt;&lt;!--MD--&gt;&lt;!-- --&gt; &lt;tr&gt;&lt;td&gt; &lt;a href=#embedded-content&gt;Embedded content&lt;/a&gt; &lt;td&gt; - &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; + &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; &lt;code&gt;&lt;a href=#the-canvas-element&gt;canvas&lt;/a&gt;&lt;/code&gt; &lt;code&gt;&lt;a href=#the-embed-element&gt;embed&lt;/a&gt;&lt;/code&gt; &lt;code&gt;&lt;a href=#the-iframe-element&gt;iframe&lt;/a&gt;&lt;/code&gt; @@ -95948,7 +95942,7 @@ &lt;code&gt;&lt;a href=#math&gt;math&lt;/a&gt;&lt;/code&gt; &lt;code&gt;&lt;a href=#the-object-element&gt;object&lt;/a&gt;&lt;/code&gt; &lt;code&gt;&lt;a href=#svg&gt;svg&lt;/a&gt;&lt;/code&gt; - &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; + &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; &lt;td&gt; &mdash; @@ -95964,12 +95958,12 @@ &lt;code&gt;&lt;a href=#the-select-element&gt;select&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-textarea-element&gt;textarea&lt;/a&gt;&lt;/code&gt;; &lt;td&gt; - &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-media-controls&gt;&lt;a href=#attr-media-controls&gt;controls&lt;/a&gt;&lt;/code&gt; attribute is present); + &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-media-controls&gt;&lt;a href=#attr-media-controls&gt;controls&lt;/a&gt;&lt;/code&gt; attribute is present); &lt;code&gt;&lt;a href=#the-img-element&gt;img&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-hyperlink-usemap&gt;&lt;a href=#attr-hyperlink-usemap&gt;usemap&lt;/a&gt;&lt;/code&gt; attribute is present); &lt;code&gt;&lt;a href=#the-input-element&gt;input&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-input-type&gt;&lt;a href=#attr-input-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute is &lt;em&gt;not&lt;/em&gt; in the &lt;a href=#hidden-state title=attr-input-type-hidden&gt;Hidden&lt;/a&gt; state); - &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute is in the &lt;a href=#toolbar-state title=&quot;toolbar state&quot;&gt;toolbar&lt;/a&gt; state); + &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute is in the &lt;a href=#toolbar-state title=&quot;toolbar state&quot;&gt;toolbar&lt;/a&gt; state); &lt;code&gt;&lt;a href=#the-object-element&gt;object&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-hyperlink-usemap&gt;&lt;a href=#attr-hyperlink-usemap&gt;usemap&lt;/a&gt;&lt;/code&gt; attribute is present)&lt;!-- see also comment in &lt;object&gt; section --&gt;; - &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-media-controls&gt;&lt;a href=#attr-media-controls&gt;controls&lt;/a&gt;&lt;/code&gt; attribute is present) + &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-media-controls&gt;&lt;a href=#attr-media-controls&gt;controls&lt;/a&gt;&lt;/code&gt; attribute is present) &lt;tr&gt;&lt;td&gt; &lt;a href=#sectioning-root title=&quot;sectioning root&quot;&gt;Sectioning roots&lt;/a&gt; &lt;td&gt; @@ -97185,7 +97179,7 @@ &lt;tr&gt;&lt;td&gt; &lt;code&gt;&lt;a href=#the-aside-element&gt;aside&lt;/a&gt;&lt;/code&gt; &lt;td&gt; &lt;code&gt;&lt;a href=#htmlelement&gt;HTMLElement&lt;/a&gt;&lt;/code&gt; - &lt;tr&gt;&lt;td&gt; &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; + &lt;tr&gt;&lt;td&gt; &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; &lt;td&gt; &lt;code&gt;&lt;a href=#htmlaudioelement&gt;HTMLAudioElement&lt;/a&gt;&lt;/code&gt; : &lt;code&gt;&lt;a href=#htmlmediaelement&gt;HTMLMediaElement&lt;/a&gt;&lt;/code&gt; : &lt;code&gt;&lt;a href=#htmlelement&gt;HTMLElement&lt;/a&gt;&lt;/code&gt; &lt;tr&gt;&lt;td&gt; &lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; @@ -97230,7 +97224,7 @@ &lt;tr&gt;&lt;td&gt; &lt;code&gt;&lt;a href=#the-colgroup-element&gt;colgroup&lt;/a&gt;&lt;/code&gt; &lt;td&gt; &lt;code&gt;&lt;a href=#htmltablecolelement&gt;HTMLTableColElement&lt;/a&gt;&lt;/code&gt; : &lt;code&gt;&lt;a href=#htmlelement&gt;HTMLElement&lt;/a&gt;&lt;/code&gt; - &lt;tr&gt;&lt;td&gt; &lt;code&gt;&lt;a href=#the-command&gt;command&lt;/a&gt;&lt;/code&gt; + &lt;tr&gt;&lt;td&gt; &lt;code&gt;&lt;a href=#the-command-element&gt;command&lt;/a&gt;&lt;/code&gt; &lt;td&gt; &lt;code&gt;&lt;a href=#htmlcommandelement&gt;HTMLCommandElement&lt;/a&gt;&lt;/code&gt; : &lt;code&gt;&lt;a href=#htmlelement&gt;HTMLElement&lt;/a&gt;&lt;/code&gt; &lt;tr&gt;&lt;td&gt; &lt;code&gt;&lt;a href=#the-datalist-element&gt;datalist&lt;/a&gt;&lt;/code&gt; @@ -97275,7 +97269,7 @@ &lt;tr&gt;&lt;td&gt; &lt;code&gt;&lt;a href=#the-form-element&gt;form&lt;/a&gt;&lt;/code&gt; &lt;td&gt; &lt;code&gt;&lt;a href=#htmlformelement&gt;HTMLFormElement&lt;/a&gt;&lt;/code&gt; : &lt;code&gt;&lt;a href=#htmlelement&gt;HTMLElement&lt;/a&gt;&lt;/code&gt; - &lt;tr&gt;&lt;td&gt; &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; + &lt;tr&gt;&lt;td&gt; &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; &lt;td&gt; &lt;code&gt;&lt;a href=#htmlheadelement&gt;HTMLHeadElement&lt;/a&gt;&lt;/code&gt; : &lt;code&gt;&lt;a href=#htmlelement&gt;HTMLElement&lt;/a&gt;&lt;/code&gt; &lt;tr&gt;&lt;td&gt; &lt;code&gt;&lt;a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements&gt;h1&lt;/a&gt;&lt;/code&gt; @@ -97305,7 +97299,7 @@ &lt;tr&gt;&lt;td&gt; &lt;code&gt;&lt;a href=#the-hr-element&gt;hr&lt;/a&gt;&lt;/code&gt; &lt;td&gt; &lt;code&gt;&lt;a href=#htmlhrelement&gt;HTMLHRElement&lt;/a&gt;&lt;/code&gt; : &lt;code&gt;&lt;a href=#htmlelement&gt;HTMLElement&lt;/a&gt;&lt;/code&gt; - &lt;tr&gt;&lt;td&gt; &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; + &lt;tr&gt;&lt;td&gt; &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; &lt;td&gt; &lt;code&gt;&lt;a href=#htmlhtmlelement&gt;HTMLHtmlElement&lt;/a&gt;&lt;/code&gt; : &lt;code&gt;&lt;a href=#htmlelement&gt;HTMLElement&lt;/a&gt;&lt;/code&gt; &lt;tr&gt;&lt;td&gt; &lt;code&gt;&lt;a href=#the-i-element&gt;i&lt;/a&gt;&lt;/code&gt; @@ -97455,7 +97449,7 @@ &lt;tr&gt;&lt;td&gt; &lt;code&gt;&lt;a href=#the-time-element&gt;time&lt;/a&gt;&lt;/code&gt; &lt;td&gt; &lt;code&gt;&lt;a href=#htmltimeelement&gt;HTMLTimeElement&lt;/a&gt;&lt;/code&gt; : &lt;code&gt;&lt;a href=#htmlelement&gt;HTMLElement&lt;/a&gt;&lt;/code&gt; - &lt;tr&gt;&lt;td&gt; &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt; + &lt;tr&gt;&lt;td&gt; &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt; &lt;td&gt; &lt;code&gt;&lt;a href=#htmltitleelement&gt;HTMLTitleElement&lt;/a&gt;&lt;/code&gt; : &lt;code&gt;&lt;a href=#htmlelement&gt;HTMLElement&lt;/a&gt;&lt;/code&gt; &lt;tr&gt;&lt;td&gt; &lt;code&gt;&lt;a href=#the-tr-element&gt;tr&lt;/a&gt;&lt;/code&gt; @@ -97473,7 +97467,7 @@ &lt;tr&gt;&lt;td&gt; &lt;code&gt;&lt;a href=#the-var-element&gt;var&lt;/a&gt;&lt;/code&gt; &lt;td&gt; &lt;code&gt;&lt;a href=#htmlelement&gt;HTMLElement&lt;/a&gt;&lt;/code&gt; - &lt;tr&gt;&lt;td&gt; &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; + &lt;tr&gt;&lt;td&gt; &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; &lt;td&gt; &lt;code&gt;&lt;a href=#htmlvideoelement&gt;HTMLVideoElement&lt;/a&gt;&lt;/code&gt; : &lt;code&gt;&lt;a href=#htmlmediaelement&gt;HTMLMediaElement&lt;/a&gt;&lt;/code&gt; : &lt;code&gt;&lt;a href=#htmlelement&gt;HTMLElement&lt;/a&gt;&lt;/code&gt; &lt;tr&gt;&lt;td&gt; &lt;code&gt;&lt;a href=#the-wbr-element&gt;wbr&lt;/a&gt;&lt;/code&gt; Modified: index =================================================================== --- index 2011-05-03 01:10:20 UTC (rev 6049) +++ index 2011-05-03 19:18:56 UTC (rev 6050) @@ -468,14 +468,14 @@ &lt;ol&gt; &lt;li&gt;&lt;a href=#the-root-element&gt;&lt;span class=secno&gt;4.1 &lt;/span&gt;The root element&lt;/a&gt; &lt;ol&gt; - &lt;li&gt;&lt;a href=#the-html-element-0&gt;&lt;span class=secno&gt;4.1.1 &lt;/span&gt;The &lt;code&gt;html&lt;/code&gt; element&lt;/a&gt;&lt;/ol&gt;&lt;/li&gt; + &lt;li&gt;&lt;a href=#the-html-element&gt;&lt;span class=secno&gt;4.1.1 &lt;/span&gt;The &lt;code&gt;html&lt;/code&gt; element&lt;/a&gt;&lt;/ol&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=#document-metadata&gt;&lt;span class=secno&gt;4.2 &lt;/span&gt;Document metadata&lt;/a&gt; &lt;ol&gt; - &lt;li&gt;&lt;a href=#the-head-element-0&gt;&lt;span class=secno&gt;4.2.1 &lt;/span&gt;The &lt;code&gt;head&lt;/code&gt; element&lt;/a&gt;&lt;/li&gt; - &lt;li&gt;&lt;a href=#the-title-element-0&gt;&lt;span class=secno&gt;4.2.2 &lt;/span&gt;The &lt;code&gt;title&lt;/code&gt; element&lt;/a&gt;&lt;/li&gt; + &lt;li&gt;&lt;a href=#the-head-element&gt;&lt;span class=secno&gt;4.2.1 &lt;/span&gt;The &lt;code&gt;head&lt;/code&gt; element&lt;/a&gt;&lt;/li&gt; + &lt;li&gt;&lt;a href=#the-title-element&gt;&lt;span class=secno&gt;4.2.2 &lt;/span&gt;The &lt;code&gt;title&lt;/code&gt; element&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=#the-base-element&gt;&lt;span class=secno&gt;4.2.3 &lt;/span&gt;The &lt;code&gt;base&lt;/code&gt; element&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=#the-link-element&gt;&lt;span class=secno&gt;4.2.4 &lt;/span&gt;The &lt;code&gt;link&lt;/code&gt; element&lt;/a&gt;&lt;/li&gt; - &lt;li&gt;&lt;a href=#meta&gt;&lt;span class=secno&gt;4.2.5 &lt;/span&gt;The &lt;code&gt;meta&lt;/code&gt; element&lt;/a&gt; + &lt;li&gt;&lt;a href=#the-meta-element&gt;&lt;span class=secno&gt;4.2.5 &lt;/span&gt;The &lt;code&gt;meta&lt;/code&gt; element&lt;/a&gt; &lt;ol&gt; &lt;li&gt;&lt;a href=#standard-metadata-names&gt;&lt;span class=secno&gt;4.2.5.1 &lt;/span&gt;Standard metadata names&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=#other-metadata-names&gt;&lt;span class=secno&gt;4.2.5.2 &lt;/span&gt;Other metadata names&lt;/a&gt;&lt;/li&gt; @@ -486,7 +486,7 @@ &lt;li&gt;&lt;a href=#styling&gt;&lt;span class=secno&gt;4.2.7 &lt;/span&gt;Styling&lt;/a&gt;&lt;/ol&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=#scripting-1&gt;&lt;span class=secno&gt;4.3 &lt;/span&gt;Scripting&lt;/a&gt; &lt;ol&gt; - &lt;li&gt;&lt;a href=#script&gt;&lt;span class=secno&gt;4.3.1 &lt;/span&gt;The &lt;code&gt;script&lt;/code&gt; element&lt;/a&gt; + &lt;li&gt;&lt;a href=#the-script-element&gt;&lt;span class=secno&gt;4.3.1 &lt;/span&gt;The &lt;code&gt;script&lt;/code&gt; element&lt;/a&gt; &lt;ol&gt; &lt;li&gt;&lt;a href=#scriptingLanguages&gt;&lt;span class=secno&gt;4.3.1.1 &lt;/span&gt;Scripting languages&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=#restrictions-for-contents-of-script-elements&gt;&lt;span class=secno&gt;4.3.1.2 &lt;/span&gt;Restrictions for contents of &lt;code&gt;script&lt;/code&gt; elements&lt;/a&gt;&lt;/li&gt; @@ -500,10 +500,7 @@ &lt;li&gt;&lt;a href=#the-nav-element&gt;&lt;span class=secno&gt;4.4.3 &lt;/span&gt;The &lt;code&gt;nav&lt;/code&gt; element&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=#the-article-element&gt;&lt;span class=secno&gt;4.4.4 &lt;/span&gt;The &lt;code&gt;article&lt;/code&gt; element&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=#the-aside-element&gt;&lt;span class=secno&gt;4.4.5 &lt;/span&gt;The &lt;code&gt;aside&lt;/code&gt; element&lt;/a&gt;&lt;/li&gt; - &lt;li&gt;&lt;a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements&gt;&lt;span class=secno&gt;4.4.6 &lt;/span&gt;The &lt;code&gt;h1&lt;/code&gt;, &lt;code&gt;h2&lt;/code&gt;, - &lt;code&gt;h3&lt;/code&gt;, &lt;code&gt;h4&lt;/code&gt;, - &lt;code&gt;h5&lt;/code&gt;, and &lt;code&gt;h6&lt;/code&gt; - elements&lt;/a&gt;&lt;/li&gt; + &lt;li&gt;&lt;a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements&gt;&lt;span class=secno&gt;4.4.6 &lt;/span&gt;The &lt;code&gt;h1&lt;/code&gt;, &lt;code&gt;h2&lt;/code&gt;, &lt;code&gt;h3&lt;/code&gt;, &lt;code&gt;h4&lt;/code&gt;, &lt;code&gt;h5&lt;/code&gt;, and &lt;code&gt;h6&lt;/code&gt; elements&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=#the-hgroup-element&gt;&lt;span class=secno&gt;4.4.7 &lt;/span&gt;The &lt;code&gt;hgroup&lt;/code&gt; element&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=#the-header-element&gt;&lt;span class=secno&gt;4.4.8 &lt;/span&gt;The &lt;code&gt;header&lt;/code&gt; element&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=#the-footer-element&gt;&lt;span class=secno&gt;4.4.9 &lt;/span&gt;The &lt;code&gt;footer&lt;/code&gt; element&lt;/a&gt;&lt;/li&gt; @@ -587,8 +584,8 @@ &lt;li&gt;&lt;a href=#the-embed-element&gt;&lt;span class=secno&gt;4.8.3 &lt;/span&gt;The &lt;code&gt;embed&lt;/code&gt; element&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=#the-object-element&gt;&lt;span class=secno&gt;4.8.4 &lt;/span&gt;The &lt;code&gt;object&lt;/code&gt; element&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=#the-param-element&gt;&lt;span class=secno&gt;4.8.5 &lt;/span&gt;The &lt;code&gt;param&lt;/code&gt; element&lt;/a&gt;&lt;/li&gt; - &lt;li&gt;&lt;a href=#video&gt;&lt;span class=secno&gt;4.8.6 &lt;/span&gt;The &lt;code&gt;video&lt;/code&gt; element&lt;/a&gt;&lt;/li&gt; - &lt;li&gt;&lt;a href=#audio&gt;&lt;span class=secno&gt;4.8.7 &lt;/span&gt;The &lt;code&gt;audio&lt;/code&gt; element&lt;/a&gt;&lt;/li&gt; + &lt;li&gt;&lt;a href=#the-video-element&gt;&lt;span class=secno&gt;4.8.6 &lt;/span&gt;The &lt;code&gt;video&lt;/code&gt; element&lt;/a&gt;&lt;/li&gt; + &lt;li&gt;&lt;a href=#the-audio-element&gt;&lt;span class=secno&gt;4.8.7 &lt;/span&gt;The &lt;code&gt;audio&lt;/code&gt; element&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=#the-source-element&gt;&lt;span class=secno&gt;4.8.8 &lt;/span&gt;The &lt;code&gt;source&lt;/code&gt; element&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=#the-track-element&gt;&lt;span class=secno&gt;4.8.9 &lt;/span&gt;The &lt;code&gt;track&lt;/code&gt; element&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=#media-elements&gt;&lt;span class=secno&gt;4.8.10 &lt;/span&gt;Media elements&lt;/a&gt; @@ -778,8 +775,8 @@ &lt;ol&gt; &lt;li&gt;&lt;a href=#the-details-element&gt;&lt;span class=secno&gt;4.11.1 &lt;/span&gt;The &lt;code&gt;details&lt;/code&gt; element&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=#the-summary-element&gt;&lt;span class=secno&gt;4.11.2 &lt;/span&gt;The &lt;code&gt;summary&lt;/code&gt; element&lt;/a&gt;&lt;/li&gt; - &lt;li&gt;&lt;a href=#the-command&gt;&lt;span class=secno&gt;4.11.3 &lt;/span&gt;The &lt;code&gt;command&lt;/code&gt; element&lt;/a&gt;&lt;/li&gt; - &lt;li&gt;&lt;a href=#menus&gt;&lt;span class=secno&gt;4.11.4 &lt;/span&gt;The &lt;code&gt;menu&lt;/code&gt; element&lt;/a&gt; + &lt;li&gt;&lt;a href=#the-command-element&gt;&lt;span class=secno&gt;4.11.3 &lt;/span&gt;The &lt;code&gt;command&lt;/code&gt; element&lt;/a&gt;&lt;/li&gt; + &lt;li&gt;&lt;a href=#the-menu-element&gt;&lt;span class=secno&gt;4.11.4 &lt;/span&gt;The &lt;code&gt;menu&lt;/code&gt; element&lt;/a&gt; &lt;ol&gt; &lt;li&gt;&lt;a href=#menus-intro&gt;&lt;span class=secno&gt;4.11.4.1 &lt;/span&gt;Introduction&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=#building-menus-and-toolbars&gt;&lt;span class=secno&gt;4.11.4.2 &lt;/span&gt;Building menus and toolbars&lt;/a&gt;&lt;/li&gt; @@ -1923,9 +1920,9 @@ &lt;p&gt;The &lt;a href=#intro-early-example&gt;markup snippet at the top of this section&lt;/a&gt; would be turned into the following DOM tree:&lt;/p&gt; - &lt;ul class=domTree&gt;&lt;li class=t10&gt;DOCTYPE: &lt;code title=&quot;&quot;&gt;html&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;&#9166;&#9251;&#9251;&lt;/span&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;Sample page&lt;/span&gt;&lt;/ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;&#9166;&#9251;&lt;/span&gt;&lt;/ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;&#9166;&#9251;&lt;/span&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;&#9166;&#9251;&#9251;&lt;/span&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements&gt;h1&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;Sample page&lt;/span&gt;&lt;/ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;&#9166;&#9251;&#9251;&lt;/span&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;&lt;u l&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;This is a &lt;/span&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-a-element&gt;a&lt;/a&gt;&lt;/code&gt; &lt;span class=t2 title=&quot;&quot;&gt;&lt;code class=&quot;attribute name&quot;&gt;href&lt;/code&gt;=&quot;&lt;code class=&quot;attribute value&quot;&gt;demo.html&lt;/code&gt;&quot;&lt;/span&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;simple&lt;/span&gt;&lt;/ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt; sample.&lt;/span&gt;&lt;/ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;&#9166;&#9251;&#9251;&lt;/span&gt;&lt;li class=t8&gt;&lt;code&gt;#comment&lt;/code&gt;: &lt;span title=&quot;&quot;&gt; this is a comment &lt;/span&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;&#9166;&#9251;&#9166;&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;The &lt;a href=#root-element&gt;root element&lt;/a&gt; of this tree is the - &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element, which is the element always found at the - root of HTML documents. It contains two elements, &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; + &lt;ul class=domTree&gt;&lt;li class=t10&gt;DOCTYPE: &lt;code title=&quot;&quot;&gt;html&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;&#9166;&#9251;&#9251;&lt;/span&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;Sample page&lt;/span&gt;&lt;/ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;&#9166;&#9251;&lt;/span&gt;&lt;/ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;&#9166;&#9251;&lt;/span&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;&#9166;&#9251;&#9251;&lt;/span&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements&gt;h1&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;Sample page&lt;/span&gt;&lt;/ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;&#9166;&#9251;&#9251;&lt;/span&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;This is a &lt;/span&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-a-element&gt;a&lt;/a&gt;&lt;/code&gt; &lt;span class=t2 title=&quot;&quot;&gt;&lt;code class=&quot;attribute name&quot;&gt;href&lt;/code&gt;=&quot;&lt;code class=&quot;attribute value&quot;&gt;demo.html&lt;/code&gt;&quot;&lt;/span&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;simple&lt;/span&gt;&lt;/ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt; sample.&lt;/span&gt;&lt;/ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;&#9166;&#9251;&#9251;&lt;/span&gt;&lt;li class=t8&gt;&lt;code&gt;#comment&lt;/code&gt;: &lt;span title=&quot;&quot;&gt; this is a comment &lt;/span&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;&#9166;&#9251;&#9166;&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;The &lt;a href=#root-element&gt;root element&lt;/a&gt; of this tree is the + &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element, which is the element always found at the + root of HTML documents. It contains two elements, &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; and &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;, as well as a text node between them.&lt;/p&gt; &lt;p&gt;There are many more text nodes in the DOM tree than one would @@ -1934,11 +1931,11 @@ all end up as text nodes in the DOM. However, for historical reasons not all of the spaces and line breaks in the original markup appear in the DOM. In particular, all the whitespace before - &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; start tag ends up being dropped silently, and all + &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; start tag ends up being dropped silently, and all the whitespace after the &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt; end tag ends up placed at the end of the &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;.&lt;/p&gt; - &lt;p&gt;The &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element contains a &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt; + &lt;p&gt;The &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element contains a &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt; element, which itself contains a text node with the text &quot;Sample page&quot;. Similarly, the &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt; element contains an &lt;code&gt;&lt;a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements&gt;h1&lt;/a&gt;&lt;/code&gt; element, a &lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt; element, and a @@ -1946,14 +1943,14 @@ &lt;hr&gt;&lt;p&gt;This DOM tree can be manipulated from scripts in the page. Scripts (typically in JavaScript) are small programs that can - be embedded using the &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element or using + be embedded using the &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element or using &lt;a href=#event-handler-content-attributes&gt;event handler content attributes&lt;/a&gt;. For example, here is a form with a script that sets the value of the form's &lt;code&gt;&lt;a href=#the-output-element&gt;output&lt;/a&gt;&lt;/code&gt; element to say &quot;Hello World&quot;:&lt;/p&gt; &lt;pre&gt;&lt;&lt;a href=#the-form-element&gt;form&lt;/a&gt; &lt;a href=#attr-form-name title=attr-form-name&gt;name&lt;/a&gt;=&quot;main&quot;&gt; Result: &lt;&lt;a href=#the-output-element&gt;output&lt;/a&gt; &lt;a href=#attr-fe-name title=attr-fe-name&gt;name&lt;/a&gt;=&quot;result&quot;&gt;&lt;/output&gt; - &lt;&lt;a href=#script&gt;script&lt;/a&gt;&gt; + &lt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&gt; &lt;a href=#htmldocument title=HTMLDocument&gt;document&lt;/a&gt;.&lt;a href=#dom-document-forms title=dom-document-forms&gt;forms&lt;/a&gt;.main.&lt;a href=#dom-form-elements title=dom-form-elements&gt;elements&lt;/a&gt;.result.&lt;a href=#dom-output-value title=dom-output-value&gt;value&lt;/a&gt; = 'Hello World'; &lt;/script&gt; &lt;/form&gt;&lt;/pre&gt; @@ -2530,14 +2527,14 @@ encouraging authors to avoid making them, authors can save time in future efforts.&lt;/p&gt; - &lt;p class=example&gt;For example, a &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element's + &lt;p class=example&gt;For example, a &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element's &lt;code title=attr-script-src&gt;&lt;a href=#attr-script-src&gt;src&lt;/a&gt;&lt;/code&gt; attribute causes the element's contents to be ignored. However, this isn't obvious, especially if the element's contents appear to be executable script &mdash; which can lead to authors spending a lot of time trying to debug the inline script without realizing that it is not executing. To reduce this problem, this specification makes it - non-conforming to have executable script in a &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; + non-conforming to have executable script in a &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element when the &lt;code title=attr-script-src&gt;&lt;a href=#attr-script-src&gt;src&lt;/a&gt;&lt;/code&gt; attribute is present. This means that authors who are validating their documents are less likely to waste time with this kind of @@ -2880,7 +2877,7 @@ described in the DOM Core specification. For example, the &lt;code title=dom-cloneNode&gt;cloneNode()&lt;/code&gt; and &lt;code title=dom-importNode&gt;importNode()&lt;/code&gt; methods of the &lt;code&gt;&lt;a href=#node&gt;Node&lt;/a&gt;&lt;/code&gt; interface both clone nodes, as do a number of algorithms in this specification. Certain &lt;a href=#html-elements&gt;HTML elements&lt;/a&gt; - (in particular, &lt;code&gt;&lt;a href=#the-input-element&gt;input&lt;/a&gt;&lt;/code&gt; and &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt;) apply + (in particular, &lt;code&gt;&lt;a href=#the-input-element&gt;input&lt;/a&gt;&lt;/code&gt; and &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt;) apply additional requirements on how they are cloned. &lt;a href=#refsDOMCORE&gt;[DOMCORE]&lt;/a&gt;&lt;/p&gt; @@ -3077,11 +3074,11 @@ specifications.&lt;/p&gt; &lt;p class=example&gt;A conforming XHTML processor would, upon - finding an XHTML &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element in an XML document, + finding an XHTML &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element in an XML document, execute the script contained in that element. However, if the element is found within a transformation expressed in XSLT (assuming the user agent also supports XSLT), then the processor - would instead treat the &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element as an opaque + would instead treat the &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element as an opaque element that forms part of the transform.&lt;/p&gt; &lt;p&gt;Web browsers that support &lt;a href=#syntax&gt;the HTML syntax&lt;/a&gt; must @@ -3096,7 +3093,7 @@ &lt;p class=note&gt;Unless explicitly stated, specifications that override the semantics of HTML elements do not override the requirements on DOM objects representing those elements. For - example, the &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element in the example above + example, the &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element in the example above would still implement the &lt;code&gt;&lt;a href=#htmlscriptelement&gt;HTMLScriptElement&lt;/a&gt;&lt;/code&gt; interface.&lt;/p&gt; @@ -3558,7 +3555,7 @@ include data on HTML elements that scripts can then look for and process.&lt;/li&gt; - &lt;li&gt;Authors can use the &lt;code title=meta&gt;&lt;a href=#meta&gt;&lt;meta name=&quot;&quot; + &lt;li&gt;Authors can use the &lt;code title=meta&gt;&lt;a href=#the-meta-element&gt;&lt;meta name=&quot;&quot; content=&quot;&quot;&gt;&lt;/a&gt;&lt;/code&gt; mechanism to include page-wide metadata by registering &lt;a href=#concept-meta-extensions title=concept-meta-extensions&gt;extensions to the predefined set of metadata names&lt;/a&gt;.&lt;/li&gt; @@ -3567,7 +3564,7 @@ links with specific meanings by registering &lt;a href=#concept-rel-extensions title=concept-rel-extensions&gt;extensions to the predefined set of link types&lt;/a&gt;. This is also used by Microformats.&lt;/li&gt; - &lt;li&gt;Authors can embed raw data using the &lt;code title=script&gt;&lt;a href=#script&gt;&lt;script type=&quot;&quot;&gt;&lt;/a&gt;&lt;/code&gt; mechanism with a custom + &lt;li&gt;Authors can embed raw data using the &lt;code title=script&gt;&lt;a href=#the-script-element&gt;&lt;script type=&quot;&quot;&gt;&lt;/a&gt;&lt;/code&gt; mechanism with a custom type, for further handling by inline or server-side scripts.&lt;/li&gt; &lt;li&gt;Authors can create &lt;a href=#plugin title=plugin&gt;plugins&lt;/a&gt; and @@ -7086,7 +7083,7 @@ specification. &lt;a href=#refsMIMESNIFF&gt;[MIMESNIFF]&lt;/a&gt;&lt;/p&gt; - &lt;h4 id=extracting-encodings-from-meta-elements&gt;&lt;span class=secno&gt;2.7.4 &lt;/span&gt;Extracting encodings from &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; elements&lt;/h4&gt; + &lt;h4 id=extracting-encodings-from-meta-elements&gt;&lt;span class=secno&gt;2.7.4 &lt;/span&gt;Extracting encodings from &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; elements&lt;/h4&gt; &lt;p&gt;The &lt;dfn id=algorithm-for-extracting-an-encoding-from-a-meta-element&gt;algorithm for extracting an encoding from a &lt;code&gt;meta&lt;/code&gt; element&lt;/dfn&gt;, given a string &lt;var title=&quot;&quot;&gt;s&lt;/var&gt;, is as follows. It either returns an encoding or @@ -9005,43 +9002,43 @@ &lt;h4 id=dom-tree-accessors&gt;&lt;span class=secno&gt;3.1.4 &lt;/span&gt;&lt;dfn&gt;DOM tree accessors&lt;/dfn&gt;&lt;/h4&gt; - &lt;p&gt;&lt;dfn id=the-html-element&gt;The &lt;code&gt;html&lt;/code&gt; element&lt;/dfn&gt; of a document is the + &lt;p&gt;&lt;dfn id=the-html-element-0&gt;The &lt;code&gt;html&lt;/code&gt; element&lt;/dfn&gt; of a document is the document's root element, if there is one and it's an - &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element, or null otherwise.&lt;/p&gt; + &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element, or null otherwise.&lt;/p&gt; &lt;hr&gt;&lt;dl class=domintro&gt;&lt;dt&gt;&lt;var title=&quot;&quot;&gt;document&lt;/var&gt; . &lt;code title=dom-document-head&gt;&lt;a href=#dom-document-head&gt;head&lt;/a&gt;&lt;/code&gt;&lt;/dt&gt; &lt;dd&gt; - &lt;p&gt;Returns &lt;a href=#the-head-element&gt;the &lt;code&gt;head&lt;/code&gt; element&lt;/a&gt;.&lt;/p&gt; + &lt;p&gt;Returns &lt;a href=#the-head-element-0&gt;the &lt;code&gt;head&lt;/code&gt; element&lt;/a&gt;.&lt;/p&gt; &lt;/dd&gt; - &lt;/dl&gt;&lt;p&gt;&lt;dfn id=the-head-element&gt;The &lt;code&gt;head&lt;/code&gt; element&lt;/dfn&gt; of a document is the - first &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element that is a child of &lt;a href=#the-html-element&gt;the + &lt;/dl&gt;&lt;p&gt;&lt;dfn id=the-head-element-0&gt;The &lt;code&gt;head&lt;/code&gt; element&lt;/dfn&gt; of a document is the + first &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element that is a child of &lt;a href=#the-html-element-0&gt;the &lt;code&gt;html&lt;/code&gt; element&lt;/a&gt;, if there is one, or null otherwise.&lt;/p&gt; &lt;div class=impl&gt; &lt;p&gt;The &lt;dfn id=dom-document-head title=dom-document-head&gt;&lt;code&gt;head&lt;/code&gt;&lt;/dfn&gt; - attribute, on getting, must return &lt;a href=#the-head-element&gt;the &lt;code&gt;head&lt;/code&gt; - element&lt;/a&gt; of the document (a &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element or + attribute, on getting, must return &lt;a href=#the-head-element-0&gt;the &lt;code&gt;head&lt;/code&gt; + element&lt;/a&gt; of the document (a &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element or null).&lt;/p&gt; &lt;/div&gt; &lt;hr&gt;&lt;dl class=domintro&gt;&lt;dt&gt;&lt;var title=&quot;&quot;&gt;document&lt;/var&gt; . &lt;code title=dom-document-title&gt;&lt;a href=#document.title&gt;title&lt;/a&gt;&lt;/code&gt; [ = &lt;var title=&quot;&quot;&gt;value&lt;/var&gt; ]&lt;/dt&gt; &lt;dd&gt; - &lt;p&gt;Returns the document's title, as given by &lt;a href=#the-title-element&gt;the + &lt;p&gt;Returns the document's title, as given by &lt;a href=#the-title-element-0&gt;the &lt;code&gt;title&lt;/code&gt; element&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;Can be set, to update the document's title. If there is no - &lt;a href=#the-head-element title=&quot;the head element&quot;&gt;&lt;code&gt;head&lt;/code&gt; element&lt;/a&gt;, + &lt;a href=#the-head-element-0 title=&quot;the head element&quot;&gt;&lt;code&gt;head&lt;/code&gt; element&lt;/a&gt;, the new value is ignored.&lt;/p&gt; &lt;p&gt;In SVG documents, the &lt;code&gt;SVGDocument&lt;/code&gt; interface's &lt;code title=dom-svg-title&gt;title&lt;/code&gt; attribute takes precedence.&lt;/p&gt; &lt;/dd&gt; - &lt;/dl&gt;&lt;p&gt;&lt;dfn id=the-title-element&gt;The &lt;code&gt;title&lt;/code&gt; element&lt;/dfn&gt; of a document is the - first &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt; element in the document (in tree order), if + &lt;/dl&gt;&lt;p&gt;&lt;dfn id=the-title-element-0&gt;The &lt;code&gt;title&lt;/code&gt; element&lt;/dfn&gt; of a document is the + first &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt; element in the document (in tree order), if there is one, or null otherwise.&lt;/p&gt; &lt;div class=impl&gt; @@ -9057,8 +9054,8 @@ &lt;li&gt;&lt;p&gt;Otherwise, let &lt;var title=&quot;&quot;&gt;value&lt;/var&gt; be a concatenation of the data of all the child &lt;a href=#text-node title=&quot;text node&quot;&gt;text - nodes&lt;/a&gt; of &lt;a href=#the-title-element&gt;the &lt;code&gt;title&lt;/code&gt; element&lt;/a&gt;, in - &lt;a href=#tree-order&gt;tree order&lt;/a&gt;, or the empty string if &lt;a href=#the-title-element&gt;the + nodes&lt;/a&gt; of &lt;a href=#the-title-element-0&gt;the &lt;code&gt;title&lt;/code&gt; element&lt;/a&gt;, in + &lt;a href=#tree-order&gt;tree order&lt;/a&gt;, or the empty string if &lt;a href=#the-title-element-0&gt;the &lt;code&gt;title&lt;/code&gt; element&lt;/a&gt; is null.&lt;/li&gt; &lt;li&gt;&lt;p&gt;Replace any sequence of one or more consecutive &lt;a href=#space-character title=&quot;space character&quot;&gt;space characters&lt;/a&gt; in &lt;var title=&quot;&quot;&gt;value&lt;/var&gt; with a single U+0020 SPACE character.&lt;/li&gt; @@ -9078,13 +9075,13 @@ &lt;code&gt;SVGDocument&lt;/code&gt; interface (if it is readonly, then this will raise an exception). Stop the algorithm here. &lt;a href=#refsSVG&gt;[SVG]&lt;/a&gt;&lt;/li&gt; - &lt;li&gt;If &lt;a href=#the-title-element&gt;the &lt;code&gt;title&lt;/code&gt; element&lt;/a&gt; is null and - &lt;a href=#the-head-element&gt;the &lt;code&gt;head&lt;/code&gt; element&lt;/a&gt; is null, then the + &lt;li&gt;If &lt;a href=#the-title-element-0&gt;the &lt;code&gt;title&lt;/code&gt; element&lt;/a&gt; is null and + &lt;a href=#the-head-element-0&gt;the &lt;code&gt;head&lt;/code&gt; element&lt;/a&gt; is null, then the attribute must do nothing. Stop the algorithm here.&lt;/li&gt; - &lt;li&gt;If &lt;a href=#the-title-element&gt;the &lt;code&gt;title&lt;/code&gt; element&lt;/a&gt; is null, then a - new &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt; element must be created and appended to - &lt;a href=#the-head-element&gt;the &lt;code&gt;head&lt;/code&gt; element&lt;/a&gt;. Let &lt;var title=&quot;&quot;&gt;element&lt;/var&gt; be that element. Otherwise, let &lt;var title=&quot;&quot;&gt;element&lt;/var&gt; be &lt;a href=#the-title-element&gt;the &lt;code&gt;title&lt;/code&gt; + &lt;li&gt;If &lt;a href=#the-title-element-0&gt;the &lt;code&gt;title&lt;/code&gt; element&lt;/a&gt; is null, then a + new &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt; element must be created and appended to + &lt;a href=#the-head-element-0&gt;the &lt;code&gt;head&lt;/code&gt; element&lt;/a&gt;. Let &lt;var title=&quot;&quot;&gt;element&lt;/var&gt; be that element. Otherwise, let &lt;var title=&quot;&quot;&gt;element&lt;/var&gt; be &lt;a href=#the-title-element-0&gt;the &lt;code&gt;title&lt;/code&gt; element&lt;/a&gt;.&lt;/li&gt; &lt;li&gt;The children of &lt;var title=&quot;&quot;&gt;element&lt;/var&gt; (if any) must all @@ -9108,7 +9105,7 @@ &lt;/dd&gt; &lt;/dl&gt;&lt;p&gt;&lt;dfn id=the-body-element&gt;The body element&lt;/dfn&gt; of a document is the first child of - &lt;a href=#the-html-element&gt;the &lt;code&gt;html&lt;/code&gt; element&lt;/a&gt; that is either a + &lt;a href=#the-html-element-0&gt;the &lt;code&gt;html&lt;/code&gt; element&lt;/a&gt; that is either a &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt; element or a &lt;code&gt;&lt;a href=#frameset&gt;frameset&lt;/a&gt;&lt;/code&gt; element. If there is no such element, it is null. &lt;span class=impl&gt;If the body element is null, then when the specification requires that events be @@ -9173,7 +9170,7 @@ &lt;dt&gt;&lt;var title=&quot;&quot;&gt;document&lt;/var&gt; . &lt;code title=dom-document-scripts&gt;&lt;a href=#dom-document-scripts&gt;scripts&lt;/a&gt;&lt;/code&gt;&lt;/dt&gt; &lt;dd&gt; - &lt;p&gt;Return an &lt;code&gt;&lt;a href=#htmlcollection&gt;HTMLCollection&lt;/a&gt;&lt;/code&gt; of the &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; elements in the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt;.&lt;/p&gt; + &lt;p&gt;Return an &lt;code&gt;&lt;a href=#htmlcollection&gt;HTMLCollection&lt;/a&gt;&lt;/code&gt; of the &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements in the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt;.&lt;/p&gt; &lt;/dd&gt; &lt;/dl&gt;&lt;div class=impl&gt; @@ -9208,7 +9205,7 @@ &lt;p&gt;The &lt;dfn id=dom-document-scripts title=dom-document-scripts&gt;&lt;code&gt;scripts&lt;/code&gt;&lt;/dfn&gt; attribute must return an &lt;code&gt;&lt;a href=#htmlcollection&gt;HTMLCollection&lt;/a&gt;&lt;/code&gt; rooted at the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt; node, whose filter matches only - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; elements.&lt;/p&gt; + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements.&lt;/p&gt; &lt;hr&gt;&lt;/div&gt; @@ -9333,7 +9330,7 @@ &lt;p&gt;Each entry in the &lt;a href=#css-id-overrides-list&gt;CSS ID overrides list&lt;/a&gt;, while it is in the list and is either &lt;a href=#in-a-document title=&quot;in a Document&quot;&gt;in the &lt;code&gt;Document&lt;/code&gt;&lt;/a&gt; or is an &lt;code&gt;&lt;a href=#the-img-element&gt;img&lt;/a&gt;&lt;/code&gt;, - &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt;, or &lt;code&gt;&lt;a href=#the-canvas-element&gt;canvas&lt;/a&gt;&lt;/code&gt; element, defines a + &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt;, or &lt;code&gt;&lt;a href=#the-canvas-element&gt;canvas&lt;/a&gt;&lt;/code&gt; element, defines a &lt;span&gt;CSS element reference identifier&lt;/span&gt; mapping the given name to the given &lt;code&gt;&lt;a href=#element&gt;Element&lt;/a&gt;&lt;/code&gt;. &lt;a href=#refsCSSIMAGES&gt;[CSSIMAGES]&lt;/a&gt;&lt;/p&gt; @@ -9501,7 +9498,7 @@ &lt;dd&gt; &lt;p&gt;Returns a new &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt;, with a basic DOM already - constructed with an appropriate &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt; element.&lt;/p&gt; + constructed with an appropriate &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt; element.&lt;/p&gt; &lt;/dd&gt; @@ -9521,20 +9518,20 @@ and empty lists, as appropriate. Append the newly created node to &lt;var title=&quot;&quot;&gt;doc&lt;/var&gt;.&lt;/li&gt; - &lt;li&gt;&lt;p&gt;Create an &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element, and append it to &lt;var title=&quot;&quot;&gt;doc&lt;/var&gt;.&lt;/li&gt; + &lt;li&gt;&lt;p&gt;Create an &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element, and append it to &lt;var title=&quot;&quot;&gt;doc&lt;/var&gt;.&lt;/li&gt; - &lt;li&gt;&lt;p&gt;Create a &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element, and append it to the - &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element created in the previous step.&lt;/p&gt; + &lt;li&gt;&lt;p&gt;Create a &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element, and append it to the + &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element created in the previous step.&lt;/p&gt; - &lt;li&gt;&lt;p&gt;Create a &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt; element, and append it to the - &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element created in the previous step.&lt;/p&gt; + &lt;li&gt;&lt;p&gt;Create a &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt; element, and append it to the + &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element created in the previous step.&lt;/p&gt; &lt;li&gt;&lt;p&gt;Create a &lt;code&gt;&lt;a href=#text&gt;Text&lt;/a&gt;&lt;/code&gt; node, and set its &lt;code title=&quot;&quot;&gt;data&lt;/code&gt; attribute to the string given by the method's argument (which could be the empty string). Append it to the - &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt; element created in the previous step.&lt;/p&gt; + &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt; element created in the previous step.&lt;/p&gt; &lt;li&gt;&lt;p&gt;Create a &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt; element, and append it to the - &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element created in the earlier step.&lt;/p&gt; + &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element created in the earlier step.&lt;/p&gt; &lt;li&gt;&lt;p&gt;Return &lt;var title=&quot;&quot;&gt;doc&lt;/var&gt;.&lt;/li&gt; @@ -10355,7 +10352,7 @@ determined and that is either:&lt;/p&gt; &lt;ul class=brief&gt;&lt;li&gt;A &lt;code&gt;&lt;a href=#the-bdi-element&gt;bdi&lt;/a&gt;&lt;/code&gt; element. - &lt;li&gt;A &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element. + &lt;li&gt;A &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element. &lt;li&gt;A &lt;code&gt;&lt;a href=#the-style-element&gt;style&lt;/a&gt;&lt;/code&gt; element. &lt;li&gt;An element with a &lt;code title=attr-dir&gt;&lt;a href=#the-dir-attribute&gt;dir&lt;/a&gt;&lt;/code&gt; attribute in a defined state. &lt;/ul&gt;&lt;/li&gt; @@ -10392,9 +10389,9 @@ &lt;hr&gt;&lt;dl class=domintro&gt;&lt;dt&gt;&lt;var title=&quot;&quot;&gt;document&lt;/var&gt; . &lt;code title=dom-dir&gt;&lt;a href=#dom-dir&gt;dir&lt;/a&gt;&lt;/code&gt; [ = &lt;var title=&quot;&quot;&gt;value&lt;/var&gt; ]&lt;/dt&gt; &lt;dd&gt; - &lt;p&gt;Returns &lt;a href=#the-html-element&gt;the &lt;code&gt;html&lt;/code&gt; element&lt;/a&gt;'s &lt;code title=attr-dir&gt;&lt;a href=#the-dir-attribute&gt;dir&lt;/a&gt;&lt;/code&gt; attribute's value, if any.&lt;/p&gt; - &lt;p&gt;Can be set, to either &quot;&lt;code title=&quot;&quot;&gt;ltr&lt;/code&gt;&quot;, &quot;&lt;code title=&quot;&quot;&gt;rtl&lt;/code&gt;&quot;, or &quot;&lt;code title=&quot;&quot;&gt;auto&lt;/code&gt;&quot; to replace &lt;a href=#the-html-element&gt;the &lt;code&gt;html&lt;/code&gt; element&lt;/a&gt;'s &lt;code title=attr-dir&gt;&lt;a href=#the-dir-attribute&gt;dir&lt;/a&gt;&lt;/code&gt; attribute's value.&lt;/p&gt; - &lt;p&gt;If there is no &lt;a href=#the-html-element title=&quot;the html element&quot;&gt;&lt;code&gt;html&lt;/code&gt; element&lt;/a&gt;, returns the empty string and ignores new values.&lt;/p&gt; + &lt;p&gt;Returns &lt;a href=#the-html-element-0&gt;the &lt;code&gt;html&lt;/code&gt; element&lt;/a&gt;'s &lt;code title=attr-dir&gt;&lt;a href=#the-dir-attribute&gt;dir&lt;/a&gt;&lt;/code&gt; attribute's value, if any.&lt;/p&gt; + &lt;p&gt;Can be set, to either &quot;&lt;code title=&quot;&quot;&gt;ltr&lt;/code&gt;&quot;, &quot;&lt;code title=&quot;&quot;&gt;rtl&lt;/code&gt;&quot;, or &quot;&lt;code title=&quot;&quot;&gt;auto&lt;/code&gt;&quot; to replace &lt;a href=#the-html-element-0&gt;the &lt;code&gt;html&lt;/code&gt; element&lt;/a&gt;'s &lt;code title=attr-dir&gt;&lt;a href=#the-dir-attribute&gt;dir&lt;/a&gt;&lt;/code&gt; attribute's value.&lt;/p&gt; + &lt;p&gt;If there is no &lt;a href=#the-html-element-0 title=&quot;the html element&quot;&gt;&lt;code&gt;html&lt;/code&gt; element&lt;/a&gt;, returns the empty string and ignores new values.&lt;/p&gt; &lt;/dd&gt; &lt;/dl&gt;&lt;div class=impl&gt; @@ -10406,7 +10403,7 @@ &lt;p&gt;The &lt;dfn id=dom-document-dir title=dom-document-dir&gt;&lt;code&gt;dir&lt;/code&gt;&lt;/dfn&gt; IDL attribute on &lt;code&gt;&lt;a href=#htmldocument&gt;HTMLDocument&lt;/a&gt;&lt;/code&gt; objects must &lt;a href=#reflect&gt;reflect&lt;/a&gt; the &lt;code title=attr-dir&gt;&lt;a href=#the-dir-attribute&gt;dir&lt;/a&gt;&lt;/code&gt; content - attribute of &lt;a href=#the-html-element&gt;the &lt;code&gt;html&lt;/code&gt; element&lt;/a&gt;, if any, + attribute of &lt;a href=#the-html-element-0&gt;the &lt;code&gt;html&lt;/code&gt; element&lt;/a&gt;, if any, &lt;a href=#limited-to-only-known-values&gt;limited to only known values&lt;/a&gt;. If there is no such element, then the attribute must return the empty string and do nothing on setting.&lt;/p&gt; @@ -10937,13 +10934,13 @@ &lt;!-- when updating this also update the category index --&gt; &lt;ul class=&quot;brief category-list&quot;&gt;&lt;li&gt;&lt;code&gt;&lt;a href=#the-base-element&gt;base&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; - &lt;li&gt;&lt;code&gt;&lt;a href=#the-command&gt;command&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; + &lt;li&gt;&lt;code&gt;&lt;a href=#the-command-element&gt;command&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-link-element&gt;link&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; - &lt;li&gt;&lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; + &lt;li&gt;&lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; - &lt;li&gt;&lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; + &lt;li&gt;&lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-style-element&gt;style&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; - &lt;li&gt;&lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; + &lt;li&gt;&lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;/ul&gt;&lt;p&gt;Elements from other namespaces whose semantics are primarily metadata-related (e.g. RDF) are also &lt;a href=#metadata-content&gt;metadata content&lt;/a&gt;.&lt;/p&gt; @@ -10989,7 +10986,7 @@ &lt;li&gt;&lt;code&gt;&lt;a href=#the-area-element&gt;area&lt;/a&gt;&lt;/code&gt; (if it is a descendant of a &lt;code&gt;&lt;a href=#the-map-element&gt;map&lt;/a&gt;&lt;/code&gt; element)&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-article-element&gt;article&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-aside-element&gt;aside&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; - &lt;li&gt;&lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; + &lt;li&gt;&lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-bdi-element&gt;bdi&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-bdo-element&gt;bdo&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; @@ -10999,7 +10996,7 @@ &lt;li&gt;&lt;code&gt;&lt;a href=#the-canvas-element&gt;canvas&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-cite-element&gt;cite&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-code-element&gt;code&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; - &lt;li&gt;&lt;code&gt;&lt;a href=#the-command&gt;command&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; + &lt;li&gt;&lt;code&gt;&lt;a href=#the-command-element&gt;command&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-datalist-element&gt;datalist&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-del-element&gt;del&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-details-element&gt;details&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; @@ -11035,9 +11032,9 @@ &lt;li&gt;&lt;code&gt;&lt;a href=#the-map-element&gt;map&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-mark-element&gt;mark&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#math&gt;math&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; - &lt;li&gt;&lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; + &lt;li&gt;&lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;!--MD--&gt; - &lt;li&gt;&lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-itemprop&gt;&lt;a href=#names:-the-itemprop-attribute&gt;itemprop&lt;/a&gt;&lt;/code&gt; attribute is present)&lt;/li&gt; + &lt;li&gt;&lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-itemprop&gt;&lt;a href=#names:-the-itemprop-attribute&gt;itemprop&lt;/a&gt;&lt;/code&gt; attribute is present)&lt;/li&gt; &lt;!--MD--&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-meter-element&gt;meter&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-nav-element&gt;nav&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; @@ -11052,7 +11049,7 @@ &lt;li&gt;&lt;code&gt;&lt;a href=#the-ruby-element&gt;ruby&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-s-element&gt;s&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-samp-element&gt;samp&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; - &lt;li&gt;&lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; + &lt;li&gt;&lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-section-element&gt;section&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-select-element&gt;select&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-small-element&gt;small&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; @@ -11068,7 +11065,7 @@ &lt;li&gt;&lt;code&gt;&lt;a href=#the-u-element&gt;u&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-ul-element&gt;ul&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-var-element&gt;var&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; - &lt;li&gt;&lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; + &lt;li&gt;&lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-wbr-element&gt;wbr&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=#text-content title=&quot;text content&quot;&gt;Text&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;&lt;p&gt;As a general rule, elements whose content model allows any @@ -11130,7 +11127,7 @@ &lt;ul class=&quot;brief category-list&quot;&gt;&lt;li&gt;&lt;code&gt;&lt;a href=#the-a-element&gt;a&lt;/a&gt;&lt;/code&gt; (if it contains only &lt;a href=#phrasing-content&gt;phrasing content&lt;/a&gt;)&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-abbr-element&gt;abbr&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-area-element&gt;area&lt;/a&gt;&lt;/code&gt; (if it is a descendant of a &lt;code&gt;&lt;a href=#the-map-element&gt;map&lt;/a&gt;&lt;/code&gt; element)&lt;/li&gt; - &lt;li&gt;&lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; + &lt;li&gt;&lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-bdi-element&gt;bdi&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-bdo-element&gt;bdo&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; @@ -11139,7 +11136,7 @@ &lt;li&gt;&lt;code&gt;&lt;a href=#the-canvas-element&gt;canvas&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-cite-element&gt;cite&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-code-element&gt;code&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; - &lt;li&gt;&lt;code&gt;&lt;a href=#the-command&gt;command&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; + &lt;li&gt;&lt;code&gt;&lt;a href=#the-command-element&gt;command&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-datalist-element&gt;datalist&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-del-element&gt;del&lt;/a&gt;&lt;/code&gt; (if it contains only &lt;a href=#phrasing-content&gt;phrasing content&lt;/a&gt;)&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-dfn-element&gt;dfn&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; @@ -11160,7 +11157,7 @@ &lt;li&gt;&lt;code&gt;&lt;a href=#the-mark-element&gt;mark&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#math&gt;math&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;!--MD--&gt; - &lt;li&gt;&lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-itemprop&gt;&lt;a href=#names:-the-itemprop-attribute&gt;itemprop&lt;/a&gt;&lt;/code&gt; attribute is present)&lt;/li&gt; + &lt;li&gt;&lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-itemprop&gt;&lt;a href=#names:-the-itemprop-attribute&gt;itemprop&lt;/a&gt;&lt;/code&gt; attribute is present)&lt;/li&gt; &lt;!--MD--&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-meter-element&gt;meter&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; @@ -11171,7 +11168,7 @@ &lt;li&gt;&lt;code&gt;&lt;a href=#the-ruby-element&gt;ruby&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-s-element&gt;s&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-samp-element&gt;samp&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; - &lt;li&gt;&lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; + &lt;li&gt;&lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-select-element&gt;select&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-small-element&gt;small&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-span-element&gt;span&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; @@ -11183,7 +11180,7 @@ &lt;li&gt;&lt;code&gt;&lt;a href=#the-time-element&gt;time&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-u-element&gt;u&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-var-element&gt;var&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; - &lt;li&gt;&lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; + &lt;li&gt;&lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-wbr-element&gt;wbr&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=#text-content title=&quot;text content&quot;&gt;Text&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;&lt;p&gt;As a general rule, elements whose content model allows any @@ -11215,7 +11212,7 @@ is inserted into the document.&lt;/p&gt; &lt;!-- when updating this also update the category index --&gt; - &lt;ul class=&quot;brief category-list&quot;&gt;&lt;li&gt;&lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; + &lt;ul class=&quot;brief category-list&quot;&gt;&lt;li&gt;&lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-canvas-element&gt;canvas&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-embed-element&gt;embed&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-iframe-element&gt;iframe&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; @@ -11223,7 +11220,7 @@ &lt;li&gt;&lt;code&gt;&lt;a href=#math&gt;math&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-object-element&gt;object&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#svg&gt;svg&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; - &lt;li&gt;&lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; + &lt;li&gt;&lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;/ul&gt;&lt;p&gt;Elements that are from namespaces other than the &lt;a href=#html-namespace-0&gt;HTML namespace&lt;/a&gt; and that convey content but not metadata, are &lt;a href=#embedded-content&gt;embedded content&lt;/a&gt; for the purposes of the content models @@ -11253,7 +11250,7 @@ &lt;!-- when updating this also update the category index --&gt; &lt;ul class=&quot;brief category-list&quot;&gt;&lt;li&gt;&lt;code&gt;&lt;a href=#the-a-element&gt;a&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; - &lt;li&gt;&lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-media-controls&gt;&lt;a href=#attr-media-controls&gt;controls&lt;/a&gt;&lt;/code&gt; attribute is present)&lt;/li&gt; + &lt;li&gt;&lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-media-controls&gt;&lt;a href=#attr-media-controls&gt;controls&lt;/a&gt;&lt;/code&gt; attribute is present)&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-button-element&gt;button&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-details-element&gt;details&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-embed-element&gt;embed&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; @@ -11262,11 +11259,11 @@ &lt;li&gt;&lt;code&gt;&lt;a href=#the-input-element&gt;input&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-input-type&gt;&lt;a href=#attr-input-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute is &lt;em&gt;not&lt;/em&gt; in the &lt;a href=#hidden-state title=attr-input-type-hidden&gt;Hidden&lt;/a&gt; state)&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-keygen-element&gt;keygen&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-label-element&gt;label&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; - &lt;li&gt;&lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute is in the &lt;a href=#toolbar-state title=&quot;toolbar state&quot;&gt;toolbar&lt;/a&gt; state)&lt;/li&gt; + &lt;li&gt;&lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute is in the &lt;a href=#toolbar-state title=&quot;toolbar state&quot;&gt;toolbar&lt;/a&gt; state)&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-object-element&gt;object&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-hyperlink-usemap&gt;&lt;a href=#attr-hyperlink-usemap&gt;usemap&lt;/a&gt;&lt;/code&gt; attribute is present)&lt;!-- see also comment in &lt;object&gt; section --&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-select-element&gt;select&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-textarea-element&gt;textarea&lt;/a&gt;&lt;/code&gt;&lt;/li&gt; - &lt;li&gt;&lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-media-controls&gt;&lt;a href=#attr-media-controls&gt;controls&lt;/a&gt;&lt;/code&gt; attribute is present)&lt;/li&gt; + &lt;li&gt;&lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-media-controls&gt;&lt;a href=#attr-media-controls&gt;controls&lt;/a&gt;&lt;/code&gt; attribute is present)&lt;/li&gt; &lt;/ul&gt;&lt;p&gt;Certain elements in HTML have an &lt;a href=#activation-behavior&gt;activation behavior&lt;/a&gt;, which means that the user can activate them. This triggers a sequence of events dependent on the activation mechanism, @@ -11511,7 +11508,7 @@ &lt;p&gt;Conformance checkers may warn authors of cases where they have paragraphs that overlap each other (this can happen with - &lt;code&gt;&lt;a href=#the-object-element&gt;object&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt;, and + &lt;code&gt;&lt;a href=#the-object-element&gt;object&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt;, and &lt;code&gt;&lt;a href=#the-canvas-element&gt;canvas&lt;/a&gt;&lt;/code&gt; elements, and indirectly through elements in other namespaces that allow HTML to be further embedded therein, like &lt;code&gt;&lt;a href=#svg&gt;svg&lt;/a&gt;&lt;/code&gt; or &lt;code&gt;&lt;a href=#math&gt;math&lt;/a&gt;&lt;/code&gt;).&lt;/p&gt; &lt;!-- example below @@ -11749,7 +11746,7 @@ &lt;td&gt;&lt;code title=&quot;attr-aria-role-heading&quot;&gt;heading&lt;/code&gt; role, with the &lt;code title=&quot;attr-aria-level&quot;&gt;aria-level&lt;/code&gt; property set to the element's &lt;span&gt;outline depth&lt;/span&gt; --&gt; - &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element + &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element &lt;td&gt;No role &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#the-hgroup-element&gt;hgroup&lt;/a&gt;&lt;/code&gt; element @@ -11758,7 +11755,7 @@ &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#the-hr-element&gt;hr&lt;/a&gt;&lt;/code&gt; element &lt;td&gt;&lt;code title=attr-aria-role-separator&gt;separator&lt;/code&gt; role - &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element + &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element &lt;td&gt;No role &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#the-img-element&gt;img&lt;/a&gt;&lt;/code&gt; element whose &lt;code title=attr-img-alt&gt;&lt;a href=#attr-img-alt&gt;alt&lt;/a&gt;&lt;/code&gt; attribute's value is empty @@ -11842,16 +11839,16 @@ &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#the-link-element&gt;link&lt;/a&gt;&lt;/code&gt; element that creates a &lt;a href=#hyperlink&gt;hyperlink&lt;/a&gt; &lt;td&gt;&lt;code title=attr-aria-role-link&gt;link&lt;/code&gt; role - &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute in the &lt;a href=#context-menu-state title=&quot;context menu state&quot;&gt;context menu&lt;/a&gt; state + &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute in the &lt;a href=#context-menu-state title=&quot;context menu state&quot;&gt;context menu&lt;/a&gt; state &lt;td&gt;No role - &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute in the &lt;a href=#list-state title=&quot;list state&quot;&gt;list&lt;/a&gt; state + &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute in the &lt;a href=#list-state title=&quot;list state&quot;&gt;list&lt;/a&gt; state &lt;td&gt;&lt;code title=attr-aria-role-menu&gt;menu&lt;/code&gt; role - &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute in the &lt;a href=#toolbar-state title=&quot;toolbar state&quot;&gt;toolbar&lt;/a&gt; state + &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute in the &lt;a href=#toolbar-state title=&quot;toolbar state&quot;&gt;toolbar&lt;/a&gt; state &lt;td&gt;&lt;code title=attr-aria-role-toolbar&gt;toolbar&lt;/code&gt; role - &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element + &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element &lt;td&gt;No role &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#the-meter-element&gt;meter&lt;/a&gt;&lt;/code&gt; element @@ -11875,7 +11872,7 @@ &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#the-progress-element&gt;progress&lt;/a&gt;&lt;/code&gt; element &lt;td&gt;&lt;code title=attr-aria-role-progressbar&gt;progressbar&lt;/code&gt; role, with, if the progress bar is determinate, the &lt;code title=attr-aria-valuemax&gt;aria-valuemax&lt;/code&gt; property set to the maximum value of the progress bar, the &lt;code title=attr-aria-valuemin&gt;aria-valuemin&lt;/code&gt; property set to zero, and the &lt;code title=attr-aria-valuenow&gt;aria-valuenow&lt;/code&gt; property set to the current value of the progress bar - &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element + &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element &lt;td&gt;No role &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#the-select-element&gt;select&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-select-multiple&gt;&lt;a href=#attr-select-multiple&gt;multiple&lt;/a&gt;&lt;/code&gt; attribute @@ -11902,16 +11899,16 @@ &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#the-textarea-element&gt;textarea&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-textarea-required&gt;&lt;a href=#attr-textarea-required&gt;required&lt;/a&gt;&lt;/code&gt; attribute &lt;td&gt;The &lt;code title=title-aria-required&gt;aria-required&lt;/code&gt; state set to &quot;true&quot; - &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt; element + &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt; element &lt;td&gt;No role - &lt;tr&gt;&lt;td&gt;An element that &lt;a href=#concept-command title=concept-command&gt;defines a command&lt;/a&gt;, whose &lt;a href=#command-facet-type title=command-facet-type&gt;Type&lt;/a&gt; facet is &quot;checkbox&quot;, and that is a descendant of a &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; element whose &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute in the &lt;a href=#list-state title=&quot;list state&quot;&gt;list&lt;/a&gt; state + &lt;tr&gt;&lt;td&gt;An element that &lt;a href=#concept-command title=concept-command&gt;defines a command&lt;/a&gt;, whose &lt;a href=#command-facet-type title=command-facet-type&gt;Type&lt;/a&gt; facet is &quot;checkbox&quot;, and that is a descendant of a &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; element whose &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute in the &lt;a href=#list-state title=&quot;list state&quot;&gt;list&lt;/a&gt; state &lt;td&gt;&lt;code title=attr-aria-role-menuitemcheckbox&gt;menuitemcheckbox&lt;/code&gt; role, with the &lt;code title=attr-aria-checked&gt;aria-checked&lt;/code&gt; state set to &quot;true&quot; if the command's &lt;a href=#command-facet-checkedstate title=command-facet-checkedstate&gt;Checked State&lt;/a&gt; facet is true, and &quot;false&quot; otherwise - &lt;tr&gt;&lt;td&gt;An element that &lt;a href=#concept-command title=concept-command&gt;defines a command&lt;/a&gt;, whose &lt;a href=#command-facet-type title=command-facet-type&gt;Type&lt;/a&gt; facet is &quot;command&quot;, and that is a descendant of a &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; element whose &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute in the &lt;a href=#list-state title=&quot;list state&quot;&gt;list&lt;/a&gt; state + &lt;tr&gt;&lt;td&gt;An element that &lt;a href=#concept-command title=concept-command&gt;defines a command&lt;/a&gt;, whose &lt;a href=#command-facet-type title=command-facet-type&gt;Type&lt;/a&gt; facet is &quot;command&quot;, and that is a descendant of a &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; element whose &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute in the &lt;a href=#list-state title=&quot;list state&quot;&gt;list&lt;/a&gt; state &lt;td&gt;&lt;code title=attr-aria-role-menuitem&gt;menuitem&lt;/code&gt; role - &lt;tr&gt;&lt;td&gt;An element that &lt;a href=#concept-command title=concept-command&gt;defines a command&lt;/a&gt;, whose &lt;a href=#command-facet-type title=command-facet-type&gt;Type&lt;/a&gt; facet is &quot;radio&quot;, and that is a descendant of a &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; element whose &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute in the &lt;a href=#list-state title=&quot;list state&quot;&gt;list&lt;/a&gt; state + &lt;tr&gt;&lt;td&gt;An element that &lt;a href=#concept-command title=concept-command&gt;defines a command&lt;/a&gt;, whose &lt;a href=#command-facet-type title=command-facet-type&gt;Type&lt;/a&gt; facet is &quot;radio&quot;, and that is a descendant of a &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; element whose &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute in the &lt;a href=#list-state title=&quot;list state&quot;&gt;list&lt;/a&gt; state &lt;td&gt;&lt;code title=attr-aria-role-menuitemradio&gt;menuitemradio&lt;/code&gt; role, with the &lt;code title=attr-aria-checked&gt;aria-checked&lt;/code&gt; state set to &quot;true&quot; if the command's &lt;a href=#command-facet-checkedstate title=command-facet-checkedstate&gt;Checked State&lt;/a&gt; facet is true, and &quot;false&quot; otherwise &lt;tr&gt;&lt;td&gt;Element that is &lt;a href=#concept-fe-disabled title=concept-fe-disabled&gt;disabled&lt;/a&gt; @@ -11955,7 +11952,7 @@ &lt;td&gt;&lt;code title=attr-aria-role-note&gt;note&lt;/code&gt; role &lt;td&gt;Role must be either &lt;code title=attr-aria-role-note&gt;note&lt;/code&gt;, &lt;code title=attr-aria-role-complementary&gt;complementary&lt;/code&gt;, or &lt;code title=attr-aria-role-search&gt;search&lt;/code&gt; - &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; element + &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; element &lt;td&gt;No role &lt;td&gt;If specified, role must be &lt;code title=attr-aria-role-application&gt;application&lt;/code&gt; @@ -12069,7 +12066,7 @@ &lt;td&gt;&lt;code title=attr-aria-role-list&gt;list&lt;/code&gt; role &lt;td&gt;Role must be either &lt;code title=attr-aria-role-directory&gt;directory&lt;/code&gt;, &lt;code title=attr-aria-role-list&gt;list&lt;/code&gt;, &lt;code title=attr-aria-role-listbox&gt;listbox&lt;/code&gt;, &lt;code title=attr-aria-role-menu&gt;menu&lt;/code&gt;, &lt;code title=attr-aria-role-menubar&gt;menubar&lt;/code&gt;, &lt;code title=attr-aria-role-tablist&gt;tablist&lt;/code&gt;, &lt;code title=&quot;attr-aria-role-toolbar &quot;&gt;toolbar&lt;/code&gt;, &lt;code title=attr-aria-role-tree&gt;tree&lt;/code&gt; - &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element + &lt;tr&gt;&lt;td&gt;&lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element &lt;td&gt;No role &lt;td&gt;If specified, role must be &lt;code title=attr-aria-role-application&gt;application&lt;/code&gt; @@ -12643,7 +12640,7 @@ &lt;p&gt;&lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt; objects have an &lt;dfn id=ignore-destructive-writes-counter&gt;ignore-destructive-writes counter&lt;/dfn&gt;, which is used in - conjunction with the processing of &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; elements to + conjunction with the processing of &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements to prevent external scripts from being able to use &lt;code title=dom-document-write&gt;&lt;a href=#dom-document-write&gt;document.write()&lt;/a&gt;&lt;/code&gt; to blow away the document by implicitly calling &lt;code title=dom-document-open&gt;&lt;a href=#dom-document-open&gt;document.open()&lt;/a&gt;&lt;/code&gt;. Initially, the counter must be set to zero.&lt;/p&gt; @@ -12707,12 +12704,12 @@ at a time, processing resulting tokens as they are emitted, and stopping when the tokenizer reaches the insertion point or when the processing of the tokenizer is aborted by the tree - construction stage (this can happen if a &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; end + construction stage (this can happen if a &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; end tag token is emitted by the tokenizer). &lt;p class=note&gt;If the &lt;code title=dom-document-write&gt;&lt;a href=#dom-document-write&gt;document.write()&lt;/a&gt;&lt;/code&gt; method was called from script executing inline (i.e. executing because the - parser parsed a set of &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; tags), then this is a + parser parsed a set of &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; tags), then this is a &lt;a href=#nestedParsing&gt;reentrant invocation of the parser&lt;/a&gt;.&lt;/p&gt; @@ -13164,7 +13161,7 @@ &lt;h3 id=the-root-element&gt;&lt;span class=secno&gt;4.1 &lt;/span&gt;The root element&lt;/h3&gt; - &lt;h4 id=the-html-element-0&gt;&lt;span class=secno&gt;4.1.1 &lt;/span&gt;The &lt;dfn&gt;&lt;code&gt;html&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; + &lt;h4 id=the-html-element&gt;&lt;span class=secno&gt;4.1.1 &lt;/span&gt;The &lt;dfn&gt;&lt;code&gt;html&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; &lt;dl class=element&gt;&lt;dt&gt;Categories&lt;/dt&gt; &lt;dd&gt;None.&lt;/dd&gt; @@ -13172,7 +13169,7 @@ &lt;dd&gt;As the root element of a document.&lt;/dd&gt; &lt;dd&gt;Wherever a subdocument fragment is allowed in a compound document.&lt;/dd&gt; &lt;dt&gt;Content model:&lt;/dt&gt; - &lt;dd&gt;A &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element followed by a &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt; element.&lt;/dd&gt; + &lt;dd&gt;A &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element followed by a &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt; element.&lt;/dd&gt; &lt;dt&gt;Content attributes:&lt;/dt&gt; &lt;dd&gt;&lt;a href=#global-attributes&gt;Global attributes&lt;/a&gt;&lt;/dd&gt; &lt;dd&gt;&lt;code title=attr-html-manifest&gt;&lt;a href=#attr-html-manifest&gt;manifest&lt;/a&gt;&lt;/code&gt;&lt;/dd&gt; @@ -13180,7 +13177,7 @@ &lt;dd&gt; &lt;pre class=idl&gt;interface &lt;dfn id=htmlhtmlelement&gt;HTMLHtmlElement&lt;/dfn&gt; : &lt;a href=#htmlelement&gt;HTMLElement&lt;/a&gt; {};&lt;/pre&gt; &lt;/dd&gt; - &lt;/dl&gt;&lt;p&gt;The &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element &lt;a href=#represents&gt;represents&lt;/a&gt; the root of + &lt;/dl&gt;&lt;p&gt;The &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element &lt;a href=#represents&gt;represents&lt;/a&gt; the root of an HTML document.&lt;/p&gt; &lt;p&gt;The &lt;dfn id=attr-html-manifest title=attr-html-manifest&gt;&lt;code&gt;manifest&lt;/code&gt;&lt;/dfn&gt; @@ -13206,7 +13203,7 @@ &lt;div class=example&gt; - &lt;p&gt;The &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element in the following example declares + &lt;p&gt;The &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element in the following example declares that the document's language is English.&lt;/p&gt; &lt;pre&gt;&lt;!DOCTYPE html&gt; @@ -13228,27 +13225,27 @@ &lt;h3 id=document-metadata&gt;&lt;span class=secno&gt;4.2 &lt;/span&gt;Document metadata&lt;/h3&gt; - &lt;h4 id=the-head-element-0&gt;&lt;span class=secno&gt;4.2.1 &lt;/span&gt;The &lt;dfn&gt;&lt;code&gt;head&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; + &lt;h4 id=the-head-element&gt;&lt;span class=secno&gt;4.2.1 &lt;/span&gt;The &lt;dfn&gt;&lt;code&gt;head&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; &lt;dl class=element&gt;&lt;dt&gt;Categories&lt;/dt&gt; &lt;dd&gt;None.&lt;/dd&gt; &lt;dt&gt;Contexts in which this element can be used:&lt;/dt&gt; - &lt;dd&gt;As the first element in an &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element.&lt;/dd&gt; + &lt;dd&gt;As the first element in an &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element.&lt;/dd&gt; &lt;dt&gt;Content model:&lt;/dt&gt; &lt;dd&gt;If the document is &lt;a href=#an-iframe-srcdoc-document&gt;an &lt;code&gt;iframe&lt;/code&gt; &lt;code title=attr-iframe-srcdoc&gt;srcdoc&lt;/code&gt; document&lt;/a&gt; or if title information is available from a higher-level protocol: Zero or more elements of &lt;a href=#metadata-content&gt;metadata content&lt;/a&gt;.&lt;/dd&gt; - &lt;dd&gt;Otherwise: One or more elements of &lt;a href=#metadata-content&gt;metadata content&lt;/a&gt;, of which exactly one is a &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt; element.&lt;/dd&gt; + &lt;dd&gt;Otherwise: One or more elements of &lt;a href=#metadata-content&gt;metadata content&lt;/a&gt;, of which exactly one is a &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt; element.&lt;/dd&gt; &lt;dt&gt;Content attributes:&lt;/dt&gt; &lt;dd&gt;&lt;a href=#global-attributes&gt;Global attributes&lt;/a&gt;&lt;/dd&gt; &lt;dt&gt;DOM interface:&lt;/dt&gt; &lt;dd&gt; &lt;pre class=idl&gt;interface &lt;dfn id=htmlheadelement&gt;HTMLHeadElement&lt;/dfn&gt; : &lt;a href=#htmlelement&gt;HTMLElement&lt;/a&gt; {};&lt;/pre&gt; &lt;/dd&gt; - &lt;/dl&gt;&lt;p&gt;The &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element &lt;a href=#represents&gt;represents&lt;/a&gt; a + &lt;/dl&gt;&lt;p&gt;The &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element &lt;a href=#represents&gt;represents&lt;/a&gt; a collection of metadata for the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt;.&lt;/p&gt; &lt;div class=example&gt; - &lt;p&gt;The collection of metadata in a &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element can be + &lt;p&gt;The collection of metadata in a &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element can be large or small. Here is an example of a very short one:&lt;/p&gt; &lt;pre&gt;&lt;!doctype html&gt; @@ -13277,20 +13274,20 @@ &lt;/div&gt; - &lt;p class=note&gt;The &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt; element is a required child + &lt;p class=note&gt;The &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt; element is a required child in most situations, but when a higher-level protocol provides title information, e.g. in the Subject line of an e-mail when HTML is used - as an e-mail authoring format, the &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt; element can be + as an e-mail authoring format, the &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt; element can be omitted.&lt;/p&gt; - &lt;h4 id=the-title-element-0&gt;&lt;span class=secno&gt;4.2.2 &lt;/span&gt;The &lt;dfn&gt;&lt;code&gt;title&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; + &lt;h4 id=the-title-element&gt;&lt;span class=secno&gt;4.2.2 &lt;/span&gt;The &lt;dfn&gt;&lt;code&gt;title&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; &lt;dl class=element&gt;&lt;dt&gt;Categories&lt;/dt&gt; &lt;dd&gt;&lt;a href=#metadata-content&gt;Metadata content&lt;/a&gt;.&lt;/dd&gt; &lt;dt&gt;Contexts in which this element can be used:&lt;/dt&gt; - &lt;dd&gt;In a &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element containing no other &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt; elements.&lt;/dd&gt; + &lt;dd&gt;In a &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element containing no other &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt; elements.&lt;/dd&gt; &lt;dt&gt;Content model:&lt;/dt&gt; &lt;dd&gt;&lt;a href=#text-content title=&quot;text content&quot;&gt;Text&lt;/a&gt;.&lt;/dd&gt; &lt;dt&gt;Content attributes:&lt;/dt&gt; @@ -13301,7 +13298,7 @@ attribute DOMString &lt;a href=#dom-title-text title=dom-title-text&gt;text&lt;/a&gt;; };&lt;/pre&gt; &lt;/dd&gt; - &lt;/dl&gt;&lt;p&gt;The &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt; element &lt;a href=#represents&gt;represents&lt;/a&gt; the + &lt;/dl&gt;&lt;p&gt;The &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt; element &lt;a href=#represents&gt;represents&lt;/a&gt; the document's title or name. Authors should use titles that identify their documents even when they are used out of context, for example in a user's history or bookmarks, or in search results. The @@ -13309,7 +13306,7 @@ first heading does not have to stand alone when taken out of context.&lt;/p&gt; - &lt;p&gt;There must be no more than one &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt; element per + &lt;p&gt;There must be no more than one &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt; element per document.&lt;/p&gt; &lt;dl class=domintro&gt;&lt;dt&gt;&lt;var title=&quot;&quot;&gt;title&lt;/var&gt; . &lt;code title=dom-title-text&gt;&lt;a href=#dom-title-text&gt;text&lt;/a&gt;&lt;/code&gt; [ = &lt;var title=&quot;&quot;&gt;value&lt;/var&gt; ]&lt;/dt&gt; @@ -13329,7 +13326,7 @@ &lt;p&gt;The IDL attribute &lt;dfn id=dom-title-text title=dom-title-text&gt;&lt;code&gt;text&lt;/code&gt;&lt;/dfn&gt; must return a concatenation of the contents of all the &lt;a href=#text-node title=&quot;text node&quot;&gt;text nodes&lt;/a&gt; that are direct children of the - &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt; element (ignoring any other nodes such as + &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt; element (ignoring any other nodes such as comments or elements), in tree order. On setting, it must act the same way as the &lt;code&gt;&lt;a href=#textcontent&gt;textContent&lt;/a&gt;&lt;/code&gt; IDL attribute.&lt;/p&gt; @@ -13363,8 +13360,8 @@ &lt;p&gt;User agents should use the document's title when referring to the document in their user interface. When the contents of a - &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt; element are used in this way, &lt;a href=#the-directionality&gt;the - directionality&lt;/a&gt; of that &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt; element should be + &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt; element are used in this way, &lt;a href=#the-directionality&gt;the + directionality&lt;/a&gt; of that &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt; element should be used to set the directionality of the document's title in the user interface.&lt;/p&gt; @@ -13376,7 +13373,7 @@ &lt;dl class=element&gt;&lt;dt&gt;Categories&lt;/dt&gt; &lt;dd&gt;&lt;a href=#metadata-content&gt;Metadata content&lt;/a&gt;.&lt;/dd&gt; &lt;dt&gt;Contexts in which this element can be used:&lt;/dt&gt; - &lt;dd&gt;In a &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element containing no other &lt;code&gt;&lt;a href=#the-base-element&gt;base&lt;/a&gt;&lt;/code&gt; elements.&lt;/dd&gt; + &lt;dd&gt;In a &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element containing no other &lt;code&gt;&lt;a href=#the-base-element&gt;base&lt;/a&gt;&lt;/code&gt; elements.&lt;/dd&gt; &lt;dt&gt;Content model:&lt;/dt&gt; &lt;dd&gt;Empty.&lt;/dd&gt; &lt;dt&gt;Content attributes:&lt;/dt&gt; @@ -13407,7 +13404,7 @@ &lt;p&gt;A &lt;code&gt;&lt;a href=#the-base-element&gt;base&lt;/a&gt;&lt;/code&gt; element, if it has an &lt;code title=attr-base-href&gt;&lt;a href=#attr-base-href&gt;href&lt;/a&gt;&lt;/code&gt; attribute, must come before any other elements in the tree that have attributes defined as taking - &lt;a href=#url title=URL&gt;URLs&lt;/a&gt;, except the &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element + &lt;a href=#url title=URL&gt;URLs&lt;/a&gt;, except the &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element (its &lt;code title=attr-html-manifest&gt;&lt;a href=#attr-html-manifest&gt;manifest&lt;/a&gt;&lt;/code&gt; attribute isn't affected by &lt;code&gt;&lt;a href=#the-base-element&gt;base&lt;/a&gt;&lt;/code&gt; elements).&lt;/p&gt; @@ -13477,7 +13474,7 @@ &lt;!--MD--&gt; &lt;dt&gt;Contexts in which this element can be used:&lt;/dt&gt; &lt;dd&gt;Where &lt;a href=#metadata-content&gt;metadata content&lt;/a&gt; is expected.&lt;/dd&gt; - &lt;dd&gt;In a &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt; element that is a child of a &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element.&lt;/dd&gt; + &lt;dd&gt;In a &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt; element that is a child of a &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element.&lt;/dd&gt; &lt;!--MD--&gt; &lt;dd&gt;If the &lt;code title=attr-itemprop&gt;&lt;a href=#names:-the-itemprop-attribute&gt;itemprop&lt;/a&gt;&lt;/code&gt; attribute is present: where &lt;a href=#phrasing-content&gt;phrasing content&lt;/a&gt; is expected.&lt;/dd&gt; &lt;!--MD--&gt; @@ -13841,7 +13838,7 @@ - &lt;h4 id=meta&gt;&lt;span class=secno&gt;4.2.5 &lt;/span&gt;The &lt;dfn&gt;&lt;code&gt;meta&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; + &lt;h4 id=the-meta-element&gt;&lt;span class=secno&gt;4.2.5 &lt;/span&gt;The &lt;dfn id=meta&gt;&lt;code&gt;meta&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; &lt;dl class=element&gt;&lt;dt&gt;Categories&lt;/dt&gt; &lt;dd&gt;&lt;a href=#metadata-content&gt;Metadata content&lt;/a&gt;.&lt;/dd&gt; @@ -13850,9 +13847,9 @@ &lt;dd&gt;If the &lt;code title=attr-itemprop&gt;&lt;a href=#names:-the-itemprop-attribute&gt;itemprop&lt;/a&gt;&lt;/code&gt; attribute is present: &lt;a href=#phrasing-content&gt;phrasing content&lt;/a&gt;.&lt;/dd&gt; &lt;!--MD--&gt; &lt;dt&gt;Contexts in which this element can be used:&lt;/dt&gt; - &lt;dd&gt;If the &lt;code title=attr-meta-charset&gt;&lt;a href=#attr-meta-charset&gt;charset&lt;/a&gt;&lt;/code&gt; attribute is present, or if the element's &lt;code title=attr-meta-http-equiv&gt;&lt;a href=#attr-meta-http-equiv&gt;http-equiv&lt;/a&gt;&lt;/code&gt; attribute is in the &lt;a href=#attr-meta-http-equiv-content-type title=attr-meta-http-equiv-content-type&gt;Encoding declaration state&lt;/a&gt;: in a &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element.&lt;/dd&gt; - &lt;dd&gt;If the &lt;code title=attr-meta-http-equiv&gt;&lt;a href=#attr-meta-http-equiv&gt;http-equiv&lt;/a&gt;&lt;/code&gt; attribute is present but not in the &lt;a href=#attr-meta-http-equiv-content-type title=attr-meta-http-equiv-content-type&gt;Encoding declaration state&lt;/a&gt;: in a &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element.&lt;/dd&gt; - &lt;dd&gt;If the &lt;code title=attr-meta-http-equiv&gt;&lt;a href=#attr-meta-http-equiv&gt;http-equiv&lt;/a&gt;&lt;/code&gt; attribute is present but not in the &lt;a href=#attr-meta-http-equiv-content-type title=attr-meta-http-equiv-content-type&gt;Encoding declaration state&lt;/a&gt;: in a &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt; element that is a child of a &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element.&lt;/dd&gt; + &lt;dd&gt;If the &lt;code title=attr-meta-charset&gt;&lt;a href=#attr-meta-charset&gt;charset&lt;/a&gt;&lt;/code&gt; attribute is present, or if the element's &lt;code title=attr-meta-http-equiv&gt;&lt;a href=#attr-meta-http-equiv&gt;http-equiv&lt;/a&gt;&lt;/code&gt; attribute is in the &lt;a href=#attr-meta-http-equiv-content-type title=attr-meta-http-equiv-content-type&gt;Encoding declaration state&lt;/a&gt;: in a &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element.&lt;/dd&gt; + &lt;dd&gt;If the &lt;code title=attr-meta-http-equiv&gt;&lt;a href=#attr-meta-http-equiv&gt;http-equiv&lt;/a&gt;&lt;/code&gt; attribute is present but not in the &lt;a href=#attr-meta-http-equiv-content-type title=attr-meta-http-equiv-content-type&gt;Encoding declaration state&lt;/a&gt;: in a &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element.&lt;/dd&gt; + &lt;dd&gt;If the &lt;code title=attr-meta-http-equiv&gt;&lt;a href=#attr-meta-http-equiv&gt;http-equiv&lt;/a&gt;&lt;/code&gt; attribute is present but not in the &lt;a href=#attr-meta-http-equiv-content-type title=attr-meta-http-equiv-content-type&gt;Encoding declaration state&lt;/a&gt;: in a &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt; element that is a child of a &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element.&lt;/dd&gt; &lt;dd&gt;If the &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; attribute is present: where &lt;a href=#metadata-content&gt;metadata content&lt;/a&gt; is expected.&lt;/dd&gt; &lt;!--MD--&gt; &lt;dd&gt;If the &lt;code title=attr-itemprop&gt;&lt;a href=#names:-the-itemprop-attribute&gt;itemprop&lt;/a&gt;&lt;/code&gt; attribute is present: where &lt;a href=#metadata-content&gt;metadata content&lt;/a&gt; is expected.&lt;/dd&gt; @@ -13874,12 +13871,12 @@ attribute DOMString &lt;a href=#dom-meta-content title=dom-meta-content&gt;content&lt;/a&gt;; };&lt;/pre&gt; &lt;/dd&gt; - &lt;/dl&gt;&lt;p&gt;The &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element &lt;a href=#represents&gt;represents&lt;/a&gt; various + &lt;/dl&gt;&lt;p&gt;The &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element &lt;a href=#represents&gt;represents&lt;/a&gt; various kinds of metadata that cannot be expressed using the - &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-base-element&gt;base&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-link-element&gt;link&lt;/a&gt;&lt;/code&gt;, - &lt;code&gt;&lt;a href=#the-style-element&gt;style&lt;/a&gt;&lt;/code&gt;, and &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; elements.&lt;/p&gt; + &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-base-element&gt;base&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-link-element&gt;link&lt;/a&gt;&lt;/code&gt;, + &lt;code&gt;&lt;a href=#the-style-element&gt;style&lt;/a&gt;&lt;/code&gt;, and &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements.&lt;/p&gt; - &lt;p&gt;The &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element can represent document-level + &lt;p&gt;The &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element can represent document-level metadata with the &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; attribute, pragma directives with the &lt;code title=attr-meta-http-equiv&gt;&lt;a href=#attr-meta-http-equiv&gt;http-equiv&lt;/a&gt;&lt;/code&gt; attribute, and the file's &lt;a href=#character-encoding-declaration&gt;character encoding declaration&lt;/a&gt; when an HTML @@ -13903,11 +13900,11 @@ UTF-8 as its encoding).&lt;/p&gt; &lt;p class=note&gt;The &lt;code title=attr-meta-charset&gt;&lt;a href=#attr-meta-charset&gt;charset&lt;/a&gt;&lt;/code&gt; - attribute on the &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element has no effect in XML + attribute on the &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element has no effect in XML documents, and is only allowed in order to facilitate migration to and from XHTML.&lt;/p&gt; - &lt;p&gt;There must not be more than one &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element with a + &lt;p&gt;There must not be more than one &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-meta-charset&gt;&lt;a href=#attr-meta-charset&gt;charset&lt;/a&gt;&lt;/code&gt; attribute per document.&lt;/p&gt; @@ -13917,14 +13914,14 @@ values depend on the exact context, as described in subsequent sections of this specification.&lt;/p&gt; - &lt;p&gt;If a &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element has a &lt;dfn id=attr-meta-name title=attr-meta-name&gt;&lt;code&gt;name&lt;/code&gt;&lt;/dfn&gt; attribute, it sets + &lt;p&gt;If a &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element has a &lt;dfn id=attr-meta-name title=attr-meta-name&gt;&lt;code&gt;name&lt;/code&gt;&lt;/dfn&gt; attribute, it sets document metadata. Document metadata is expressed in terms of name/value pairs, the &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; - attribute on the &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element giving the name, and the + attribute on the &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element giving the name, and the &lt;code title=attr-meta-content&gt;&lt;a href=#attr-meta-content&gt;content&lt;/a&gt;&lt;/code&gt; attribute on the same element giving the value. The name specifies what aspect of metadata is being set; valid names and the meaning of their values are - described in the following sections. If a &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element + described in the following sections. If a &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element has no &lt;code title=attr-meta-content&gt;&lt;a href=#attr-meta-content&gt;content&lt;/a&gt;&lt;/code&gt; attribute, then the value part of the metadata name/value pair is the empty string.&lt;/p&gt; @@ -13942,7 +13939,7 @@ &lt;h5 id=standard-metadata-names&gt;&lt;span class=secno&gt;4.2.5.1 &lt;/span&gt;Standard metadata names&lt;/h5&gt; &lt;p&gt;This specification defines a few names for the &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; attribute of the - &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element.&lt;/p&gt; + &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element.&lt;/p&gt; &lt;p&gt;Names are case-insensitive&lt;span class=impl&gt;, and must be compared in an &lt;a href=#ascii-case-insensitive&gt;ASCII case-insensitive&lt;/a&gt; manner&lt;/span&gt;.&lt;/p&gt; @@ -13952,11 +13949,11 @@ &lt;dd&gt;&lt;p&gt;The value must be a short free-form string giving the name of the Web application that the page represents. If the page is not a Web application, the &lt;code title=meta-application-name&gt;&lt;a href=#meta-application-name&gt;application-name&lt;/a&gt;&lt;/code&gt; metadata name - must not be used. There must not be more than one &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; + must not be used. There must not be more than one &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element with its &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; attribute set to the value &lt;code title=meta-application-name&gt;&lt;a href=#meta-application-name&gt;application-name&lt;/a&gt;&lt;/code&gt; per document. &lt;span class=impl&gt;User agents may use the application - name in UI in preference to the page's &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt;, since + name in UI in preference to the page's &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt;, since the title might include status messages and the like relevant to the status of the page at a particular moment in time instead of just being the name of the application.&lt;/span&gt;&lt;/dd&gt; @@ -13971,7 +13968,7 @@ &lt;dd&gt;&lt;p&gt;The value must be a free-form string that describes the page. The value must be appropriate for use in a directory of pages, e.g. in a search engine. There must not be more than one - &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element with its &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; attribute set to the value &lt;code title=meta-description&gt;&lt;a href=#meta-description&gt;description&lt;/a&gt;&lt;/code&gt; per document.&lt;/dd&gt; + &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element with its &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; attribute set to the value &lt;code title=meta-description&gt;&lt;a href=#meta-description&gt;description&lt;/a&gt;&lt;/code&gt; per document.&lt;/dd&gt; &lt;dt&gt;&lt;dfn id=meta-generator title=meta-generator&gt;&lt;code&gt;generator&lt;/code&gt;&lt;/dfn&gt;&lt;/dt&gt; @@ -13984,7 +13981,7 @@ &lt;div class=example&gt; &lt;p&gt;Here is what a tool called &quot;Frontweaver&quot; could include in its - output, in the page's &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element, to identify + output, in the page's &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element, to identify itself as the tool used to generate the page:&lt;/p&gt; &lt;pre&gt;&lt;meta name=generator content=&quot;Frontweaver 8.2&quot;&gt;&lt;/pre&gt; @@ -14003,7 +14000,7 @@ &lt;div class=example&gt; &lt;p&gt;This page about typefaces on British motorways uses a - &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element to specify some keywords that users + &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element to specify some keywords that users might use to look for the page:&lt;/p&gt; &lt;pre&gt;&lt;!DOCTYPE HTML&gt; @@ -14033,7 +14030,7 @@ &lt;li&gt; - &lt;p&gt;For each &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; attribute and a &lt;code title=attr-meta-content&gt;&lt;a href=#attr-meta-content&gt;content&lt;/a&gt;&lt;/code&gt; attribute and whose + &lt;p&gt;For each &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; attribute and a &lt;code title=attr-meta-content&gt;&lt;a href=#attr-meta-content&gt;content&lt;/a&gt;&lt;/code&gt; attribute and whose &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; attribute's value is &lt;code title=meta-keywords&gt;&lt;a href=#meta-keywords&gt;keywords&lt;/a&gt;&lt;/code&gt;, run the following substeps:&lt;/p&gt; @@ -14174,14 +14171,14 @@ &lt;p&gt;Metadata names whose values are to be &lt;a href=#url title=URL&gt;URLs&lt;/a&gt; must not be proposed or accepted. Links must be represented using the &lt;code&gt;&lt;a href=#the-link-element&gt;link&lt;/a&gt;&lt;/code&gt; element, not the - &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element.&lt;/p&gt; + &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element.&lt;/p&gt; &lt;h5 id=pragma-directives&gt;&lt;span class=secno&gt;4.2.5.3 &lt;/span&gt;Pragma directives&lt;/h5&gt; &lt;p&gt;When the &lt;dfn id=attr-meta-http-equiv title=attr-meta-http-equiv&gt;&lt;code&gt;http-equiv&lt;/code&gt;&lt;/dfn&gt; attribute - is specified on a &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element, the element is a pragma + is specified on a &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element, the element is a pragma directive.&lt;/p&gt; &lt;p&gt;The &lt;code title=attr-meta-http-equiv&gt;&lt;a href=#attr-meta-http-equiv&gt;http-equiv&lt;/a&gt;&lt;/code&gt; @@ -14260,7 +14257,7 @@ people expect to have work and what is necessary. --&gt;&lt;div class=impl&gt; - &lt;p&gt;When a &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element is &lt;a href=#insert-an-element-into-a-document title=&quot;insert an + &lt;p&gt;When a &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element is &lt;a href=#insert-an-element-into-a-document title=&quot;insert an element into a document&quot;&gt;inserted into the document&lt;/a&gt;, if its &lt;code title=attr-meta-http-equiv&gt;&lt;a href=#attr-meta-http-equiv&gt;http-equiv&lt;/a&gt;&lt;/code&gt; attribute is present and represents one of the above states, then the user agent @@ -14281,14 +14278,14 @@ language&lt;/dfn&gt;. Until the pragma is successfully processed, there is no &lt;a href=#pragma-set-default-language&gt;pragma-set default language&lt;/a&gt;.&lt;/p&gt; - &lt;ol&gt;&lt;li&gt;&lt;p&gt;If another &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element with an &lt;code title=attr-meta-http-equiv&gt;&lt;a href=#attr-meta-http-equiv&gt;http-equiv&lt;/a&gt;&lt;/code&gt; attribute in the + &lt;ol&gt;&lt;li&gt;&lt;p&gt;If another &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element with an &lt;code title=attr-meta-http-equiv&gt;&lt;a href=#attr-meta-http-equiv&gt;http-equiv&lt;/a&gt;&lt;/code&gt; attribute in the &lt;a href=#attr-meta-http-equiv-content-language title=attr-meta-http-equiv-content-language&gt;Content Language state&lt;/a&gt; has already been successfully processed (i.e. when it was inserted the user agent processed it and reached the last step of this list of steps), then abort these steps.&lt;/li&gt; - &lt;li&gt;&lt;p&gt;If the &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element has no &lt;code title=attr-meta-content&gt;&lt;a href=#attr-meta-content&gt;content&lt;/a&gt;&lt;/code&gt; attribute, or if that + &lt;li&gt;&lt;p&gt;If the &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element has no &lt;code title=attr-meta-content&gt;&lt;a href=#attr-meta-content&gt;content&lt;/a&gt;&lt;/code&gt; attribute, or if that attribute's value is the empty string, then abort these steps.&lt;/li&gt; @@ -14328,7 +14325,7 @@ &lt;a href=#character-encoding-declaration&gt;character encoding declaration&lt;/a&gt;. &lt;span class=impl&gt;This state's user agent requirements are all handled by the parsing section of the specification.&lt;/span&gt;&lt;/p&gt; - &lt;p&gt;For &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; elements with an &lt;code title=attr-meta-http-equiv&gt;&lt;a href=#attr-meta-http-equiv&gt;http-equiv&lt;/a&gt;&lt;/code&gt; attribute in the + &lt;p&gt;For &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; elements with an &lt;code title=attr-meta-http-equiv&gt;&lt;a href=#attr-meta-http-equiv&gt;http-equiv&lt;/a&gt;&lt;/code&gt; attribute in the &lt;a href=#attr-meta-http-equiv-content-type title=attr-meta-http-equiv-content-type&gt;Encoding declaration state&lt;/a&gt;, the &lt;code title=attr-meta-content&gt;&lt;a href=#attr-meta-content&gt;content&lt;/a&gt;&lt;/code&gt; attribute must have a value that is an &lt;a href=#ascii-case-insensitive&gt;ASCII case-insensitive&lt;/a&gt; match for a @@ -14338,11 +14335,11 @@ the character encoding name of the &lt;a href=#character-encoding-declaration&gt;character encoding declaration&lt;/a&gt;.&lt;/p&gt; - &lt;p&gt;If the document contains a &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element with an + &lt;p&gt;If the document contains a &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element with an &lt;code title=attr-meta-http-equiv&gt;&lt;a href=#attr-meta-http-equiv&gt;http-equiv&lt;/a&gt;&lt;/code&gt; attribute in the &lt;a href=#attr-meta-http-equiv-content-type title=attr-meta-http-equiv-content-type&gt;Encoding declaration state&lt;/a&gt;, then the document must not contain a - &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element with the &lt;code title=attr-meta-charset&gt;&lt;a href=#attr-meta-charset&gt;charset&lt;/a&gt;&lt;/code&gt; attribute present.&lt;/p&gt; + &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element with the &lt;code title=attr-meta-charset&gt;&lt;a href=#attr-meta-charset&gt;charset&lt;/a&gt;&lt;/code&gt; attribute present.&lt;/p&gt; &lt;p&gt;The &lt;a href=#attr-meta-http-equiv-content-type title=attr-meta-http-equiv-content-type&gt;Encoding declaration state&lt;/a&gt; may be used in &lt;a href=#html-documents&gt;HTML @@ -14360,7 +14357,7 @@ &lt;div class=impl&gt; - &lt;ol&gt;&lt;li&gt;&lt;p&gt;If the &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element has no &lt;code title=attr-meta-content&gt;&lt;a href=#attr-meta-content&gt;content&lt;/a&gt;&lt;/code&gt; attribute, or if that + &lt;ol&gt;&lt;li&gt;&lt;p&gt;If the &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element has no &lt;code title=attr-meta-content&gt;&lt;a href=#attr-meta-content&gt;content&lt;/a&gt;&lt;/code&gt; attribute, or if that attribute's value is the empty string, then abort these steps.&lt;/li&gt; @@ -14379,13 +14376,13 @@ &lt;div class=impl&gt; - &lt;ol&gt;&lt;!-- TESTS: <A HREF="http://www.hixie.ch/tests/adhoc/html/meta/refresh/">http://www.hixie.ch/tests/adhoc/html/meta/refresh/</A> --&gt;&lt;!-- <A HREF="http://software.hixie.ch/utilities/js/live-dom-viewer/saved/734">http://software.hixie.ch/utilities/js/live-dom-viewer/saved/734</A> --&gt;&lt;li&gt;&lt;p&gt;If another &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element with an &lt;code title=attr-meta-http-equiv&gt;&lt;a href=#attr-meta-http-equiv&gt;http-equiv&lt;/a&gt;&lt;/code&gt; attribute in the + &lt;ol&gt;&lt;!-- TESTS: <A HREF="http://www.hixie.ch/tests/adhoc/html/meta/refresh/">http://www.hixie.ch/tests/adhoc/html/meta/refresh/</A> --&gt;&lt;!-- <A HREF="http://software.hixie.ch/utilities/js/live-dom-viewer/saved/734">http://software.hixie.ch/utilities/js/live-dom-viewer/saved/734</A> --&gt;&lt;li&gt;&lt;p&gt;If another &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element with an &lt;code title=attr-meta-http-equiv&gt;&lt;a href=#attr-meta-http-equiv&gt;http-equiv&lt;/a&gt;&lt;/code&gt; attribute in the &lt;a href=#attr-meta-http-equiv-refresh title=attr-meta-http-equiv-refresh&gt;Refresh state&lt;/a&gt; has already been successfully processed (i.e. when it was inserted the user agent processed it and reached the last step of this list of steps), then abort these steps.&lt;/li&gt; - &lt;li&gt;&lt;p&gt;If the &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element has no &lt;code title=attr-meta-content&gt;&lt;a href=#attr-meta-content&gt;content&lt;/a&gt;&lt;/code&gt; attribute, or if that + &lt;li&gt;&lt;p&gt;If the &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element has no &lt;code title=attr-meta-content&gt;&lt;a href=#attr-meta-content&gt;content&lt;/a&gt;&lt;/code&gt; attribute, or if that attribute's value is the empty string, then abort these steps.&lt;/li&gt; @@ -14469,7 +14466,7 @@ (LF), and U+000D CARRIAGE RETURN (CR) characters from &lt;var title=&quot;&quot;&gt;url&lt;/var&gt;.&lt;/li&gt; &lt;li&gt;&lt;p&gt;&lt;a href=#resolve-a-url title=&quot;resolve a url&quot;&gt;Resolve&lt;/a&gt; the &lt;var title=&quot;&quot;&gt;url&lt;/var&gt; value to an &lt;a href=#absolute-url&gt;absolute URL&lt;/a&gt;, - relative to the &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element. If this fails, abort + relative to the &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element. If this fails, abort these steps.&lt;/li&gt; &lt;li&gt; @@ -14480,7 +14477,7 @@ &lt;p&gt;After the refresh has come due (as defined below), if the user has not canceled the redirect and if the - &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element's &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt;'s + &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element's &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt;'s &lt;a href=#browsing-context&gt;browsing context&lt;/a&gt; did not have the &lt;a href=#sandboxed-automatic-features-browsing-context-flag&gt;sandboxed automatic features browsing context flag&lt;/a&gt; set when the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt; was created, &lt;a href=#navigate title=navigate&gt;navigate&lt;/a&gt;&lt;!--DONAV meta refresh--&gt; the @@ -14499,7 +14496,7 @@ &lt;!-- <A HREF="http://software.hixie.ch/utilities/js/live-dom-viewer/saved/774">http://software.hixie.ch/utilities/js/live-dom-viewer/saved/774</A> --&gt; &lt;li&gt;At least &lt;var title=&quot;&quot;&gt;time&lt;/var&gt; seconds have elapsed - since the &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element was &lt;a href=#insert-an-element-into-a-document title=&quot;insert + since the &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element was &lt;a href=#insert-an-element-into-a-document title=&quot;insert an element into a document&quot;&gt;inserted into the &lt;code&gt;Document&lt;/code&gt;&lt;/a&gt;, adjusted to take into account user or user agent preferences.&lt;/li&gt; @@ -14523,7 +14520,7 @@ &lt;/ol&gt;&lt;/div&gt; - &lt;p&gt;For &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; elements with an &lt;code title=attr-meta-http-equiv&gt;&lt;a href=#attr-meta-http-equiv&gt;http-equiv&lt;/a&gt;&lt;/code&gt; attribute in the + &lt;p&gt;For &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; elements with an &lt;code title=attr-meta-http-equiv&gt;&lt;a href=#attr-meta-http-equiv&gt;http-equiv&lt;/a&gt;&lt;/code&gt; attribute in the &lt;a href=#attr-meta-http-equiv-refresh title=attr-meta-http-equiv-refresh&gt;Refresh state&lt;/a&gt;, the &lt;code title=attr-meta-content&gt;&lt;a href=#attr-meta-content&gt;content&lt;/a&gt;&lt;/code&gt; attribute must have a value consisting either of:&lt;/p&gt; @@ -14546,7 +14543,7 @@ &lt;div class=example&gt; &lt;p&gt;A news organization's front page could include the following - markup in the page's &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element, to ensure that + markup in the page's &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element, to ensure that the page automatically reloads from the server every five minutes:&lt;/p&gt; @@ -14574,7 +14571,7 @@ &lt;p&gt;It is non-conforming. Real HTTP headers should be used instead.&lt;/p&gt; - &lt;ol&gt;&lt;li&gt;&lt;p&gt;If the &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element has no &lt;code title=attr-meta-content&gt;&lt;a href=#attr-meta-content&gt;content&lt;/a&gt;&lt;/code&gt; attribute, or if that + &lt;ol&gt;&lt;li&gt;&lt;p&gt;If the &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element has no &lt;code title=attr-meta-content&gt;&lt;a href=#attr-meta-content&gt;content&lt;/a&gt;&lt;/code&gt; attribute, or if that attribute's value is the empty string, then abort these steps.&lt;/li&gt; @@ -14588,7 +14585,7 @@ &lt;/ol&gt;&lt;/dd&gt; - &lt;/dl&gt;&lt;p&gt;There must not be more than one &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element with + &lt;/dl&gt;&lt;p&gt;There must not be more than one &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element with any particular state in the document at a time.&lt;/p&gt; @@ -14695,8 +14692,8 @@ character encoding used must be an &lt;a href=#ascii-compatible-character-encoding&gt;ASCII-compatible character encoding&lt;/a&gt;, and, in addition, if that encoding isn't US-ASCII itself, then the encoding must be specified using a - &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-meta-charset&gt;&lt;a href=#attr-meta-charset&gt;charset&lt;/a&gt;&lt;/code&gt; attribute or a - &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element with an &lt;code title=attr-meta-http-equiv&gt;&lt;a href=#attr-meta-http-equiv&gt;http-equiv&lt;/a&gt;&lt;/code&gt; attribute in the + &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-meta-charset&gt;&lt;a href=#attr-meta-charset&gt;charset&lt;/a&gt;&lt;/code&gt; attribute or a + &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element with an &lt;code title=attr-meta-http-equiv&gt;&lt;a href=#attr-meta-http-equiv&gt;http-equiv&lt;/a&gt;&lt;/code&gt; attribute in the &lt;a href=#attr-meta-http-equiv-content-type title=attr-meta-http-equiv-content-type&gt;Encoding declaration state&lt;/a&gt;.&lt;/p&gt; @@ -14707,8 +14704,8 @@ &lt;code&gt;&lt;a href=#the-iframe-element&gt;iframe&lt;/a&gt;&lt;/code&gt;.)&lt;/p&gt; &lt;p&gt;If an &lt;a href=#html-documents title=&quot;HTML documents&quot;&gt;HTML document&lt;/a&gt; contains - a &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-meta-charset&gt;&lt;a href=#attr-meta-charset&gt;charset&lt;/a&gt;&lt;/code&gt; attribute or a - &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element with an &lt;code title=attr-meta-http-equiv&gt;&lt;a href=#attr-meta-http-equiv&gt;http-equiv&lt;/a&gt;&lt;/code&gt; attribute in the + a &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-meta-charset&gt;&lt;a href=#attr-meta-charset&gt;charset&lt;/a&gt;&lt;/code&gt; attribute or a + &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element with an &lt;code title=attr-meta-http-equiv&gt;&lt;a href=#attr-meta-http-equiv&gt;http-equiv&lt;/a&gt;&lt;/code&gt; attribute in the &lt;a href=#attr-meta-http-equiv-content-type title=attr-meta-http-equiv-content-type&gt;Encoding declaration state&lt;/a&gt;, then the character encoding used must be an &lt;a href=#ascii-compatible-character-encoding&gt;ASCII-compatible character encoding&lt;/a&gt;.&lt;/p&gt; @@ -14773,7 +14770,7 @@ &lt;p&gt;In HTML, to declare that the character encoding is UTF-8, the author could include the following markup near the top of the - document (in the &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element):&lt;/p&gt; + document (in the &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element):&lt;/p&gt; &lt;pre&gt;&lt;meta charset=&quot;utf-8&quot;&gt;&lt;/pre&gt; @@ -14792,7 +14789,7 @@ &lt;dd&gt;If the &lt;code title=attr-style-scoped&gt;&lt;a href=#attr-style-scoped&gt;scoped&lt;/a&gt;&lt;/code&gt; attribute is present: &lt;a href=#flow-content&gt;flow content&lt;/a&gt;.&lt;/dd&gt; &lt;dt&gt;Contexts in which this element can be used:&lt;/dt&gt; &lt;dd&gt;If the &lt;code title=attr-style-scoped&gt;&lt;a href=#attr-style-scoped&gt;scoped&lt;/a&gt;&lt;/code&gt; attribute is absent: where &lt;a href=#metadata-content&gt;metadata content&lt;/a&gt; is expected.&lt;/dd&gt; - &lt;dd&gt;If the &lt;code title=attr-style-scoped&gt;&lt;a href=#attr-style-scoped&gt;scoped&lt;/a&gt;&lt;/code&gt; attribute is absent: in a &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt; element that is a child of a &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element.&lt;/dd&gt; + &lt;dd&gt;If the &lt;code title=attr-style-scoped&gt;&lt;a href=#attr-style-scoped&gt;scoped&lt;/a&gt;&lt;/code&gt; attribute is absent: in a &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt; element that is a child of a &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element.&lt;/dd&gt; &lt;dd&gt;If the &lt;code title=attr-style-scoped&gt;&lt;a href=#attr-style-scoped&gt;scoped&lt;/a&gt;&lt;/code&gt; attribute is present: where &lt;a href=#flow-content&gt;flow content&lt;/a&gt; is expected, but before any other &lt;a href=#flow-content&gt;flow content&lt;/a&gt; other than other &lt;code&gt;&lt;a href=#the-style-element&gt;style&lt;/a&gt;&lt;/code&gt; elements and &lt;a href=#inter-element-whitespace&gt;inter-element whitespace&lt;/a&gt;.&lt;/dd&gt; &lt;dt&gt;Content model:&lt;/dt&gt; &lt;dd&gt;Depends on the value of the &lt;code title=attr-style-type&gt;&lt;a href=#attr-style-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute, but must match requirements described in prose below.&lt;/dd&gt; @@ -15173,7 +15170,7 @@ &lt;/div&gt; - &lt;h4 id=script&gt;&lt;span class=secno&gt;4.3.1 &lt;/span&gt;The &lt;dfn&gt;&lt;code&gt;script&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; + &lt;h4 id=the-script-element&gt;&lt;span class=secno&gt;4.3.1 &lt;/span&gt;The &lt;dfn id=script&gt;&lt;code&gt;script&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; &lt;dl class=element&gt;&lt;dt&gt;Categories&lt;/dt&gt; &lt;dd&gt;&lt;a href=#metadata-content&gt;Metadata content&lt;/a&gt;.&lt;/dd&gt; @@ -15208,7 +15205,7 @@ attribute DOMString &lt;a href=#dom-script-text title=dom-script-text&gt;text&lt;/a&gt;; };&lt;/pre&gt; &lt;/dd&gt; - &lt;/dl&gt;&lt;p&gt;The &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element allows authors to include dynamic + &lt;/dl&gt;&lt;p&gt;The &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element allows authors to include dynamic script and data blocks in their documents. The element does not &lt;a href=#represents title=represents&gt;represent&lt;/a&gt; content for the user.&lt;/p&gt; @@ -15218,14 +15215,14 @@ is not that described by &quot;&lt;code title=&quot;&quot;&gt;text/javascript&lt;/code&gt;&quot;, then the &lt;code title=attr-script-type&gt;&lt;a href=#attr-script-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute must be present, as described below. Whatever language is used, the - contents of the &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element must conform with the + contents of the &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element must conform with the requirements of that language's specification.&lt;/p&gt; &lt;p&gt;When used to include data blocks (as opposed to scripts), the data must be embedded inline, the format of the data must be given using the &lt;code title=attr-script-type&gt;&lt;a href=#attr-script-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute, the &lt;code title=attr-script-src&gt;&lt;a href=#attr-script-src&gt;src&lt;/a&gt;&lt;/code&gt; attribute must not be - specified, and the contents of the &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element must + specified, and the contents of the &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element must conform to the requirements defined for the format used.&lt;/p&gt; &lt;p&gt;The &lt;dfn id=attr-script-type title=attr-script-type&gt;&lt;code&gt;type&lt;/code&gt;&lt;/dfn&gt; @@ -15278,7 +15275,7 @@ therefore by necessity scattered throughout the specification. The algorithms below (in this section) describe the core of this processing, but these algorithms reference and are referenced by the - parsing rules for &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; &lt;a href=#scriptTag&gt;start&lt;/a&gt; + parsing rules for &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; &lt;a href=#scriptTag&gt;start&lt;/a&gt; and &lt;a href=#scriptEndTag&gt;end&lt;/a&gt; tags in HTML, &lt;a href=#scriptForeignEndTag&gt;in foreign content&lt;/a&gt;, and &lt;a href=#scriptTagXML&gt;in XML&lt;/a&gt;, the rules for the &lt;code title=dom-document-write&gt;&lt;a href=#dom-document-write&gt;document.write()&lt;/a&gt;&lt;/code&gt; method, the handling of &lt;a href=#scripting&gt;scripting&lt;/a&gt;, etc.&lt;/p&gt; @@ -15295,28 +15292,28 @@ &lt;div class=impl&gt; - &lt;p&gt;A &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element has several associated pieces of + &lt;p&gt;A &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element has several associated pieces of state.&lt;/p&gt; &lt;p&gt;The first is a flag indicating whether or not the script block has been &lt;dfn id=already-started&gt;&quot;already started&quot;&lt;/dfn&gt;. Initially, - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; elements must have this flag unset (script + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements must have this flag unset (script blocks, when created, are not &quot;already started&quot;). When a - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element is &lt;a href=#concept-clone title=concept-clone&gt;cloned&lt;/a&gt;, the &quot;already started&quot; flag, if + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element is &lt;a href=#concept-clone title=concept-clone&gt;cloned&lt;/a&gt;, the &quot;already started&quot; flag, if set, must be propagated to the clone when it is created.&lt;/p&gt; &lt;p&gt;The second is a flag indicating whether the element was - &lt;dfn id=parser-inserted&gt;&quot;parser-inserted&quot;&lt;/dfn&gt;. Initially, &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; + &lt;dfn id=parser-inserted&gt;&quot;parser-inserted&quot;&lt;/dfn&gt;. Initially, &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements must have this flag unset. It is set by the &lt;a href=#html-parser&gt;HTML - parser&lt;/a&gt; and the &lt;a href=#xml-parser&gt;XML parser&lt;/a&gt; on &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; + parser&lt;/a&gt; and the &lt;a href=#xml-parser&gt;XML parser&lt;/a&gt; on &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements they insert and affects the processing of those elements.&lt;/p&gt; &lt;p&gt;The third is a flag indicating whether the element will - &lt;dfn id=force-async&gt;&quot;force-async&quot;&lt;/dfn&gt;. Initially, &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; elements + &lt;dfn id=force-async&gt;&quot;force-async&quot;&lt;/dfn&gt;. Initially, &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements must have this flag set. It is unset by the &lt;a href=#html-parser&gt;HTML parser&lt;/a&gt; - and the &lt;a href=#xml-parser&gt;XML parser&lt;/a&gt; on &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; elements they - insert. In addition, whenever a &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element whose + and the &lt;a href=#xml-parser&gt;XML parser&lt;/a&gt; on &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements they + insert. In addition, whenever a &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element whose &lt;a href=#force-async&gt;&quot;force-async&quot;&lt;/a&gt; flag is set has a &lt;code title=attr-script-async&gt;&lt;a href=#attr-script-async&gt;async&lt;/a&gt;&lt;/code&gt; content attribute added, the element's &lt;a href=#force-async&gt;&quot;force-async&quot;&lt;/a&gt; flag must be unset.&lt;/p&gt; &lt;!-- there's no need to unset it when the attribute is removed since you @@ -15324,7 +15321,7 @@ &lt;p&gt;The fourth is a flag indicating whether or not the script block is &lt;dfn id=ready-to-be-parser-executed&gt;&quot;ready to be parser-executed&quot;&lt;/dfn&gt;. Initially, - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; elements must have this flag unset (script + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements must have this flag unset (script blocks, when created, are not &quot;ready to be parser-executed&quot;). This flag is used only for elements that are also &lt;a href=#parser-inserted&gt;&quot;parser-inserted&quot;&lt;/a&gt;, to let the parser know when to @@ -15335,21 +15332,21 @@ encoding&lt;/var&gt;&lt;/dfn&gt;, and &lt;dfn id=&quot;the-script-block's-fallback-character-encoding&quot;&gt;&lt;var&gt;the script block's fallback character encoding&lt;/var&gt;&lt;/dfn&gt;. They are determined when the script is prepared, based on the attributes on the element at that time, - and the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt; of the &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; + and the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt; of the &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element.&lt;/p&gt; - &lt;p&gt;When a &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element that is not marked as being + &lt;p&gt;When a &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element that is not marked as being &lt;a href=#parser-inserted&gt;&quot;parser-inserted&quot;&lt;/a&gt; experiences one of the events listed - in the following list, the user agent must synchronously &lt;a href=#prepare-a-script title=&quot;prepare a script&quot;&gt;prepare&lt;/a&gt; the &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; + in the following list, the user agent must synchronously &lt;a href=#prepare-a-script title=&quot;prepare a script&quot;&gt;prepare&lt;/a&gt; the &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element:&lt;/p&gt; - &lt;ul&gt;&lt;li&gt;The &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element gets &lt;a href=#insert-an-element-into-a-document title=&quot;insert an + &lt;ul&gt;&lt;li&gt;The &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element gets &lt;a href=#insert-an-element-into-a-document title=&quot;insert an element into a document&quot;&gt;inserted into a document&lt;/a&gt;.&lt;/li&gt; - &lt;li&gt;The &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element is &lt;a href=#in-a-document&gt;in a + &lt;li&gt;The &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element is &lt;a href=#in-a-document&gt;in a &lt;code&gt;Document&lt;/code&gt;&lt;/a&gt; and its child nodes are changed.&lt;/li&gt; - &lt;li&gt;The &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element is &lt;a href=#in-a-document&gt;in a + &lt;li&gt;The &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element is &lt;a href=#in-a-document&gt;in a &lt;code&gt;Document&lt;/code&gt;&lt;/a&gt; and has a &lt;code title=attr-script-src&gt;&lt;a href=#attr-script-src&gt;src&lt;/a&gt;&lt;/code&gt; attribute set where previously the element had no such attribute.&lt;/li&gt; @@ -15358,7 +15355,7 @@ &lt;ol&gt;&lt;li&gt; - &lt;p&gt;If the &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element is marked as having + &lt;p&gt;If the &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element is marked as having &lt;a href=#already-started&gt;&quot;already started&quot;&lt;/a&gt;, then the user agent must abort these steps at this point. The script is not executed.&lt;/p&gt; @@ -15372,7 +15369,7 @@ &lt;var title=&quot;&quot;&gt;was-parser-inserted&lt;/var&gt; to false.&lt;/p&gt; &lt;p class=note&gt;This is done so that if parser-inserted - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; elements fail to run when the parser tries to + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements fail to run when the parser tries to run them, e.g. because they are empty or specify an unsupported scripting language, another script can later mutate them and cause them to run again.&lt;/p&gt; @@ -15388,7 +15385,7 @@ element's &lt;a href=#force-async&gt;&quot;force-async&quot;&lt;/a&gt; flag to true.&lt;/p&gt; &lt;p class=note&gt;This is done so that if a parser-inserted - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element fails to run when the parser tries to + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element fails to run when the parser tries to run it, but it is later executed after a script dynamically updates it, it will execute asynchronously even if the &lt;code title=attr-script-async&gt;&lt;a href=#attr-script-async&gt;async&lt;/a&gt;&lt;/code&gt; attribute isn't @@ -15418,25 +15415,25 @@ &lt;p&gt;If either:&lt;/p&gt; - &lt;ul class=brief&gt;&lt;li&gt;the &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element has a &lt;code title=attr-script-type&gt;&lt;a href=#attr-script-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute and its value is + &lt;ul class=brief&gt;&lt;li&gt;the &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element has a &lt;code title=attr-script-type&gt;&lt;a href=#attr-script-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute and its value is the empty string, or&lt;/li&gt; - &lt;li&gt;the &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element has no &lt;code title=attr-script-type&gt;&lt;a href=#attr-script-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute but it has a &lt;code title=attr-script-language&gt;&lt;a href=#attr-script-language&gt;language&lt;/a&gt;&lt;/code&gt; attribute and + &lt;li&gt;the &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element has no &lt;code title=attr-script-type&gt;&lt;a href=#attr-script-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute but it has a &lt;code title=attr-script-language&gt;&lt;a href=#attr-script-language&gt;language&lt;/a&gt;&lt;/code&gt; attribute and &lt;em&gt;that&lt;/em&gt; attribute's value is the empty string, or&lt;/li&gt; - &lt;li&gt;the &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element has neither a &lt;code title=attr-script-type&gt;&lt;a href=#attr-script-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute nor a &lt;code title=attr-script-language&gt;&lt;a href=#attr-script-language&gt;language&lt;/a&gt;&lt;/code&gt; attribute, then&lt;/li&gt; + &lt;li&gt;the &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element has neither a &lt;code title=attr-script-type&gt;&lt;a href=#attr-script-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute nor a &lt;code title=attr-script-language&gt;&lt;a href=#attr-script-language&gt;language&lt;/a&gt;&lt;/code&gt; attribute, then&lt;/li&gt; &lt;/ul&gt;&lt;p&gt;...let &lt;var&gt;&lt;a href=&quot;#the-script-block's-type&quot;&gt;the script block's type&lt;/a&gt;&lt;/var&gt; for this - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element be &quot;&lt;code title=&quot;&quot;&gt;text/javascript&lt;/code&gt;&quot;.&lt;/p&gt; + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element be &quot;&lt;code title=&quot;&quot;&gt;text/javascript&lt;/code&gt;&quot;.&lt;/p&gt; - &lt;p&gt;Otherwise, if the &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element has a &lt;code title=attr-script-type&gt;&lt;a href=#attr-script-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute, let &lt;var&gt;&lt;a href=&quot;#the-script-block's-type&quot;&gt;the - script block's type&lt;/a&gt;&lt;/var&gt; for this &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element be + &lt;p&gt;Otherwise, if the &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element has a &lt;code title=attr-script-type&gt;&lt;a href=#attr-script-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute, let &lt;var&gt;&lt;a href=&quot;#the-script-block's-type&quot;&gt;the + script block's type&lt;/a&gt;&lt;/var&gt; for this &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element be the value of that attribute with any leading or trailing sequences of &lt;a href=#space-character title=&quot;space character&quot;&gt;space characters&lt;/a&gt; removed.&lt;/p&gt; &lt;p&gt;Otherwise, the element has a non-empty &lt;code title=attr-script-language&gt;&lt;a href=#attr-script-language&gt;language&lt;/a&gt;&lt;/code&gt; attribute; let - &lt;var&gt;&lt;a href=&quot;#the-script-block's-type&quot;&gt;the script block's type&lt;/a&gt;&lt;/var&gt; for this &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; + &lt;var&gt;&lt;a href=&quot;#the-script-block's-type&quot;&gt;the script block's type&lt;/a&gt;&lt;/var&gt; for this &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element be the concatenation of the string &quot;&lt;code title=&quot;&quot;&gt;text/&lt;/code&gt;&quot; followed by the value of the &lt;code title=attr-script-language&gt;&lt;a href=#attr-script-language&gt;language&lt;/a&gt;&lt;/code&gt; attribute.&lt;/p&gt; &lt;!-- user agents already support, e.g., type=&quot;text/javascript1.3&quot;, so we don't have to support that separately. --&gt; @@ -15450,7 +15447,7 @@ &lt;p&gt;If the user agent does not &lt;a href=#support-the-scripting-language&gt;support the scripting language&lt;/a&gt; given by &lt;var&gt;&lt;a href=&quot;#the-script-block's-type&quot;&gt;the script block's type&lt;/a&gt;&lt;/var&gt; for - this &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element, then the user agent must abort + this &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element, then the user agent must abort these steps at this point. The script is not executed.&lt;/p&gt; &lt;/li&gt; @@ -15485,7 +15482,7 @@ &lt;li id=script-processing-noscript&gt; &lt;p&gt;If &lt;a href=#concept-n-noscript title=concept-n-noscript&gt;scripting is - disabled&lt;/a&gt; for the &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element, then the user + disabled&lt;/a&gt; for the &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element, then the user agent must abort these steps at this point. The script is not executed.&lt;/p&gt; @@ -15504,7 +15501,7 @@ &lt;li id=script-processing-for&gt; - &lt;p&gt;If the &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element has an &lt;code title=attr-script-event&gt;&lt;a href=#attr-script-event&gt;event&lt;/a&gt;&lt;/code&gt; attribute and a &lt;code title=attr-script-for&gt;&lt;a href=#attr-script-for&gt;for&lt;/a&gt;&lt;/code&gt; attribute, then run these + &lt;p&gt;If the &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element has an &lt;code title=attr-script-event&gt;&lt;a href=#attr-script-event&gt;event&lt;/a&gt;&lt;/code&gt; attribute and a &lt;code title=attr-script-for&gt;&lt;a href=#attr-script-for&gt;for&lt;/a&gt;&lt;/code&gt; attribute, then run these substeps:&lt;/p&gt; &lt;ol&gt;&lt;li&gt;&lt;p&gt;Let &lt;var title=&quot;&quot;&gt;for&lt;/var&gt; be the value of the &lt;code title=attr-script-for&gt;&lt;a href=#attr-script-for&gt;for&lt;/a&gt;&lt;/code&gt; attribute.&lt;/li&gt; @@ -15526,12 +15523,12 @@ &lt;li id=script-processing-encoding&gt; - &lt;p&gt;If the &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element has a &lt;code title=attr-script-charset&gt;&lt;a href=#attr-script-charset&gt;charset&lt;/a&gt;&lt;/code&gt; attribute, then let + &lt;p&gt;If the &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element has a &lt;code title=attr-script-charset&gt;&lt;a href=#attr-script-charset&gt;charset&lt;/a&gt;&lt;/code&gt; attribute, then let &lt;var&gt;&lt;a href=&quot;#the-script-block's-character-encoding&quot;&gt;the script block's character encoding&lt;/a&gt;&lt;/var&gt; for this - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element be the encoding given by the &lt;code title=attr-script-charset&gt;&lt;a href=#attr-script-charset&gt;charset&lt;/a&gt;&lt;/code&gt; attribute.&lt;/p&gt; + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element be the encoding given by the &lt;code title=attr-script-charset&gt;&lt;a href=#attr-script-charset&gt;charset&lt;/a&gt;&lt;/code&gt; attribute.&lt;/p&gt; &lt;p&gt;Otherwise, let &lt;var&gt;&lt;a href=&quot;#the-script-block's-fallback-character-encoding&quot;&gt;the script block's fallback character - encoding&lt;/a&gt;&lt;/var&gt; for this &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element be the same as + encoding&lt;/a&gt;&lt;/var&gt; for this &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element be the same as &lt;a href=&quot;#document's-character-encoding&quot; title=&quot;document's character encoding&quot;&gt;the encoding of the document itself&lt;/a&gt;.&lt;/p&gt; @@ -15631,7 +15628,7 @@ have a &lt;code title=attr-script-src&gt;&lt;a href=#attr-script-src&gt;src&lt;/a&gt;&lt;/code&gt; attribute, and the element has been flagged as &lt;a href=#parser-inserted&gt;&quot;parser-inserted&quot;&lt;/a&gt;, and the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt; of the &lt;a href=#html-parser&gt;HTML parser&lt;/a&gt; or - &lt;a href=#xml-parser&gt;XML parser&lt;/a&gt; that created the &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; + &lt;a href=#xml-parser&gt;XML parser&lt;/a&gt; that created the &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element &lt;a href=#has-a-style-sheet-that-is-blocking-scripts&gt;has a style sheet that is blocking scripts&lt;/a&gt;&lt;/dt&gt; @@ -15657,7 +15654,7 @@ &lt;p&gt;The element must be added to the end of the &lt;dfn id=list-of-scripts-that-will-execute-in-order-as-soon-as-possible&gt;list of scripts that will execute in order as soon as possible&lt;/dfn&gt; associated with the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt; of the - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element at the time the &lt;a href=#prepare-a-script&gt;prepare a + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element at the time the &lt;a href=#prepare-a-script&gt;prepare a script&lt;/a&gt; algorithm started.&lt;/p&gt; &lt;p&gt;The &lt;a href=#concept-task title=concept-task&gt;task&lt;/a&gt; that the @@ -15693,7 +15690,7 @@ &lt;p&gt;The element must be added to the &lt;dfn id=set-of-scripts-that-will-execute-as-soon-as-possible&gt;set of scripts that will execute as soon as possible&lt;/dfn&gt; of the - &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt; of the &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element at the + &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt; of the &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element at the time the &lt;a href=#prepare-a-script&gt;prepare a script&lt;/a&gt; algorithm started.&lt;/p&gt; &lt;p&gt;The &lt;a href=#concept-task title=concept-task&gt;task&lt;/a&gt; that the @@ -15723,7 +15720,7 @@ &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt; is used by the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt;'s parser(s).&lt;/p&gt; - &lt;p class=note&gt;If a &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element that blocks a + &lt;p class=note&gt;If a &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element that blocks a parser gets moved to another &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt; before it would normally have stopped blocking that parser, it nonetheless continues blocking that parser until the condition that causes it to be @@ -15775,7 +15772,7 @@ following steps. For the purposes of these steps, the script is considered to be from an &lt;i&gt;external file&lt;/i&gt; if, while the &lt;a href=#prepare-a-script&gt;prepare a script&lt;/a&gt; algorithm above was running for - this script, the &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element had a &lt;code title=attr-script-src&gt;&lt;a href=#attr-script-src&gt;src&lt;/a&gt;&lt;/code&gt; attribute specified.&lt;/p&gt; + this script, the &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element had a &lt;code title=attr-script-src&gt;&lt;a href=#attr-script-src&gt;src&lt;/a&gt;&lt;/code&gt; attribute specified.&lt;/p&gt; &lt;ol&gt;&lt;li id=establish-script-block-source&gt; @@ -15878,7 +15875,7 @@ &lt;dd&gt; - &lt;p&gt;The child nodes of the &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element at the + &lt;p&gt;The child nodes of the &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element at the time the element's &lt;a href=#already-started&gt;&quot;already started&quot;&lt;/a&gt; flag was last set are the script source.&lt;/p&gt; @@ -15890,7 +15887,7 @@ &lt;p&gt;If the script is from an external file, then increment the &lt;a href=#ignore-destructive-writes-counter&gt;ignore-destructive-writes counter&lt;/a&gt; of the - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element's &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt;. Let &lt;var title=&quot;&quot;&gt;neutralized doc&lt;/var&gt; be that + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element's &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt;. Let &lt;var title=&quot;&quot;&gt;neutralized doc&lt;/var&gt; be that &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt;.&lt;/p&gt; &lt;/li&gt; @@ -15898,7 +15895,7 @@ &lt;li&gt; &lt;p&gt;&lt;a href=#create-a-script-from-a-node title=&quot;create a script from a node&quot;&gt;Create a - script&lt;/a&gt; from the &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element node, using + script&lt;/a&gt; from the &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element node, using &lt;var&gt;&lt;a href=&quot;#the-script-block's-source&quot;&gt;the script block's source&lt;/a&gt;&lt;/var&gt; and &lt;var&gt;&lt;a href=&quot;#the-script-block's-type&quot;&gt;the script block's type&lt;/a&gt;&lt;/var&gt;.&lt;/p&gt; @@ -15919,10 +15916,10 @@ &lt;p&gt;If the script is from an external file, &lt;a href=#fire-a-simple-event&gt;fire a simple event&lt;/a&gt; named &lt;code title=event-load&gt;load&lt;/code&gt; at the - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element.&lt;/p&gt; + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element.&lt;/p&gt; &lt;p&gt;Otherwise, the script is internal; &lt;a href=#queue-a-task&gt;queue a - task&lt;/a&gt; to &lt;a href=#fire-a-simple-event&gt;fire a simple event&lt;/a&gt; named &lt;code title=event-load&gt;load&lt;/code&gt; at the &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; + task&lt;/a&gt; to &lt;a href=#fire-a-simple-event&gt;fire a simple event&lt;/a&gt; named &lt;code title=event-load&gt;load&lt;/code&gt; at the &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element.&lt;/p&gt; &lt;/li&gt; @@ -15966,20 +15963,20 @@ &lt;p&gt;The IDL attribute &lt;dfn id=dom-script-text title=dom-script-text&gt;&lt;code&gt;text&lt;/code&gt;&lt;/dfn&gt; must return a concatenation of the contents of all the &lt;a href=#text-node title=&quot;text node&quot;&gt;text nodes&lt;/a&gt; that are direct children of the - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element (ignoring any other nodes such as + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element (ignoring any other nodes such as comments or elements), in tree order. On setting, it must act the same way as the &lt;code&gt;&lt;a href=#textcontent&gt;textContent&lt;/a&gt;&lt;/code&gt; IDL attribute.&lt;/p&gt; &lt;/div&gt; &lt;p class=note&gt;When inserted using the &lt;code title=dom-document-write&gt;&lt;a href=#dom-document-write&gt;document.write()&lt;/a&gt;&lt;/code&gt; method, - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; elements execute (typically synchronously), but + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements execute (typically synchronously), but when inserted using &lt;code title=dom-innerHTML&gt;&lt;a href=#dom-innerhtml&gt;innerHTML&lt;/a&gt;&lt;/code&gt; and &lt;code title=dom-outerHTML&gt;&lt;a href=#dom-outerhtml&gt;outerHTML&lt;/a&gt;&lt;/code&gt; attributes, they do not execute at all.&lt;/p&gt; &lt;div class=example&gt; - &lt;p&gt;In this example, two &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; elements are used. One + &lt;p&gt;In this example, two &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements are used. One embeds an external script, and the other includes some data.&lt;/p&gt; &lt;pre&gt;&lt;script src=&quot;game-engine.js&quot;&gt;&lt;/script&gt; @@ -16003,7 +16000,7 @@ &lt;p&gt;The following sample shows how a script element can be used to define a function that is then used by other parts of the - document. It also shows how a &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element can be + document. It also shows how a &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element can be used to invoke script while the document is being parsed, in this case to initialize the form's output.&lt;/p&gt; @@ -16095,7 +16092,7 @@ &lt;h5 id=restrictions-for-contents-of-script-elements&gt;&lt;span class=secno&gt;4.3.1.2 &lt;/span&gt;&lt;dfn title=&quot;script content restrictions&quot;&gt;Restrictions for contents of &lt;code&gt;script&lt;/code&gt; elements&lt;/dfn&gt;&lt;/h5&gt; - &lt;p&gt;The &lt;code&gt;&lt;a href=#textcontent&gt;textContent&lt;/a&gt;&lt;/code&gt; of a &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element + &lt;p&gt;The &lt;code&gt;&lt;a href=#textcontent&gt;textContent&lt;/a&gt;&lt;/code&gt; of a &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element must match the &lt;code title=&quot;&quot;&gt;script&lt;/code&gt; production in the following ABNF, the character set for which is Unicode. &lt;a href=#refsABNF&gt;[ABNF]&lt;/a&gt;&lt;/p&gt; @@ -16137,15 +16134,15 @@ tag-end =/ %x002F ; U+002F SOLIDUS (/) tag-end =/ %x003E ; U+003E GREATER-THAN SIGN (&gt;)&lt;/pre&gt; - &lt;p&gt;When a &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element contains &lt;a href=#inline-documentation-for-external-scripts&gt;script + &lt;p&gt;When a &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element contains &lt;a href=#inline-documentation-for-external-scripts&gt;script documentation&lt;/a&gt;, there are further restrictions on the contents of the element, as described in the section below.&lt;/p&gt; &lt;h5 id=inline-documentation-for-external-scripts&gt;&lt;span class=secno&gt;4.3.1.3 &lt;/span&gt;&lt;dfn title=&quot;script documentation&quot;&gt;Inline documentation for external scripts&lt;/dfn&gt;&lt;/h5&gt; - &lt;p&gt;If a &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element's &lt;code title=attr-script-src&gt;&lt;a href=#attr-script-src&gt;src&lt;/a&gt;&lt;/code&gt; attribute is specified, then the - contents of the &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element, if any, must be such + &lt;p&gt;If a &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element's &lt;code title=attr-script-src&gt;&lt;a href=#attr-script-src&gt;src&lt;/a&gt;&lt;/code&gt; attribute is specified, then the + contents of the &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element, if any, must be such that the value of the &lt;code title=dom-script-text&gt;&lt;a href=#dom-script-text&gt;text&lt;/a&gt;&lt;/code&gt; IDL attribute, which is derived from the element's contents, matches the &lt;code title=&quot;&quot;&gt;documentation&lt;/code&gt; production in the following @@ -16172,7 +16169,7 @@ element in JavaScript comments.&lt;/p&gt; &lt;p class=note&gt;This requirement is in addition to the earlier - restrictions on the syntax of contents of &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; + restrictions on the syntax of contents of &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements.&lt;/p&gt; &lt;div class=example&gt; @@ -16196,12 +16193,12 @@ &lt;div class=impl&gt; - &lt;h5 id=scriptTagXSLT&gt;&lt;span class=secno&gt;4.3.1.4 &lt;/span&gt;Interaction of &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; elements and XSLT&lt;/h5&gt; + &lt;h5 id=scriptTagXSLT&gt;&lt;span class=secno&gt;4.3.1.4 &lt;/span&gt;Interaction of &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements and XSLT&lt;/h5&gt; &lt;p&gt;&lt;i&gt;This section is non-normative.&lt;/i&gt;&lt;/p&gt; &lt;p&gt;This specification does not define how XSLT interacts with the - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element (or, indeed, how XSLT processing + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element (or, indeed, how XSLT processing triggers the &lt;a href=#stop-parsing&gt;stop parsing&lt;/a&gt; steps, how it interacts with the &lt;a href=#navigate title=navigate&gt;navigation&lt;/a&gt; algorithm, or how it fits in with the &lt;a href=#event-loop&gt;event loop&lt;/a&gt;). However, in the absence @@ -16210,7 +16207,7 @@ &lt;ul&gt;&lt;li&gt;&lt;p&gt;When an XSLT transformation program is triggered by an &lt;code title=&quot;&quot;&gt;&lt;?xml-stylesheet?&gt;&lt;/code&gt; processing instruction and the browser implements a direct-to-DOM transformation, - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; elements created by the XSLT processor need to + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements created by the XSLT processor need to be marked &lt;a href=#parser-inserted&gt;&quot;parser-inserted&quot;&lt;/a&gt; and run in document order (modulo scripts marked &lt;code title=attr-script-defer&gt;&lt;a href=#attr-script-defer&gt;defer&lt;/a&gt;&lt;/code&gt; or &lt;code title=attr-script-async&gt;&lt;a href=#attr-script-async&gt;async&lt;/a&gt;&lt;/code&gt;), asynchronously @@ -16219,17 +16216,17 @@ &lt;li&gt;&lt;p&gt;The &lt;code title=dom-XSLTProcessor-transformToDocument&gt;XSLTProcessor.transformToDocument()&lt;/code&gt; method adds elements to a &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt; that is not in a &lt;a href=#browsing-context&gt;browsing context&lt;/a&gt;, and, accordingly, any - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; elements they create need to have their + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements they create need to have their &lt;a href=#already-started&gt;&quot;already started&quot;&lt;/a&gt; flag set in the &lt;a href=#prepare-a-script&gt;prepare a script&lt;/a&gt; algorithm and never get executed (&lt;a href=#concept-bc-noscript title=concept-bc-noscript&gt;scripting is disabled&lt;/a&gt;). Such - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; elements still need to be marked + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements still need to be marked &lt;a href=#parser-inserted&gt;&quot;parser-inserted&quot;&lt;/a&gt;, though, such that their &lt;code title=dom-script-async&gt;&lt;a href=#dom-script-async&gt;async&lt;/a&gt;&lt;/code&gt; IDL attribute will return false in the absence of an &lt;code title=attr-script-async&gt;&lt;a href=#attr-script-async&gt;async&lt;/a&gt;&lt;/code&gt; content attribute.&lt;/li&gt; &lt;li&gt;&lt;p&gt;The &lt;code title=dom-XSLTProcessor-transformToFragment&gt;XSLTProcessor.transformToFragment()&lt;/code&gt; method needs to create a fragment that is equivalent to one built manually by creating the elements using &lt;code title=dom-document-createElementNS&gt;&lt;a href=#dom-document-createelementns&gt;document.createElementNS()&lt;/a&gt;&lt;/code&gt;. - For instance, it needs to create &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; elements that + For instance, it needs to create &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements that aren't &lt;a href=#parser-inserted&gt;&quot;parser-inserted&quot;&lt;/a&gt; and that don't have their &lt;a href=#already-started&gt;&quot;already started&quot;&lt;/a&gt; flag set, so that they will execute when the fragment is inserted into a document.&lt;/li&gt; @@ -16249,11 +16246,11 @@ &lt;dd&gt;&lt;a href=#flow-content&gt;Flow content&lt;/a&gt;.&lt;/dd&gt; &lt;dd&gt;&lt;a href=#phrasing-content&gt;Phrasing content&lt;/a&gt;.&lt;/dd&gt; &lt;dt&gt;Contexts in which this element can be used:&lt;/dt&gt; - &lt;dd&gt;In a &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element of an &lt;a href=#html-documents title=&quot;HTML documents&quot;&gt;HTML document&lt;/a&gt;, if there are no ancestor &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt; elements.&lt;/dd&gt; + &lt;dd&gt;In a &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element of an &lt;a href=#html-documents title=&quot;HTML documents&quot;&gt;HTML document&lt;/a&gt;, if there are no ancestor &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt; elements.&lt;/dd&gt; &lt;dd&gt;Where &lt;a href=#phrasing-content&gt;phrasing content&lt;/a&gt; is expected in &lt;a href=#html-documents&gt;HTML documents&lt;/a&gt;, if there are no ancestor &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt; elements.&lt;/dd&gt; &lt;dt&gt;Content model:&lt;/dt&gt; - &lt;dd&gt;When &lt;a href=#concept-n-noscript title=concept-n-noscript&gt;scripting is disabled&lt;/a&gt;, in a &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element: in any order, zero or more &lt;code&gt;&lt;a href=#the-link-element&gt;link&lt;/a&gt;&lt;/code&gt; elements, zero or more &lt;code&gt;&lt;a href=#the-style-element&gt;style&lt;/a&gt;&lt;/code&gt; elements, and zero or more &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; elements.&lt;/dd&gt; - &lt;dd&gt;When &lt;a href=#concept-n-noscript title=concept-n-noscript&gt;scripting is disabled&lt;/a&gt;, not in a &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element: &lt;a href=#transparent&gt;transparent&lt;/a&gt;, but there must be no &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt; element descendants.&lt;/dd&gt; + &lt;dd&gt;When &lt;a href=#concept-n-noscript title=concept-n-noscript&gt;scripting is disabled&lt;/a&gt;, in a &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element: in any order, zero or more &lt;code&gt;&lt;a href=#the-link-element&gt;link&lt;/a&gt;&lt;/code&gt; elements, zero or more &lt;code&gt;&lt;a href=#the-style-element&gt;style&lt;/a&gt;&lt;/code&gt; elements, and zero or more &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; elements.&lt;/dd&gt; + &lt;dd&gt;When &lt;a href=#concept-n-noscript title=concept-n-noscript&gt;scripting is disabled&lt;/a&gt;, not in a &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element: &lt;a href=#transparent&gt;transparent&lt;/a&gt;, but there must be no &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt; element descendants.&lt;/dd&gt; &lt;dd&gt;Otherwise: text that conforms to the requirements given in the prose.&lt;/dd&gt; &lt;dt&gt;Content attributes:&lt;/dt&gt; &lt;dd&gt;&lt;a href=#global-attributes&gt;Global attributes&lt;/a&gt;&lt;/dd&gt; @@ -16269,14 +16266,14 @@ &lt;p&gt;When used in &lt;a href=#html-documents&gt;HTML documents&lt;/a&gt;, the allowed content model is as follows:&lt;/p&gt; - &lt;dl&gt;&lt;dt&gt;In a &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element, if &lt;a href=#concept-n-noscript title=concept-n-noscript&gt;scripting is disabled&lt;/a&gt; for the + &lt;dl&gt;&lt;dt&gt;In a &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element, if &lt;a href=#concept-n-noscript title=concept-n-noscript&gt;scripting is disabled&lt;/a&gt; for the &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt; element&lt;/dt&gt; &lt;dd&gt;&lt;p&gt;The &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt; element must contain only - &lt;code&gt;&lt;a href=#the-link-element&gt;link&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-style-element&gt;style&lt;/a&gt;&lt;/code&gt;, and &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; + &lt;code&gt;&lt;a href=#the-link-element&gt;link&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-style-element&gt;style&lt;/a&gt;&lt;/code&gt;, and &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; elements.&lt;/dd&gt; - &lt;dt&gt;In a &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element, if &lt;a href=#concept-n-script title=concept-n-script&gt;scripting is enabled&lt;/a&gt; for the + &lt;dt&gt;In a &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element, if &lt;a href=#concept-n-script title=concept-n-script&gt;scripting is enabled&lt;/a&gt; for the &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt; element&lt;/dt&gt; &lt;dd&gt;&lt;p&gt;The &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt; element must contain only text, @@ -16284,10 +16281,10 @@ algorithm&lt;/a&gt; &lt;!-- (which disables &lt;script&gt; execution) --&gt; with the &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt; element as the &lt;var title=&quot;&quot;&gt;context&lt;/var&gt; element and the text contents as the &lt;var title=&quot;&quot;&gt;input&lt;/var&gt; must result in a list of nodes that consists only of &lt;code&gt;&lt;a href=#the-link-element&gt;link&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-style-element&gt;style&lt;/a&gt;&lt;/code&gt;, and - &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; elements that would be conforming if they were + &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; elements that would be conforming if they were children of the &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt; element, and no &lt;a href=#parse-error title=&quot;parse error&quot;&gt;parse errors&lt;/a&gt;.&lt;/dd&gt; - &lt;dt&gt;Outside of &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; elements, if &lt;a href=#concept-n-noscript title=concept-n-noscript&gt;scripting is disabled&lt;/a&gt; for the + &lt;dt&gt;Outside of &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; elements, if &lt;a href=#concept-n-noscript title=concept-n-noscript&gt;scripting is disabled&lt;/a&gt; for the &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt; element&lt;/dt&gt; &lt;dd&gt;&lt;p&gt;The &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt; element's content model is @@ -16296,7 +16293,7 @@ element as an ancestor (that is, &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt; can't be nested).&lt;/dd&gt; - &lt;dt&gt;Outside of &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; elements, if &lt;a href=#concept-n-script title=concept-n-script&gt;scripting is enabled&lt;/a&gt; for the + &lt;dt&gt;Outside of &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; elements, if &lt;a href=#concept-n-script title=concept-n-script&gt;scripting is enabled&lt;/a&gt; for the &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt; element&lt;/dt&gt; &lt;dd&gt; @@ -16304,11 +16301,11 @@ &lt;p&gt;The &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt; element must contain only text, except that the text must be such that running the following algorithm results in a conforming document with no - &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt; elements and no &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; + &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt; elements and no &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements, and such that no step in the algorithm causes an &lt;a href=#html-parser&gt;HTML parser&lt;/a&gt; to flag a &lt;a href=#parse-error&gt;parse error&lt;/a&gt;:&lt;/p&gt; - &lt;ol&gt;&lt;li&gt;Remove every &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element from the + &lt;ol&gt;&lt;li&gt;Remove every &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element from the document.&lt;/li&gt; &lt;li&gt;Make a list of every &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt; element in the @@ -16444,7 +16441,7 @@ &lt;dl class=element&gt;&lt;dt&gt;Categories&lt;/dt&gt; &lt;dd&gt;&lt;a href=#sectioning-root&gt;Sectioning root&lt;/a&gt;.&lt;/dd&gt; &lt;dt&gt;Contexts in which this element can be used:&lt;/dt&gt; - &lt;dd&gt;As the second element in an &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element.&lt;/dd&gt; + &lt;dd&gt;As the second element in an &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element.&lt;/dd&gt; &lt;dt&gt;Content model:&lt;/dt&gt; &lt;dd&gt;&lt;a href=#flow-content&gt;Flow content&lt;/a&gt;.&lt;/dd&gt; &lt;dt&gt;Content attributes:&lt;/dt&gt; @@ -16527,11 +16524,11 @@ body element&lt;/a&gt; of a &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt; would first trigger the &lt;code title=handler-onerror&gt;&lt;a href=#handler-onerror&gt;onerror&lt;/a&gt;&lt;/code&gt; &lt;a href=#event-handler-content-attributes&gt;event handler content attributes&lt;/a&gt; of that element, then that of the root - &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element, and only &lt;em&gt;then&lt;/em&gt; would it trigger + &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element, and only &lt;em&gt;then&lt;/em&gt; would it trigger the &lt;code title=handler-window-onerror&gt;&lt;a href=#handler-window-onerror&gt;onerror&lt;/a&gt;&lt;/code&gt; &lt;a href=#event-handler-content-attributes title=&quot;event handler content attributes&quot;&gt;event handler content attribute&lt;/a&gt; on the &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt; element. This is because the event would bubble from the target, to the &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;, to - the &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;, to the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt;, to the + the &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;, to the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt;, to the &lt;code&gt;&lt;a href=#window&gt;Window&lt;/a&gt;&lt;/code&gt;, and the &lt;a href=#event-handlers title=&quot;event handlers&quot;&gt;event handler&lt;/a&gt; on the &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt; is watching the &lt;code&gt;&lt;a href=#window&gt;Window&lt;/a&gt;&lt;/code&gt; not the &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;. A regular event @@ -17097,10 +17094,7 @@ - &lt;h4 id=the-h1,-h2,-h3,-h4,-h5,-and-h6-elements&gt;&lt;span class=secno&gt;4.4.6 &lt;/span&gt;The &lt;dfn&gt;&lt;code&gt;h1&lt;/code&gt;&lt;/dfn&gt;, &lt;dfn&gt;&lt;code&gt;h2&lt;/code&gt;&lt;/dfn&gt;, - &lt;dfn&gt;&lt;code&gt;h3&lt;/code&gt;&lt;/dfn&gt;, &lt;dfn&gt;&lt;code&gt;h4&lt;/code&gt;&lt;/dfn&gt;, - &lt;dfn&gt;&lt;code&gt;h5&lt;/code&gt;&lt;/dfn&gt;, and &lt;dfn&gt;&lt;code&gt;h6&lt;/code&gt;&lt;/dfn&gt; - elements&lt;/h4&gt; + &lt;h4 id=the-h1,-h2,-h3,-h4,-h5,-and-h6-elements&gt;&lt;span class=secno&gt;4.4.6 &lt;/span&gt;The &lt;dfn id=the-h1-element&gt;&lt;code&gt;h1&lt;/code&gt;&lt;/dfn&gt;, &lt;dfn id=the-h2-element&gt;&lt;code&gt;h2&lt;/code&gt;&lt;/dfn&gt;, &lt;dfn id=the-h3-element&gt;&lt;code&gt;h3&lt;/code&gt;&lt;/dfn&gt;, &lt;dfn id=the-h4-element&gt;&lt;code&gt;h4&lt;/code&gt;&lt;/dfn&gt;, &lt;dfn id=the-h5-element&gt;&lt;code&gt;h5&lt;/code&gt;&lt;/dfn&gt;, and &lt;dfn id=the-h6-element&gt;&lt;code&gt;h6&lt;/code&gt;&lt;/dfn&gt; elements&lt;/h4&gt; &lt;dl class=element&gt;&lt;dt&gt;Categories&lt;/dt&gt; &lt;dd&gt;&lt;a href=#flow-content&gt;Flow content&lt;/a&gt;.&lt;/dd&gt; @@ -18703,7 +18697,7 @@ &lt;dt&gt;Contexts in which this element can be used:&lt;/dt&gt; &lt;dd&gt;Inside &lt;code&gt;&lt;a href=#the-ol-element&gt;ol&lt;/a&gt;&lt;/code&gt; elements.&lt;/dd&gt; &lt;dd&gt;Inside &lt;code&gt;&lt;a href=#the-ul-element&gt;ul&lt;/a&gt;&lt;/code&gt; elements.&lt;/dd&gt; - &lt;dd&gt;Inside &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; elements.&lt;/dd&gt; + &lt;dd&gt;Inside &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; elements.&lt;/dd&gt; &lt;dt&gt;Content model:&lt;/dt&gt; &lt;dd&gt;&lt;a href=#flow-content&gt;Flow content&lt;/a&gt;.&lt;/dd&gt; &lt;dt&gt;Content attributes:&lt;/dt&gt; @@ -18717,7 +18711,7 @@ &lt;/dd&gt; &lt;/dl&gt;&lt;p&gt;The &lt;code&gt;&lt;a href=#the-li-element&gt;li&lt;/a&gt;&lt;/code&gt; element &lt;a href=#represents&gt;represents&lt;/a&gt; a list item. If its parent element is an &lt;code&gt;&lt;a href=#the-ol-element&gt;ol&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-ul-element&gt;ul&lt;/a&gt;&lt;/code&gt;, - or &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; element, then the element is an item of the + or &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; element, then the element is an item of the parent element's list, as defined for those elements. Otherwise, the list item has no defined list-related relationship to any other &lt;code&gt;&lt;a href=#the-li-element&gt;li&lt;/a&gt;&lt;/code&gt; element.&lt;/p&gt; @@ -18790,7 +18784,7 @@ &lt;/div&gt; &lt;p class=note&gt;If the &lt;code&gt;&lt;a href=#the-li-element&gt;li&lt;/a&gt;&lt;/code&gt; element is the child of a - &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; element and itself has a child that defines a + &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; element and itself has a child that defines a &lt;a href=#concept-command title=concept-command&gt;command&lt;/a&gt;, then the &lt;code&gt;&lt;a href=#the-li-element&gt;li&lt;/a&gt;&lt;/code&gt; element will match the &lt;code title=selector-enabled&gt;&lt;a href=#selector-enabled&gt;:enabled&lt;/a&gt;&lt;/code&gt; and &lt;code title=selector-disabled&gt;&lt;a href=#selector-disabled&gt;:disabled&lt;/a&gt;&lt;/code&gt; pseudo-classes in the same way as the first such child element does.&lt;/p&gt; @@ -20606,7 +20600,7 @@ &lt;/div&gt; - &lt;h4 id=the-sub-and-sup-elements&gt;&lt;span class=secno&gt;4.6.15 &lt;/span&gt;The &lt;dfn&gt;&lt;code&gt;sub&lt;/code&gt;&lt;/dfn&gt; and &lt;dfn&gt;&lt;code&gt;sup&lt;/code&gt;&lt;/dfn&gt; elements&lt;/h4&gt; + &lt;h4 id=the-sub-and-sup-elements&gt;&lt;span class=secno&gt;4.6.15 &lt;/span&gt;The &lt;dfn id=the-sub-element&gt;&lt;code&gt;sub&lt;/code&gt;&lt;/dfn&gt; and &lt;dfn id=the-sup-element&gt;&lt;code&gt;sup&lt;/code&gt;&lt;/dfn&gt; elements&lt;/h4&gt; &lt;dl class=element&gt;&lt;dt&gt;Categories&lt;/dt&gt; &lt;dd&gt;&lt;a href=#flow-content&gt;Flow content&lt;/a&gt;.&lt;/dd&gt; @@ -23316,7 +23310,7 @@ who is known to be able to view images.&lt;/li&gt; &lt;!--FORK--&gt; - &lt;li&gt;The document has a &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; attribute whose value is an + &lt;li&gt;The document has a &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; attribute whose value is an &lt;a href=#ascii-case-insensitive&gt;ASCII case-insensitive&lt;/a&gt; match for the string &quot;&lt;code title=meta-generator&gt;&lt;a href=#meta-generator&gt;generator&lt;/a&gt;&lt;/code&gt;&quot;. (This case does not represent a case where the document is conforming, only that the generator could not determine appropriate alternative text &mdash; @@ -23389,7 +23383,7 @@ &lt;li&gt;Any number of &lt;a href=#syntax-comments title=syntax-comments&gt;comments&lt;/a&gt; and &lt;a href=#space-character title=&quot;space character&quot;&gt;space characters&lt;/a&gt;.&lt;/li&gt; - &lt;li&gt;The root element, in the form of an &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; &lt;a href=#syntax-elements title=syntax-elements&gt;element&lt;/a&gt;.&lt;/li&gt; + &lt;li&gt;The root element, in the form of an &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; &lt;a href=#syntax-elements title=syntax-elements&gt;element&lt;/a&gt;.&lt;/li&gt; &lt;li&gt;Any number of &lt;a href=#syntax-comments title=syntax-comments&gt;comments&lt;/a&gt; and &lt;a href=#space-character title=&quot;space character&quot;&gt;space characters&lt;/a&gt;.&lt;/li&gt; @@ -24120,7 +24114,7 @@ &lt;var title=&quot;&quot;&gt;input&lt;/var&gt; must result in a list of nodes that are all &lt;a href=#phrasing-content&gt;phrasing content&lt;/a&gt;, with no &lt;a href=#parse-error title=&quot;parse error&quot;&gt;parse errors&lt;/a&gt; having occurred, with no - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; elements being anywhere in the list or as + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements being anywhere in the list or as descendants of elements in the list, and with all the elements in the list (including their descendants) being themselves conforming.&lt;/p&gt; @@ -25167,10 +25161,10 @@ &lt;p&gt;The following example shows how a plugin can be used in HTML (in this case the Flash plugin, to show a video file). Fallback is provided for users who do not have Flash enabled, in this case - using the &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element to show the video for those - using user agents that support &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt;, and finally + using the &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element to show the video for those + using user agents that support &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt;, and finally providing a link to the video for those who have neither Flash nor - a &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt;-capable browser.&lt;/p&gt; + a &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt;-capable browser.&lt;/p&gt; &lt;pre&gt;&lt;p&gt;Look at my video: &lt;object type=&quot;application/x-shockwave-flash&quot;&gt; @@ -25273,7 +25267,7 @@ &lt;/div&gt; - &lt;h4 id=video&gt;&lt;span class=secno&gt;4.8.6 &lt;/span&gt;The &lt;dfn&gt;&lt;code&gt;video&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; + &lt;h4 id=the-video-element&gt;&lt;span class=secno&gt;4.8.6 &lt;/span&gt;The &lt;dfn id=video&gt;&lt;code&gt;video&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; &lt;dl class=element&gt;&lt;dt&gt;Categories&lt;/dt&gt; &lt;dd&gt;&lt;a href=#flow-content&gt;Flow content&lt;/a&gt;.&lt;/dd&gt; @@ -25311,13 +25305,13 @@ attribute DOMString &lt;a href=#dom-video-poster title=dom-video-poster&gt;poster&lt;/a&gt;; };&lt;/pre&gt; &lt;/dd&gt; - &lt;/dl&gt;&lt;p&gt;A &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element is used for playing videos or + &lt;/dl&gt;&lt;p&gt;A &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element is used for playing videos or movies, and audio files with captions.&lt;/p&gt; - &lt;p&gt;Content may be provided inside the &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; + &lt;p&gt;Content may be provided inside the &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element&lt;span class=impl&gt;. User agents should not show this content to the user&lt;/span&gt;; it is intended for older Web browsers which do - not support &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt;, so that legacy video plugins can be + not support &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt;, so that legacy video plugins can be tried, or to show text to the users of these older browsers informing them of how to access the video contents.&lt;/p&gt; @@ -25329,7 +25323,7 @@ subtitle tracks, audio description tracks, or sign-language overlays) into their media streams.&lt;/p&gt; - &lt;p&gt;The &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element is a &lt;a href=#media-element&gt;media element&lt;/a&gt; + &lt;p&gt;The &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element is a &lt;a href=#media-element&gt;media element&lt;/a&gt; whose &lt;a href=#media-data&gt;media data&lt;/a&gt; is ostensibly video data, possibly with associated audio data.&lt;/p&gt; @@ -25355,7 +25349,7 @@ URL. --&gt; &lt;ol&gt;&lt;li&gt;&lt;p&gt;If there is an existing instance of this algorithm running - for this &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element, abort that instance of this + for this &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element, abort that instance of this algorithm without changing the &lt;a href=#poster-frame&gt;poster frame&lt;/a&gt;.&lt;/li&gt; &lt;li&gt;&lt;p&gt;If the &lt;code title=attr-video-poster&gt;&lt;a href=#attr-video-poster&gt;poster&lt;/a&gt;&lt;/code&gt; @@ -25390,11 +25384,11 @@ &lt;code title=dom-media-HAVE_NOTHING&gt;&lt;a href=#dom-media-have_nothing&gt;HAVE_NOTHING&lt;/a&gt;&lt;/code&gt;, or &lt;code title=dom-media-HAVE_METADATA&gt;&lt;a href=#dom-media-have_metadata&gt;HAVE_METADATA&lt;/a&gt;&lt;/code&gt; but no video data has yet been obtained at all, or the element's &lt;code title=dom-media-readyState&gt;&lt;a href=#dom-media-readystate&gt;readyState&lt;/a&gt;&lt;/code&gt; attribute is any subsequent value but the &lt;a href=#media-resource&gt;media resource&lt;/a&gt; does not have a - video channel), the &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element + video channel), the &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element &lt;a href=#represents&gt;represents&lt;/a&gt; either the &lt;a href=#poster-frame&gt;poster frame&lt;/a&gt;, or nothing.&lt;/p&gt; - &lt;p&gt;When a &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element is &lt;a href=#dom-media-paused title=dom-media-paused&gt;paused&lt;/a&gt; and the &lt;a href=#current-playback-position title=&quot;current + &lt;p&gt;When a &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element is &lt;a href=#dom-media-paused title=dom-media-paused&gt;paused&lt;/a&gt; and the &lt;a href=#current-playback-position title=&quot;current playback position&quot;&gt;current playback position&lt;/a&gt; is the first frame of video, the element &lt;a href=#represents&gt;represents&lt;/a&gt; either the frame of video corresponding to the &lt;a href=#current-playback-position title=&quot;current playback @@ -25405,7 +25399,7 @@ be preferred over nothing, but the &lt;a href=#poster-frame&gt;poster frame&lt;/a&gt; should not be shown again after a frame of video has been shown.&lt;/p&gt; - &lt;p&gt;When a &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element is &lt;a href=#dom-media-paused title=dom-media-paused&gt;paused&lt;/a&gt; at any other position, and + &lt;p&gt;When a &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element is &lt;a href=#dom-media-paused title=dom-media-paused&gt;paused&lt;/a&gt; at any other position, and the &lt;a href=#media-resource&gt;media resource&lt;/a&gt; has a video channel, the element &lt;a href=#represents&gt;represents&lt;/a&gt; the frame of video corresponding to the &lt;a href=#current-playback-position title=&quot;current playback position&quot;&gt;current playback @@ -25413,7 +25407,7 @@ video is seeking or buffering), the last frame of the video to have been rendered.&lt;/p&gt; - &lt;p&gt;When a &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element whose &lt;a href=#media-resource&gt;media + &lt;p&gt;When a &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element whose &lt;a href=#media-resource&gt;media resource&lt;/a&gt; has a video channel is &lt;a href=#potentially-playing&gt;potentially playing&lt;/a&gt;, it &lt;a href=#represents&gt;represents&lt;/a&gt; the frame of video at the continuously increasing &lt;a href=#current-playback-position title=&quot;current playback @@ -25427,7 +25421,7 @@ playback position&lt;/a&gt;, at the element's &lt;a href=#effective-media-volume&gt;effective media volume&lt;/a&gt;.&lt;/p&gt; - &lt;p&gt;When a &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element whose &lt;a href=#media-resource&gt;media + &lt;p&gt;When a &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element whose &lt;a href=#media-resource&gt;media resource&lt;/a&gt; has a video channel is neither &lt;a href=#potentially-playing&gt;potentially playing&lt;/a&gt; nor &lt;a href=#dom-media-paused title=dom-media-paused&gt;paused&lt;/a&gt; (e.g. when seeking or stalled), the element &lt;a href=#represents&gt;represents&lt;/a&gt; @@ -25437,7 +25431,7 @@ particular playback position is defined by the video stream's format.&lt;/p&gt; - &lt;p&gt;The &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element also &lt;a href=#represents&gt;represents&lt;/a&gt; any + &lt;p&gt;The &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element also &lt;a href=#represents&gt;represents&lt;/a&gt; any &lt;a href=#text-track-cue title=&quot;text track cue&quot;&gt;text track cues&lt;/a&gt; whose &lt;a href=#text-track-cue-active-flag&gt;text track cue active flag&lt;/a&gt; is set and whose &lt;a href=#text-track&gt;text track&lt;/a&gt; is in the &lt;a href=#text-track-showing title=&quot;text track @@ -25488,7 +25482,7 @@ &lt;/div&gt; - &lt;p&gt;The &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element supports &lt;a href=#dimension-attributes&gt;dimension + &lt;p&gt;The &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element supports &lt;a href=#dimension-attributes&gt;dimension attributes&lt;/a&gt;.&lt;/p&gt; &lt;div class=impl&gt; @@ -25507,13 +25501,13 @@ requirement can be implemented by using the &lt;a href=#video-object-fit&gt;style rule suggested in the rendering section&lt;/a&gt;.&lt;/p&gt; - &lt;p&gt;The intrinsic width of a &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element's playback + &lt;p&gt;The intrinsic width of a &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element's playback area is the &lt;a href=#concept-video-intrinsic-width title=concept-video-intrinsic-width&gt;intrinsic width&lt;/a&gt; of the video resource, if that is available; otherwise it is the intrinsic width of the &lt;a href=#poster-frame&gt;poster frame&lt;/a&gt;, if that is available; otherwise it is 300 CSS pixels.&lt;/p&gt; - &lt;p&gt;The intrinsic height of a &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element's playback + &lt;p&gt;The intrinsic height of a &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element's playback area is the &lt;a href=#concept-video-intrinsic-height title=concept-video-intrinsic-height&gt;intrinsic height&lt;/a&gt; of the video resource, if that is available; otherwise it is the intrinsic height of the &lt;a href=#poster-frame&gt;poster frame&lt;/a&gt;, if that @@ -25606,7 +25600,7 @@ - &lt;h4 id=audio&gt;&lt;span class=secno&gt;4.8.7 &lt;/span&gt;The &lt;dfn&gt;&lt;code&gt;audio&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; + &lt;h4 id=the-audio-element&gt;&lt;span class=secno&gt;4.8.7 &lt;/span&gt;The &lt;dfn id=audio&gt;&lt;code&gt;audio&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; &lt;dl class=element&gt;&lt;dt&gt;Categories&lt;/dt&gt; &lt;dd&gt;&lt;a href=#flow-content&gt;Flow content&lt;/a&gt;.&lt;/dd&gt; @@ -25637,7 +25631,7 @@ NamedConstructor=&lt;a href=#dom-audio-s title=dom-Audio-s&gt;Audio&lt;/a&gt;(in DOMString src)] interface &lt;dfn id=htmlaudioelement&gt;HTMLAudioElement&lt;/dfn&gt; : &lt;a href=#htmlmediaelement&gt;HTMLMediaElement&lt;/a&gt; {};&lt;/pre&gt; &lt;/dd&gt; - &lt;/dl&gt;&lt;p&gt;An &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; element &lt;a href=#represents&gt;represents&lt;/a&gt; a sound or + &lt;/dl&gt;&lt;p&gt;An &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; element &lt;a href=#represents&gt;represents&lt;/a&gt; a sound or audio stream.&lt;/p&gt; &lt;!-- v2 (actually v3) suggestions: @@ -25657,10 +25651,10 @@ &gt; Support very simple audio codecs, and programmable synthesizers. --&gt; - &lt;p&gt;Content may be provided inside the &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; + &lt;p&gt;Content may be provided inside the &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; element&lt;span class=impl&gt;. User agents should not show this content to the user&lt;/span&gt;; it is intended for older Web browsers which do - not support &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt;, so that legacy audio plugins can be + not support &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt;, so that legacy audio plugins can be tried, or to show text to the users of these older browsers informing them of how to access the audio contents.&lt;/p&gt; @@ -25671,7 +25665,7 @@ embed accessibility aids (such as transcriptions) into their media streams.&lt;/p&gt; - &lt;p&gt;The &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; element is a &lt;a href=#media-element&gt;media element&lt;/a&gt; + &lt;p&gt;The &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; element is a &lt;a href=#media-element&gt;media element&lt;/a&gt; whose &lt;a href=#media-data&gt;media data&lt;/a&gt; is ostensibly audio data.&lt;/p&gt; &lt;p&gt;The &lt;code title=attr-media-src&gt;&lt;a href=#attr-media-src&gt;src&lt;/a&gt;&lt;/code&gt;, &lt;code title=attr-media-preload&gt;&lt;a href=#attr-media-preload&gt;preload&lt;/a&gt;&lt;/code&gt;, &lt;code title=attr-media-autoplay&gt;&lt;a href=#attr-media-autoplay&gt;autoplay&lt;/a&gt;&lt;/code&gt;, @@ -25682,12 +25676,12 @@ &lt;div class=impl&gt; - &lt;p&gt;When an &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; element is &lt;a href=#potentially-playing&gt;potentially + &lt;p&gt;When an &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; element is &lt;a href=#potentially-playing&gt;potentially playing&lt;/a&gt;, it must have its audio data played synchronized with the &lt;a href=#current-playback-position&gt;current playback position&lt;/a&gt;, at the element's &lt;a href=#effective-media-volume&gt;effective media volume&lt;/a&gt;.&lt;/p&gt; - &lt;p&gt;When an &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; element is not &lt;a href=#potentially-playing&gt;potentially + &lt;p&gt;When an &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; element is not &lt;a href=#potentially-playing&gt;potentially playing&lt;/a&gt;, audio must not play for the element.&lt;/p&gt; &lt;/div&gt; @@ -25696,7 +25690,7 @@ &lt;dd&gt; - &lt;p&gt;Returns a new &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; element, with the &lt;code title=attr-media-src&gt;&lt;a href=#attr-media-src&gt;src&lt;/a&gt;&lt;/code&gt; attribute set to the value + &lt;p&gt;Returns a new &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; element, with the &lt;code title=attr-media-src&gt;&lt;a href=#attr-media-src&gt;src&lt;/a&gt;&lt;/code&gt; attribute set to the value passed in the argument, if applicable.&lt;/p&gt; &lt;/dd&gt; @@ -25707,7 +25701,7 @@ &lt;code&gt;&lt;a href=#htmlaudioelement&gt;HTMLAudioElement&lt;/a&gt;&lt;/code&gt; objects (in addition to the factory methods from DOM Core such as &lt;code title=&quot;&quot;&gt;createElement()&lt;/code&gt;): &lt;dfn id=dom-audio title=dom-Audio&gt;&lt;code&gt;Audio()&lt;/code&gt;&lt;/dfn&gt; and &lt;dfn id=dom-audio-s title=dom-Audio-s&gt;&lt;code&gt;Audio(&lt;var title=&quot;&quot;&gt;src&lt;/var&gt;)&lt;/code&gt;&lt;/dfn&gt;. When invoked as constructors, these must return a new &lt;code&gt;&lt;a href=#htmlaudioelement&gt;HTMLAudioElement&lt;/a&gt;&lt;/code&gt; object (a new - &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; element). The element must have its &lt;code title=attr-media-preload&gt;&lt;a href=#attr-media-preload&gt;preload&lt;/a&gt;&lt;/code&gt; attribute set to the + &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; element). The element must have its &lt;code title=attr-media-preload&gt;&lt;a href=#attr-media-preload&gt;preload&lt;/a&gt;&lt;/code&gt; attribute set to the literal value &quot;&lt;code title=attr-media-preload-auto&gt;&lt;a href=#attr-media-preload-auto&gt;auto&lt;/a&gt;&lt;/code&gt;&quot;. If the &lt;var title=&quot;&quot;&gt;src&lt;/var&gt; argument is present, the object created must have its &lt;code title=attr-media-src&gt;&lt;a href=#attr-media-src&gt;src&lt;/a&gt;&lt;/code&gt; content attribute set to the provided value, and the user agent must invoke the object's @@ -25786,7 +25780,7 @@ &lt;p class=note&gt;Dynamically modifying a &lt;code&gt;&lt;a href=#the-source-element&gt;source&lt;/a&gt;&lt;/code&gt; element and its attribute when the element is already inserted in a - &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; or &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; element will have no + &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; or &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; element will have no effect. To change what is playing, either just use the &lt;code title=attr-media-src&gt;&lt;a href=#attr-media-src&gt;src&lt;/a&gt;&lt;/code&gt; attribute on the &lt;a href=#media-element&gt;media element&lt;/a&gt; directly, or call the &lt;code title=dom-media-load&gt;&lt;a href=#dom-media-load&gt;load()&lt;/a&gt;&lt;/code&gt; method on the &lt;a href=#media-element&gt;media element&lt;/a&gt; after manipulating the &lt;code&gt;&lt;a href=#the-source-element&gt;source&lt;/a&gt;&lt;/code&gt; @@ -26120,7 +26114,7 @@ &lt;h4 id=media-elements&gt;&lt;span class=secno&gt;4.8.10 &lt;/span&gt;Media elements&lt;/h4&gt; &lt;p&gt;&lt;dfn id=media-element title=&quot;media element&quot;&gt;Media elements&lt;/dfn&gt; - (&lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; and &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt;, in this specification) + (&lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; and &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt;, in this specification) implement the following interface:&lt;/p&gt; &lt;pre class=idl&gt;interface &lt;dfn id=htmlmediaelement&gt;HTMLMediaElement&lt;/dfn&gt; : &lt;a href=#htmlelement&gt;HTMLElement&lt;/a&gt; { @@ -26242,11 +26236,11 @@ element's &lt;code title=dom-media-audioTracks&gt;&lt;a href=#dom-media-audiotracks&gt;audioTracks&lt;/a&gt;&lt;/code&gt; attribute.&lt;/p&gt; - &lt;p class=note&gt;Both &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; and &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; + &lt;p class=note&gt;Both &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; and &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; elements can be used for both audio and video. The main difference - between the two is simply that the &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; element has no + between the two is simply that the &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; element has no playback area for visual content (such as video or captions), - whereas the &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element does.&lt;/p&gt; + whereas the &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element does.&lt;/p&gt; &lt;div class=impl&gt; @@ -26445,7 +26439,7 @@ agent knows it cannot render&lt;/a&gt; or is the type &quot;&lt;code&gt;application/octet-stream&lt;/code&gt;&quot;; it must return &quot;&lt;code title=&quot;&quot;&gt;probably&lt;/code&gt;&quot; if the user agent is confident that the type represents a &lt;a href=#media-resource&gt;media resource&lt;/a&gt; that it can render if - used in with this &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; or &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element; + used in with this &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; or &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element; and it must return &quot;&lt;code title=&quot;&quot;&gt;maybe&lt;/code&gt;&quot; otherwise. Implementors are encouraged to return &quot;&lt;code title=&quot;&quot;&gt;maybe&lt;/code&gt;&quot; unless the type can be confidently established as being supported or @@ -26458,7 +26452,7 @@ &lt;p&gt;This script tests to see if the user agent supports a (fictional) new format to dynamically decide whether to use a - &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element or a plugin:&lt;/p&gt; + &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element or a plugin:&lt;/p&gt; &lt;pre&gt;&lt;section id=&quot;video&quot;&gt; &lt;p&gt;&lt;a href=&quot;playing-cats.nfv&quot;&gt;Download video&lt;/a&gt;&lt;/p&gt; @@ -27089,7 +27083,7 @@ &lt;/li&gt; - &lt;li&gt;&lt;p&gt;For &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; elements, set the &lt;code title=dom-video-videoWidth&gt;&lt;a href=#dom-video-videowidth&gt;videoWidth&lt;/a&gt;&lt;/code&gt; and &lt;code title=dom-video-videoHeight&gt;&lt;a href=#dom-video-videoheight&gt;videoHeight&lt;/a&gt;&lt;/code&gt; + &lt;li&gt;&lt;p&gt;For &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; elements, set the &lt;code title=dom-video-videoWidth&gt;&lt;a href=#dom-video-videowidth&gt;videoWidth&lt;/a&gt;&lt;/code&gt; and &lt;code title=dom-video-videoHeight&gt;&lt;a href=#dom-video-videoheight&gt;videoHeight&lt;/a&gt;&lt;/code&gt; attributes.&lt;/li&gt; &lt;li&gt; @@ -27753,7 +27747,7 @@ &lt;dt&gt;&lt;dfn id=dom-media-have_metadata title=dom-media-HAVE_METADATA&gt;&lt;code&gt;HAVE_METADATA&lt;/code&gt;&lt;/dfn&gt; (numeric value 1)&lt;/dt&gt; &lt;dd&gt;Enough of the resource has been obtained that the duration of - the resource is available. In the case of a &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; + the resource is available. In the case of a &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element, the dimensions of the video are also available. The API will no longer raise an exception when seeking. No &lt;a href=#media-data&gt;media data&lt;/a&gt; is available for the immediate &lt;a href=#current-playback-position&gt;current playback @@ -27819,7 +27813,7 @@ &lt;p class=note&gt;Before this task is run, as part of the event loop mechanism, the rendering will have been updated to resize - the &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element if appropriate.&lt;/p&gt; + the &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element if appropriate.&lt;/p&gt; &lt;/dd&gt; @@ -29774,7 +29768,7 @@ &lt;p&gt;In this example, a sign-languge interpreter track from a movie file is overlaid on the primary video track of that same video file - using two &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; elements, some CSS, and an implicit + using two &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; elements, some CSS, and an implicit &lt;code&gt;&lt;a href=#mediacontroller&gt;MediaController&lt;/a&gt;&lt;/code&gt;:&lt;/p&gt; &lt;pre&gt;&lt;article&gt; @@ -31014,7 +31008,7 @@ &lt;div class=example&gt; - &lt;p&gt;In this example, an &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; element is used to play a + &lt;p&gt;In this example, an &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; element is used to play a specific sound-effect from a sound file containing many sound effects. A cue is used to pause the audio, so that it ends exactly at the end of the clip, even if the browser is busy running some @@ -33268,7 +33262,7 @@ &lt;/ol&gt;&lt;/div&gt; &lt;p&gt;The &lt;dfn id=attr-media-muted title=attr-media-muted&gt;&lt;code&gt;muted&lt;/code&gt;&lt;/dfn&gt; - attribute on the &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element controls the default + attribute on the &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element controls the default state of the audio channel of the &lt;a href=#media-resource&gt;media resource&lt;/a&gt;, potentially overriding user preferences.&lt;/p&gt; @@ -33540,7 +33534,7 @@ &lt;h5 id=security-and-privacy-considerations&gt;&lt;span class=secno&gt;4.8.10.17 &lt;/span&gt;Security and privacy considerations&lt;/h5&gt; &lt;p&gt;The main security and privacy implications of the - &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; and &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; elements come from the + &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; and &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; elements come from the ability to embed media cross-origin. There are two directions that threats can flow: from hostile content to a victim page, and from a hostile page to victim content.&lt;/p&gt; @@ -33554,7 +33548,7 @@ own unrelated &lt;a href=#top-level-browsing-context&gt;top-level browsing context&lt;/a&gt;.&lt;/p&gt; &lt;p class=example&gt;For instance, if an SVG animation was embedded in - a &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element, the user agent would not give it + a &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element, the user agent would not give it access to the DOM of the outer page. From the perspective of scripts in the SVG resource, the SVG file would appear to be in a lone top-level browsing context with no parent.&lt;/p&gt; @@ -34839,7 +34833,7 @@ &lt;code title=&quot;&quot;&gt;repeat&lt;/code&gt; is used.&lt;/p&gt; &lt;p&gt;If the first argument isn't an &lt;code&gt;&lt;a href=#the-img-element&gt;img&lt;/a&gt;&lt;/code&gt;, - &lt;code&gt;&lt;a href=#the-canvas-element&gt;canvas&lt;/a&gt;&lt;/code&gt;, or &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element, throws a + &lt;code&gt;&lt;a href=#the-canvas-element&gt;canvas&lt;/a&gt;&lt;/code&gt;, or &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element, throws a &lt;code&gt;&lt;a href=#type_mismatch_err&gt;TYPE_MISMATCH_ERR&lt;/a&gt;&lt;/code&gt; exception. If the image has no image data, throws an &lt;code&gt;&lt;a href=#invalid_state_err&gt;INVALID_STATE_ERR&lt;/a&gt;&lt;/code&gt; exception. If the second argument isn't one of the allowed values, throws a @@ -36340,7 +36334,7 @@ &lt;p&gt;&lt;img alt=&quot;The sx and sy parameters give the x and y coordinates of the source rectangle; the sw and sh arguments give the width and height of the source rectangle; the dx and dy give the x and y coordinates of the destination rectangle; and the dw and dh arguments give the width and height of the destination rectangle.&quot; height=356 src=<A HREF="http://images.whatwg.org/drawImage.png">http://images.whatwg.org/drawImage.png</A> width=356&gt;&lt;/p&gt; &lt;p&gt;If the first argument isn't an &lt;code&gt;&lt;a href=#the-img-element&gt;img&lt;/a&gt;&lt;/code&gt;, - &lt;code&gt;&lt;a href=#the-canvas-element&gt;canvas&lt;/a&gt;&lt;/code&gt;, or &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element, throws a + &lt;code&gt;&lt;a href=#the-canvas-element&gt;canvas&lt;/a&gt;&lt;/code&gt;, or &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element, throws a &lt;code&gt;&lt;a href=#type_mismatch_err&gt;TYPE_MISMATCH_ERR&lt;/a&gt;&lt;/code&gt; exception. If the image has no image data, throws an &lt;code&gt;&lt;a href=#invalid_state_err&gt;INVALID_STATE_ERR&lt;/a&gt;&lt;/code&gt; exception. If the numeric arguments don't make sense (e.g. the destination is a @@ -37733,7 +37727,7 @@ &lt;p&gt;&lt;span class=impl&gt;&lt;strong&gt;Author requirements&lt;/strong&gt;:&lt;/span&gt; The &lt;dfn id=attr-dim-width title=attr-dim-width&gt;&lt;code&gt;width&lt;/code&gt;&lt;/dfn&gt; and &lt;dfn id=attr-dim-height title=attr-dim-height&gt;&lt;code&gt;height&lt;/code&gt;&lt;/dfn&gt; attributes on &lt;code&gt;&lt;a href=#the-img-element&gt;img&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-iframe-element&gt;iframe&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-embed-element&gt;embed&lt;/a&gt;&lt;/code&gt;, - &lt;code&gt;&lt;a href=#the-object-element&gt;object&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt;, and, when their &lt;code title=attr-input-type&gt;&lt;a href=#attr-input-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute is in the &lt;a href=#image-button-state title=attr-input-type-image&gt;Image Button&lt;/a&gt; state, + &lt;code&gt;&lt;a href=#the-object-element&gt;object&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt;, and, when their &lt;code title=attr-input-type&gt;&lt;a href=#attr-input-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute is in the &lt;a href=#image-button-state title=attr-input-type-image&gt;Image Button&lt;/a&gt; state, &lt;code&gt;&lt;a href=#the-input-element&gt;input&lt;/a&gt;&lt;/code&gt; elements may be specified to give the dimensions of the visual content of the element (the width and height respectively, relative to the nominal direction of the output @@ -37780,12 +37774,12 @@ &lt;p&gt;The &lt;dfn id=dom-dim-width title=dom-dim-width&gt;&lt;code&gt;width&lt;/code&gt;&lt;/dfn&gt; and &lt;dfn id=dom-dim-height title=dom-dim-height&gt;&lt;code&gt;height&lt;/code&gt;&lt;/dfn&gt; IDL attributes on the &lt;code&gt;&lt;a href=#the-iframe-element&gt;iframe&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-embed-element&gt;embed&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-object-element&gt;object&lt;/a&gt;&lt;/code&gt;, - and &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; elements must &lt;a href=#reflect&gt;reflect&lt;/a&gt; the + and &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; elements must &lt;a href=#reflect&gt;reflect&lt;/a&gt; the respective content attributes of the same name.&lt;/p&gt; &lt;p class=note&gt;For &lt;code&gt;&lt;a href=#the-iframe-element&gt;iframe&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-embed-element&gt;embed&lt;/a&gt;&lt;/code&gt;, and &lt;code&gt;&lt;a href=#the-object-element&gt;object&lt;/a&gt;&lt;/code&gt; the IDL attributes are &lt;code&gt;DOMString&lt;/code&gt;; - for &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; the IDL attributes are &lt;code&gt;unsigned + for &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; the IDL attributes are &lt;code&gt;unsigned long&lt;/code&gt;.&lt;/p&gt; &lt;/div&gt; @@ -46567,9 +46561,9 @@ something like &lt;samp&gt;The text you have entered does not match the required pattern. Birthday&lt;/samp&gt;, which is not useful.&lt;/p&gt; - &lt;p&gt;UAs may still show the &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt; in non-error situations + &lt;p&gt;UAs may still show the &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt; in non-error situations (for example, as a tooltip when hovering over the control), so - authors should be careful not to word &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt;s as if an + authors should be careful not to word &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt;s as if an error has necessarily occurred.&lt;/p&gt; @@ -51550,7 +51544,7 @@ - &lt;h4 id=the-command&gt;&lt;span class=secno&gt;4.11.3 &lt;/span&gt;The &lt;dfn&gt;&lt;code&gt;command&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; + &lt;h4 id=the-command-element&gt;&lt;span class=secno&gt;4.11.3 &lt;/span&gt;The &lt;dfn id=the-command&gt;&lt;code&gt;command&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; &lt;dl class=element&gt;&lt;dt&gt;Categories&lt;/dt&gt; &lt;dd&gt;&lt;a href=#metadata-content&gt;Metadata content&lt;/a&gt;.&lt;/dd&gt; @@ -51583,11 +51577,11 @@ attribute boolean &lt;span title=&quot;dom-command-default&quot;&gt;default&lt;/span&gt;;--&gt; };&lt;/pre&gt; &lt;/dd&gt; - &lt;/dl&gt;&lt;p&gt;The &lt;code&gt;&lt;a href=#the-command&gt;command&lt;/a&gt;&lt;/code&gt; element represents a command that the user + &lt;/dl&gt;&lt;p&gt;The &lt;code&gt;&lt;a href=#the-command-element&gt;command&lt;/a&gt;&lt;/code&gt; element represents a command that the user can invoke.&lt;/p&gt; &lt;p&gt;A command can be part of a context menu or toolbar, using the - &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; element, or can be put anywhere else in the page, + &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; element, or can be put anywhere else in the page, to define a keyboard shortcut.&lt;/p&gt; &lt;!-- in the future we'll also add a command=&quot;&quot; attribute to refer to a command, which can then be defined anywhere --&gt; @@ -51721,7 +51715,7 @@ &lt;dd&gt;&lt;p&gt;If the element has a parent, then the UA must walk the list of child nodes of that parent element, and for each node that is a - &lt;code&gt;&lt;a href=#the-command&gt;command&lt;/a&gt;&lt;/code&gt; element, if that element has a &lt;code title=attr-command-radiogroup&gt;&lt;a href=#attr-command-radiogroup&gt;radiogroup&lt;/a&gt;&lt;/code&gt; attribute whose + &lt;code&gt;&lt;a href=#the-command-element&gt;command&lt;/a&gt;&lt;/code&gt; element, if that element has a &lt;code title=attr-command-radiogroup&gt;&lt;a href=#attr-command-radiogroup&gt;radiogroup&lt;/a&gt;&lt;/code&gt; attribute whose value exactly matches the current element's (treating missing &lt;code title=attr-command-radiogroup&gt;&lt;a href=#attr-command-radiogroup&gt;radiogroup&lt;/a&gt;&lt;/code&gt; attributes as if they were the empty string), and has a &lt;code title=attr-command-checked&gt;&lt;a href=#attr-command-checked&gt;checked&lt;/a&gt;&lt;/code&gt; attribute, must remove that attribute.&lt;/p&gt; @@ -51747,8 +51741,8 @@ &lt;/div&gt; - &lt;p class=note&gt;&lt;code&gt;&lt;a href=#the-command&gt;command&lt;/a&gt;&lt;/code&gt; elements are not rendered - unless they &lt;a href=#menus title=menu&gt;form part of a menu&lt;/a&gt;.&lt;/p&gt; + &lt;p class=note&gt;&lt;code&gt;&lt;a href=#the-command-element&gt;command&lt;/a&gt;&lt;/code&gt; elements are not rendered + unless they &lt;a href=#the-menu-element title=menu&gt;form part of a menu&lt;/a&gt;.&lt;/p&gt; &lt;div class=example&gt; @@ -51774,7 +51768,7 @@ - &lt;h4 id=menus&gt;&lt;span class=secno&gt;4.11.4 &lt;/span&gt;The &lt;dfn&gt;&lt;code&gt;menu&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; + &lt;h4 id=the-menu-element&gt;&lt;span class=secno&gt;4.11.4 &lt;/span&gt;The &lt;dfn id=menus&gt;&lt;code&gt;menu&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; &lt;dl class=element&gt;&lt;dt&gt;Categories&lt;/dt&gt; &lt;dd&gt;&lt;a href=#flow-content&gt;Flow content&lt;/a&gt;.&lt;/dd&gt; @@ -51794,7 +51788,7 @@ attribute DOMString &lt;a href=#dom-menu-type title=dom-menu-type&gt;type&lt;/a&gt;; attribute DOMString &lt;a href=#dom-menu-label title=dom-menu-label&gt;label&lt;/a&gt;; };&lt;/pre&gt; - &lt;/dl&gt;&lt;p&gt;The &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; element represents a list of commands.&lt;/p&gt; + &lt;/dl&gt;&lt;p&gt;The &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; element represents a list of commands.&lt;/p&gt; &lt;!-- v2 idea: &lt;menu&gt; should get an icon, like &lt;command&gt; --&gt; @@ -51810,16 +51804,16 @@ a list of commands that is neither declaring a context menu nor defining a toolbar.&lt;/p&gt; - &lt;p&gt;If a &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; element's &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute is in the &lt;a href=#context-menu-state title=&quot;context menu state&quot;&gt;context menu&lt;/a&gt; state, then the + &lt;p&gt;If a &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; element's &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute is in the &lt;a href=#context-menu-state title=&quot;context menu state&quot;&gt;context menu&lt;/a&gt; state, then the element &lt;a href=#represents&gt;represents&lt;/a&gt; the commands of a context menu, and the user can only interact with the commands if that context menu is activated.&lt;/p&gt; - &lt;p&gt;If a &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; element's &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute is in the &lt;a href=#toolbar-state title=&quot;toolbar state&quot;&gt;toolbar&lt;/a&gt; state, then the element + &lt;p&gt;If a &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; element's &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute is in the &lt;a href=#toolbar-state title=&quot;toolbar state&quot;&gt;toolbar&lt;/a&gt; state, then the element &lt;a href=#represents&gt;represents&lt;/a&gt; a list of active commands that the user can immediately interact with.&lt;/p&gt; - &lt;p&gt;If a &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; element's &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute is in the &lt;a href=#list-state title=&quot;list state&quot;&gt;list&lt;/a&gt; state, then the element either + &lt;p&gt;If a &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; element's &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute is in the &lt;a href=#list-state title=&quot;list state&quot;&gt;list&lt;/a&gt; state, then the element either &lt;a href=#represents&gt;represents&lt;/a&gt; an unordered list of items (each represented by an &lt;code&gt;&lt;a href=#the-li-element&gt;li&lt;/a&gt;&lt;/code&gt; element), each of which represents a command that the user can perform or activate, or, if the element has no @@ -51846,7 +51840,7 @@ &lt;p&gt;&lt;i&gt;This section is non-normative.&lt;/i&gt;&lt;/p&gt; - &lt;p&gt;The &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; element is used to define context menus and + &lt;p&gt;The &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; element is used to define context menus and toolbars.&lt;/p&gt; &lt;p&gt;For example, the following represents a toolbar with three menu @@ -51910,7 +51904,7 @@ above, but here the legacy behavior consists of a single &lt;code&gt;&lt;a href=#the-select-element&gt;select&lt;/a&gt;&lt;/code&gt; element with a submit button. The submit button doesn't appear in the toolbar, because it is not a direct child of - the &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; element or of its &lt;code&gt;&lt;a href=#the-li-element&gt;li&lt;/a&gt;&lt;/code&gt; + the &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; element or of its &lt;code&gt;&lt;a href=#the-li-element&gt;li&lt;/a&gt;&lt;/code&gt; children.&lt;/p&gt; @@ -51925,7 +51919,7 @@ &lt;ul class=brief&gt;&lt;li&gt;&lt;a href=#concept-command title=concept-command&gt;Commands&lt;/a&gt;, which can be marked as default commands&lt;/li&gt; &lt;li&gt;Separators&lt;/li&gt; &lt;li&gt;Other menus (which allows the list to be nested)&lt;/li&gt; - &lt;/ul&gt;&lt;p&gt;The list corresponding to a particular &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; element + &lt;/ul&gt;&lt;p&gt;The list corresponding to a particular &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; element is built by iterating over its child nodes. For each child node in &lt;a href=#tree-order&gt;tree order&lt;/a&gt;, the required behavior depends on what the node is, as follows:&lt;/p&gt; @@ -51961,17 +51955,17 @@ &lt;dd&gt;Iterate over the children of the element.&lt;/dd&gt; - &lt;dt&gt;A &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; element with no &lt;code title=attr-menu-label&gt;&lt;a href=#attr-menu-label&gt;label&lt;/a&gt;&lt;/code&gt; attribute&lt;/dt&gt; + &lt;dt&gt;A &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; element with no &lt;code title=attr-menu-label&gt;&lt;a href=#attr-menu-label&gt;label&lt;/a&gt;&lt;/code&gt; attribute&lt;/dt&gt; &lt;dt&gt;A &lt;code&gt;&lt;a href=#the-select-element&gt;select&lt;/a&gt;&lt;/code&gt; element&lt;/dt&gt; &lt;dd&gt;Append a separator to the menu, then iterate over the children - of the &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; or &lt;code&gt;&lt;a href=#the-select-element&gt;select&lt;/a&gt;&lt;/code&gt; element, then + of the &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; or &lt;code&gt;&lt;a href=#the-select-element&gt;select&lt;/a&gt;&lt;/code&gt; element, then append another separator.&lt;/dd&gt; &lt;!-- v2: we might want to support &lt;select&gt; in &lt;label&gt; as giving a named submenu --&gt; - &lt;dt&gt;A &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-menu-label&gt;&lt;a href=#attr-menu-label&gt;label&lt;/a&gt;&lt;/code&gt; attribute&lt;/dt&gt; + &lt;dt&gt;A &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-menu-label&gt;&lt;a href=#attr-menu-label&gt;label&lt;/a&gt;&lt;/code&gt; attribute&lt;/dt&gt; &lt;dt&gt;An &lt;code&gt;&lt;a href=#the-optgroup-element&gt;optgroup&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-menu-label&gt;&lt;a href=#attr-menu-label&gt;label&lt;/a&gt;&lt;/code&gt; attribute&lt;/dt&gt; &lt;dd&gt;Append a submenu to the menu, using the value of the element's @@ -52006,11 +52000,11 @@ &lt;p&gt;The &lt;dfn id=attr-contextmenu title=attr-contextmenu&gt;&lt;code&gt;contextmenu&lt;/code&gt;&lt;/dfn&gt; attribute gives the element's &lt;a href=#context-menus title=&quot;context menus&quot;&gt;context - menu&lt;/a&gt;. The value must be the &lt;a href=#concept-id title=concept-id&gt;ID&lt;/a&gt; of a &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; element + menu&lt;/a&gt;. The value must be the &lt;a href=#concept-id title=concept-id&gt;ID&lt;/a&gt; of a &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; element in the DOM. &lt;span class=impl&gt;If the node that would be obtained by the invoking the &lt;code title=dom-Document-getElementById&gt;&lt;a href=#dom-document-getelementbyid&gt;getElementById()&lt;/a&gt;&lt;/code&gt; method using the attribute's value as the only argument is null or not a - &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; element, then the element has no assigned context + &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; element, then the element has no assigned context menu. Otherwise, the element's assigned context menu is the element so identified.&lt;/span&gt;&lt;/p&gt; @@ -52051,13 +52045,13 @@ &lt;p&gt;If the element or one of its ancestors &lt;em&gt;does&lt;/em&gt; have a context menu assigned, then the user agent must &lt;a href=#fire-a-simple-event&gt;fire a simple event&lt;/a&gt; named &lt;code title=event-show&gt;show&lt;/code&gt; at the - &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; element of the context menu of the nearest + &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; element of the context menu of the nearest ancestor (including the element itself) with one assigned.&lt;/p&gt; &lt;!-- v2: include modifier key information --&gt; &lt;p&gt;The default action of &lt;em&gt;this&lt;/em&gt; event is that the user agent must show a context menu &lt;a href=#building-menus-and-toolbars title=&quot;building menus and - toolbars&quot;&gt;built&lt;/a&gt; from the &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; element.&lt;/p&gt; + toolbars&quot;&gt;built&lt;/a&gt; from the &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; element.&lt;/p&gt; &lt;p&gt;The user agent may also provide access to its default context menu, if any, with the context menu shown. For example, it could @@ -52111,13 +52105,13 @@ &lt;h5 id=toolbars&gt;&lt;span class=secno&gt;4.11.4.4 &lt;/span&gt;&lt;dfn&gt;Toolbars&lt;/dfn&gt;&lt;/h5&gt; - &lt;p&gt;When a &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; element has a &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute in the &lt;a href=#toolbar-state title=&quot;toolbar state&quot;&gt;toolbar&lt;/a&gt; state, then the user agent + &lt;p&gt;When a &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; element has a &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute in the &lt;a href=#toolbar-state title=&quot;toolbar state&quot;&gt;toolbar&lt;/a&gt; state, then the user agent must &lt;a href=#building-menus-and-toolbars title=&quot;building menus and toolbars&quot;&gt;build&lt;/a&gt; the - menu for that &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; element, and use the result in the + menu for that &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; element, and use the result in the rendering.&lt;/p&gt; &lt;p&gt;The user agent must reflect changes made to the - &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt;'s DOM, by immediately &lt;a href=#building-menus-and-toolbars title=&quot;building menus + &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt;'s DOM, by immediately &lt;a href=#building-menus-and-toolbars title=&quot;building menus and toolbars&quot;&gt;rebuilding&lt;/a&gt; the menu.&lt;/p&gt; &lt;/div&gt; @@ -52317,7 +52311,7 @@ not specify an icon, or if the element does not define a command, then the attribute must return null. This attribute will be shadowed by the &lt;code title=dom-command-icon&gt;&lt;a href=#dom-command-icon&gt;icon&lt;/a&gt;&lt;/code&gt; IDL attribute on - &lt;code&gt;&lt;a href=#the-command&gt;command&lt;/a&gt;&lt;/code&gt; elements.&lt;/p&gt; + &lt;code&gt;&lt;a href=#the-command-element&gt;command&lt;/a&gt;&lt;/code&gt; elements.&lt;/p&gt; &lt;p&gt;The &lt;dfn id=dom-command-ro-disabled title=dom-command-ro-disabled&gt;&lt;code&gt;disabled&lt;/code&gt;&lt;/dfn&gt; attribute must return true if the command's &lt;a href=#command-facet-disabledstate title=command-facet-DisabledState&gt;Disabled State&lt;/a&gt; is that @@ -52331,7 +52325,7 @@ command is checked, and false if it is that the command is not checked. If the element does not define a command, the attribute must return false. This attribute will be shadowed by the &lt;code title=&quot;&quot;&gt;checked&lt;/code&gt; IDL attribute on &lt;code&gt;&lt;a href=#the-input-element&gt;input&lt;/a&gt;&lt;/code&gt; and - &lt;code&gt;&lt;a href=#the-command&gt;command&lt;/a&gt;&lt;/code&gt; elements.&lt;/p&gt; + &lt;code&gt;&lt;a href=#the-command-element&gt;command&lt;/a&gt;&lt;/code&gt; elements.&lt;/p&gt; &lt;!--v2COMMAND &lt;p&gt;The &lt;dfn @@ -52561,10 +52555,10 @@ &lt;h5 id=using-the-command-element-to-define-a-command&gt;&lt;span class=secno&gt;4.11.5.5 &lt;/span&gt;Using the &lt;dfn title=command-element&gt;&lt;code&gt;command&lt;/code&gt;&lt;/dfn&gt; element to define a command&lt;/h5&gt; - &lt;p&gt;A &lt;code&gt;&lt;a href=#the-command&gt;command&lt;/a&gt;&lt;/code&gt; element &lt;a href=#concept-command title=concept-command&gt;defines a command&lt;/a&gt;.&lt;/p&gt; + &lt;p&gt;A &lt;code&gt;&lt;a href=#the-command-element&gt;command&lt;/a&gt;&lt;/code&gt; element &lt;a href=#concept-command title=concept-command&gt;defines a command&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;The &lt;a href=#command-facet-type title=command-facet-Type&gt;Type&lt;/a&gt; of the command - is &quot;radio&quot; if the &lt;code&gt;&lt;a href=#the-command&gt;command&lt;/a&gt;&lt;/code&gt;'s &lt;code title=attr-command-type&gt;&lt;a href=#attr-command-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute is + is &quot;radio&quot; if the &lt;code&gt;&lt;a href=#the-command-element&gt;command&lt;/a&gt;&lt;/code&gt;'s &lt;code title=attr-command-type&gt;&lt;a href=#attr-command-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute is &quot;&lt;code&gt;radio&lt;/code&gt;&quot;, &quot;checkbox&quot; if the attribute's value is &quot;&lt;code&gt;checkbox&lt;/code&gt;&quot;, and &quot;command&quot; otherwise.&lt;/p&gt; @@ -54546,7 +54540,7 @@ &lt;li&gt;&lt;code&gt;&lt;a href=#the-input-element&gt;input&lt;/a&gt;&lt;/code&gt; elements whose &lt;code title=attr-input-type&gt;&lt;a href=#attr-input-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute is in the &lt;a href=#submit-button-state title=attr-input-type-submit&gt;Submit Button&lt;/a&gt;, &lt;a href=#image-button-state title=attr-input-type-image&gt;Image Button&lt;/a&gt;, &lt;a href=#reset-button-state title=attr-input-type-reset&gt;Reset Button&lt;/a&gt;, or &lt;a href=#button-state title=attr-input-type-button&gt;Button&lt;/a&gt; state&lt;/li&gt; - &lt;li&gt;&lt;code&gt;&lt;a href=#the-command&gt;command&lt;/a&gt;&lt;/code&gt; elements that do not have a &lt;code title=attr-command-disabled&gt;&lt;a href=#attr-command-disabled&gt;disabled&lt;/a&gt;&lt;/code&gt; attribute&lt;/li&gt; + &lt;li&gt;&lt;code&gt;&lt;a href=#the-command-element&gt;command&lt;/a&gt;&lt;/code&gt; elements that do not have a &lt;code title=attr-command-disabled&gt;&lt;a href=#attr-command-disabled&gt;disabled&lt;/a&gt;&lt;/code&gt; attribute&lt;/li&gt; &lt;li&gt;elements that are &lt;a href=#specially-focusable&gt;specially focusable&lt;/a&gt;&lt;/li&gt; @@ -54605,10 +54599,10 @@ &lt;li&gt;&lt;code&gt;&lt;a href=#the-option-element&gt;option&lt;/a&gt;&lt;/code&gt; elements that are not &lt;a href=#concept-option-disabled title=concept-option-disabled&gt;disabled&lt;/a&gt;&lt;/li&gt; - &lt;li&gt;&lt;code&gt;&lt;a href=#the-command&gt;command&lt;/a&gt;&lt;/code&gt; elements that do not have a &lt;code title=attr-command-disabled&gt;&lt;a href=#attr-command-disabled&gt;disabled&lt;/a&gt;&lt;/code&gt; attribute&lt;/li&gt; + &lt;li&gt;&lt;code&gt;&lt;a href=#the-command-element&gt;command&lt;/a&gt;&lt;/code&gt; elements that do not have a &lt;code title=attr-command-disabled&gt;&lt;a href=#attr-command-disabled&gt;disabled&lt;/a&gt;&lt;/code&gt; attribute&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-li-element&gt;li&lt;/a&gt;&lt;/code&gt; elements that are children of - &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; elements, and that have a child element that + &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; elements, and that have a child element that defines a &lt;a href=#concept-command title=concept-command&gt;command&lt;/a&gt;, if the first such element's &lt;a href=#command-facet-disabledstate title=command-facet-disabledstate&gt;Disabled State&lt;/a&gt; facet is false (not disabled)&lt;/li&gt; @@ -54638,10 +54632,10 @@ &lt;li&gt;&lt;code&gt;&lt;a href=#the-option-element&gt;option&lt;/a&gt;&lt;/code&gt; elements that are &lt;a href=#concept-option-disabled title=concept-option-disabled&gt;disabled&lt;/a&gt;&lt;/li&gt; - &lt;li&gt;&lt;code&gt;&lt;a href=#the-command&gt;command&lt;/a&gt;&lt;/code&gt; elements that have a &lt;code title=attr-command-disabled&gt;&lt;a href=#attr-command-disabled&gt;disabled&lt;/a&gt;&lt;/code&gt; attribute&lt;/li&gt; + &lt;li&gt;&lt;code&gt;&lt;a href=#the-command-element&gt;command&lt;/a&gt;&lt;/code&gt; elements that have a &lt;code title=attr-command-disabled&gt;&lt;a href=#attr-command-disabled&gt;disabled&lt;/a&gt;&lt;/code&gt; attribute&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-li-element&gt;li&lt;/a&gt;&lt;/code&gt; elements that are children of - &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; elements, and that have a child element that + &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; elements, and that have a child element that defines a &lt;a href=#concept-command title=concept-command&gt;command&lt;/a&gt;, if the first such element's &lt;a href=#command-facet-disabledstate title=command-facet-disabledstate&gt;Disabled State&lt;/a&gt; facet is true (disabled)&lt;/li&gt; @@ -54670,11 +54664,11 @@ &lt;li&gt;&lt;code&gt;&lt;a href=#the-option-element&gt;option&lt;/a&gt;&lt;/code&gt; elements whose &lt;a href=#concept-option-selectedness title=concept-option-selectedness&gt;selectedness&lt;/a&gt; is true&lt;/li&gt; - &lt;li&gt;&lt;code&gt;&lt;a href=#the-command&gt;command&lt;/a&gt;&lt;/code&gt; elements whose &lt;code title=attr-command-type&gt;&lt;a href=#attr-command-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute is in the &lt;a href=#attr-command-type-state-checkbox title=attr-command-type-state-checkbox&gt;Checkbox&lt;/a&gt; state + &lt;li&gt;&lt;code&gt;&lt;a href=#the-command-element&gt;command&lt;/a&gt;&lt;/code&gt; elements whose &lt;code title=attr-command-type&gt;&lt;a href=#attr-command-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute is in the &lt;a href=#attr-command-type-state-checkbox title=attr-command-type-state-checkbox&gt;Checkbox&lt;/a&gt; state and that have a &lt;code title=attr-command-checked&gt;&lt;a href=#attr-command-checked&gt;checked&lt;/a&gt;&lt;/code&gt; attribute&lt;/li&gt; - &lt;li&gt;&lt;code&gt;&lt;a href=#the-command&gt;command&lt;/a&gt;&lt;/code&gt; elements whose &lt;code title=attr-command-type&gt;&lt;a href=#attr-command-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute is in the &lt;a href=#attr-command-type-state-radio title=attr-command-type-state-radio&gt;Radio&lt;/a&gt; state and that + &lt;li&gt;&lt;code&gt;&lt;a href=#the-command-element&gt;command&lt;/a&gt;&lt;/code&gt; elements whose &lt;code title=attr-command-type&gt;&lt;a href=#attr-command-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute is in the &lt;a href=#attr-command-type-state-radio title=attr-command-type-state-radio&gt;Radio&lt;/a&gt; state and that have a &lt;code title=attr-command-checked&gt;&lt;a href=#attr-command-checked&gt;checked&lt;/a&gt;&lt;/code&gt; attribute&lt;/li&gt; @@ -55649,15 +55643,15 @@ created by the element.&lt;/dd&gt; - &lt;dt&gt;If the element is a &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element&lt;/dt&gt; + &lt;dt&gt;If the element is a &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element&lt;/dt&gt; &lt;dd&gt;&lt;p&gt;The value is the value of the element's &lt;code title=attr-content&gt;content&lt;/code&gt; attribute, if any, or the empty string if there is no such attribute.&lt;/dd&gt; - &lt;dt&gt;If the element is an &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-embed-element&gt;embed&lt;/a&gt;&lt;/code&gt;, + &lt;dt&gt;If the element is an &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-embed-element&gt;embed&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-iframe-element&gt;iframe&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-img-element&gt;img&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-source-element&gt;source&lt;/a&gt;&lt;/code&gt;, - &lt;code&gt;&lt;a href=#the-track-element&gt;track&lt;/a&gt;&lt;/code&gt;, or &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element&lt;/dt&gt; + &lt;code&gt;&lt;a href=#the-track-element&gt;track&lt;/a&gt;&lt;/code&gt;, or &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element&lt;/dt&gt; &lt;dd&gt;&lt;p&gt;The value is the &lt;a href=#absolute-url&gt;absolute URL&lt;/a&gt; that results from &lt;a href=#resolve-a-url title=&quot;resolve a url&quot;&gt;resolving&lt;/a&gt; the value of the @@ -55699,10 +55693,10 @@ &lt;code&gt;&lt;a href=#textcontent&gt;textContent&lt;/a&gt;&lt;/code&gt;.&lt;/dd&gt; &lt;/dl&gt;&lt;p&gt;The &lt;dfn id=url-property-elements&gt;URL property elements&lt;/dfn&gt; are the &lt;code&gt;&lt;a href=#the-a-element&gt;a&lt;/a&gt;&lt;/code&gt;, - &lt;code&gt;&lt;a href=#the-area-element&gt;area&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-embed-element&gt;embed&lt;/a&gt;&lt;/code&gt;, + &lt;code&gt;&lt;a href=#the-area-element&gt;area&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-embed-element&gt;embed&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-iframe-element&gt;iframe&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-img-element&gt;img&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-link-element&gt;link&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-object-element&gt;object&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-source-element&gt;source&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-track-element&gt;track&lt;/a&gt;&lt;/code&gt;, and - &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; elements.&lt;/p&gt; + &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; elements.&lt;/p&gt; &lt;p&gt;If a property's &lt;a href=#concept-property-value title=concept-property-value&gt;value&lt;/a&gt; is an &lt;a href=#absolute-url&gt;absolute URL&lt;/a&gt;, the property must be specified @@ -55960,15 +55954,15 @@ setting.&lt;/p&gt; - &lt;dt&gt;If the element is a &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element&lt;/dt&gt; + &lt;dt&gt;If the element is a &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element&lt;/dt&gt; &lt;dd&gt;&lt;p&gt;The attribute must act as it would if it was &lt;a href=#reflect title=reflect&gt;reflecting&lt;/a&gt; the element's &lt;code title=attr-meta-content&gt;&lt;a href=#attr-meta-content&gt;content&lt;/a&gt;&lt;/code&gt; content attribute.&lt;/dd&gt; - &lt;dt&gt;If the element is an &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-embed-element&gt;embed&lt;/a&gt;&lt;/code&gt;, + &lt;dt&gt;If the element is an &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-embed-element&gt;embed&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-iframe-element&gt;iframe&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-img-element&gt;img&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-source-element&gt;source&lt;/a&gt;&lt;/code&gt;, - &lt;code&gt;&lt;a href=#the-track-element&gt;track&lt;/a&gt;&lt;/code&gt;, or &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element&lt;/dt&gt; + &lt;code&gt;&lt;a href=#the-track-element&gt;track&lt;/a&gt;&lt;/code&gt;, or &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element&lt;/dt&gt; &lt;dd&gt;&lt;p&gt;The attribute must act as it would if it was &lt;a href=#reflect title=reflect&gt;reflecting&lt;/a&gt; the element's &lt;code title=&quot;&quot;&gt;src&lt;/code&gt; content attribute.&lt;/dd&gt; @@ -57144,10 +57138,10 @@ text string&lt;/a&gt; that is &lt;a href=&quot;#the-document's-current-address&quot;&gt;the document's current address&lt;/a&gt; as the value to &lt;var title=&quot;&quot;&gt;output&lt;/var&gt;.&lt;/li&gt; - &lt;li&gt;&lt;p&gt;If &lt;a href=#the-title-element&gt;the &lt;code&gt;title&lt;/code&gt; element&lt;/a&gt; is not null, + &lt;li&gt;&lt;p&gt;If &lt;a href=#the-title-element-0&gt;the &lt;code&gt;title&lt;/code&gt; element&lt;/a&gt; is not null, &lt;a href=#add-a-vcard-line&gt;add a vCard line&lt;/a&gt; with the type &quot;&lt;code title=&quot;&quot;&gt;NAME&lt;/code&gt;&quot; and with the result of &lt;a href=#escaping-the-vcard-text-string&gt;escaping the vCard text string&lt;/a&gt; obtained from the &lt;code&gt;&lt;a href=#textcontent&gt;textContent&lt;/a&gt;&lt;/code&gt; - of &lt;a href=#the-title-element&gt;the &lt;code&gt;title&lt;/code&gt; element&lt;/a&gt; as the value to &lt;var title=&quot;&quot;&gt;output&lt;/var&gt;.&lt;/li&gt; + of &lt;a href=#the-title-element-0&gt;the &lt;code&gt;title&lt;/code&gt; element&lt;/a&gt; as the value to &lt;var title=&quot;&quot;&gt;output&lt;/var&gt;.&lt;/li&gt; &lt;li&gt;&lt;p&gt;If &lt;var title=&quot;&quot;&gt;node&lt;/var&gt; has a &lt;a href=#global-identifier&gt;global identifier&lt;/a&gt;, &lt;a href=#add-a-vcard-line&gt;add a vCard line&lt;/a&gt; with the type @@ -58660,12 +58654,12 @@ &lt;ol&gt;&lt;li&gt; - &lt;p&gt;If &lt;a href=#the-title-element&gt;the &lt;code&gt;title&lt;/code&gt; element&lt;/a&gt; is not null, + &lt;p&gt;If &lt;a href=#the-title-element-0&gt;the &lt;code&gt;title&lt;/code&gt; element&lt;/a&gt; is not null, then generate the following triple:&lt;/p&gt; &lt;dl class=triple&gt;&lt;dt&gt;subject &lt;dd&gt; &lt;a href=&quot;#the-document's-current-address&quot;&gt;the document's current address&lt;/a&gt; &lt;dt&gt;predicate &lt;dd&gt; &lt;code title=&quot;&quot;&gt;<A HREF="http://purl.org/dc/terms/title&lt;/code">http://purl.org/dc/terms/title&lt;/code</A>&gt; - &lt;dt&gt;object &lt;dd&gt; the concatenation of the data of all the child &lt;a href=#text-node title=&quot;text node&quot;&gt;text nodes&lt;/a&gt; of &lt;a href=#the-title-element&gt;the &lt;code&gt;title&lt;/code&gt; element&lt;/a&gt;, in &lt;a href=#tree-order&gt;tree order&lt;/a&gt;, as a plain literal, with the language information set from the &lt;a href=#language&gt;language&lt;/a&gt; of &lt;a href=#the-title-element&gt;the &lt;code&gt;title&lt;/code&gt; element&lt;/a&gt;, if it is not unknown. + &lt;dt&gt;object &lt;dd&gt; the concatenation of the data of all the child &lt;a href=#text-node title=&quot;text node&quot;&gt;text nodes&lt;/a&gt; of &lt;a href=#the-title-element-0&gt;the &lt;code&gt;title&lt;/code&gt; element&lt;/a&gt;, in &lt;a href=#tree-order&gt;tree order&lt;/a&gt;, as a plain literal, with the language information set from the &lt;a href=#language&gt;language&lt;/a&gt; of &lt;a href=#the-title-element-0&gt;the &lt;code&gt;title&lt;/code&gt; element&lt;/a&gt;, if it is not unknown. &lt;/dl&gt;&lt;/li&gt; @@ -58720,7 +58714,7 @@ &lt;li&gt; - &lt;p&gt;For each &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element in the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt; + &lt;p&gt;For each &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element in the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt; that has a &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; attribute and a &lt;code title=attr-meta-content&gt;&lt;a href=#attr-meta-content&gt;content&lt;/a&gt;&lt;/code&gt; attribute, if the value of the &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; attribute @@ -58730,7 +58724,7 @@ &lt;dl class=triple&gt;&lt;dt&gt;subject &lt;dd&gt; &lt;a href=&quot;#the-document's-current-address&quot;&gt;the document's current address&lt;/a&gt; &lt;dt&gt;predicate &lt;dd&gt; the concatenation of the string &quot;&lt;code title=&quot;&quot;&gt;<A HREF="http://www.w3.org/1999/xhtml/vocab#&lt;/code">http://www.w3.org/1999/xhtml/vocab#&lt;/code</A>&gt;&quot; and the value of the element's &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; attribute, &lt;a href=#converted-to-ascii-lowercase&gt;converted to ASCII lowercase&lt;/a&gt;, with any characters in the value that are not valid in the &lt;ifragment&gt; production of the IRI syntax being %-escaped &lt;a href=#refsRFC3987&gt;[RFC3987]&lt;/a&gt; &lt;dt&gt;object &lt;dd&gt; the value of the element's &lt;code title=attr-meta-content&gt;&lt;a href=#attr-meta-content&gt;content&lt;/a&gt;&lt;/code&gt; attribute, as a plain literal, with the language information set from the &lt;a href=#language&gt;language&lt;/a&gt; of the element, if it is not unknown - &lt;/dl&gt;&lt;p&gt;For each &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element in the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt; + &lt;/dl&gt;&lt;p&gt;For each &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element in the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt; that has a &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; attribute and a &lt;code title=attr-meta-content&gt;&lt;a href=#attr-meta-content&gt;content&lt;/a&gt;&lt;/code&gt; attribute, if the value of the &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; attribute is @@ -59080,7 +59074,7 @@ &lt;li&gt; - &lt;p&gt;For each &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; attribute and a &lt;code title=attr-meta-content&gt;&lt;a href=#attr-meta-content&gt;content&lt;/a&gt;&lt;/code&gt; attribute and whose &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; attribute's value is &lt;code title=meta-author&gt;&lt;a href=#meta-author&gt;author&lt;/a&gt;&lt;/code&gt;, run the following substeps:&lt;/p&gt; + &lt;p&gt;For each &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; attribute and a &lt;code title=attr-meta-content&gt;&lt;a href=#attr-meta-content&gt;content&lt;/a&gt;&lt;/code&gt; attribute and whose &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; attribute's value is &lt;code title=meta-author&gt;&lt;a href=#meta-author&gt;author&lt;/a&gt;&lt;/code&gt;, run the following substeps:&lt;/p&gt; &lt;ol&gt;&lt;li&gt;&lt;p&gt;Append an &lt;code title=&quot;&quot;&gt;author&lt;/code&gt; element in the &lt;a href=#atom-namespace&gt;Atom namespace&lt;/a&gt; to the root element of &lt;var title=&quot;&quot;&gt;R&lt;/var&gt;.&lt;/li&gt; @@ -59090,7 +59084,7 @@ previous step.&lt;/p&gt; &lt;li&gt;&lt;p&gt;Append a text node whose data is the value of the - &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element's &lt;code title=attr-meta-content&gt;&lt;a href=#attr-meta-content&gt;content&lt;/a&gt;&lt;/code&gt; attribute to the element + &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element's &lt;code title=attr-meta-content&gt;&lt;a href=#attr-meta-content&gt;content&lt;/a&gt;&lt;/code&gt; attribute to the element created in the previous step.&lt;/li&gt; &lt;/ol&gt;&lt;!-- could use vCards instead, and get &lt;atom:email&gt; and &lt;atom:uri&gt; @@ -59173,7 +59167,7 @@ &lt;dd&gt; &lt;p&gt;Let &lt;var title=&quot;&quot;&gt;heading content&lt;/var&gt; be the descendants of - &lt;a href=#the-title-element&gt;the &lt;code&gt;title&lt;/code&gt; element&lt;/a&gt;, if there is one, or + &lt;a href=#the-title-element-0&gt;the &lt;code&gt;title&lt;/code&gt; element&lt;/a&gt;, if there is one, or an empty list otherwise.&lt;/p&gt; &lt;/dd&gt; @@ -59709,7 +59703,7 @@ whose &lt;a href=&quot;#the-document's-address&quot; title=&quot;the document's address&quot;&gt;address&lt;/a&gt; is &lt;code&gt;&lt;a href=#about:blank&gt;about:blank&lt;/a&gt;&lt;/code&gt;, which is marked as being an &lt;a href=#html-documents title=&quot;HTML documents&quot;&gt;HTML document&lt;/a&gt;, and whose &lt;a href=&quot;#document's-character-encoding&quot; title=&quot;document's character encoding&quot;&gt;character encoding&lt;/a&gt; is UTF-8. The &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt; must have a single child - &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; node, which itself has a single child + &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; node, which itself has a single child &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt; node.&lt;/p&gt; &lt;p class=note&gt;If the &lt;a href=#browsing-context&gt;browsing context&lt;/a&gt; is created @@ -61019,10 +61013,10 @@ origin&lt;/a&gt; of a script are determined from another resource, called the &lt;i&gt;owner&lt;/i&gt;:&lt;/p&gt; - &lt;dl class=switch&gt;&lt;dt&gt;If a script is in a &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element&lt;/dt&gt; + &lt;dl class=switch&gt;&lt;dt&gt;If a script is in a &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element&lt;/dt&gt; &lt;dd&gt;The owner is the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt; to which the - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element belongs.&lt;/dd&gt; + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element belongs.&lt;/dd&gt; &lt;dt&gt;If a script is in an &lt;a href=#event-handler-content-attributes title=&quot;event handler content @@ -61176,7 +61170,7 @@ &lt;/dd&gt; - &lt;dt&gt;For &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; and &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; elements&lt;/dt&gt; + &lt;dt&gt;For &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; and &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; elements&lt;/dt&gt; &lt;dd&gt; @@ -61491,7 +61485,7 @@ &lt;p class=note&gt;Titles associated with &lt;a href=#session-history-entry title=&quot;session history entry&quot;&gt;session history entries&lt;/a&gt; need not have any relation - with the current &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt; of the + with the current &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt; of the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt;. The title of a &lt;a href=#session-history-entry&gt;session history entry&lt;/a&gt; is intended to explain the state of the document at that point, so that the user can navigate the document's @@ -61949,8 +61943,8 @@ &lt;p&gt;Applications might not use the same title for a &lt;a href=#session-history-entry&gt;session history entry&lt;/a&gt; as the value of the document's - &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt; element at that time. For example, here is a - simple page that shows a block in the &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt; element. + &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt; element at that time. For example, here is a + simple page that shows a block in the &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt; element. Clearly, when navigating backwards to a previous state the user does not go back in time, and therefore it would be inappropriate to put the time in the session history title.&lt;/p&gt; @@ -62828,7 +62822,7 @@ character encoding.&lt;/p&gt; &lt;p&gt;If the root element, as parsed according to the XML - specifications cited above, is found to be an &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; + specifications cited above, is found to be an &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element with an attribute &lt;code title=attr-html-manifest&gt;&lt;a href=#attr-html-manifest&gt;manifest&lt;/a&gt;&lt;/code&gt; whose value is not the empty string, then, as soon as the element is &lt;a href=#insert-an-element-into-a-document title=&quot;insert an element into a document&quot;&gt;inserted into the document&lt;/a&gt;, the user @@ -62915,9 +62909,9 @@ before the page has finished parsing, the user agent must &lt;a href=#update-the-session-history-with-the-new-page&gt;update the session history with the new page&lt;/a&gt;.&lt;/p&gt; - &lt;p&gt;User agents may add content to the &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element of + &lt;p&gt;User agents may add content to the &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element of the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt;, e.g. linking to a style sheet or an XBL - binding, providing script, giving the document a &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt;, + binding, providing script, giving the document a &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt;, etc.&lt;/p&gt; &lt;p class=note&gt;In particular, if the user agent supports the &lt;code title=&quot;&quot;&gt;Format=Flowed&lt;/code&gt; feature of RFC 3676 then the user @@ -62934,9 +62928,9 @@ &lt;p&gt;When an image resource is to be loaded in a &lt;a href=#browsing-context&gt;browsing context&lt;/a&gt;, the user agent should &lt;a href=#create-a-document-object&gt;create a &lt;code&gt;Document&lt;/code&gt; object&lt;/a&gt;, mark it as being an &lt;a href=#html-documents title=&quot;HTML documents&quot;&gt;HTML document&lt;/a&gt;, append an - &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element to the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt;, append a - &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element and a &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt; element to the - &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element, append an &lt;code&gt;&lt;a href=#the-img-element&gt;img&lt;/a&gt;&lt;/code&gt; to the + &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element to the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt;, append a + &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element and a &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt; element to the + &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element, append an &lt;code&gt;&lt;a href=#the-img-element&gt;img&lt;/a&gt;&lt;/code&gt; to the &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt; element, and set the &lt;code title=attr-img-src&gt;&lt;a href=#attr-img-src&gt;src&lt;/a&gt;&lt;/code&gt; attribute of the &lt;code&gt;&lt;a href=#the-img-element&gt;img&lt;/a&gt;&lt;/code&gt; element to the address of the image.&lt;/p&gt; @@ -62955,10 +62949,10 @@ before the page has finished fully loading, the user agent must &lt;a href=#update-the-session-history-with-the-new-page&gt;update the session history with the new page&lt;/a&gt;.&lt;/p&gt; - &lt;p&gt;User agents may add content to the &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element of + &lt;p&gt;User agents may add content to the &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element of the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt;, or attributes to the &lt;code&gt;&lt;a href=#the-img-element&gt;img&lt;/a&gt;&lt;/code&gt; element, e.g. to link to a style sheet or an XBL binding, to provide - a script, to give the document a &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt;, etc.&lt;/p&gt; + a script, to give the document a &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt;, etc.&lt;/p&gt; &lt;h4 id=read-plugin&gt;&lt;span class=secno&gt;6.5.6 &lt;/span&gt;&lt;dfn title=navigate-plugin&gt;Page load processing model for content that uses plugins&lt;/dfn&gt;&lt;/h4&gt; @@ -62967,9 +62961,9 @@ is to be loaded in a &lt;a href=#browsing-context&gt;browsing context&lt;/a&gt;, the user agent should &lt;a href=#create-a-document-object&gt;create a &lt;code&gt;Document&lt;/code&gt; object&lt;/a&gt;, mark it as being an &lt;a href=#html-documents title=&quot;HTML documents&quot;&gt;HTML document&lt;/a&gt;, - append an &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element to the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt;, - append a &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element and a &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt; element - to the &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element, append an &lt;code&gt;&lt;a href=#the-embed-element&gt;embed&lt;/a&gt;&lt;/code&gt; to + append an &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element to the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt;, + append a &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element and a &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt; element + to the &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element, append an &lt;code&gt;&lt;a href=#the-embed-element&gt;embed&lt;/a&gt;&lt;/code&gt; to the &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt; element, and set the &lt;code title=attr-embed-src&gt;&lt;a href=#attr-embed-src&gt;src&lt;/a&gt;&lt;/code&gt; attribute of the &lt;code&gt;&lt;a href=#the-embed-element&gt;embed&lt;/a&gt;&lt;/code&gt; element to the address of the resource.&lt;/p&gt; @@ -62988,10 +62982,10 @@ before the page has finished fully loading, the user agent must &lt;a href=#update-the-session-history-with-the-new-page&gt;update the session history with the new page&lt;/a&gt;.&lt;/p&gt; - &lt;p&gt;User agents may add content to the &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element of + &lt;p&gt;User agents may add content to the &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element of the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt;, or attributes to the &lt;code&gt;&lt;a href=#the-embed-element&gt;embed&lt;/a&gt;&lt;/code&gt; element, e.g. to link to a style sheet or an XBL binding, or to give - the document a &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt;.&lt;/p&gt; + the document a &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt;.&lt;/p&gt; &lt;p class=note id=sandboxPluginNavigate&gt;If the &lt;a href=#sandboxed-plugins-browsing-context-flag&gt;sandboxed plugins browsing context flag&lt;/a&gt; was set on the &lt;a href=#browsing-context&gt;browsing @@ -63837,7 +63831,7 @@ &lt;dt&gt;&lt;dfn id=concept-appcache-manifest title=concept-appcache-manifest&gt;The manifest&lt;/dfn&gt; &lt;dd&gt;&lt;p class=note&gt;This is the resource corresponding to the URL - that was given in a master entry's &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element's + that was given in a master entry's &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element's &lt;code title=attr-html-manifest&gt;&lt;a href=#attr-html-manifest&gt;manifest&lt;/a&gt;&lt;/code&gt; attribute. The manifest is fetched and processed during the &lt;a href=#application-cache-download-process&gt;application cache download process&lt;/a&gt;. All the &lt;a href=#concept-appcache-master title=concept-appcache-master&gt;master entries&lt;/a&gt; have the @@ -65052,7 +65046,7 @@ entry&lt;/a&gt;.&lt;/li&gt; &lt;li&gt;&lt;p&gt;As an optimization, if the resource is an HTML or XML file - whose root element is an &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-html-manifest&gt;&lt;a href=#attr-html-manifest&gt;manifest&lt;/a&gt;&lt;/code&gt; attribute whose value + whose root element is an &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-html-manifest&gt;&lt;a href=#attr-html-manifest&gt;manifest&lt;/a&gt;&lt;/code&gt; attribute whose value doesn't match the manifest URL of the application cache being processed, then the user agent should mark the entry as being &lt;a href=#concept-appcache-foreign title=concept-appcache-foreign&gt;foreign&lt;/a&gt;.&lt;/p&gt; @@ -65813,7 +65807,7 @@ run in the context of a document. These mechanisms include, but are probably not limited to:&lt;/p&gt; - &lt;ul&gt;&lt;li&gt;Processing of &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; elements.&lt;/li&gt; + &lt;ul&gt;&lt;li&gt;Processing of &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements.&lt;/li&gt; &lt;li&gt;Processing of inline &lt;code title=&quot;javascript protocol&quot;&gt;&lt;a href=#javascript-protocol&gt;javascript:&lt;/a&gt;&lt;/code&gt; URLs (e.g. the &lt;code title=attr-img-src&gt;&lt;a href=#attr-img-src&gt;src&lt;/a&gt;&lt;/code&gt; attribute of &lt;code&gt;&lt;a href=#the-img-element&gt;img&lt;/a&gt;&lt;/code&gt; @@ -68856,7 +68850,7 @@ &lt;li&gt;&lt;code&gt;&lt;a href=#the-textarea-element&gt;textarea&lt;/a&gt;&lt;/code&gt; elements that are not &lt;a href=#concept-fe-disabled title=concept-fe-disabled&gt;disabled&lt;/a&gt;&lt;/li&gt; - &lt;li&gt;&lt;code&gt;&lt;a href=#the-command&gt;command&lt;/a&gt;&lt;/code&gt; elements that do not have a &lt;code title=attr-command-disabled&gt;&lt;a href=#attr-command-disabled&gt;disabled&lt;/a&gt;&lt;/code&gt; attribute&lt;/li&gt; + &lt;li&gt;&lt;code&gt;&lt;a href=#the-command-element&gt;command&lt;/a&gt;&lt;/code&gt; elements that do not have a &lt;code title=attr-command-disabled&gt;&lt;a href=#attr-command-disabled&gt;disabled&lt;/a&gt;&lt;/code&gt; attribute&lt;/li&gt; &lt;li&gt;Elements with a &lt;code title=attr-draggable&gt;&lt;a href=#the-draggable-attribute&gt;draggable&lt;/a&gt;&lt;/code&gt; attribute set, if that would enable the user agent to allow the @@ -73037,8 +73031,8 @@ receiving streams from remote peers.&lt;/li&gt; &lt;li&gt;Displaying such streams (both the locally-produced ones and the - remotely-obtained ones) locally using the &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; or - &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; elements.&lt;/li&gt; + remotely-obtained ones) locally using the &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; or + &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; elements.&lt;/li&gt; &lt;li&gt;Sending arbitrary data to remote peers.&lt;/li&gt; @@ -73589,8 +73583,8 @@ &lt;li&gt;&lt;p&gt;Return, and run the remaining steps asynchronously.&lt;/li&gt; &lt;li&gt;&lt;p&gt;Generate a file that containing &lt;var title=&quot;&quot;&gt;data&lt;/var&gt; in - a format supported by the user agent for use in &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; - and &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; elements.&lt;/li&gt; + a format supported by the user agent for use in &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; + and &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; elements.&lt;/li&gt; &lt;li&gt;&lt;p&gt;Let &lt;var title=&quot;&quot;&gt;blob&lt;/var&gt; be a &lt;code&gt;Blob&lt;/code&gt; object representing the contents of the file generated in the previous @@ -73688,7 +73682,7 @@ &lt;p&gt;For audio and video streams, the data exposed on that stream must be in a format supported by the user agent for use in - &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; and &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; elements.&lt;/p&gt; + &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; and &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; elements.&lt;/p&gt; &lt;p class=bookkeeping&gt;A &lt;dfn id=blob-url&gt;Blob URL&lt;/dfn&gt; is the same as what the File API specification calls a &lt;span&gt;Blob URI&lt;/span&gt;, except that @@ -74140,13 +74134,13 @@ &lt;p&gt;User agents may negotiate any codec and any resolution, bitrate, or other quality metric. User agents are encouraged to initially negotiate for the native resolution of the stream. For streams that - are then rendered (using a &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element), user agents + are then rendered (using a &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element), user agents are encouraged to renegotiate for a resolution that matches the rendered display size.&lt;/p&gt; &lt;p class=note&gt;Starting with the native resolution means that if the Web application notifies its peer of the native resolution as it - starts sending data, and the peer prepares its &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; + starts sending data, and the peer prepares its &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element accordingly, there will be no need for a renegotiation once the stream is flowing.&lt;/p&gt; @@ -75611,7 +75605,7 @@ &lt;li&gt;Any number of &lt;a href=#syntax-comments title=syntax-comments&gt;comments&lt;/a&gt; and &lt;a href=#space-character title=&quot;space character&quot;&gt;space characters&lt;/a&gt;.&lt;/li&gt; - &lt;li&gt;The root element, in the form of an &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; &lt;a href=#syntax-elements title=syntax-elements&gt;element&lt;/a&gt;.&lt;/li&gt; + &lt;li&gt;The root element, in the form of an &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; &lt;a href=#syntax-elements title=syntax-elements&gt;element&lt;/a&gt;.&lt;/li&gt; &lt;li&gt;Any number of &lt;a href=#syntax-comments title=syntax-comments&gt;comments&lt;/a&gt; and &lt;a href=#space-character title=&quot;space character&quot;&gt;space characters&lt;/a&gt;.&lt;/li&gt; @@ -75625,19 +75619,19 @@ &lt;div class=note&gt; - &lt;p&gt;Space characters before the root &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element, and - space characters at the start of the &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element and - before the &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element, will be dropped when the + &lt;p&gt;Space characters before the root &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element, and + space characters at the start of the &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element and + before the &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element, will be dropped when the document is parsed; space characters &lt;em&gt;after&lt;/em&gt; the root - &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element will be parsed as if they were at the end + &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element will be parsed as if they were at the end of the &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt; element. Thus, space characters around the root element do not round-trip.&lt;/p&gt; &lt;p&gt;It is suggested that newlines be inserted after the DOCTYPE, after any comments that are before the root element, after the - &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element's start tag (if it is not &lt;a href=#syntax-tag-omission title=syntax-tag-omission&gt;omitted&lt;/a&gt;), and after any comments - that are inside the &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element but before the - &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element.&lt;/p&gt; + &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element's start tag (if it is not &lt;a href=#syntax-tag-omission title=syntax-tag-omission&gt;omitted&lt;/a&gt;), and after any comments + that are inside the &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element but before the + &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element.&lt;/p&gt; &lt;/div&gt; @@ -75742,21 +75736,21 @@ &lt;dl&gt;&lt;dt&gt;&lt;dfn id=void-elements&gt;Void elements&lt;/dfn&gt;&lt;/dt&gt; &lt;dd&gt;&lt;code&gt;&lt;a href=#the-area-element&gt;area&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-base-element&gt;base&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-br-element&gt;br&lt;/a&gt;&lt;/code&gt;, - &lt;code&gt;&lt;a href=#the-col-element&gt;col&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-command&gt;command&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-embed-element&gt;embed&lt;/a&gt;&lt;/code&gt;, + &lt;code&gt;&lt;a href=#the-col-element&gt;col&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-command-element&gt;command&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-embed-element&gt;embed&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-hr-element&gt;hr&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-img-element&gt;img&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-input-element&gt;input&lt;/a&gt;&lt;/code&gt;, - &lt;code&gt;&lt;a href=#the-keygen-element&gt;keygen&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-link-element&gt;link&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt;, + &lt;code&gt;&lt;a href=#the-keygen-element&gt;keygen&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-link-element&gt;link&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-param-element&gt;param&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-source-element&gt;source&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-track-element&gt;track&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-wbr-element&gt;wbr&lt;/a&gt;&lt;/code&gt;&lt;/dd&gt; &lt;!-- see also other places that say VOIDLIST --&gt; &lt;dt&gt;&lt;dfn id=raw-text-elements&gt;Raw text elements&lt;/dfn&gt;&lt;/dt&gt; - &lt;dd&gt;&lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-style-element&gt;style&lt;/a&gt;&lt;/code&gt;&lt;/dd&gt; &lt;!-- iframe and + &lt;dd&gt;&lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-style-element&gt;style&lt;/a&gt;&lt;/code&gt;&lt;/dd&gt; &lt;!-- iframe and noscript don't count as raw text for syntax purposes --&gt; &lt;dt&gt;&lt;dfn id=rcdata-elements&gt;RCDATA elements&lt;/dfn&gt;&lt;/dt&gt; - &lt;dd&gt;&lt;code&gt;&lt;a href=#the-textarea-element&gt;textarea&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt;&lt;/dd&gt; + &lt;dd&gt;&lt;code&gt;&lt;a href=#the-textarea-element&gt;textarea&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt;&lt;/dd&gt; &lt;dt&gt;&lt;dfn id=foreign-elements&gt;Foreign elements&lt;/dfn&gt;&lt;/dt&gt; @@ -76110,34 +76104,34 @@ &lt;p class=note&gt;Omitting an element's &lt;a href=#syntax-start-tag title=syntax-start-tag&gt;start tag&lt;/a&gt; does not mean the element is not present; it is implied, but it is still there. An HTML - document always has a root &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element, even if the + document always has a root &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element, even if the string &lt;code title=&quot;&quot;&gt;&lt;html&gt;&lt;/code&gt; doesn't appear anywhere in the markup.&lt;/p&gt; &lt;!-- &lt;html&gt; --&gt; - &lt;p&gt;An &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element's &lt;a href=#syntax-start-tag title=syntax-start-tag&gt;start tag&lt;/a&gt; may be omitted if the - first thing inside the &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element is not a &lt;a href=#syntax-comments title=syntax-comments&gt;comment&lt;/a&gt;.&lt;/p&gt; + &lt;p&gt;An &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element's &lt;a href=#syntax-start-tag title=syntax-start-tag&gt;start tag&lt;/a&gt; may be omitted if the + first thing inside the &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element is not a &lt;a href=#syntax-comments title=syntax-comments&gt;comment&lt;/a&gt;.&lt;/p&gt; &lt;!-- &lt;/html&gt; --&gt; - &lt;p&gt;An &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element's &lt;a href=#syntax-end-tag title=syntax-end-tag&gt;end - tag&lt;/a&gt; may be omitted if the &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element is not + &lt;p&gt;An &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element's &lt;a href=#syntax-end-tag title=syntax-end-tag&gt;end + tag&lt;/a&gt; may be omitted if the &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element is not immediately followed by a &lt;a href=#syntax-comments title=syntax-comments&gt;comment&lt;/a&gt;.&lt;/p&gt; &lt;!-- &lt;head&gt; --&gt; - &lt;p&gt;A &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element's &lt;a href=#syntax-start-tag title=syntax-start-tag&gt;start tag&lt;/a&gt; may be omitted if the + &lt;p&gt;A &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element's &lt;a href=#syntax-start-tag title=syntax-start-tag&gt;start tag&lt;/a&gt; may be omitted if the element is empty, or if the first thing inside the - &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element is an element.&lt;/p&gt; + &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element is an element.&lt;/p&gt; &lt;!-- &lt;/head&gt; --&gt; - &lt;p&gt;A &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element's &lt;a href=#syntax-end-tag title=syntax-end-tag&gt;end - tag&lt;/a&gt; may be omitted if the &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element is not + &lt;p&gt;A &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element's &lt;a href=#syntax-end-tag title=syntax-end-tag&gt;end + tag&lt;/a&gt; may be omitted if the &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element is not immediately followed by a &lt;a href=#space-character&gt;space character&lt;/a&gt; or a &lt;a href=#syntax-comments title=syntax-comments&gt;comment&lt;/a&gt;.&lt;/p&gt; &lt;!-- &lt;body&gt; --&gt; &lt;p&gt;A &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt; element's &lt;a href=#syntax-start-tag title=syntax-start-tag&gt;start tag&lt;/a&gt; may be omitted if the element is empty, or if the first thing inside the &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt; element is not a &lt;a href=#space-character&gt;space character&lt;/a&gt; or a &lt;a href=#syntax-comments title=syntax-comments&gt;comment&lt;/a&gt;, except if the first thing - inside the &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt; element is a &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; or + inside the &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt; element is a &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; or &lt;code&gt;&lt;a href=#the-style-element&gt;style&lt;/a&gt;&lt;/code&gt; element. &lt;!-- Note that even if the &lt;/head&gt; end tag is present, the parser makes &lt;style&gt; and &lt;script&gt; elements between &lt;/head&gt; and &lt;body&gt; end up in the &lt;head&gt; instead of implying @@ -76176,7 +76170,7 @@ &lt;code&gt;&lt;a href=#the-fieldset-element&gt;fieldset&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-footer-element&gt;footer&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-form-element&gt;form&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements&gt;h1&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements&gt;h2&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements&gt;h3&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements&gt;h4&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements&gt;h5&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements&gt;h6&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-header-element&gt;header&lt;/a&gt;&lt;/code&gt;, - &lt;code&gt;&lt;a href=#the-hgroup-element&gt;hgroup&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-hr-element&gt;hr&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt;, + &lt;code&gt;&lt;a href=#the-hgroup-element&gt;hgroup&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-hr-element&gt;hr&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-nav-element&gt;nav&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-ol-element&gt;ol&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-pre-element&gt;pre&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-section-element&gt;section&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt;, or &lt;code&gt;&lt;a href=#the-ul-element&gt;ul&lt;/a&gt;&lt;/code&gt;, element, or if there is no more content in the parent element and @@ -77460,7 +77454,7 @@ then switch the &lt;a href=#insertion-mode&gt;insertion mode&lt;/a&gt; to &quot;&lt;a href=#parsing-main-intable title=&quot;insertion mode: in table&quot;&gt;in table&lt;/a&gt;&quot; and abort these steps.&lt;/li&gt; - &lt;li&gt;If &lt;var title=&quot;&quot;&gt;node&lt;/var&gt; is a &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element, + &lt;li&gt;If &lt;var title=&quot;&quot;&gt;node&lt;/var&gt; is a &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element, then switch the &lt;a href=#insertion-mode&gt;insertion mode&lt;/a&gt; to &quot;&lt;a href=#parsing-main-inbody title=&quot;insertion mode: in body&quot;&gt;in body&lt;/a&gt;&quot; (&quot;&lt;a href=#parsing-main-inbody title=&quot;insertion mode: in body&quot;&gt;in body&lt;/a&gt;&quot;! &lt;em&gt; not &quot;&lt;a href=#parsing-main-inhead title=&quot;insertion mode: in head&quot;&gt;in head&lt;/a&gt;&quot;&lt;/em&gt;!) and abort these steps. (&lt;a href=#fragment-case&gt;fragment case&lt;/a&gt;)&lt;/li&gt; &lt;!-- This is only here for now in case people think that the spec accidentally @@ -77482,7 +77476,7 @@ then switch the &lt;a href=#insertion-mode&gt;insertion mode&lt;/a&gt; to &quot;&lt;a href=#parsing-main-inframeset title=&quot;insertion mode: in frameset&quot;&gt;in frameset&lt;/a&gt;&quot; and abort these steps. (&lt;a href=#fragment-case&gt;fragment case&lt;/a&gt;)&lt;/li&gt; - &lt;li&gt;If &lt;var title=&quot;&quot;&gt;node&lt;/var&gt; is an &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element, + &lt;li&gt;If &lt;var title=&quot;&quot;&gt;node&lt;/var&gt; is an &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element, then &lt;!--: if the &lt;span&gt;&lt;code title=&quot;&quot;&gt;head&lt;/code&gt; element pointer&lt;/span&gt; is null,--&gt; switch the &lt;a href=#insertion-mode&gt;insertion mode&lt;/a&gt; to &quot;&lt;a href=#the-before-head-insertion-mode title=&quot;insertion mode: before head&quot;&gt;before @@ -77513,17 +77507,17 @@ &lt;p&gt;The &quot;&lt;a href=#the-before-html-insertion-mode title=&quot;insertion mode: before html&quot;&gt;before html&lt;/a&gt;&quot; &lt;a href=#insertion-mode&gt;insertion mode&lt;/a&gt; creates the - &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; root element node, which is then added to the + &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; root element node, which is then added to the stack.&lt;/p&gt; &lt;p&gt;In the &lt;a href=#fragment-case&gt;fragment case&lt;/a&gt;, the &lt;a href=#stack-of-open-elements&gt;stack of open - elements&lt;/a&gt; is initialized to contain an &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; + elements&lt;/a&gt; is initialized to contain an &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element that is created as part of &lt;a href=#html-fragment-parsing-algorithm title=&quot;html fragment parsing algorithm&quot;&gt;that algorithm&lt;/a&gt;. (The &lt;a href=#fragment-case&gt;fragment case&lt;/a&gt; skips the &quot;&lt;a href=#the-before-html-insertion-mode title=&quot;insertion mode: before html&quot;&gt;before html&lt;/a&gt;&quot; &lt;a href=#insertion-mode&gt;insertion mode&lt;/a&gt;.)&lt;/p&gt; - &lt;p&gt;The &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; node, however it is created, is the topmost + &lt;p&gt;The &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; node, however it is created, is the topmost node of the stack. It only gets popped off the stack when the parser &lt;a href=#stop-parsing title=&quot;stop parsing&quot;&gt;finishes&lt;/a&gt;.&lt;/p&gt; @@ -77535,7 +77529,7 @@ one. If there is no &lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt; element in the &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt; (&lt;a href=#fragment-case&gt;fragment case&lt;/a&gt;), then the &lt;a href=#current-table&gt;current table&lt;/a&gt; is the first element in the &lt;a href=#stack-of-open-elements&gt;stack - of open elements&lt;/a&gt; (the &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element).&lt;/p&gt; + of open elements&lt;/a&gt; (the &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element).&lt;/p&gt; &lt;p&gt;Elements in the stack fall into the following categories:&lt;/p&gt; @@ -77546,28 +77540,28 @@ &lt;code&gt;&lt;a href=#the-base-element&gt;base&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#basefont&gt;basefont&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#bgsound&gt;bgsound&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-blockquote-element&gt;blockquote&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-br-element&gt;br&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-button-element&gt;button&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-caption-element&gt;caption&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#center&gt;center&lt;/a&gt;&lt;/code&gt;, - &lt;code&gt;&lt;a href=#the-col-element&gt;col&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-colgroup-element&gt;colgroup&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-command&gt;command&lt;/a&gt;&lt;/code&gt;, + &lt;code&gt;&lt;a href=#the-col-element&gt;col&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-colgroup-element&gt;colgroup&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-command-element&gt;command&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-dd-element&gt;dd&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-details-element&gt;details&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#dir&gt;dir&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-div-element&gt;div&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-dl-element&gt;dl&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-dt-element&gt;dt&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-embed-element&gt;embed&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-fieldset-element&gt;fieldset&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-figcaption-element&gt;figcaption&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-figure-element&gt;figure&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-footer-element&gt;footer&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-form-element&gt;form&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#frame&gt;frame&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#frameset&gt;frameset&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements&gt;h1&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements&gt;h2&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements&gt;h3&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements&gt;h4&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements&gt;h5&lt;/a&gt;&lt;/code&gt;, - &lt;code&gt;&lt;a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements&gt;h6&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-header-element&gt;header&lt;/a&gt;&lt;/code&gt;, - &lt;code&gt;&lt;a href=#the-hgroup-element&gt;hgroup&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-hr-element&gt;hr&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;, + &lt;code&gt;&lt;a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements&gt;h6&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-header-element&gt;header&lt;/a&gt;&lt;/code&gt;, + &lt;code&gt;&lt;a href=#the-hgroup-element&gt;hgroup&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-hr-element&gt;hr&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-iframe-element&gt;iframe&lt;/a&gt;&lt;/code&gt;, &lt;!-- &lt;code&gt;image&lt;/code&gt;, (commented out because this isn't an element that can end up on the stack, so it doesn't matter) --&gt; &lt;code&gt;&lt;a href=#the-img-element&gt;img&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-input-element&gt;input&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#isindex-0&gt;isindex&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-li-element&gt;li&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-link-element&gt;link&lt;/a&gt;&lt;/code&gt;, - &lt;code&gt;&lt;a href=#listing&gt;listing&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-marquee-element&gt;marquee&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt;, - &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-nav-element&gt;nav&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#noembed&gt;noembed&lt;/a&gt;&lt;/code&gt;, + &lt;code&gt;&lt;a href=#listing&gt;listing&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-marquee-element&gt;marquee&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt;, + &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-nav-element&gt;nav&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#noembed&gt;noembed&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#noframes&gt;noframes&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-object-element&gt;object&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-ol-element&gt;ol&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-param-element&gt;param&lt;/a&gt;&lt;/code&gt;, - &lt;code&gt;&lt;a href=#plaintext&gt;plaintext&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-pre-element&gt;pre&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt;, + &lt;code&gt;&lt;a href=#plaintext&gt;plaintext&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-pre-element&gt;pre&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-section-element&gt;section&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-select-element&gt;select&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-style-element&gt;style&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-summary-element&gt;summary&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-tbody-element&gt;tbody&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-td-element&gt;td&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-textarea-element&gt;textarea&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-tfoot-element&gt;tfoot&lt;/a&gt;&lt;/code&gt;, - &lt;code&gt;&lt;a href=#the-th-element&gt;th&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-thead-element&gt;thead&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt;, + &lt;code&gt;&lt;a href=#the-th-element&gt;th&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-thead-element&gt;thead&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-tr-element&gt;tr&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-ul-element&gt;ul&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-wbr-element&gt;wbr&lt;/a&gt;&lt;/code&gt;, and &lt;code&gt;&lt;a href=#xmp&gt;xmp&lt;/a&gt;&lt;/code&gt;; MathML's &lt;code title=&quot;&quot;&gt;mi&lt;/code&gt;, &lt;code title=&quot;&quot;&gt;mo&lt;/code&gt;, &lt;code title=&quot;&quot;&gt;mn&lt;/code&gt;, &lt;code title=&quot;&quot;&gt;ms&lt;/code&gt;, &lt;code title=&quot;&quot;&gt;mtext&lt;/code&gt;, and &lt;code title=&quot;&quot;&gt;annotation-xml&lt;/code&gt;; and SVG's &lt;code title=&quot;&quot;&gt;foreignObject&lt;/code&gt;, &lt;code title=&quot;&quot;&gt;desc&lt;/code&gt;, and &lt;code title=&quot;&quot;&gt;title&lt;/code&gt;.&lt;/dd&gt; &lt;!-- we could actually put @@ -77604,7 +77598,7 @@ entry in the &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt; and return to step 2. (This will never fail, since the loop will always terminate in the previous step if the top of the stack &mdash; an - &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element &mdash; is reached.)&lt;/li&gt; + &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element &mdash; is reached.)&lt;/li&gt; &lt;/ol&gt;&lt;p&gt;The &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt; is said to &lt;dfn id=has-an-element-in-scope title=&quot;has an element in scope&quot;&gt;have an element in scope&lt;/dfn&gt; when it &lt;a href=#has-an-element-in-the-specific-scope&gt;has an element in the specific scope&lt;/a&gt; consisting @@ -77612,7 +77606,7 @@ &lt;ul class=brief&gt;&lt;li&gt;&lt;code&gt;&lt;a href=#the-applet-element&gt;applet&lt;/a&gt;&lt;/code&gt; in the &lt;a href=#html-namespace-0&gt;HTML namespace&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-caption-element&gt;caption&lt;/a&gt;&lt;/code&gt; in the &lt;a href=#html-namespace-0&gt;HTML namespace&lt;/a&gt;&lt;/li&gt; - &lt;li&gt;&lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; in the &lt;a href=#html-namespace-0&gt;HTML namespace&lt;/a&gt;&lt;/li&gt; &lt;!-- (This can only happen if the &lt;var title=&quot;&quot;&gt;node&lt;/var&gt; is the topmost node of the &lt;span&gt;stack of open elements&lt;/span&gt;, and prevents the next step from being invoked if there are no more elements in the stack.) --&gt; + &lt;li&gt;&lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; in the &lt;a href=#html-namespace-0&gt;HTML namespace&lt;/a&gt;&lt;/li&gt; &lt;!-- (This can only happen if the &lt;var title=&quot;&quot;&gt;node&lt;/var&gt; is the topmost node of the &lt;span&gt;stack of open elements&lt;/span&gt;, and prevents the next step from being invoked if there are no more elements in the stack.) --&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt; in the &lt;a href=#html-namespace-0&gt;HTML namespace&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-td-element&gt;td&lt;/a&gt;&lt;/code&gt; in the &lt;a href=#html-namespace-0&gt;HTML namespace&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-th-element&gt;th&lt;/a&gt;&lt;/code&gt; in the &lt;a href=#html-namespace-0&gt;HTML namespace&lt;/a&gt;&lt;/li&gt; @@ -77646,7 +77640,7 @@ scope&lt;/dfn&gt; when it &lt;a href=#has-an-element-in-the-specific-scope&gt;has an element in the specific scope&lt;/a&gt; consisting of the following element types:&lt;/p&gt; - &lt;ul class=brief&gt;&lt;li&gt;&lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; in the &lt;a href=#html-namespace-0&gt;HTML namespace&lt;/a&gt;&lt;/li&gt; &lt;!-- (This can only happen if the &lt;var title=&quot;&quot;&gt;node&lt;/var&gt; is the topmost node of the &lt;span&gt;stack of open elements&lt;/span&gt;, and prevents the next step from being invoked if there are no more elements in the stack.) --&gt; + &lt;ul class=brief&gt;&lt;li&gt;&lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; in the &lt;a href=#html-namespace-0&gt;HTML namespace&lt;/a&gt;&lt;/li&gt; &lt;!-- (This can only happen if the &lt;var title=&quot;&quot;&gt;node&lt;/var&gt; is the topmost node of the &lt;span&gt;stack of open elements&lt;/span&gt;, and prevents the next step from being invoked if there are no more elements in the stack.) --&gt; &lt;li&gt;&lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt; in the &lt;a href=#html-namespace-0&gt;HTML namespace&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;&lt;p&gt;The &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt; is said to &lt;dfn id=has-an-element-in-select-scope title=&quot;has an element in select scope&quot;&gt;have an element in select scope&lt;/dfn&gt; when it &lt;a href=#has-an-element-in-the-specific-scope&gt;has an element in the specific @@ -77790,7 +77784,7 @@ pointer&lt;/dfn&gt; and the &lt;dfn id=form-element-pointer&gt;&lt;code title=&quot;&quot;&gt;form&lt;/code&gt; element pointer&lt;/dfn&gt; are both null.&lt;/p&gt; - &lt;p&gt;Once a &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element has been parsed (whether + &lt;p&gt;Once a &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element has been parsed (whether implicitly or explicitly) the &lt;a href=#head-element-pointer&gt;&lt;code title=&quot;&quot;&gt;head&lt;/code&gt; element pointer&lt;/a&gt; gets set to point to this node.&lt;/p&gt; @@ -77809,7 +77803,7 @@ &lt;p class=note&gt;The &lt;a href=#scripting-flag&gt;scripting flag&lt;/a&gt; can be enabled even when the parser was originally created for the &lt;a href=#html-fragment-parsing-algorithm&gt;HTML fragment - parsing algorithm&lt;/a&gt;, even though &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; elements + parsing algorithm&lt;/a&gt;, even though &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements don't execute in that case.&lt;/p&gt; &lt;p&gt;The &lt;dfn id=frameset-ok-flag&gt;frameset-ok flag&lt;/dfn&gt; is set to &quot;ok&quot; when the parser is @@ -77857,7 +77851,7 @@ &lt;a href=#tree-construction&gt;tree construction&lt;/a&gt; stage. The tree construction stage can affect the state of the tokenization stage, and can insert additional characters into the stream. (For example, the - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element can result in scripts executing and + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element can result in scripts executing and using the &lt;a href=#dynamic-markup-insertion&gt;dynamic markup insertion&lt;/a&gt; APIs to insert characters into the stream being tokenized.)&lt;/p&gt; @@ -80316,7 +80310,7 @@ &lt;p&gt;If there is no &lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt; element in the &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt; (&lt;a href=#fragment-case&gt;fragment case&lt;/a&gt;), then the &lt;i&gt;&lt;a href=#foster-parent-element&gt;foster parent element&lt;/a&gt;&lt;/i&gt; is the first element in the &lt;a href=#stack-of-open-elements&gt;stack - of open elements&lt;/a&gt; (the &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element). Otherwise, + of open elements&lt;/a&gt; (the &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element). Otherwise, if there is a &lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt; element in the &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt;, but the last &lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt; element in the &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt; has no parent, or its parent @@ -80593,7 +80587,7 @@ &lt;dt&gt;Anything else&lt;/dt&gt; &lt;dd&gt; - &lt;p&gt;Create an &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element. Append it to the + &lt;p&gt;Create an &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element. Append it to the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt; object. Put this element in the &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt;.&lt;/p&gt; @@ -80648,7 +80642,7 @@ &lt;p&gt;&lt;a href=#insert-an-html-element&gt;Insert an HTML element&lt;/a&gt; for the token.&lt;/p&gt; &lt;p&gt;Set the &lt;a href=#head-element-pointer&gt;&lt;code title=&quot;&quot;&gt;head&lt;/code&gt; element pointer&lt;/a&gt; - to the newly created &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element.&lt;/p&gt; + to the newly created &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element.&lt;/p&gt; &lt;p&gt;Switch the &lt;a href=#insertion-mode&gt;insertion mode&lt;/a&gt; to &quot;&lt;a href=#parsing-main-inhead title=&quot;insertion mode: in head&quot;&gt;in head&lt;/a&gt;&quot;.&lt;/p&gt; @@ -80795,7 +80789,7 @@ &lt;li&gt;&lt;p&gt;If the parser was originally created for the &lt;a href=#html-fragment-parsing-algorithm&gt;HTML fragment parsing algorithm&lt;/a&gt;, then mark the - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element as &lt;a href=#already-started&gt;&quot;already + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element as &lt;a href=#already-started&gt;&quot;already started&quot;&lt;/a&gt;. (&lt;a href=#fragment-case&gt;fragment case&lt;/a&gt;)&lt;/li&gt; &lt;li&gt;&lt;p&gt;Append the new element to the &lt;a href=#current-node&gt;current node&lt;/a&gt; @@ -80816,7 +80810,7 @@ &lt;dd&gt; &lt;p&gt;Pop the &lt;a href=#current-node&gt;current node&lt;/a&gt; (which will be the - &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element) off the &lt;a href=#stack-of-open-elements&gt;stack of open + &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element) off the &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;Switch the &lt;a href=#insertion-mode&gt;insertion mode&lt;/a&gt; to &quot;&lt;a href=#the-after-head-insertion-mode title=&quot;insertion mode: after head&quot;&gt;after head&lt;/a&gt;&quot;.&lt;/p&gt; @@ -80865,7 +80859,7 @@ &lt;p&gt;Pop the &lt;a href=#current-node&gt;current node&lt;/a&gt; (which will be a &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt; element) from the &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt;; the new &lt;a href=#current-node&gt;current node&lt;/a&gt; will be a - &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; element.&lt;/p&gt; + &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; element.&lt;/p&gt; &lt;p&gt;Switch the &lt;a href=#insertion-mode&gt;insertion mode&lt;/a&gt; to &quot;&lt;a href=#parsing-main-inhead title=&quot;insertion mode: in head&quot;&gt;in head&lt;/a&gt;&quot;.&lt;/p&gt; @@ -81105,7 +81099,7 @@ &lt;li&gt;&lt;p&gt;Pop all the nodes from the bottom of the &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt;, from the &lt;a href=#current-node&gt;current node&lt;/a&gt; up to, - but not including, the root &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element.&lt;/p&gt; + but not including, the root &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element.&lt;/p&gt; &lt;li&gt;&lt;p&gt;&lt;a href=#insert-an-html-element&gt;Insert an HTML element&lt;/a&gt; for the token.&lt;/li&gt; @@ -81123,7 +81117,7 @@ &lt;code&gt;&lt;a href=#the-tbody-element&gt;tbody&lt;/a&gt;&lt;/code&gt; element, a &lt;code&gt;&lt;a href=#the-td-element&gt;td&lt;/a&gt;&lt;/code&gt; element, a &lt;code&gt;&lt;a href=#the-tfoot-element&gt;tfoot&lt;/a&gt;&lt;/code&gt; element, a &lt;code&gt;&lt;a href=#the-th-element&gt;th&lt;/a&gt;&lt;/code&gt; element, a &lt;code&gt;&lt;a href=#the-thead-element&gt;thead&lt;/a&gt;&lt;/code&gt; element, a &lt;code&gt;&lt;a href=#the-tr-element&gt;tr&lt;/a&gt;&lt;/code&gt; element, the - &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt; element, or the &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element, then + &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt; element, or the &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element, then this is a &lt;a href=#parse-error&gt;parse error&lt;/a&gt;.&lt;/p&gt; &lt;!-- (some of those are fragment cases) --&gt; @@ -81150,7 +81144,7 @@ &lt;code&gt;&lt;a href=#the-td-element&gt;td&lt;/a&gt;&lt;/code&gt; element, a &lt;code&gt;&lt;a href=#the-tfoot-element&gt;tfoot&lt;/a&gt;&lt;/code&gt; element, a &lt;code&gt;&lt;a href=#the-th-element&gt;th&lt;/a&gt;&lt;/code&gt; element, a &lt;code&gt;&lt;a href=#the-thead-element&gt;thead&lt;/a&gt;&lt;/code&gt; element, a &lt;code&gt;&lt;a href=#the-tr-element&gt;tr&lt;/a&gt;&lt;/code&gt; element, the &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt; element, or the - &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element, then this is a &lt;a href=#parse-error&gt;parse + &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element, then this is a &lt;a href=#parse-error&gt;parse error&lt;/a&gt;.&lt;/p&gt; &lt;!-- (some of those are fragment cases, e.g. for &lt;tbody&gt; you'd have hit the first paragraph since the &lt;body&gt; wouldn't be in scope, unless it was a fragment case) --&gt; @@ -82278,8 +82272,8 @@ &lt;!-- can't be the fragment case --&gt; &lt;p&gt;&lt;a href=#parse-error&gt;Parse error&lt;/a&gt;.&lt;/p&gt; - &lt;p&gt;If the &lt;a href=#current-node&gt;current node&lt;/a&gt; is a &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; - element, mark the &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element as &lt;a href=#already-started&gt;&quot;already + &lt;p&gt;If the &lt;a href=#current-node&gt;current node&lt;/a&gt; is a &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; + element, mark the &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element as &lt;a href=#already-started&gt;&quot;already started&quot;&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;Pop the &lt;a href=#current-node&gt;current node&lt;/a&gt; off the &lt;a href=#stack-of-open-elements&gt;stack of open @@ -82296,7 +82290,7 @@ &lt;p&gt;&lt;a href=#provide-a-stable-state&gt;Provide a stable state&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;Let &lt;var title=&quot;&quot;&gt;script&lt;/var&gt; be the &lt;a href=#current-node&gt;current node&lt;/a&gt; - (which will be a &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element).&lt;/p&gt; + (which will be a &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element).&lt;/p&gt; &lt;p&gt;Pop the &lt;a href=#current-node&gt;current node&lt;/a&gt; off the &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt;.&lt;/p&gt; @@ -82576,7 +82570,7 @@ &lt;dd&gt; &lt;p&gt;If the &lt;a href=#current-node&gt;current node&lt;/a&gt; is not the root - &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element, then this is a &lt;a href=#parse-error&gt;parse + &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element, then this is a &lt;a href=#parse-error&gt;parse error&lt;/a&gt;.&lt;/p&gt; &lt;p class=note&gt;It can only be the &lt;a href=#current-node&gt;current node&lt;/a&gt; in @@ -82602,11 +82596,11 @@ &lt;/dl&gt;&lt;p&gt;When the steps above require the UA to &lt;dfn id=clear-the-stack-back-to-a-table-context&gt;clear the stack back to a table context&lt;/dfn&gt;, it means that the UA must, while the &lt;a href=#current-node&gt;current node&lt;/a&gt; is not a &lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt; - element or an &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element, pop elements from the + element or an &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element, pop elements from the &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt;.&lt;/p&gt; &lt;p class=note&gt;The &lt;a href=#current-node&gt;current node&lt;/a&gt; being an - &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element after this process is a &lt;a href=#fragment-case&gt;fragment + &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element after this process is a &lt;a href=#fragment-case&gt;fragment case&lt;/a&gt;.&lt;/p&gt; @@ -82755,7 +82749,7 @@ &lt;dd&gt; &lt;p&gt;If the &lt;a href=#current-node&gt;current node&lt;/a&gt; is the root - &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element, then this is a &lt;a href=#parse-error&gt;parse + &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element, then this is a &lt;a href=#parse-error&gt;parse error&lt;/a&gt;; ignore the token. (&lt;a href=#fragment-case&gt;fragment case&lt;/a&gt;)&lt;/p&gt; @@ -82774,7 +82768,7 @@ &lt;dt&gt;An end-of-file token&lt;/dt&gt; &lt;dd&gt; - &lt;p&gt;If the &lt;a href=#current-node&gt;current node&lt;/a&gt; is the root &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; + &lt;p&gt;If the &lt;a href=#current-node&gt;current node&lt;/a&gt; is the root &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element, then &lt;a href=#stop-parsing&gt;stop parsing&lt;/a&gt;. (&lt;a href=#fragment-case&gt;fragment case&lt;/a&gt;)&lt;/p&gt; @@ -82874,12 +82868,12 @@ &lt;/dl&gt;&lt;p&gt;When the steps above require the UA to &lt;dfn id=clear-the-stack-back-to-a-table-body-context&gt;clear the stack back to a table body context&lt;/dfn&gt;, it means that the UA must, while the &lt;a href=#current-node&gt;current node&lt;/a&gt; is not a &lt;code&gt;&lt;a href=#the-tbody-element&gt;tbody&lt;/a&gt;&lt;/code&gt;, - &lt;code&gt;&lt;a href=#the-tfoot-element&gt;tfoot&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-thead-element&gt;thead&lt;/a&gt;&lt;/code&gt;, or &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; + &lt;code&gt;&lt;a href=#the-tfoot-element&gt;tfoot&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-thead-element&gt;thead&lt;/a&gt;&lt;/code&gt;, or &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element, pop elements from the &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt;.&lt;/p&gt; &lt;p class=note&gt;The &lt;a href=#current-node&gt;current node&lt;/a&gt; being an - &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element after this process is a &lt;a href=#fragment-case&gt;fragment + &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element after this process is a &lt;a href=#fragment-case&gt;fragment case&lt;/a&gt;.&lt;/p&gt; @@ -82965,11 +82959,11 @@ &lt;/dl&gt;&lt;p&gt;When the steps above require the UA to &lt;dfn id=clear-the-stack-back-to-a-table-row-context&gt;clear the stack back to a table row context&lt;/dfn&gt;, it means that the UA must, while the &lt;a href=#current-node&gt;current node&lt;/a&gt; is not a &lt;code&gt;&lt;a href=#the-tr-element&gt;tr&lt;/a&gt;&lt;/code&gt; - element or an &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element, pop elements from the + element or an &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element, pop elements from the &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt;.&lt;/p&gt; &lt;p class=note&gt;The &lt;a href=#current-node&gt;current node&lt;/a&gt; being an - &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element after this process is a &lt;a href=#fragment-case&gt;fragment + &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element after this process is a &lt;a href=#fragment-case&gt;fragment case&lt;/a&gt;.&lt;/p&gt; @@ -83201,7 +83195,7 @@ &lt;dd&gt; &lt;p&gt;If the &lt;a href=#current-node&gt;current node&lt;/a&gt; is not the root - &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element, then this is a &lt;a href=#parse-error&gt;parse + &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element, then this is a &lt;a href=#parse-error&gt;parse error&lt;/a&gt;.&lt;/p&gt; &lt;p class=note&gt;It can only be the &lt;a href=#current-node&gt;current node&lt;/a&gt; in @@ -83262,7 +83256,7 @@ &lt;dt&gt;A comment token&lt;/dt&gt; &lt;dd&gt; &lt;p&gt;Append a &lt;code&gt;&lt;a href=#comment-0&gt;Comment&lt;/a&gt;&lt;/code&gt; node to the first element in - the &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt; (the &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; + the &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt; (the &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element), with the &lt;code title=&quot;&quot;&gt;data&lt;/code&gt; attribute set to the data given in the comment token.&lt;/p&gt; &lt;/dd&gt; @@ -83343,7 +83337,7 @@ &lt;dd&gt; &lt;p&gt;If the &lt;a href=#current-node&gt;current node&lt;/a&gt; is the root - &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element, then this is a &lt;a href=#parse-error&gt;parse + &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element, then this is a &lt;a href=#parse-error&gt;parse error&lt;/a&gt;; ignore the token. (&lt;a href=#fragment-case&gt;fragment case&lt;/a&gt;)&lt;/p&gt; @@ -83381,7 +83375,7 @@ &lt;dd&gt; &lt;p&gt;If the &lt;a href=#current-node&gt;current node&lt;/a&gt; is not the root - &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element, then this is a &lt;a href=#parse-error&gt;parse + &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element, then this is a &lt;a href=#parse-error&gt;parse error&lt;/a&gt;.&lt;/p&gt; &lt;p class=note&gt;It can only be the &lt;a href=#current-node&gt;current node&lt;/a&gt; in @@ -83758,17 +83752,17 @@ substeps:&lt;/p&gt; &lt;ol&gt;&lt;li&gt;&lt;p&gt;&lt;a href=#spin-the-event-loop&gt;Spin the event loop&lt;/a&gt; until the first - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; in the &lt;a href=#list-of-scripts-that-will-execute-when-the-document-has-finished-parsing&gt;list of scripts that will + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; in the &lt;a href=#list-of-scripts-that-will-execute-when-the-document-has-finished-parsing&gt;list of scripts that will execute when the document has finished parsing&lt;/a&gt; has its &lt;a href=#ready-to-be-parser-executed&gt;&quot;ready to be parser-executed&quot;&lt;/a&gt; flag set &lt;em&gt;and&lt;/em&gt; the parser's &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt; &lt;a href=#has-no-style-sheet-that-is-blocking-scripts&gt;has no style sheet that is blocking scripts&lt;/a&gt;.&lt;/li&gt; &lt;li&gt;&lt;p&gt;&lt;a href=#execute-the-script-block title=&quot;execute the script block&quot;&gt;Execute&lt;/a&gt; the - first &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; in the &lt;a href=#list-of-scripts-that-will-execute-when-the-document-has-finished-parsing&gt;list of scripts that will + first &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; in the &lt;a href=#list-of-scripts-that-will-execute-when-the-document-has-finished-parsing&gt;list of scripts that will execute when the document has finished parsing&lt;/a&gt;.&lt;/li&gt; - &lt;li&gt;&lt;p&gt;Remove the first &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element from the + &lt;li&gt;&lt;p&gt;Remove the first &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element from the &lt;a href=#list-of-scripts-that-will-execute-when-the-document-has-finished-parsing&gt;list of scripts that will execute when the document has finished parsing&lt;/a&gt; (i.e. shift out the first entry in the list).&lt;/li&gt; @@ -83968,8 +83962,8 @@ &lt;p&gt;The parsing of this markup is straightforward up to the &quot;3&quot;. At this point, the DOM looks like this:&lt;/p&gt; - &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;1&lt;/span&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;2&lt;/span&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-i-element&gt;i&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;3&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;Here, the &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt; has five elements - on it: &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;, + &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;1&lt;/span&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;2&lt;/span&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-i-element&gt;i&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;3&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;Here, the &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt; has five elements + on it: &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;, and &lt;code&gt;&lt;a href=#the-i-element&gt;i&lt;/a&gt;&lt;/code&gt;. The &lt;a href=#list-of-active-formatting-elements&gt;list of active formatting elements&lt;/a&gt; just has two: &lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; and &lt;code&gt;&lt;a href=#the-i-element&gt;i&lt;/a&gt;&lt;/code&gt;. The &lt;a href=#insertion-mode&gt;insertion mode&lt;/a&gt; is &quot;&lt;a href=#parsing-main-inbody title=&quot;insertion mode: in body&quot;&gt;in body&lt;/a&gt;&quot;.&lt;/p&gt; @@ -83978,7 +83972,7 @@ invoked. This is a simple case, in that the &lt;var title=&quot;&quot;&gt;formatting element&lt;/var&gt; is the &lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; element, and there is no &lt;var title=&quot;&quot;&gt;furthest block&lt;/var&gt;. Thus, the &lt;a href=#stack-of-open-elements&gt;stack of open - elements&lt;/a&gt; ends up with just three elements: &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;, + elements&lt;/a&gt; ends up with just three elements: &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;, and &lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;, while the &lt;a href=#list-of-active-formatting-elements&gt;list of active formatting elements&lt;/a&gt; has just one: &lt;code&gt;&lt;a href=#the-i-element&gt;i&lt;/a&gt;&lt;/code&gt;. The DOM tree is unmodified at this point.&lt;/p&gt; @@ -83990,7 +83984,7 @@ received, and the &quot;5&quot; text node is inserted, the DOM looks as follows:&lt;/p&gt; - &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;1&lt;/span&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;2&lt;/span&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-i-element&gt;i&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;3&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-i-element&gt;i&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;4&lt;/span&gt;&lt;/ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;5&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;h5 id=misnested-tags:-b-p-/b-/p&gt;&lt;span class=secno&gt;11.2.8.2 &lt;/span&gt;Misnested tags: &lt;b&gt;&lt;p&gt;&lt;/b&gt;&lt;/p&gt;&lt;/h5&gt; + &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;1&lt;/span&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;2&lt;/span&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-i-element&gt;i&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;3&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-i-element&gt;i&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;4&lt;/span&gt;&lt;/ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;5&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;h5 id=misnested-tags:-b-p-/b-/p&gt;&lt;span class=secno&gt;11.2.8.2 &lt;/span&gt;Misnested tags: &lt;b&gt;&lt;p&gt;&lt;/b&gt;&lt;/p&gt;&lt;/h5&gt; &lt;p&gt;&lt;i&gt;This section is non-normative.&lt;/i&gt;&lt;/p&gt; @@ -84000,11 +83994,11 @@ &lt;p&gt;Up to the &quot;2&quot; the parsing here is straightforward:&lt;/p&gt; - &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;1&lt;/span&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;2&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;The interesting part is when the end tag token with the tag name + &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;1&lt;/span&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;2&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;The interesting part is when the end tag token with the tag name &quot;b&quot; is parsed.&lt;/p&gt; &lt;p&gt;Before that token is seen, the &lt;a href=#stack-of-open-elements&gt;stack of open - elements&lt;/a&gt; has four elements on it: &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;, + elements&lt;/a&gt; has four elements on it: &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;, and &lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;. The &lt;a href=#list-of-active-formatting-elements&gt;list of active formatting elements&lt;/a&gt; just has the one: &lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;. The &lt;a href=#insertion-mode&gt;insertion mode&lt;/a&gt; is &quot;&lt;a href=#parsing-main-inbody title=&quot;insertion mode: in body&quot;&gt;in body&lt;/a&gt;&quot;.&lt;/p&gt; @@ -84028,18 +84022,18 @@ &lt;p&gt;The &lt;var title=&quot;&quot;&gt;last node&lt;/var&gt; gets appended (moved) to the &lt;var title=&quot;&quot;&gt;common ancestor&lt;/var&gt;, so that the DOM looks like:&lt;/p&gt; - &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;1&lt;/span&gt;&lt;/ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;2&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;A new &lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; element is created, and the children of the + &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;1&lt;/span&gt;&lt;/ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;2&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;A new &lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; element is created, and the children of the &lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt; element are moved to it:&lt;/p&gt; - &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;1&lt;/span&gt;&lt;/ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;2&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;Finally, the new &lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; element is appended to the + &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;1&lt;/span&gt;&lt;/ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;2&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;Finally, the new &lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; element is appended to the &lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt; element, so that the DOM looks like:&lt;/p&gt; - &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;1&lt;/span&gt;&lt;/ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;2&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;The &lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; element is removed from the &lt;a href=#list-of-active-formatting-elements&gt;list of + &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;1&lt;/span&gt;&lt;/ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;2&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;The &lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; element is removed from the &lt;a href=#list-of-active-formatting-elements&gt;list of active formatting elements&lt;/a&gt; and the &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt;, so that when the &quot;3&quot; is parsed, it is appended to the &lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt; element:&lt;/p&gt; - &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;1&lt;/span&gt;&lt;/ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;2&lt;/span&gt;&lt;/ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;3&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;h5 id=unexpected-markup-in-tables&gt;&lt;span class=secno&gt;11.2.8.3 &lt;/span&gt;Unexpected markup in tables&lt;/h5&gt; + &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;1&lt;/span&gt;&lt;/ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;2&lt;/span&gt;&lt;/ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;3&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;h5 id=unexpected-markup-in-tables&gt;&lt;span class=secno&gt;11.2.8.3 &lt;/span&gt;Unexpected markup in tables&lt;/h5&gt; &lt;p&gt;&lt;i&gt;This section is non-normative.&lt;/i&gt;&lt;/p&gt; @@ -84054,11 +84048,11 @@ examining the DOM tree as it stands just after the &lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt; element's start tag has been seen:&lt;/p&gt; - &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;...and then immediately after the &lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; element start + &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;...and then immediately after the &lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; element start tag has been seen:&lt;/p&gt; - &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;At this point, the &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt; has on it - the elements &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;, + &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;At this point, the &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt; has on it + the elements &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt;, and &lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; (in that order, despite the resulting DOM tree); the &lt;a href=#list-of-active-formatting-elements&gt;list of active formatting elements&lt;/a&gt; just has the &lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; element in it; and the @@ -84074,8 +84068,8 @@ row&lt;/a&gt;&quot; insertion modes, after which the DOM looks as follows:&lt;/p&gt; - &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-tbody-element&gt;tbody&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-tr-element&gt;tr&lt;/a&gt;&lt;/code&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;Here, the &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt; has on it the - elements &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt;, + &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-tbody-element&gt;tbody&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-tr-element&gt;tr&lt;/a&gt;&lt;/code&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;Here, the &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt; has on it the + elements &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-tbody-element&gt;tbody&lt;/a&gt;&lt;/code&gt;, and &lt;code&gt;&lt;a href=#the-tr-element&gt;tr&lt;/a&gt;&lt;/code&gt;; the &lt;a href=#list-of-active-formatting-elements&gt;list of active formatting elements&lt;/a&gt; still has the &lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; element in it; and the &lt;a href=#insertion-mode&gt;insertion mode&lt;/a&gt; is &quot;&lt;a href=#parsing-main-intr title=&quot;insertion @@ -84086,13 +84080,13 @@ of active formatting elements&lt;/a&gt; (it also switches to the &quot;&lt;a href=#parsing-main-intd title=&quot;insertion mode: in cell&quot;&gt;in cell&lt;/a&gt;&quot; &lt;a href=#insertion-mode&gt;insertion mode&lt;/a&gt;).&lt;/p&gt; - &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-tbody-element&gt;tbody&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-tr-element&gt;tr&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-td-element&gt;td&lt;/a&gt;&lt;/code&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;The marker means that when the &quot;aaa&quot; character tokens are seen, + &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-tbody-element&gt;tbody&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-tr-element&gt;tr&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-td-element&gt;td&lt;/a&gt;&lt;/code&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;The marker means that when the &quot;aaa&quot; character tokens are seen, no &lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; element is created to hold the resulting text node:&lt;/p&gt; - &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-tbody-element&gt;tbody&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-tr-element&gt;tr&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-td-element&gt;td&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;aaa&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;The end tags are handled in a straight-forward manner; after + &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-tbody-element&gt;tbody&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-tr-element&gt;tr&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-td-element&gt;td&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;aaa&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;The end tags are handled in a straight-forward manner; after handling them, the &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt; has on it the - elements &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt;, + elements &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt;, and &lt;code&gt;&lt;a href=#the-tbody-element&gt;tbody&lt;/a&gt;&lt;/code&gt;; the &lt;a href=#list-of-active-formatting-elements&gt;list of active formatting elements&lt;/a&gt; still has the &lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; element in it (the marker having been removed by the &quot;td&quot; end tag token); and the @@ -84117,8 +84111,8 @@ parent&quot;&gt;foster parented&lt;/a&gt;, and then the &quot;bbb&quot; text node is appended to it:&lt;/p&gt; - &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;bbb&lt;/span&gt;&lt;/ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-tbody-element&gt;tbody&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-tr-element&gt;tr&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-td-element&gt;td&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;aaa&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;The &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt; has on it the elements - &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt;, + &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;bbb&lt;/span&gt;&lt;/ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-tbody-element&gt;tbody&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-tr-element&gt;tr&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-td-element&gt;td&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;aaa&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;The &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt; has on it the elements + &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-tbody-element&gt;tbody&lt;/a&gt;&lt;/code&gt;, and the new &lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; (again, note that this doesn't match the resulting tree!); the &lt;a href=#list-of-active-formatting-elements&gt;list of active formatting elements&lt;/a&gt; has the new &lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; element in it; @@ -84138,7 +84132,7 @@ result in yet another &lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; element being created, this time after the table:&lt;/p&gt; - &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;bbb&lt;/span&gt;&lt;/ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-tbody-element&gt;tbody&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-tr-element&gt;tr&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-td-element&gt;td&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;aaa&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;ccc&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;h5 id=scripts-that-modify-the-page-as-it-is-being-parsed&gt;&lt;span class=secno&gt;11.2.8.4 &lt;/span&gt;Scripts that modify the page as it is bein g parsed&lt;/h5&gt; + &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;bbb&lt;/span&gt;&lt;/ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-tbody-element&gt;tbody&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-tr-element&gt;tr&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-td-element&gt;td&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;aaa&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;ccc&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;h5 id=scripts-that-modify-the-page-as-it-is-being-parsed&gt;&lt;span class=secno&gt;11.2.8.4 &lt;/span&gt;Scripts that modify the page as it is being pa rsed&lt;/h5&gt; &lt;p&gt;&lt;i&gt;This section is non-normative.&lt;/i&gt;&lt;/p&gt; @@ -84163,16 +84157,16 @@ &lt;p&gt;Up to the first &quot;script&quot; end tag, before the script is parsed, the result is relatively straightforward:&lt;/p&gt; - &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-div-element&gt;div&lt;/a&gt;&lt;/code&gt; &lt;span class=t2 title=&quot;&quot;&gt;&lt;code class=&quot;attribute name&quot;&gt;id&lt;/code&gt;=&quot;&lt;code class=&quot;attribute value&quot;&gt;&lt;a href=#the-a-element&gt;a&lt;/a&gt;&lt;/code&gt;&quot;&lt;/span&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt; - &lt;/span&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;var div = document.getElementById('a'); &#9166; parent.document.body.appendChild(div);&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;After the script is parsed, though, the &lt;code&gt;&lt;a href=#the-div-element&gt;div&lt;/a&gt;&lt;/code&gt; element - and its child &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element are gone:&lt;/p&gt; + &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-div-element&gt;div&lt;/a&gt;&lt;/code&gt; &lt;span class=t2 title=&quot;&quot;&gt;&lt;code class=&quot;attribute name&quot;&gt;id&lt;/code&gt;=&quot;&lt;code class=&quot;attribute value&quot;&gt;&lt;a href=#the-a-element&gt;a&lt;/a&gt;&lt;/code&gt;&quot;&lt;/span&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt; + &lt;/span&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;var div = document.getElementById('a'); &#9166; parent.document.body.appendChild(div);&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;After the script is parsed, though, the &lt;code&gt;&lt;a href=#the-div-element&gt;div&lt;/a&gt;&lt;/code&gt; element + and its child &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element are gone:&lt;/p&gt; - &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;They are, at this point, in the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt; of the + &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;They are, at this point, in the &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt; of the aforementioned outer &lt;a href=#browsing-context&gt;browsing context&lt;/a&gt;. However, the &lt;a href=#stack-of-open-elements&gt;stack of open elements&lt;/a&gt; &lt;em&gt;still contains the &lt;code&gt;&lt;a href=#the-div-element&gt;div&lt;/a&gt;&lt;/code&gt; element&lt;/em&gt;.&lt;/p&gt; - &lt;p&gt;Thus, when the second &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element is parsed, it + &lt;p&gt;Thus, when the second &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element is parsed, it is inserted &lt;em&gt;into the outer &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt; object&lt;/em&gt;.&lt;/p&gt; @@ -84190,9 +84184,9 @@ &lt;p&gt;Once the &lt;code&gt;&lt;a href=#the-div-element&gt;div&lt;/a&gt;&lt;/code&gt; element's end tag is parsed, the &lt;code&gt;&lt;a href=#the-div-element&gt;div&lt;/a&gt;&lt;/code&gt; element is popped off the stack, and so the next - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element is in the inner &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt;:&lt;/p&gt; + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element is in the inner &lt;code&gt;&lt;a href=#document&gt;Document&lt;/a&gt;&lt;/code&gt;:&lt;/p&gt; - &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;alert(document.URL);&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;This second alert will say &quot;<A HREF="http://example.com/inner">http://example.com/inner</A>&quot;.&lt;/p&gt; + &lt;ul class=domTree&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;alert(document.URL);&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;This second alert will say &quot;<A HREF="http://example.com/inner">http://example.com/inner</A>&quot;.&lt;/p&gt; &lt;h5 id=the-execution-of-scripts-that-are-moving-across-multiple-documents&gt;&lt;span class=secno&gt;11.2.8.5 &lt;/span&gt;The execution of scripts that are moving across multiple documents&lt;/h5&gt; @@ -84200,7 +84194,7 @@ &lt;p&gt;&lt;i&gt;This section is non-normative.&lt;/i&gt;&lt;/p&gt; &lt;p&gt;Elaborating on the example in the previous section, consider a - case where a &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-script-src&gt;&lt;a href=#attr-script-src&gt;src&lt;/a&gt;&lt;/code&gt; attribute is parsed, but while + case where a &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-script-src&gt;&lt;a href=#attr-script-src&gt;src&lt;/a&gt;&lt;/code&gt; attribute is parsed, but while the external script is being downloaded, the element is moved to another document.&lt;/p&gt; @@ -84228,7 +84222,7 @@ &lt;p&gt;The resulting DOM tree is as follows:&lt;/p&gt; - &lt;ul class=domTree&gt;&lt;li class=t10&gt;DOCTYPE: &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; &lt;span class=t2 title=&quot;&quot;&gt;&lt;code class=&quot;attribute name&quot;&gt;class&lt;/code&gt;=&quot;&lt;code class=&quot;attribute value&quot;&gt;x&lt;/code&gt;&quot;&lt;/span&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; &lt;span class=t2 title=&quot;&quot;&gt;&lt;code class=&quot;attribute name&quot;&gt;class&lt;/code&gt;=&quot;&lt;code class=&quot;attribute value&quot;&gt;x&lt;/code&gt;&quot;&lt;/span&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; &lt;span class=t2 title=&quot;&quot;&gt;&lt;code class=&quot;attribute name&quot;&gt;class&lt;/code&gt;=&quot;&lt;code class=&quot;attribute value&quot;&gt;x&lt;/code&gt;&quot;&lt;/span&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; &lt;span class=t2 t itle=&quot;&quot;&gt;&lt;code class=&quot;attribute name&quot;&gt;class&lt;/code&gt;=&quot;&lt;code class=&quot;attribute value&quot;&gt;x&lt;/code&gt;&quot;&lt;/span&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;X&#9166;&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; &lt;span class=t2 title=&quot;&quot;&gt;&lt;code class=&quot;attribute name&quot;&gt;class&lt;/code&gt;=&quot;&lt;code class=&quot;attribute value&quot;&gt;x&lt;/code&gt;&quot;&lt;/span&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; &lt;span class=t2 title=&quot;&quot;&gt;&lt;code class=&quot;attribute name&quot;&gt;class&lt;/code&gt;=&quot;&lt;code class=&quot;attribute value&quot;&gt;x&lt;/code&gt;&quot;&lt;/span&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; &lt;span class=t2 title=&quot;&quot;&gt;&lt;code class=&quot;attribute name&quot;&gt;class&lt;/code&gt;=&quot;&lt;code class=&quot;attribute value&quot;&gt;x&lt;/code&gt;&quot;&lt;/span&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span tit le=&quot;&quot;&gt;X&#9166;&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; &lt;span class=t2 title=&quot;&quot;&gt;&lt;code class=&quot;attribute name&quot;&gt;class&lt;/code&gt;=&quot;&lt;code class=&quot;attribute value&quot;&gt;x&lt;/code&gt;&quot;&lt;/span&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; &lt;span class=t2 title=&quot;&quot;&gt;&lt;code class=&quot;attribute name&quot;&gt;class&lt;/code&gt;=&quot;&lt;code class=&quot;attribute value&quot;&gt;x&lt;/code&gt;&quot;&lt;/span&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; &lt;span class=t2 title=&quot;&quot;&gt;&lt;code class=&quot;attribute name&quot;&gt;class&lt;/code&gt;=&quot;&lt;code class=&quot;attribute value&quot;&gt;x&lt;/code&gt;&quot;&lt;/span&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; &lt;span class=t2 title=&quot;&quot;&gt;&lt;code class=&quot;attribute name&quot;&gt;class&lt;/code&gt;=&quot;&lt;code class=&quot;attribute value&quot;&gt;x&lt;/code&gt;&quot;&lt;/span&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code &gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;X&#9166;&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;X&#9166;&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;Note how the second &lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt; element in the markup has no + &lt;ul class=domTree&gt;&lt;li class=t10&gt;DOCTYPE: &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; &lt;span class=t2 title=&quot;&quot;&gt;&lt;code class=&quot;attribute name&quot;&gt;class&lt;/code&gt;=&quot;&lt;code class=&quot;attribute value&quot;&gt;x&lt;/code&gt;&quot;&lt;/span&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; &lt;span class=t2 title=&quot;&quot;&gt;&lt;code class=&quot;attribute name&quot;&gt;class&lt;/code&gt;=&quot;&lt;code class=&quot;attribute value&quot;&gt;x&lt;/code&gt;&quot;&lt;/span&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; &lt;span class=t2 title=&quot;&quot;&gt;&lt;code class=&quot;attribute name&quot;&gt;class&lt;/code&gt;=&quot;&lt;code class=&quot;attribute value&quot;&gt;x&lt;/code&gt;&quot;&lt;/span&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; &lt;span class=t2 title=&quot; &quot;&gt;&lt;code class=&quot;attribute name&quot;&gt;class&lt;/code&gt;=&quot;&lt;code class=&quot;attribute value&quot;&gt;x&lt;/code&gt;&quot;&lt;/span&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;X&#9166;&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; &lt;span class=t2 title=&quot;&quot;&gt;&lt;code class=&quot;attribute name&quot;&gt;class&lt;/code&gt;=&quot;&lt;code class=&quot;attribute value&quot;&gt;x&lt;/code&gt;&quot;&lt;/span&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; &lt;span class=t2 title=&quot;&quot;&gt;&lt;code class=&quot;attribute name&quot;&gt;class&lt;/code&gt;=&quot;&lt;code class=&quot;attribute value&quot;&gt;x&lt;/code&gt;&quot;&lt;/span&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; &lt;span class=t2 title=&quot;&quot;&gt;&lt;code class=&quot;attribute name&quot;&gt;class&lt;/code&gt;=&quot;&lt;code class=&quot;attribute value&quot;&gt;x&lt;/code&gt;&quot;&lt;/span&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt; X&#9166;&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; &lt;span class=t2 title=&quot;&quot;&gt;&lt;code class=&quot;attribute name&quot;&gt;class&lt;/code&gt;=&quot;&lt;code class=&quot;attribute value&quot;&gt;x&lt;/code&gt;&quot;&lt;/span&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; &lt;span class=t2 title=&quot;&quot;&gt;&lt;code class=&quot;attribute name&quot;&gt;class&lt;/code&gt;=&quot;&lt;code class=&quot;attribute value&quot;&gt;x&lt;/code&gt;&quot;&lt;/span&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; &lt;span class=t2 title=&quot;&quot;&gt;&lt;code class=&quot;attribute name&quot;&gt;class&lt;/code&gt;=&quot;&lt;code class=&quot;attribute value&quot;&gt;x&lt;/code&gt;&quot;&lt;/span&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; &lt;span class=t2 title=&quot;&quot;&gt;&lt;code class=&quot;attribute name&quot;&gt;class&lt;/code&gt;=&quot;&lt;code class=&quot;attribute value&quot;&gt;x&lt;/code&gt;&quot;&lt;/span&gt;&lt;ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a hr ef=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;X&#9166;&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;li class=t1&gt;&lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt;&lt;ul&gt;&lt;li class=t3&gt;&lt;code&gt;#text&lt;/code&gt;: &lt;span title=&quot;&quot;&gt;X&#9166;&lt;/span&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;Note how the second &lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt; element in the markup has no explicit &lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; elements, but in the resulting DOM, up to three of each kind of formatting element (in this case three &lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; elements with the class attribute, and two unadorned @@ -84351,9 +84345,9 @@ &lt;p&gt;If &lt;var title=&quot;&quot;&gt;current node&lt;/var&gt; is an &lt;code&gt;&lt;a href=#the-area-element&gt;area&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-base-element&gt;base&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#basefont&gt;basefont&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#bgsound&gt;bgsound&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-br-element&gt;br&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-col-element&gt;col&lt;/a&gt;&lt;/code&gt;, - &lt;code&gt;&lt;a href=#the-command&gt;command&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-embed-element&gt;embed&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#frame&gt;frame&lt;/a&gt;&lt;/code&gt;, + &lt;code&gt;&lt;a href=#the-command-element&gt;command&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-embed-element&gt;embed&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#frame&gt;frame&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-hr-element&gt;hr&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-img-element&gt;img&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-input-element&gt;input&lt;/a&gt;&lt;/code&gt;, - &lt;code&gt;&lt;a href=#the-keygen-element&gt;keygen&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-link-element&gt;link&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt;, + &lt;code&gt;&lt;a href=#the-keygen-element&gt;keygen&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-link-element&gt;link&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-param-element&gt;param&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-source-element&gt;source&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-track-element&gt;track&lt;/a&gt;&lt;/code&gt; or &lt;code&gt;&lt;a href=#the-wbr-element&gt;wbr&lt;/a&gt;&lt;/code&gt; element, then continue on to the next child node at this point.&lt;/p&gt; &lt;!-- VOIDLIST superset --&gt; @@ -84381,7 +84375,7 @@ &lt;dd&gt; &lt;p&gt;If the parent of &lt;var title=&quot;&quot;&gt;current node&lt;/var&gt; is a - &lt;code&gt;&lt;a href=#the-style-element&gt;style&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#xmp&gt;xmp&lt;/a&gt;&lt;/code&gt;, + &lt;code&gt;&lt;a href=#the-style-element&gt;style&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#xmp&gt;xmp&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-iframe-element&gt;iframe&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#noembed&gt;noembed&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#noframes&gt;noframes&lt;/a&gt;&lt;/code&gt;, or &lt;code&gt;&lt;a href=#plaintext&gt;plaintext&lt;/a&gt;&lt;/code&gt; element, or if the parent of &lt;var title=&quot;&quot;&gt;current node&lt;/var&gt; is @@ -84469,7 +84463,7 @@ literal string &quot;&lt;code title=&quot;&quot;&gt;--&gt;&lt;/code&gt;&quot;, then when the result of serializing the element is parsed, the comment will be truncated at that point and the rest of the comment will be interpreted as - markup. More examples would be making a &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element + markup. More examples would be making a &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element contain a text node with the text string &quot;&lt;code&gt;&lt;/script&gt;&lt;/code&gt;&quot;, or having a &lt;code&gt;&lt;a href=#the-p-element&gt;p&lt;/a&gt;&lt;/code&gt; element that contains a &lt;code&gt;&lt;a href=#the-ul-element&gt;ul&lt;/a&gt;&lt;/code&gt; element (as the &lt;code&gt;&lt;a href=#the-ul-element&gt;ul&lt;/a&gt;&lt;/code&gt; @@ -84485,7 +84479,7 @@ &quot;&lt;code&gt;&lt;/style&gt;&lt;script&gt;attack&lt;/script&gt;&lt;/code&gt;&quot; as a font name, &lt;code title=dom-innerHTML&gt;&lt;a href=#dom-innerhtml&gt;innerHTML&lt;/a&gt;&lt;/code&gt; will return markup that, if parsed in a different context, would contain a - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; node, even though no &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; node + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; node, even though no &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; node existed in the original DOM.&lt;/p&gt; &lt;/div&gt; @@ -84561,7 +84555,7 @@ &lt;p&gt;Set the state of the &lt;a href=#html-parser&gt;HTML parser&lt;/a&gt;'s &lt;a href=#tokenization&gt;tokenization&lt;/a&gt; stage as follows:&lt;/p&gt; - &lt;dl class=switch&gt;&lt;dt&gt;If it is a &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt; or &lt;code&gt;&lt;a href=#the-textarea-element&gt;textarea&lt;/a&gt;&lt;/code&gt; + &lt;dl class=switch&gt;&lt;dt&gt;If it is a &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt; or &lt;code&gt;&lt;a href=#the-textarea-element&gt;textarea&lt;/a&gt;&lt;/code&gt; element&lt;/dt&gt; &lt;dd&gt;Switch the tokenizer to the &lt;a href=#rcdata-state&gt;RCDATA state&lt;/a&gt;.&lt;/dd&gt; @@ -84574,7 +84568,7 @@ &lt;dd&gt;Switch the tokenizer to the &lt;a href=#rawtext-state&gt;RAWTEXT state&lt;/a&gt;.&lt;/dd&gt; - &lt;dt&gt;If it is a &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element&lt;/dt&gt; + &lt;dt&gt;If it is a &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element&lt;/dt&gt; &lt;dd&gt;Switch the tokenizer to the &lt;a href=#script-data-state&gt;script data state&lt;/a&gt;.&lt;/dd&gt; @@ -84609,7 +84603,7 @@ &lt;li&gt; - &lt;p&gt;Let &lt;var title=&quot;&quot;&gt;root&lt;/var&gt; be a new &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element + &lt;p&gt;Let &lt;var title=&quot;&quot;&gt;root&lt;/var&gt; be a new &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element with no attributes.&lt;/p&gt; &lt;/li&gt; @@ -84798,14 +84792,14 @@ handling external subsets. &lt;a href=#refsXML&gt;[XML]&lt;/a&gt;&lt;/p&gt; &lt;p id=scriptTagXML&gt;When an &lt;a href=#xml-parser&gt;XML parser&lt;/a&gt; creates a - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element, it must be marked as being + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element, it must be marked as being &lt;a href=#parser-inserted&gt;&quot;parser-inserted&quot;&lt;/a&gt; and its &lt;a href=#force-async&gt;&quot;force-async&quot;&lt;/a&gt; flag must be unset. If the parser was originally created for the &lt;a href=#xml-fragment-parsing-algorithm&gt;XML fragment parsing algorithm&lt;/a&gt;, then the element must be marked as &lt;a href=#already-started&gt;&quot;already started&quot;&lt;/a&gt; also. When the element's end tag is parsed, the user agent must &lt;a href=#provide-a-stable-state&gt;provide a stable state&lt;/a&gt;, and then &lt;a href=#prepare-a-script title=&quot;prepare a script&quot;&gt;prepare&lt;/a&gt; - the &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element. If this causes there to be a + the &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element. If this causes there to be a &lt;a href=#pending-parsing-blocking-script&gt;pending parsing-blocking script&lt;/a&gt;, then the user agent must run the following steps:&lt;/p&gt; @@ -86076,7 +86070,7 @@ &lt;h4 id=embedded-content-2&gt;&lt;span class=secno&gt;13.3.1 &lt;/span&gt;Embedded content&lt;/h4&gt; &lt;p&gt;The &lt;code&gt;&lt;a href=#the-embed-element&gt;embed&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-iframe-element&gt;iframe&lt;/a&gt;&lt;/code&gt;, and - &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; elements are expected to be treated as replaced + &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; elements are expected to be treated as replaced elements.&lt;/p&gt; &lt;p&gt;A &lt;code&gt;&lt;a href=#the-canvas-element&gt;canvas&lt;/a&gt;&lt;/code&gt; element that &lt;a href=#represents&gt;represents&lt;/a&gt; @@ -86095,43 +86089,43 @@ element. Other &lt;code&gt;&lt;a href=#the-applet-element&gt;applet&lt;/a&gt;&lt;/code&gt; elements are expected to be treated as ordinary elements in the rendering model.&lt;/p&gt; - &lt;p&gt;The &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; element, when it is &lt;a href=#expose-a-user-interface-to-the-user title=&quot;expose a + &lt;p&gt;The &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; element, when it is &lt;a href=#expose-a-user-interface-to-the-user title=&quot;expose a user interface to the user&quot;&gt;exposing a user interface&lt;/a&gt;, is expected to be treated as a replaced element about one line high, as wide as is necessary to expose the user agent's user interface - features. When an &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; element is not &lt;a href=#expose-a-user-interface-to-the-user title=&quot;expose a user interface to the user&quot;&gt;exposing a user + features. When an &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; element is not &lt;a href=#expose-a-user-interface-to-the-user title=&quot;expose a user interface to the user&quot;&gt;exposing a user interface&lt;/a&gt;, the user agent is expected to hide it, irrespective of CSS rules.&lt;/p&gt; - &lt;p&gt;Whether a &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element is &lt;a href=#expose-a-user-interface-to-the-user title=&quot;expose a + &lt;p&gt;Whether a &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element is &lt;a href=#expose-a-user-interface-to-the-user title=&quot;expose a user interface to the user&quot;&gt;exposing a user interface&lt;/a&gt; is not expected to affect the size of the rendering; controls are expected to be overlaid with the page content without causing any layout changes, and are expected to disappear when the user does not need them.&lt;/p&gt; - &lt;p&gt;When a &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element represents a poster frame or + &lt;p&gt;When a &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element represents a poster frame or frame of video, the poster frame or frame of video is expected to be rendered at the largest size that maintains the aspect ratio of that poster frame or frame of video without being taller or wider than - the &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element itself, and is expected to be - centered in the &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element.&lt;/p&gt; + the &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element itself, and is expected to be + centered in the &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element.&lt;/p&gt; &lt;p&gt;Any subtitles or captions are expected to be overlayed directly - on top of their &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element, as defined by the + on top of their &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element, as defined by the relevant rendering rules; for &lt;a href=#webvtt&gt;WebVTT&lt;/a&gt;, those are the &lt;a href=#webvtt-cue-text-rendering-rules&gt;WebVTT cue text rendering rules&lt;/a&gt; defined below.&lt;/p&gt; &lt;p&gt;When the user agent starts &lt;a href=#expose-a-user-interface-to-the-user title=&quot;expose a user interface to the user&quot;&gt;exposing a user interface&lt;/a&gt; for a - &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element, the user agent should run the &lt;a href=#rules-for-updating-the-text-track-rendering&gt;rules - for updating the text track rendering&lt;/a&gt; of each of the &lt;a href=#text-track title=&quot;text track&quot;&gt;text tracks&lt;/a&gt; in the &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; + &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element, the user agent should run the &lt;a href=#rules-for-updating-the-text-track-rendering&gt;rules + for updating the text track rendering&lt;/a&gt; of each of the &lt;a href=#text-track title=&quot;text track&quot;&gt;text tracks&lt;/a&gt; in the &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element's &lt;a href=#list-of-text-tracks&gt;list of text tracks&lt;/a&gt; that are &lt;a href=#text-track-showing title=&quot;text track showing&quot;&gt;showing&lt;/a&gt; or &lt;a href=#text-track-showing-by-default title=&quot;text track showing by default&quot;&gt;showing by default&lt;/a&gt; (e.g., for &lt;a href=#text-track title=&quot;text track&quot;&gt;text tracks&lt;/a&gt; based on &lt;a href=#webvtt&gt;WebVTT&lt;/a&gt;, the &lt;a href=#rules-for-updating-the-display-of-webvtt-text-tracks&gt;rules for updating the display of WebVTT text tracks&lt;/a&gt;).&lt;/p&gt; - &lt;p class=note&gt;Resizing &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; and &lt;code&gt;&lt;a href=#the-canvas-element&gt;canvas&lt;/a&gt;&lt;/code&gt; + &lt;p class=note&gt;Resizing &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; and &lt;code&gt;&lt;a href=#the-canvas-element&gt;canvas&lt;/a&gt;&lt;/code&gt; elements does not interrupt video playback or clear the canvas.&lt;/p&gt; &lt;hr&gt;&lt;p&gt;The following CSS rules are expected to apply:&lt;/p&gt; @@ -86158,7 +86152,7 @@ &lt;p&gt;The &lt;dfn id=rules-for-updating-the-display-of-webvtt-text-tracks&gt;rules for updating the display of WebVTT text tracks&lt;/dfn&gt; render the &lt;a href=#text-track title=&quot;text track&quot;&gt;text tracks&lt;/a&gt; of a &lt;a href=#media-element&gt;media element&lt;/a&gt; (specifically, a - &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element), or of another playback mechanism, by + &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element), or of another playback mechanism, by applying the steps below. All the &lt;a href=#text-track title=&quot;text track&quot;&gt;text tracks&lt;/a&gt; that use these rules for a given &lt;a href=#media-element&gt;media element&lt;/a&gt;, or other playback mechanism, are rendered together, @@ -86171,7 +86165,7 @@ &lt;p&gt;The rules are as follows:&lt;/p&gt; - &lt;ol&gt;&lt;li&gt;&lt;p&gt;If the &lt;a href=#media-element&gt;media element&lt;/a&gt; is an &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; + &lt;ol&gt;&lt;li&gt;&lt;p&gt;If the &lt;a href=#media-element&gt;media element&lt;/a&gt; is an &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; element, or is another playback mechanism with no rendering area, abort these steps. There is nothing to render.&lt;/li&gt; @@ -86784,7 +86778,7 @@ &lt;i&gt;matched element&lt;/i&gt;.&lt;/p&gt; &lt;p class=note&gt;If the &lt;i&gt;matched element&lt;/i&gt; is not a - &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; element, the pseudo-elements defined below won't + &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; element, the pseudo-elements defined below won't have any effect according to this specification.&lt;/p&gt; &lt;p&gt;A CSS user agent that implements the &lt;a href=#text-track title=&quot;text @@ -87134,7 +87128,7 @@ &lt;p id=dimRendering&gt;The &lt;code title=attr-dim-width&gt;&lt;a href=#attr-dim-width&gt;width&lt;/a&gt;&lt;/code&gt; and &lt;code title=attr-dim-height&gt;&lt;a href=#attr-dim-height&gt;height&lt;/a&gt;&lt;/code&gt; attributes on &lt;code&gt;&lt;a href=#the-applet-element&gt;applet&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-embed-element&gt;embed&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-iframe-element&gt;iframe&lt;/a&gt;&lt;/code&gt;, - &lt;code&gt;&lt;a href=#the-img-element&gt;img&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-object-element&gt;object&lt;/a&gt;&lt;/code&gt; or &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; + &lt;code&gt;&lt;a href=#the-img-element&gt;img&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href=#the-object-element&gt;object&lt;/a&gt;&lt;/code&gt; or &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; elements, and &lt;code&gt;&lt;a href=#the-input-element&gt;input&lt;/a&gt;&lt;/code&gt; elements with a &lt;code title=attr-input-type&gt;&lt;a href=#attr-input-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute in the &lt;a href=#image-button-state title=attr-input-type-image&gt;Image Button&lt;/a&gt; state, &lt;a href=#maps-to-the-dimension-property title=&quot;maps to the dimension property&quot;&gt;map to the dimension properties&lt;/a&gt; 'width' and 'height' on the element respectively.&lt;/p&gt; @@ -87174,7 +87168,7 @@ &lt;h4 id=toolbars-0&gt;&lt;span class=secno&gt;13.3.6 &lt;/span&gt;Toolbars&lt;/h4&gt; - &lt;p&gt;When a &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; element's &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute is in the &lt;a href=#toolbar-state title=&quot;toolbar state&quot;&gt;toolbar&lt;/a&gt; state, the element is + &lt;p&gt;When a &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; element's &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute is in the &lt;a href=#toolbar-state title=&quot;toolbar state&quot;&gt;toolbar&lt;/a&gt; state, the element is expected to be treated as a replaced element with a height about two lines high and a width derived from the contents of the element.&lt;/p&gt; @@ -87868,7 +87862,7 @@ &lt;h3 id=frames-and-framesets&gt;&lt;span class=secno&gt;13.5 &lt;/span&gt;Frames and framesets&lt;/h3&gt; - &lt;p&gt;When an &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element's second child element is a + &lt;p&gt;When an &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element's second child element is a &lt;code&gt;&lt;a href=#frameset&gt;frameset&lt;/a&gt;&lt;/code&gt; element, the user agent is expected to render the &lt;code&gt;&lt;a href=#frameset&gt;frameset&lt;/a&gt;&lt;/code&gt; element as described below across the surface of the viewport, instead of applying the usual CSS rendering @@ -88366,7 +88360,7 @@ instead.&lt;/p&gt; &lt;p&gt;Authors should not specify a &lt;code title=attr-script-language&gt;&lt;a href=#attr-script-language&gt;language&lt;/a&gt;&lt;/code&gt; attribute on a - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element. If the attribute is present, its value + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element. If the attribute is present, its value must be an &lt;a href=#ascii-case-insensitive&gt;ASCII case-insensitive&lt;/a&gt; match for the string &quot;&lt;code title=&quot;&quot;&gt;JavaScript&lt;/code&gt;&quot; and either the &lt;code title=attr-script-type&gt;&lt;a href=#attr-script-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute must be omitted or its value must be an &lt;a href=#ascii-case-insensitive&gt;ASCII case-insensitive&lt;/a&gt; match for @@ -88416,7 +88410,7 @@ &lt;code&gt;&lt;a href=#the-img-element&gt;img&lt;/a&gt;&lt;/code&gt; element if its value is the string &quot;&lt;code title=&quot;&quot;&gt;0&lt;/code&gt;&quot;.&lt;/li&gt; &lt;li&gt;&lt;p&gt;The presence of a &lt;code title=attr-script-language&gt;&lt;a href=#attr-script-language&gt;language&lt;/a&gt;&lt;/code&gt; attribute on a - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element if its value is an &lt;a href=#ascii-case-insensitive&gt;ASCII + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element if its value is an &lt;a href=#ascii-case-insensitive&gt;ASCII case-insensitive&lt;/a&gt; match for the string &quot;&lt;code title=&quot;&quot;&gt;JavaScript&lt;/code&gt;&quot; and if there is no &lt;code title=attr-script-type&gt;&lt;a href=#attr-script-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute or there is and its value is an &lt;a href=#ascii-case-insensitive&gt;ASCII case-insensitive&lt;/a&gt; match for the string &quot;&lt;code title=&quot;&quot;&gt;text/javascript&lt;/code&gt;&quot;.&lt;/li&gt; @@ -88448,7 +88442,7 @@ &lt;dd&gt;&lt;p&gt;Use &lt;code&gt;&lt;a href=#the-abbr-element&gt;abbr&lt;/a&gt;&lt;/code&gt; instead.&lt;/dd&gt; &lt;dt&gt;&lt;dfn id=bgsound&gt;&lt;code&gt;bgsound&lt;/code&gt;&lt;/dfn&gt;&lt;/dt&gt; - &lt;dd&gt;&lt;p&gt;Use &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; instead.&lt;/dd&gt; + &lt;dd&gt;&lt;p&gt;Use &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; instead.&lt;/dd&gt; &lt;dt&gt;&lt;dfn id=dir&gt;&lt;code&gt;dir&lt;/code&gt;&lt;/dfn&gt;&lt;/dt&gt; &lt;dd&gt;&lt;p&gt;Use &lt;code&gt;&lt;a href=#the-ul-element&gt;ul&lt;/a&gt;&lt;/code&gt; instead.&lt;/dd&gt; @@ -88549,13 +88543,13 @@ attribute is sufficient; the &lt;code title=attr-area-nohref&gt;&lt;a href=#attr-area-nohref&gt;nohref&lt;/a&gt;&lt;/code&gt; attribute is unnecessary. Omit it altogether.&lt;/dd&gt; - &lt;dt&gt;&lt;dfn id=attr-head-profile title=attr-head-profile&gt;&lt;code&gt;profile&lt;/code&gt;&lt;/dfn&gt; on &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; elements&lt;/dt&gt; - &lt;dd&gt;&lt;p&gt;When used for declaring which &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; terms are + &lt;dt&gt;&lt;dfn id=attr-head-profile title=attr-head-profile&gt;&lt;code&gt;profile&lt;/code&gt;&lt;/dfn&gt; on &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; elements&lt;/dt&gt; + &lt;dd&gt;&lt;p&gt;When used for declaring which &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; terms are used in the document, unnecessary; omit it altogether, and &lt;a href=#concept-meta-extensions title=concept-meta-extensions&gt;register the names&lt;/a&gt;.&lt;/dd&gt; &lt;dd&gt;&lt;p&gt;When used for triggering specific user agent behaviors: use a &lt;code&gt;&lt;a href=#the-link-element&gt;link&lt;/a&gt;&lt;/code&gt; element instead.&lt;/dd&gt; - &lt;dt&gt;&lt;dfn id=attr-html-version title=attr-html-version&gt;&lt;code&gt;version&lt;/code&gt;&lt;/dfn&gt; on &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; elements&lt;/dt&gt; + &lt;dt&gt;&lt;dfn id=attr-html-version title=attr-html-version&gt;&lt;code&gt;version&lt;/code&gt;&lt;/dfn&gt; on &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; elements&lt;/dt&gt; &lt;dd&gt;&lt;p&gt;Unnecessary. Omit it altogether.&lt;/dd&gt; &lt;dt&gt;&lt;dfn id=attr-input-usemap title=attr-input-usemap&gt;&lt;code&gt;usemap&lt;/code&gt;&lt;/dfn&gt; on &lt;code&gt;&lt;a href=#the-input-element&gt;input&lt;/a&gt;&lt;/code&gt; elements&lt;/dt&gt; @@ -88575,7 +88569,7 @@ &lt;dt&gt;&lt;dfn id=attr-link-target title=attr-link-target&gt;&lt;code&gt;target&lt;/code&gt;&lt;/dfn&gt; on &lt;code&gt;&lt;a href=#the-link-element&gt;link&lt;/a&gt;&lt;/code&gt; elements&lt;/dt&gt; &lt;dd&gt;&lt;p&gt;Unnecessary. Omit it altogether.&lt;/dd&gt; - &lt;dt&gt;&lt;dfn id=attr-meta-scheme title=attr-meta-scheme&gt;&lt;code&gt;scheme&lt;/code&gt;&lt;/dfn&gt; on &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; elements&lt;/dt&gt; + &lt;dt&gt;&lt;dfn id=attr-meta-scheme title=attr-meta-scheme&gt;&lt;code&gt;scheme&lt;/code&gt;&lt;/dfn&gt; on &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; elements&lt;/dt&gt; &lt;dd&gt;&lt;p&gt;Use only one scheme per field, or make the scheme declaration part of the value.&lt;/dd&gt; &lt;dt&gt;&lt;dfn id=attr-object-archive title=attr-object-archive&gt;&lt;code&gt;archive&lt;/code&gt;&lt;/dfn&gt; on &lt;code&gt;&lt;a href=#the-object-element&gt;object&lt;/a&gt;&lt;/code&gt; elements&lt;/dt&gt; @@ -88597,12 +88591,12 @@ &lt;dd&gt;&lt;p&gt;Use the &lt;code title=attr-param-name&gt;&lt;a href=#attr-param-name&gt;name&lt;/a&gt;&lt;/code&gt; and &lt;code title=attr-param-value&gt;&lt;a href=#attr-param-value&gt;value&lt;/a&gt;&lt;/code&gt; attributes without declaring value types.&lt;/dd&gt; - &lt;dt&gt;&lt;dfn id=attr-script-language title=attr-script-language&gt;&lt;code&gt;language&lt;/code&gt;&lt;/dfn&gt; on &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; elements (except as noted in the previous section)&lt;/dt&gt; + &lt;dt&gt;&lt;dfn id=attr-script-language title=attr-script-language&gt;&lt;code&gt;language&lt;/code&gt;&lt;/dfn&gt; on &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements (except as noted in the previous section)&lt;/dt&gt; &lt;dd&gt;&lt;p&gt;Use the &lt;code title=attr-script-type&gt;&lt;a href=#attr-script-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute instead.&lt;/dd&gt; - &lt;dt&gt;&lt;dfn id=attr-script-event title=attr-script-event&gt;&lt;code&gt;event&lt;/code&gt;&lt;/dfn&gt; on &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; elements&lt;/dt&gt; - &lt;dt&gt;&lt;dfn id=attr-script-for title=attr-script-for&gt;&lt;code&gt;for&lt;/code&gt;&lt;/dfn&gt; on &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; elements&lt;/dt&gt; + &lt;dt&gt;&lt;dfn id=attr-script-event title=attr-script-event&gt;&lt;code&gt;event&lt;/code&gt;&lt;/dfn&gt; on &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements&lt;/dt&gt; + &lt;dt&gt;&lt;dfn id=attr-script-for title=attr-script-for&gt;&lt;code&gt;for&lt;/code&gt;&lt;/dfn&gt; on &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; elements&lt;/dt&gt; &lt;dd&gt;&lt;p&gt;Use DOM Events mechanisms to register event listeners. &lt;a href=#refsDOMEVENTS&gt;[DOMEVENTS]&lt;/a&gt;&lt;/dd&gt; &lt;dt&gt;&lt;dfn id=attr-table-datapagesize title=attr-table-datapagesize&gt;&lt;code&gt;datapagesize&lt;/code&gt;&lt;/dfn&gt; on &lt;code&gt;&lt;a href=#the-table-element&gt;table&lt;/a&gt;&lt;/code&gt; elements&lt;/dt&gt; @@ -88670,7 +88664,7 @@ &lt;dt&gt;&lt;dfn id=attr-img-vspace title=attr-img-vspace&gt;&lt;code&gt;vspace&lt;/code&gt;&lt;/dfn&gt; on &lt;code&gt;&lt;a href=#the-img-element&gt;img&lt;/a&gt;&lt;/code&gt; elements&lt;/dt&gt; &lt;dt&gt;&lt;dfn id=attr-legend-align title=attr-legend-align&gt;&lt;code&gt;align&lt;/code&gt;&lt;/dfn&gt; on &lt;code&gt;&lt;a href=#the-legend-element&gt;legend&lt;/a&gt;&lt;/code&gt; elements&lt;/dt&gt; &lt;dt&gt;&lt;dfn id=attr-li-type title=attr-li-type&gt;&lt;code&gt;type&lt;/code&gt;&lt;/dfn&gt; on &lt;code&gt;&lt;a href=#the-li-element&gt;li&lt;/a&gt;&lt;/code&gt; elements&lt;/dt&gt; - &lt;dt&gt;&lt;dfn id=attr-menu-compact title=attr-menu-compact&gt;&lt;code&gt;compact&lt;/code&gt;&lt;/dfn&gt; on &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; elements&lt;/dt&gt; + &lt;dt&gt;&lt;dfn id=attr-menu-compact title=attr-menu-compact&gt;&lt;code&gt;compact&lt;/code&gt;&lt;/dfn&gt; on &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; elements&lt;/dt&gt; &lt;dt&gt;&lt;dfn id=attr-object-align title=attr-object-align&gt;&lt;code&gt;align&lt;/code&gt;&lt;/dfn&gt; on &lt;code&gt;&lt;a href=#the-object-element&gt;object&lt;/a&gt;&lt;/code&gt; elements&lt;/dt&gt; &lt;dt&gt;&lt;dfn id=attr-object-border title=attr-object-border&gt;&lt;code&gt;border&lt;/code&gt;&lt;/dfn&gt; on &lt;code&gt;&lt;a href=#the-object-element&gt;object&lt;/a&gt;&lt;/code&gt; elements&lt;/dt&gt; &lt;dt&gt;&lt;dfn id=attr-object-hspace title=attr-object-hspace&gt;&lt;code&gt;hspace&lt;/code&gt;&lt;/dfn&gt; on &lt;code&gt;&lt;a href=#the-object-element&gt;object&lt;/a&gt;&lt;/code&gt; elements&lt;/dt&gt; @@ -89352,7 +89346,7 @@ &lt;a href=#reflect&gt;reflect&lt;/a&gt; the content attribute of the same name.&lt;/p&gt; &lt;hr&gt;&lt;p class=note&gt;The &lt;dfn id=dom-head-profile title=dom-head-profile&gt;&lt;code&gt;profile&lt;/code&gt;&lt;/dfn&gt; IDL attribute on - &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; elements (with the &lt;code&gt;&lt;a href=#htmlheadelement&gt;HTMLHeadElement&lt;/a&gt;&lt;/code&gt; + &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; elements (with the &lt;code&gt;&lt;a href=#htmlheadelement&gt;HTMLHeadElement&lt;/a&gt;&lt;/code&gt; interface) is intentionally omitted. Unless so required by &lt;a href=#other-applicable-specifications title=&quot;other applicable specifications&quot;&gt;another applicable specification&lt;/a&gt;, implementations would therefore not support this attribute. (It is mentioned here as it was defined in a @@ -89382,7 +89376,7 @@ };&lt;/pre&gt; &lt;p&gt;The &lt;dfn id=dom-html-version title=dom-html-version&gt;&lt;code&gt;version&lt;/code&gt;&lt;/dfn&gt; IDL - attribute of the &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; element must &lt;a href=#reflect&gt;reflect&lt;/a&gt; + attribute of the &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; element must &lt;a href=#reflect&gt;reflect&lt;/a&gt; the content attribute of the same name.&lt;/p&gt; &lt;hr&gt;&lt;pre class=idl&gt;[Supplemental] @@ -89498,7 +89492,7 @@ };&lt;/pre&gt; &lt;p&gt;The &lt;dfn id=dom-menu-compact title=dom-menu-compact&gt;&lt;code&gt;compact&lt;/code&gt;&lt;/dfn&gt; IDL - attribute of the &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; element must &lt;a href=#reflect&gt;reflect&lt;/a&gt; + attribute of the &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; element must &lt;a href=#reflect&gt;reflect&lt;/a&gt; the content attribute of the same name.&lt;/p&gt; &lt;hr&gt;&lt;pre class=idl&gt;[Supplemental] @@ -89507,8 +89501,8 @@ };&lt;/pre&gt; &lt;p&gt;User agents may treat the &lt;code title=attr-meta-scheme&gt;&lt;a href=#attr-meta-scheme&gt;scheme&lt;/a&gt;&lt;/code&gt; content attribute on the - &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element as an extension of the element's &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; content attribute when processing - a &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; attribute whose value is one that + &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element as an extension of the element's &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; content attribute when processing + a &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element with a &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; attribute whose value is one that the user agent recognizes as supporting the &lt;code title=attr-meta-scheme&gt;&lt;a href=#attr-meta-scheme&gt;scheme&lt;/a&gt;&lt;/code&gt; attribute.&lt;/p&gt; &lt;p&gt;User agents are encouraged to ignore the &lt;code title=attr-meta-scheme&gt;&lt;a href=#attr-meta-scheme&gt;scheme&lt;/a&gt;&lt;/code&gt; attribute and instead process @@ -89517,12 +89511,12 @@ &lt;div class=example&gt; - &lt;p&gt;For example, if the user agent acts on &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; + &lt;p&gt;For example, if the user agent acts on &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; elements with &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; attributes having the value &quot;eGMS.subject.keyword&quot;, and knows that the &lt;code title=attr-meta-scheme&gt;&lt;a href=#attr-meta-scheme&gt;scheme&lt;/a&gt;&lt;/code&gt; attribute is used with this metadata name, then it could take the &lt;code title=attr-meta-scheme&gt;&lt;a href=#attr-meta-scheme&gt;scheme&lt;/a&gt;&lt;/code&gt; attribute into account, acting as if it was an extension of the &lt;code title=attr-meta-name&gt;&lt;a href=#attr-meta-name&gt;name&lt;/a&gt;&lt;/code&gt; attribute. Thus the following - two &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; elements could be treated as two elements + two &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; elements could be treated as two elements giving values for two different metadata names, one consisting of a combination of &quot;eGMS.subject.keyword&quot; and &quot;LGCL&quot;, and the other consisting of a combination of &quot;eGMS.subject.keyword&quot; and @@ -89541,7 +89535,7 @@ &lt;/div&gt; &lt;p&gt;The &lt;dfn id=dom-meta-scheme title=dom-meta-scheme&gt;&lt;code&gt;scheme&lt;/code&gt;&lt;/dfn&gt; IDL - attribute of the &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; element must &lt;a href=#reflect&gt;reflect&lt;/a&gt; + attribute of the &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; element must &lt;a href=#reflect&gt;reflect&lt;/a&gt; the content attribute of the same name.&lt;/p&gt; &lt;hr&gt;&lt;pre class=idl&gt;[Supplemental] @@ -89626,7 +89620,7 @@ &lt;p&gt;The &lt;dfn id=dom-script-event title=dom-script-event&gt;&lt;code&gt;event&lt;/code&gt;&lt;/dfn&gt; and &lt;dfn id=dom-script-htmlfor title=dom-script-htmlFor&gt;&lt;code&gt;htmlFor&lt;/code&gt;&lt;/dfn&gt; IDL - attributes of the &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt; element must return the empty + attributes of the &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt; element must return the empty string on getting, and do nothing on setting.&lt;/p&gt; &lt;hr&gt;&lt;pre class=idl&gt;[Supplemental] @@ -90648,7 +90642,7 @@ &lt;td&gt;&lt;a href=#flow-content title=&quot;Flow content&quot;&gt;flow&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;a href=#global-attributes title=&quot;global attributes&quot;&gt;globals&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;a href=#htmlelement&gt;HTMLElement&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; - &lt;tr&gt;&lt;th&gt;&lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt;&lt;/th&gt; + &lt;tr&gt;&lt;th&gt;&lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt;&lt;/th&gt; &lt;td&gt;Audio player&lt;/td&gt; &lt;td&gt;&lt;a href=#flow-content title=&quot;Flow content&quot;&gt;flow&lt;/a&gt;; &lt;a href=#phrasing-content title=&quot;Phrasing content&quot;&gt;phrasing&lt;/a&gt;; @@ -90676,7 +90670,7 @@ &lt;tr&gt;&lt;th&gt;&lt;code&gt;&lt;a href=#the-base-element&gt;base&lt;/a&gt;&lt;/code&gt;&lt;/th&gt; &lt;td&gt;Base URL and default target &lt;a href=#browsing-context&gt;browsing context&lt;/a&gt; for &lt;a href=#attr-hyperlink-target title=attr-hyperlink-target&gt;hyperlinks&lt;/a&gt; and &lt;a href=#attr-fs-target title=attr-fs-target&gt;forms&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;a href=#metadata-content title=&quot;Metadata content&quot;&gt;metadata&lt;/a&gt;&lt;/td&gt; - &lt;td&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; + &lt;td&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; &lt;td&gt;empty&lt;/td&gt; &lt;td&gt;&lt;a href=#global-attributes title=&quot;global attributes&quot;&gt;globals&lt;/a&gt;; &lt;code title=attr-base-href&gt;&lt;a href=#attr-base-href&gt;href&lt;/a&gt;&lt;/code&gt;; @@ -90711,7 +90705,7 @@ &lt;tr&gt;&lt;th&gt;&lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;&lt;/th&gt; &lt;td&gt;Document body&lt;/td&gt; &lt;td&gt;&lt;a href=#sectioning-root title=&quot;Sectioning root&quot;&gt;sectioning root&lt;/a&gt;&lt;/td&gt; - &lt;td&gt;&lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; + &lt;td&gt;&lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; &lt;td&gt;&lt;a href=#flow-content title=&quot;Flow content&quot;&gt;flow&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;a href=#global-attributes title=&quot;global attributes&quot;&gt;globals&lt;/a&gt;; &lt;code title=handler-window-onafterprint&gt;&lt;a href=#handler-window-onafterprint&gt;onafterprint&lt;/a&gt;&lt;/code&gt;; @@ -90817,12 +90811,12 @@ &lt;td&gt;&lt;a href=#global-attributes title=&quot;global attributes&quot;&gt;globals&lt;/a&gt;; &lt;code title=attr-colgroup-span&gt;&lt;a href=#attr-colgroup-span&gt;span&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;a href=#htmltablecolelement&gt;HTMLTableColElement&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; - &lt;tr&gt;&lt;th&gt;&lt;code&gt;&lt;a href=#the-command&gt;command&lt;/a&gt;&lt;/code&gt;&lt;/th&gt; + &lt;tr&gt;&lt;th&gt;&lt;code&gt;&lt;a href=#the-command-element&gt;command&lt;/a&gt;&lt;/code&gt;&lt;/th&gt; &lt;td&gt;Menu command&lt;/td&gt; &lt;td&gt;&lt;a href=#metadata-content title=&quot;Metadata content&quot;&gt;metadata&lt;/a&gt;; &lt;a href=#flow-content title=&quot;Flow content&quot;&gt;flow&lt;/a&gt;; &lt;a href=#phrasing-content title=&quot;Phrasing content&quot;&gt;phrasing&lt;/a&gt;&lt;/td&gt; - &lt;td&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;; + &lt;td&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;; &lt;a href=#phrasing-content title=&quot;Phrasing content&quot;&gt;phrasing&lt;/a&gt;&lt;/td&gt; &lt;td&gt;empty&lt;/td&gt; &lt;td&gt;&lt;a href=#global-attributes title=&quot;global attributes&quot;&gt;globals&lt;/a&gt;; @@ -90987,10 +90981,10 @@ &lt;td&gt;&lt;a href=#phrasing-content title=&quot;Phrasing content&quot;&gt;phrasing&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;a href=#global-attributes title=&quot;global attributes&quot;&gt;globals&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;a href=#htmlheadingelement&gt;HTMLHeadingElement&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; - &lt;tr&gt;&lt;th&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;&lt;/th&gt; + &lt;tr&gt;&lt;th&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;&lt;/th&gt; &lt;td&gt;Container for document metadata&lt;/td&gt; &lt;td&gt;none&lt;/td&gt; - &lt;td&gt;&lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; + &lt;td&gt;&lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; &lt;td&gt;&lt;a href=#metadata-content title=&quot;Metadata content&quot;&gt;metadata content&lt;/a&gt;*&lt;/td&gt; &lt;td&gt;&lt;a href=#global-attributes title=&quot;global attributes&quot;&gt;globals&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;a href=#htmlheadelement&gt;HTMLHeadElement&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; @@ -91018,11 +91012,11 @@ &lt;td&gt;empty&lt;/td&gt; &lt;td&gt;&lt;a href=#global-attributes title=&quot;global attributes&quot;&gt;globals&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;a href=#htmlhrelement&gt;HTMLHRElement&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; - &lt;tr&gt;&lt;th&gt;&lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt;&lt;/th&gt; + &lt;tr&gt;&lt;th&gt;&lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt;&lt;/th&gt; &lt;td&gt;Root element&lt;/td&gt; &lt;td&gt;none&lt;/td&gt; &lt;td&gt;none*&lt;/td&gt; - &lt;td&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;*; + &lt;td&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;*; &lt;code&gt;&lt;a href=#the-body-element-0&gt;body&lt;/a&gt;&lt;/code&gt;*&lt;/td&gt; &lt;td&gt;&lt;a href=#global-attributes title=&quot;global attributes&quot;&gt;globals&lt;/a&gt;; &lt;code title=attr-html-manifest&gt;&lt;a href=#attr-html-manifest&gt;manifest&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; @@ -91172,7 +91166,7 @@ &lt;tr&gt;&lt;th&gt;&lt;code&gt;&lt;a href=#the-li-element&gt;li&lt;/a&gt;&lt;/code&gt;&lt;/th&gt; &lt;td&gt;List item&lt;/td&gt; &lt;td&gt;none&lt;/td&gt; - &lt;td&gt;&lt;code&gt;&lt;a href=#the-ol-element&gt;ol&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-ul-element&gt;ul&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; + &lt;td&gt;&lt;code&gt;&lt;a href=#the-ol-element&gt;ol&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-ul-element&gt;ul&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; &lt;td&gt;&lt;a href=#flow-content title=&quot;Flow content&quot;&gt;flow&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;a href=#global-attributes title=&quot;global attributes&quot;&gt;globals&lt;/a&gt;; &lt;code title=attr-li-value&gt;&lt;a href=#attr-li-value&gt;value&lt;/a&gt;&lt;/code&gt;*&lt;/td&gt; @@ -91182,7 +91176,7 @@ &lt;td&gt;&lt;a href=#metadata-content title=&quot;Metadata content&quot;&gt;metadata&lt;/a&gt;; &lt;a href=#flow-content title=&quot;Flow content&quot;&gt;flow&lt;/a&gt;*; &lt;a href=#phrasing-content title=&quot;Phrasing content&quot;&gt;phrasing&lt;/a&gt;*&lt;/td&gt; - &lt;td&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;; + &lt;td&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt;*; &lt;a href=#phrasing-content title=&quot;phrasing content&quot;&gt;phrasing&lt;/a&gt;*&lt;/td&gt; &lt;td&gt;empty&lt;/td&gt; @@ -91212,7 +91206,7 @@ &lt;td&gt;&lt;a href=#phrasing-content title=&quot;Phrasing content&quot;&gt;phrasing&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;a href=#global-attributes title=&quot;global attributes&quot;&gt;globals&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;a href=#htmlelement&gt;HTMLElement&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; - &lt;tr&gt;&lt;th&gt;&lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt;&lt;/th&gt; + &lt;tr&gt;&lt;th&gt;&lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt;&lt;/th&gt; &lt;td&gt;Menu of commands&lt;/td&gt; &lt;td&gt;&lt;a href=#flow-content title=&quot;Flow content&quot;&gt;flow&lt;/a&gt;; &lt;a href=#interactive-content title=&quot;Interactive content&quot;&gt;interactive&lt;/a&gt;*&lt;/td&gt; @@ -91223,12 +91217,12 @@ &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt;; &lt;code title=attr-menu-label&gt;&lt;a href=#attr-menu-label&gt;label&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;a href=#htmlmenuelement&gt;HTMLMenuElement&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; - &lt;tr&gt;&lt;th&gt;&lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt;&lt;/th&gt; + &lt;tr&gt;&lt;th&gt;&lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt;&lt;/th&gt; &lt;td&gt;Text metadata&lt;/td&gt; &lt;td&gt;&lt;a href=#metadata-content title=&quot;Metadata content&quot;&gt;metadata&lt;/a&gt;; &lt;a href=#flow-content title=&quot;Flow content&quot;&gt;flow&lt;/a&gt;*; &lt;a href=#phrasing-content title=&quot;Phrasing content&quot;&gt;phrasing&lt;/a&gt;*&lt;/td&gt; - &lt;td&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;; + &lt;td&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt;*; &lt;a href=#phrasing-content title=&quot;phrasing content&quot;&gt;phrasing&lt;/a&gt;*&lt;/td&gt; &lt;td&gt;empty&lt;/td&gt; @@ -91269,7 +91263,7 @@ &lt;td&gt;&lt;a href=#metadata-content title=&quot;Metadata content&quot;&gt;metadata&lt;/a&gt;; &lt;a href=#flow-content title=&quot;Flow content&quot;&gt;flow&lt;/a&gt;; &lt;a href=#phrasing-content title=&quot;Phrasing content&quot;&gt;phrasing&lt;/a&gt;&lt;/td&gt; - &lt;td&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;*; + &lt;td&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;*; &lt;a href=#phrasing-content title=&quot;Phrasing content&quot;&gt;phrasing&lt;/a&gt;*&lt;/td&gt; &lt;td&gt;varies*&lt;/td&gt; &lt;td&gt;&lt;a href=#global-attributes title=&quot;global attributes&quot;&gt;globals&lt;/a&gt;&lt;/td&gt; @@ -91428,12 +91422,12 @@ &lt;td&gt;&lt;a href=#phrasing-content title=&quot;Phrasing content&quot;&gt;phrasing&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;a href=#global-attributes title=&quot;global attributes&quot;&gt;globals&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;a href=#htmlelement&gt;HTMLElement&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; - &lt;tr&gt;&lt;th&gt;&lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt;&lt;/th&gt; + &lt;tr&gt;&lt;th&gt;&lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt;&lt;/th&gt; &lt;td&gt;Embedded script&lt;/td&gt; &lt;td&gt;&lt;a href=#metadata-content title=&quot;Metadata content&quot;&gt;metadata&lt;/a&gt;; &lt;a href=#flow-content title=&quot;Flow content&quot;&gt;flow&lt;/a&gt;; &lt;a href=#phrasing-content title=&quot;Phrasing content&quot;&gt;phrasing&lt;/a&gt;&lt;/td&gt; - &lt;td&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;; + &lt;td&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;; &lt;a href=#phrasing-content title=&quot;Phrasing content&quot;&gt;phrasing&lt;/a&gt;&lt;/td&gt; &lt;td&gt;script, data, or script documentation*&lt;/td&gt; &lt;td&gt;&lt;a href=#global-attributes title=&quot;global attributes&quot;&gt;globals&lt;/a&gt;; @@ -91482,10 +91476,10 @@ &lt;td&gt;&lt;a href=#global-attributes title=&quot;global attributes&quot;&gt;globals&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;a href=#htmlelement&gt;HTMLElement&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; &lt;tr&gt;&lt;th&gt;&lt;code&gt;&lt;a href=#the-source-element&gt;source&lt;/a&gt;&lt;/code&gt;&lt;/th&gt; - &lt;td&gt;Media source for &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; or &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; + &lt;td&gt;Media source for &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; or &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; &lt;td&gt;none&lt;/td&gt; - &lt;td&gt;&lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt;; - &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; + &lt;td&gt;&lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt;; + &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; &lt;td&gt;empty&lt;/td&gt; &lt;td&gt;&lt;a href=#global-attributes title=&quot;global attributes&quot;&gt;globals&lt;/a&gt;; &lt;code title=attr-source-src&gt;&lt;a href=#attr-source-src&gt;src&lt;/a&gt;&lt;/code&gt;; @@ -91512,7 +91506,7 @@ &lt;td&gt;Embedded styling information&lt;/td&gt; &lt;td&gt;&lt;a href=#metadata-content title=&quot;Metadata content&quot;&gt;metadata&lt;/a&gt;; &lt;a href=#flow-content title=&quot;Flow content&quot;&gt;flow&lt;/a&gt;&lt;/td&gt; - &lt;td&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;; + &lt;td&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt;*; &lt;a href=#flow-content title=&quot;flow content&quot;&gt;flow&lt;/a&gt;*&lt;/td&gt; &lt;td&gt;varies*&lt;/td&gt; @@ -91634,10 +91628,10 @@ &lt;code title=attr-time-datetime&gt;&lt;a href=#attr-time-datetime&gt;datetime&lt;/a&gt;&lt;/code&gt;; &lt;code title=attr-time-pubdate&gt;&lt;a href=#attr-time-pubdate&gt;pubdate&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;a href=#htmltimeelement&gt;HTMLTimeElement&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; - &lt;tr&gt;&lt;th&gt;&lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt;&lt;/th&gt; + &lt;tr&gt;&lt;th&gt;&lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt;&lt;/th&gt; &lt;td&gt;Document title&lt;/td&gt; &lt;td&gt;&lt;a href=#metadata-content title=&quot;Metadata content&quot;&gt;metadata&lt;/a&gt;&lt;/td&gt; - &lt;td&gt;&lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; + &lt;td&gt;&lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; &lt;td&gt;&lt;a href=#text-content title=&quot;text content&quot;&gt;text&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;a href=#global-attributes title=&quot;global attributes&quot;&gt;globals&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;a href=#htmltitleelement&gt;HTMLTitleElement&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; @@ -91655,8 +91649,8 @@ &lt;tr&gt;&lt;th&gt;&lt;code&gt;&lt;a href=#the-track-element&gt;track&lt;/a&gt;&lt;/code&gt;&lt;/th&gt; &lt;td&gt;Timed text track&lt;/td&gt; &lt;td&gt;none&lt;/td&gt; - &lt;td&gt;&lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt;; - &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; + &lt;td&gt;&lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt;; + &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; &lt;td&gt;empty&lt;/td&gt; &lt;td&gt;&lt;a href=#global-attributes title=&quot;global attributes&quot;&gt;globals&lt;/a&gt;; &lt;code title=attr-track-default&gt;&lt;a href=#attr-track-default&gt;default&lt;/a&gt;&lt;/code&gt;; @@ -91688,7 +91682,7 @@ &lt;td&gt;&lt;a href=#phrasing-content title=&quot;Phrasing content&quot;&gt;phrasing&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;a href=#global-attributes title=&quot;global attributes&quot;&gt;globals&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;code&gt;&lt;a href=#htmlelement&gt;HTMLElement&lt;/a&gt;&lt;/code&gt;&lt;/td&gt; - &lt;tr&gt;&lt;th&gt;&lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt;&lt;/th&gt; + &lt;tr&gt;&lt;th&gt;&lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt;&lt;/th&gt; &lt;td&gt;Video player&lt;/td&gt; &lt;td&gt;&lt;a href=#flow-content title=&quot;Flow content&quot;&gt;flow&lt;/a&gt;; &lt;a href=#phrasing-content title=&quot;Phrasing content&quot;&gt;phrasing&lt;/a&gt;; @@ -91734,13 +91728,13 @@ &lt;tbody&gt;&lt;tr&gt;&lt;td&gt; &lt;a href=#metadata-content&gt;Metadata content&lt;/a&gt; &lt;td&gt; &lt;code&gt;&lt;a href=#the-base-element&gt;base&lt;/a&gt;&lt;/code&gt;; - &lt;code&gt;&lt;a href=#the-command&gt;command&lt;/a&gt;&lt;/code&gt;; + &lt;code&gt;&lt;a href=#the-command-element&gt;command&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-link-element&gt;link&lt;/a&gt;&lt;/code&gt;; - &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt;; + &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt;; - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt;; + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-style-element&gt;style&lt;/a&gt;&lt;/code&gt;; - &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt; + &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt; &lt;td&gt; &mdash; @@ -91751,7 +91745,7 @@ &lt;code&gt;&lt;a href=#the-address-element&gt;address&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-article-element&gt;article&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-aside-element&gt;aside&lt;/a&gt;&lt;/code&gt;; - &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt;; + &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-bdi-element&gt;bdi&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-bdo-element&gt;bdo&lt;/a&gt;&lt;/code&gt;; @@ -91761,7 +91755,7 @@ &lt;code&gt;&lt;a href=#the-canvas-element&gt;canvas&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-cite-element&gt;cite&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-code-element&gt;code&lt;/a&gt;&lt;/code&gt;; - &lt;code&gt;&lt;a href=#the-command&gt;command&lt;/a&gt;&lt;/code&gt;; + &lt;code&gt;&lt;a href=#the-command-element&gt;command&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-datalist-element&gt;datalist&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-del-element&gt;del&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-details-element&gt;details&lt;/a&gt;&lt;/code&gt;; @@ -91794,7 +91788,7 @@ &lt;code&gt;&lt;a href=#the-map-element&gt;map&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-mark-element&gt;mark&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#math&gt;math&lt;/a&gt;&lt;/code&gt;; - &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt;; + &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-meter-element&gt;meter&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-nav-element&gt;nav&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-noscript-element&gt;noscript&lt;/a&gt;&lt;/code&gt;; @@ -91808,7 +91802,7 @@ &lt;code&gt;&lt;a href=#the-ruby-element&gt;ruby&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-s-element&gt;s&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-samp-element&gt;samp&lt;/a&gt;&lt;/code&gt;; - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt;; + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-section-element&gt;section&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-select-element&gt;select&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-small-element&gt;small&lt;/a&gt;&lt;/code&gt;; @@ -91823,14 +91817,14 @@ &lt;code&gt;&lt;a href=#the-u-element&gt;u&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-ul-element&gt;ul&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-var-element&gt;var&lt;/a&gt;&lt;/code&gt;; - &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt;; + &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-wbr-element&gt;wbr&lt;/a&gt;&lt;/code&gt;; &lt;a href=#text-content title=&quot;text content&quot;&gt;Text&lt;/a&gt; &lt;td&gt; &lt;code&gt;&lt;a href=#the-area-element&gt;area&lt;/a&gt;&lt;/code&gt; (if it is a descendant of a &lt;code&gt;&lt;a href=#the-map-element&gt;map&lt;/a&gt;&lt;/code&gt; element); &lt;!--MD--&gt; &lt;code&gt;&lt;a href=#the-link-element&gt;link&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-itemprop&gt;&lt;a href=#names:-the-itemprop-attribute&gt;itemprop&lt;/a&gt;&lt;/code&gt; attribute is present); - &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-itemprop&gt;&lt;a href=#names:-the-itemprop-attribute&gt;itemprop&lt;/a&gt;&lt;/code&gt; attribute is present); + &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-itemprop&gt;&lt;a href=#names:-the-itemprop-attribute&gt;itemprop&lt;/a&gt;&lt;/code&gt; attribute is present); &lt;!--MD--&gt; &lt;code&gt;&lt;a href=#the-style-element&gt;style&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-style-scoped&gt;&lt;a href=#attr-style-scoped&gt;scoped&lt;/a&gt;&lt;/code&gt; attribute is present) @@ -91858,7 +91852,7 @@ &lt;tr&gt;&lt;td&gt; &lt;a href=#phrasing-content&gt;Phrasing content&lt;/a&gt; &lt;td&gt; &lt;code&gt;&lt;a href=#the-abbr-element&gt;abbr&lt;/a&gt;&lt;/code&gt;; - &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt;; + &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-bdi-element&gt;bdi&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-bdo-element&gt;bdo&lt;/a&gt;&lt;/code&gt;; @@ -91867,7 +91861,7 @@ &lt;code&gt;&lt;a href=#the-canvas-element&gt;canvas&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-cite-element&gt;cite&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-code-element&gt;code&lt;/a&gt;&lt;/code&gt;; - &lt;code&gt;&lt;a href=#the-command&gt;command&lt;/a&gt;&lt;/code&gt;; + &lt;code&gt;&lt;a href=#the-command-element&gt;command&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-datalist-element&gt;datalist&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-dfn-element&gt;dfn&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-em-element&gt;em&lt;/a&gt;&lt;/code&gt;; @@ -91890,7 +91884,7 @@ &lt;code&gt;&lt;a href=#the-ruby-element&gt;ruby&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-s-element&gt;s&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-samp-element&gt;samp&lt;/a&gt;&lt;/code&gt;; - &lt;code&gt;&lt;a href=#script&gt;script&lt;/a&gt;&lt;/code&gt;; + &lt;code&gt;&lt;a href=#the-script-element&gt;script&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-select-element&gt;select&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-small-element&gt;small&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-span-element&gt;span&lt;/a&gt;&lt;/code&gt;; @@ -91902,7 +91896,7 @@ &lt;code&gt;&lt;a href=#the-time-element&gt;time&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-u-element&gt;u&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-var-element&gt;var&lt;/a&gt;&lt;/code&gt;; - &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt;; + &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-wbr-element&gt;wbr&lt;/a&gt;&lt;/code&gt;; &lt;a href=#text-content title=&quot;text content&quot;&gt;Text&lt;/a&gt; &lt;td&gt; @@ -91915,13 +91909,13 @@ &lt;!--MD--&gt; &lt;code&gt;&lt;a href=#the-map-element&gt;map&lt;/a&gt;&lt;/code&gt; (if it contains only &lt;a href=#phrasing-content&gt;phrasing content&lt;/a&gt;)&lt;!-- --&gt;&lt;!--MD--&gt;&lt;!-- - --&gt;; &lt;code&gt;&lt;a href=#meta&gt;meta&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-itemprop&gt;&lt;a href=#names:-the-itemprop-attribute&gt;itemprop&lt;/a&gt;&lt;/code&gt; attribute is present)&lt;!-- + --&gt;; &lt;code&gt;&lt;a href=#the-meta-element&gt;meta&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-itemprop&gt;&lt;a href=#names:-the-itemprop-attribute&gt;itemprop&lt;/a&gt;&lt;/code&gt; attribute is present)&lt;!-- --&gt;&lt;!--MD--&gt;&lt;!-- --&gt; &lt;tr&gt;&lt;td&gt; &lt;a href=#embedded-content&gt;Embedded content&lt;/a&gt; &lt;td&gt; - &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; + &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; &lt;code&gt;&lt;a href=#the-canvas-element&gt;canvas&lt;/a&gt;&lt;/code&gt; &lt;code&gt;&lt;a href=#the-embed-element&gt;embed&lt;/a&gt;&lt;/code&gt; &lt;code&gt;&lt;a href=#the-iframe-element&gt;iframe&lt;/a&gt;&lt;/code&gt; @@ -91929,7 +91923,7 @@ &lt;code&gt;&lt;a href=#math&gt;math&lt;/a&gt;&lt;/code&gt; &lt;code&gt;&lt;a href=#the-object-element&gt;object&lt;/a&gt;&lt;/code&gt; &lt;code&gt;&lt;a href=#svg&gt;svg&lt;/a&gt;&lt;/code&gt; - &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; + &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; &lt;td&gt; &mdash; @@ -91945,12 +91939,12 @@ &lt;code&gt;&lt;a href=#the-select-element&gt;select&lt;/a&gt;&lt;/code&gt;; &lt;code&gt;&lt;a href=#the-textarea-element&gt;textarea&lt;/a&gt;&lt;/code&gt;; &lt;td&gt; - &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-media-controls&gt;&lt;a href=#attr-media-controls&gt;controls&lt;/a&gt;&lt;/code&gt; attribute is present); + &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-media-controls&gt;&lt;a href=#attr-media-controls&gt;controls&lt;/a&gt;&lt;/code&gt; attribute is present); &lt;code&gt;&lt;a href=#the-img-element&gt;img&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-hyperlink-usemap&gt;&lt;a href=#attr-hyperlink-usemap&gt;usemap&lt;/a&gt;&lt;/code&gt; attribute is present); &lt;code&gt;&lt;a href=#the-input-element&gt;input&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-input-type&gt;&lt;a href=#attr-input-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute is &lt;em&gt;not&lt;/em&gt; in the &lt;a href=#hidden-state title=attr-input-type-hidden&gt;Hidden&lt;/a&gt; state); - &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute is in the &lt;a href=#toolbar-state title=&quot;toolbar state&quot;&gt;toolbar&lt;/a&gt; state); + &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-menu-type&gt;&lt;a href=#attr-menu-type&gt;type&lt;/a&gt;&lt;/code&gt; attribute is in the &lt;a href=#toolbar-state title=&quot;toolbar state&quot;&gt;toolbar&lt;/a&gt; state); &lt;code&gt;&lt;a href=#the-object-element&gt;object&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-hyperlink-usemap&gt;&lt;a href=#attr-hyperlink-usemap&gt;usemap&lt;/a&gt;&lt;/code&gt; attribute is present)&lt;!-- see also comment in &lt;object&gt; section --&gt;; - &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-media-controls&gt;&lt;a href=#attr-media-controls&gt;controls&lt;/a&gt;&lt;/code&gt; attribute is present) + &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; (if the &lt;code title=attr-media-controls&gt;&lt;a href=#attr-media-controls&gt;controls&lt;/a&gt;&lt;/code&gt; attribute is present) &lt;tr&gt;&lt;td&gt; &lt;a href=#sectioning-root title=&quot;sectioning root&quot;&gt;Sectioning roots&lt;/a&gt; &lt;td&gt; @@ -93166,7 +93160,7 @@ &lt;tr&gt;&lt;td&gt; &lt;code&gt;&lt;a href=#the-aside-element&gt;aside&lt;/a&gt;&lt;/code&gt; &lt;td&gt; &lt;code&gt;&lt;a href=#htmlelement&gt;HTMLElement&lt;/a&gt;&lt;/code&gt; - &lt;tr&gt;&lt;td&gt; &lt;code&gt;&lt;a href=#audio&gt;audio&lt;/a&gt;&lt;/code&gt; + &lt;tr&gt;&lt;td&gt; &lt;code&gt;&lt;a href=#the-audio-element&gt;audio&lt;/a&gt;&lt;/code&gt; &lt;td&gt; &lt;code&gt;&lt;a href=#htmlaudioelement&gt;HTMLAudioElement&lt;/a&gt;&lt;/code&gt; : &lt;code&gt;&lt;a href=#htmlmediaelement&gt;HTMLMediaElement&lt;/a&gt;&lt;/code&gt; : &lt;code&gt;&lt;a href=#htmlelement&gt;HTMLElement&lt;/a&gt;&lt;/code&gt; &lt;tr&gt;&lt;td&gt; &lt;code&gt;&lt;a href=#the-b-element&gt;b&lt;/a&gt;&lt;/code&gt; @@ -93211,7 +93205,7 @@ &lt;tr&gt;&lt;td&gt; &lt;code&gt;&lt;a href=#the-colgroup-element&gt;colgroup&lt;/a&gt;&lt;/code&gt; &lt;td&gt; &lt;code&gt;&lt;a href=#htmltablecolelement&gt;HTMLTableColElement&lt;/a&gt;&lt;/code&gt; : &lt;code&gt;&lt;a href=#htmlelement&gt;HTMLElement&lt;/a&gt;&lt;/code&gt; - &lt;tr&gt;&lt;td&gt; &lt;code&gt;&lt;a href=#the-command&gt;command&lt;/a&gt;&lt;/code&gt; + &lt;tr&gt;&lt;td&gt; &lt;code&gt;&lt;a href=#the-command-element&gt;command&lt;/a&gt;&lt;/code&gt; &lt;td&gt; &lt;code&gt;&lt;a href=#htmlcommandelement&gt;HTMLCommandElement&lt;/a&gt;&lt;/code&gt; : &lt;code&gt;&lt;a href=#htmlelement&gt;HTMLElement&lt;/a&gt;&lt;/code&gt; &lt;tr&gt;&lt;td&gt; &lt;code&gt;&lt;a href=#the-datalist-element&gt;datalist&lt;/a&gt;&lt;/code&gt; @@ -93256,7 +93250,7 @@ &lt;tr&gt;&lt;td&gt; &lt;code&gt;&lt;a href=#the-form-element&gt;form&lt;/a&gt;&lt;/code&gt; &lt;td&gt; &lt;code&gt;&lt;a href=#htmlformelement&gt;HTMLFormElement&lt;/a&gt;&lt;/code&gt; : &lt;code&gt;&lt;a href=#htmlelement&gt;HTMLElement&lt;/a&gt;&lt;/code&gt; - &lt;tr&gt;&lt;td&gt; &lt;code&gt;&lt;a href=#the-head-element-0&gt;head&lt;/a&gt;&lt;/code&gt; + &lt;tr&gt;&lt;td&gt; &lt;code&gt;&lt;a href=#the-head-element&gt;head&lt;/a&gt;&lt;/code&gt; &lt;td&gt; &lt;code&gt;&lt;a href=#htmlheadelement&gt;HTMLHeadElement&lt;/a&gt;&lt;/code&gt; : &lt;code&gt;&lt;a href=#htmlelement&gt;HTMLElement&lt;/a&gt;&lt;/code&gt; &lt;tr&gt;&lt;td&gt; &lt;code&gt;&lt;a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements&gt;h1&lt;/a&gt;&lt;/code&gt; @@ -93286,7 +93280,7 @@ &lt;tr&gt;&lt;td&gt; &lt;code&gt;&lt;a href=#the-hr-element&gt;hr&lt;/a&gt;&lt;/code&gt; &lt;td&gt; &lt;code&gt;&lt;a href=#htmlhrelement&gt;HTMLHRElement&lt;/a&gt;&lt;/code&gt; : &lt;code&gt;&lt;a href=#htmlelement&gt;HTMLElement&lt;/a&gt;&lt;/code&gt; - &lt;tr&gt;&lt;td&gt; &lt;code&gt;&lt;a href=#the-html-element-0&gt;html&lt;/a&gt;&lt;/code&gt; + &lt;tr&gt;&lt;td&gt; &lt;code&gt;&lt;a href=#the-html-element&gt;html&lt;/a&gt;&lt;/code&gt; &lt;td&gt; &lt;code&gt;&lt;a href=#htmlhtmlelement&gt;HTMLHtmlElement&lt;/a&gt;&lt;/code&gt; : &lt;code&gt;&lt;a href=#htmlelement&gt;HTMLElement&lt;/a&gt;&lt;/code&gt; &lt;tr&gt;&lt;td&gt; &lt;code&gt;&lt;a href=#the-i-element&gt;i&lt;/a&gt;&lt;/code&gt; @@ -93436,7 +93430,7 @@ &lt;tr&gt;&lt;td&gt; &lt;code&gt;&lt;a href=#the-time-element&gt;time&lt;/a&gt;&lt;/code&gt; &lt;td&gt; &lt;code&gt;&lt;a href=#htmltimeelement&gt;HTMLTimeElement&lt;/a&gt;&lt;/code&gt; : &lt;code&gt;&lt;a href=#htmlelement&gt;HTMLElement&lt;/a&gt;&lt;/code&gt; - &lt;tr&gt;&lt;td&gt; &lt;code&gt;&lt;a href=#the-title-element-0&gt;title&lt;/a&gt;&lt;/code&gt; + &lt;tr&gt;&lt;td&gt; &lt;code&gt;&lt;a href=#the-title-element&gt;title&lt;/a&gt;&lt;/code&gt; &lt;td&gt; &lt;code&gt;&lt;a href=#htmltitleelement&gt;HTMLTitleElement&lt;/a&gt;&lt;/code&gt; : &lt;code&gt;&lt;a href=#htmlelement&gt;HTMLElement&lt;/a&gt;&lt;/code&gt; &lt;tr&gt;&lt;td&gt; &lt;code&gt;&lt;a href=#the-tr-element&gt;tr&lt;/a&gt;&lt;/code&gt; @@ -93454,7 +93448,7 @@ &lt;tr&gt;&lt;td&gt; &lt;code&gt;&lt;a href=#the-var-element&gt;var&lt;/a&gt;&lt;/code&gt; &lt;td&gt; &lt;code&gt;&lt;a href=#htmlelement&gt;HTMLElement&lt;/a&gt;&lt;/code&gt; - &lt;tr&gt;&lt;td&gt; &lt;code&gt;&lt;a href=#video&gt;video&lt;/a&gt;&lt;/code&gt; + &lt;tr&gt;&lt;td&gt; &lt;code&gt;&lt;a href=#the-video-element&gt;video&lt;/a&gt;&lt;/code&gt; &lt;td&gt; &lt;code&gt;&lt;a href=#htmlvideoelement&gt;HTMLVideoElement&lt;/a&gt;&lt;/code&gt; : &lt;code&gt;&lt;a href=#htmlmediaelement&gt;HTMLMediaElement&lt;/a&gt;&lt;/code&gt; : &lt;code&gt;&lt;a href=#htmlelement&gt;HTMLElement&lt;/a&gt;&lt;/code&gt; &lt;tr&gt;&lt;td&gt; &lt;code&gt;&lt;a href=#the-wbr-element&gt;wbr&lt;/a&gt;&lt;/code&gt; @@ -93568,7 +93562,7 @@ &lt;tr&gt;&lt;td&gt; &lt;code title=event-show&gt;show&lt;/code&gt; &lt;td&gt; &lt;code&gt;&lt;a href=#event&gt;Event&lt;/a&gt;&lt;/code&gt; - &lt;td&gt; Fired at a &lt;code&gt;&lt;a href=#menus&gt;menu&lt;/a&gt;&lt;/code&gt; element when it is shown as a context menu + &lt;td&gt; Fired at a &lt;code&gt;&lt;a href=#the-menu-element&gt;menu&lt;/a&gt;&lt;/code&gt; element when it is shown as a context menu &lt;tr&gt;&lt;td&gt; &lt;code title=event-submit&gt;submit&lt;/code&gt; &lt;td&gt; &lt;code&gt;&lt;a href=#event&gt;Event&lt;/a&gt;&lt;/code&gt; Modified: source =================================================================== --- source 2011-05-03 01:10:20 UTC (rev 6049) +++ source 2011-05-03 19:18:56 UTC (rev 6050) @@ -13864,7 +13864,7 @@ &lt;h3&gt;The root element&lt;/h3&gt; - &lt;h4&gt;The &lt;dfn&gt;&lt;code&gt;html&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; + &lt;h4 id=&quot;the-html-element&quot;&gt;The &lt;dfn&gt;&lt;code&gt;html&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; &lt;dl class=&quot;element&quot;&gt; &lt;dt&gt;Categories&lt;/dt&gt; @@ -13936,7 +13936,7 @@ &lt;h3&gt;Document metadata&lt;/h3&gt; - &lt;h4&gt;The &lt;dfn&gt;&lt;code&gt;head&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; + &lt;h4 id=&quot;the-head-element&quot;&gt;The &lt;dfn&gt;&lt;code&gt;head&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; &lt;dl class=&quot;element&quot;&gt; &lt;dt&gt;Categories&lt;/dt&gt; @@ -13996,7 +13996,7 @@ - &lt;h4&gt;The &lt;dfn&gt;&lt;code&gt;title&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; + &lt;h4 id=&quot;the-title-element&quot;&gt;The &lt;dfn&gt;&lt;code&gt;title&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; &lt;dl class=&quot;element&quot;&gt; &lt;dt&gt;Categories&lt;/dt&gt; @@ -14643,7 +14643,7 @@ - &lt;h4 id=&quot;meta&quot;&gt;The &lt;dfn&gt;&lt;code&gt;meta&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; + &lt;h4 id=&quot;the-meta-element&quot;&gt;The &lt;dfn id=&quot;meta&quot;&gt;&lt;code&gt;meta&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; &lt;dl class=&quot;element&quot;&gt; &lt;dt&gt;Categories&lt;/dt&gt; @@ -16175,7 +16175,7 @@ &lt;/div&gt; - &lt;h4 id=&quot;script&quot;&gt;The &lt;dfn&gt;&lt;code&gt;script&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; + &lt;h4 id=&quot;the-script-element&quot;&gt;The &lt;dfn id=&quot;script&quot;&gt;&lt;code&gt;script&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; &lt;dl class=&quot;element&quot;&gt; &lt;dt&gt;Categories&lt;/dt&gt; @@ -18299,10 +18299,12 @@ - &lt;h4&gt;The &lt;dfn&gt;&lt;code&gt;h1&lt;/code&gt;&lt;/dfn&gt;, &lt;dfn&gt;&lt;code&gt;h2&lt;/code&gt;&lt;/dfn&gt;, - &lt;dfn&gt;&lt;code&gt;h3&lt;/code&gt;&lt;/dfn&gt;, &lt;dfn&gt;&lt;code&gt;h4&lt;/code&gt;&lt;/dfn&gt;, - &lt;dfn&gt;&lt;code&gt;h5&lt;/code&gt;&lt;/dfn&gt;, and &lt;dfn&gt;&lt;code&gt;h6&lt;/code&gt;&lt;/dfn&gt; - elements&lt;/h4&gt; + &lt;h4&gt;The &lt;dfn id=&quot;the-h1-element&quot;&gt;&lt;code&gt;h1&lt;/code&gt;&lt;/dfn&gt;, &lt;dfn + id=&quot;the-h2-element&quot;&gt;&lt;code&gt;h2&lt;/code&gt;&lt;/dfn&gt;, &lt;dfn + id=&quot;the-h3-element&quot;&gt;&lt;code&gt;h3&lt;/code&gt;&lt;/dfn&gt;, &lt;dfn + id=&quot;the-h4-element&quot;&gt;&lt;code&gt;h4&lt;/code&gt;&lt;/dfn&gt;, &lt;dfn + id=&quot;the-h5-element&quot;&gt;&lt;code&gt;h5&lt;/code&gt;&lt;/dfn&gt;, and &lt;dfn + id=&quot;the-h6-element&quot;&gt;&lt;code&gt;h6&lt;/code&gt;&lt;/dfn&gt; elements&lt;/h4&gt; &lt;dl class=&quot;element&quot;&gt; &lt;dt&gt;Categories&lt;/dt&gt; @@ -22105,7 +22107,7 @@ &lt;/div&gt; - &lt;h4&gt;The &lt;dfn&gt;&lt;code&gt;sub&lt;/code&gt;&lt;/dfn&gt; and &lt;dfn&gt;&lt;code&gt;sup&lt;/code&gt;&lt;/dfn&gt; elements&lt;/h4&gt; + &lt;h4&gt;The &lt;dfn id=&quot;the-sub-element&quot;&gt;&lt;code&gt;sub&lt;/code&gt;&lt;/dfn&gt; and &lt;dfn id=&quot;the-sup-element&quot;&gt;&lt;code&gt;sup&lt;/code&gt;&lt;/dfn&gt; elements&lt;/h4&gt; &lt;dl class=&quot;element&quot;&gt; &lt;dt&gt;Categories&lt;/dt&gt; @@ -27254,7 +27256,7 @@ &lt;/div&gt; - &lt;h4 id=&quot;video&quot;&gt;The &lt;dfn&gt;&lt;code&gt;video&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; + &lt;h4 id=&quot;the-video-element&quot;&gt;The &lt;dfn id=&quot;video&quot;&gt;&lt;code&gt;video&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; &lt;dl class=&quot;element&quot;&gt; &lt;dt&gt;Categories&lt;/dt&gt; @@ -27627,7 +27629,7 @@ - &lt;h4 id=&quot;audio&quot;&gt;The &lt;dfn&gt;&lt;code&gt;audio&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; + &lt;h4 id=&quot;the-audio-element&quot;&gt;The &lt;dfn id=&quot;audio&quot;&gt;&lt;code&gt;audio&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; &lt;dl class=&quot;element&quot;&gt; &lt;dt&gt;Categories&lt;/dt&gt; @@ -58128,7 +58130,7 @@ - &lt;h4 id=&quot;the-command&quot;&gt;The &lt;dfn&gt;&lt;code&gt;command&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; + &lt;h4 id=&quot;the-command-element&quot;&gt;The &lt;dfn id=&quot;the-command&quot;&gt;&lt;code&gt;command&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; &lt;dl class=&quot;element&quot;&gt; &lt;dt&gt;Categories&lt;/dt&gt; @@ -58392,7 +58394,7 @@ - &lt;h4 id=&quot;menus&quot;&gt;The &lt;dfn&gt;&lt;code&gt;menu&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; + &lt;h4 id=&quot;the-menu-element&quot;&gt;The &lt;dfn id=&quot;menus&quot;&gt;&lt;code&gt;menu&lt;/code&gt;&lt;/dfn&gt; element&lt;/h4&gt; &lt;dl class=&quot;element&quot;&gt; &lt;dt&gt;Categories&lt;/dt&gt; </PRE> <!--endarticle--> <!--htdig_noindex--> <HR> <P><UL> <!--threads--> <LI>Previous message: <A HREF="012916.html">[html5] r6049 - [e] (0) Try to warn implementors about XSLT. Fixing http://www.w3.org/Bugs/Publi [...] </A></li> <LI>Next message: <A HREF="012917.html">[html5] r6051 - [e] (0) add a note to clarify interaction with rfc 2388 Fixing http://www.w3.org [...] </A></li> <LI> <B>Messages sorted by:</B> <a href="date.html#12918">[ date ]</a> <a href="thread.html#12918">[ thread ]</a> <a href="subject.html#12918">[ subject ]</a> <a href="author.html#12918">[ author ]</a> </LI> </UL> <hr> <a href="http://lists.whatwg.org/listinfo.cgi/commit-watchers-whatwg.org">More information about the Commit-Watchers mailing list</a><br> <!--/htdig_noindex--> </body></html>
103.031243
1,660
0.672638
20f2843669d92bffda5466d51b601f23c7135bcb
681
sql
SQL
data/seed.sql
brendanwelzien/bookApp
95571630992d50bd7a176971e258620439fd006d
[ "MIT" ]
null
null
null
data/seed.sql
brendanwelzien/bookApp
95571630992d50bd7a176971e258620439fd006d
[ "MIT" ]
null
null
null
data/seed.sql
brendanwelzien/bookApp
95571630992d50bd7a176971e258620439fd006d
[ "MIT" ]
1
2020-11-03T00:26:34.000Z
2020-11-03T00:26:34.000Z
INSERT INTO book (title, author, description, image_url, isbn) VALUES ('Arrows of the Night', 'Richard Bonin','Controversial efforts of US helping remove Saddem Hussein from power.', 'https://picsum.photos/200/300', '555555'); INSERT INTO book (title, author, description, image_url, isbn) VALUES ('Arrows of the Night', 'Richard Bonin','Controversial efforts of US helping remove Saddem Hussein from power.', 'https://picsum.photos/200/300', '555555'); INSERT INTO book (title, author, description, image_url, isbn) VALUES ('Arrows of the Night', 'Richard Bonin','Controversial efforts of US helping remove Saddem Hussein from power.', 'https://picsum.photos/200/300', '555555');
97.285714
163
0.753304
e90e9c088e7aa211913ae360841ed85fa82f0769
41,820
cxx
C++
extras/COMMIT_debugger/OPENGL_callbacks.cxx
ilariagabusi/COMMIT
a9e57eac8bca5ffb99b26b5fc9d255003d408410
[ "BSD-3-Clause" ]
36
2015-02-10T21:36:31.000Z
2022-02-16T07:33:06.000Z
extras/COMMIT_debugger/OPENGL_callbacks.cxx
ilariagabusi/COMMIT
a9e57eac8bca5ffb99b26b5fc9d255003d408410
[ "BSD-3-Clause" ]
61
2015-05-27T15:20:33.000Z
2022-03-05T13:51:26.000Z
extras/COMMIT_debugger/OPENGL_callbacks.cxx
ilariagabusi/COMMIT
a9e57eac8bca5ffb99b26b5fc9d255003d408410
[ "BSD-3-Clause" ]
31
2015-03-10T16:19:15.000Z
2022-03-16T10:57:26.000Z
#define GL_GLEXT_PROTOTYPES 1 #ifdef __APPLE__ #include <OpenGL/gl.h> #include <OpenGL/glext.h> #include <GLUT/glut.h> #else #include <GL/gl.h> #include <GL/glext.h> #include <GL/glut.h> #endif #include "OPENGL_utils.h" using namespace OPENGL_utils; /* global variables */ GLfloat id[16], rot[16], rot1[16], rot2[16], rot3[16]; Vec3Df translation; Vec3Di start; GLint moving; GLfloat zoom; float ScreenX, ScreenY; void drawString( const char *string ) { static int y = glutGet( GLUT_WINDOW_HEIGHT ) - 50; if ( string=="" ) y = glutGet( GLUT_WINDOW_HEIGHT ) - 50; else { glRasterPos2i(10, y); for (const char* c=string; *c != '\0'; c++) glutBitmapCharacter(GLUT_BITMAP_9_BY_15, *c); y -= 18; } } void PrintConfig() { if ( !showConfig ) return; glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity(); glMatrixMode( GL_MODELVIEW ) ; glPushMatrix() ; glLoadIdentity() ; int w = glutGet( GLUT_WINDOW_WIDTH ); int h = glutGet( GLUT_WINDOW_HEIGHT ); glOrtho( 0, w, 0, h, -1, 1 ); glDisable( GL_DEPTH_TEST ); char s[1024]; glColor3f(1, 1, 0); drawString( "" ); // reset initial position drawString( "MAP" ); sprintf( s, " - value(%d,%d,%d) = %.2f", VOXEL.x, VOXEL.y, VOXEL.z, MAP(VOXEL.x, VOXEL.y, VOXEL.z) ); drawString( s ); sprintf( s, " - range = [ %.1f ... %.1f ]", MAP_min_view, MAP_max_view ); drawString( s ); sprintf( s, " - opacity = %.1f", MAP_opacity ); drawString( s ); drawString( "SIGNAL" ); sprintf( s, " - shell = %d/%d (b=%.1f)", GLYPHS_shell+1, SCHEME_shells_b.size(), SCHEME_shells_b[GLYPHS_shell] ); drawString( s ); sprintf( s, " - use affine = %s", GLYPHS_use_affine?"true":"false" ); drawString( s ); sprintf( s, " - flip = [ %d, %d, %d ]", GLYPHS_flip[0], GLYPHS_flip[1], GLYPHS_flip[2] ); drawString( s ); sprintf( s, " - b0 thr = %.1f", GLYPHS_b0_thr ); drawString( s ); if ( PEAKS_n>0 ) { drawString( "PEAKS" ); sprintf( s, " - use affine = %s", PEAKS_use_affine?"true":"false" ); drawString( s ); sprintf( s, " - flip = [ %d, %d, %d ]", PEAKS_flip[0], PEAKS_flip[1], PEAKS_flip[2] ); drawString( s ); sprintf( s, " - thr = %.1f", PEAKS_thr ); drawString( s ); sprintf( s, " - normalize = %s", PEAKS_doNormalize?"true":"false" ); drawString( s ); } if ( TRK_nTractsPlotted>0 ) { drawString( "FIBERS" ); sprintf( s, " - shift = [ %.1f %.1f %.1f ] (voxels)", TRK_offset.x, TRK_offset.y, TRK_offset.z ); drawString( s ); sprintf( s, " - slab thickness = %.1f (voxels)", TRK_crop ); drawString( s ); } glEnable (GL_DEPTH_TEST); glMatrixMode(GL_PROJECTION); glPopMatrix(); glMatrixMode(GL_MODELVIEW); glPopMatrix(); } // KEYBOARD callback // ----------------- void GLUT__keyboard( unsigned char key, GLint x=0, GLint y=0 ) { bool doRedraw = true; switch( key ) { case 'l': showConfig = 1 - showConfig; break; case '1': showPlane[0] = 1 - showPlane[0]; break; case '2': showPlane[1] = 1 - showPlane[1]; break; case '3': showPlane[2] = 1 - showPlane[2]; break; case '4': showPlane[0] = 1; showPlane[1] = 0; showPlane[2] = 0; translation.x = translation.y = 0; OPENGL_utils::identity(rot1); OPENGL_utils::rotateX(rot1, 90.0, rot2); OPENGL_utils::rotateZ(rot2, 90.0, rot); break; case '5': showPlane[0] = 0; showPlane[1] = 1; showPlane[2] = 0; translation.x = translation.y = 0; OPENGL_utils::identity(rot1); OPENGL_utils::rotateX(rot1, 90.0, rot); break; case '6': showPlane[0] = 0; showPlane[1] = 0; showPlane[2] = 1; translation.x = translation.y = 0; OPENGL_utils::identity( rot ); break; case '0': showAxes = 1 - showAxes; break; case '-': zoom += 10.0; break; case '+': zoom -= 10.0; break; case 'm': MAP_max_view = fmaxf(0.0,MAP_max_view-MAP_max*0.05); break; case 'M': MAP_max_view = fminf(MAP_max,MAP_max_view+MAP_max*0.05); break; case 'o': MAP_opacity = fmaxf(0.0,MAP_opacity-0.1); break; case 'O': MAP_opacity = fminf(1.0,MAP_opacity+0.1); break; case 'w': LINE_width = fmaxf( 1,LINE_width-1); break; case 'W': LINE_width = fminf(10,LINE_width+1); break; case 'r': showPlane[0] = showPlane[1] = showPlane[2] = 1; translation.x = translation.y = 0; zoom = 0; OPENGL_utils::identity( rot ); break; case 's': GLYPHS_show = 1 - GLYPHS_show; break; case 'S': GLYPHS_shell = (GLYPHS_shell+1) % SCHEME_shells_idx.size(); break; case 'a': GLYPHS_use_affine = 1 - GLYPHS_use_affine; break; case 'x': GLYPHS_flip[0] = 1 - GLYPHS_flip[0]; for(int d=0; d < SCHEME_dirs.size() ;d++) SCHEME_dirs[d].x *= -1; break; case 'y': GLYPHS_flip[1] = 1 - GLYPHS_flip[1]; for(int d=0; d < SCHEME_dirs.size() ;d++) SCHEME_dirs[d].y *= -1; break; case 'z': GLYPHS_flip[2] = 1 - GLYPHS_flip[2]; for(int d=0; d < SCHEME_dirs.size() ;d++) SCHEME_dirs[d].z *= -1; break; case 'b': GLYPHS_b0_thr = fmaxf(0.0,GLYPHS_b0_thr-10.0); break; case 'B': GLYPHS_b0_thr = fminf(MAP_max,GLYPHS_b0_thr+10.0); break; case 'p': if ( PEAKS_n>0 ) PEAKS_show = 1 - PEAKS_show; break; case 'A': PEAKS_use_affine = 1 - PEAKS_use_affine; break; case 'X': PEAKS_flip[0] = 1 - PEAKS_flip[0]; break; case 'Y': PEAKS_flip[1] = 1 - PEAKS_flip[1]; break; case 'Z': PEAKS_flip[2] = 1 - PEAKS_flip[2]; break; case 't': PEAKS_thr = fmaxf(PEAKS_thr - 0.1, 0.0); break; case 'T': PEAKS_thr = fminf(PEAKS_thr + 0.1, 1.0); break; case 'n': PEAKS_doNormalize = 1 - PEAKS_doNormalize; break; case 'f': if ( TRK_nTractsPlotted>0 ) TRK_show = 1 - TRK_show; break; case 'c': TRK_crop = fmaxf( 0.0,TRK_crop-0.5); break; case 'C': TRK_crop = fminf(max(dim.x,max(dim.y,dim.z)),TRK_crop+0.5); break; case ' ': TRK_crop_mode = 1 - TRK_crop_mode; break; case 'q': case 27 : exit(0); break; default: doRedraw = false; } if ( doRedraw ) glutPostRedisplay(); } // MENU callback // ------------- void GLUT__menu( int id ) { switch( id ) { case 0: GLUT__keyboard('q'); break; case 101: GLUT__keyboard('s'); break; case 102: GLUT__keyboard('S'); break; case 103: GLUT__keyboard('a'); break; case 104: GLUT__keyboard('x'); break; case 105: GLUT__keyboard('y'); break; case 106: GLUT__keyboard('z'); break; case 107: GLUT__keyboard('b'); break; case 108: GLUT__keyboard('B'); break; case 201: GLUT__keyboard('p'); break; case 202: GLUT__keyboard('A'); break; case 203: GLUT__keyboard('X'); break; case 204: GLUT__keyboard('Y'); break; case 205: GLUT__keyboard('Z'); break; case 206: GLUT__keyboard('t'); break; case 207: GLUT__keyboard('T'); break; case 208: GLUT__keyboard('n'); break; case 301: GLUT__keyboard('f'); break; case 302: GLUT__keyboard('c'); break; case 303: GLUT__keyboard('C'); break; case 304: GLUT__keyboard(' '); break; case 401: GLUT__keyboard('1'); break; case 402: GLUT__keyboard('2'); break; case 403: GLUT__keyboard('3'); break; case 404: GLUT__keyboard('4'); break; case 405: GLUT__keyboard('5'); break; case 406: GLUT__keyboard('6'); break; case 407: GLUT__keyboard('0'); break; case 408: GLUT__keyboard('-'); break; case 409: GLUT__keyboard('+'); break; case 410: GLUT__keyboard('m'); break; case 411: GLUT__keyboard('M'); break; case 412: GLUT__keyboard('o'); break; case 413: GLUT__keyboard('O'); break; case 414: GLUT__keyboard('w'); break; case 415: GLUT__keyboard('W'); break; case 416: GLUT__keyboard('r'); break; case 417: GLUT__keyboard('l'); break; } } // Create the dropdown MENU // ------------------------ void GLUT__createMenu() { int submenu_SIGNAL_id, submenu_PEAKS_id, submenu_FIBERS_id, submenu_VIEW_id; submenu_SIGNAL_id = glutCreateMenu( GLUT__menu ); glutAddMenuEntry("[s] Show/hide", 101); glutAddMenuEntry("[S] Change shell", 102); glutAddMenuEntry("[a] Use affine", 103); glutAddMenuEntry("[x] Flip X axis", 104); glutAddMenuEntry("[y] Flip Y axis", 105); glutAddMenuEntry("[z] Flip Z axis", 106); glutAddMenuEntry("[b] Decrease b0 thr", 107); glutAddMenuEntry("[B] Increase b0 thr", 108); if ( PEAKS_n>0 ) { submenu_PEAKS_id = glutCreateMenu( GLUT__menu ); glutAddMenuEntry("[p] Show/hide", 201); glutAddMenuEntry("[A] Use affine", 202); glutAddMenuEntry("[X] Flip X axis", 203); glutAddMenuEntry("[Y] Flip Y axis", 204); glutAddMenuEntry("[Z] Flip Z axis", 205); glutAddMenuEntry("[t] Decrease threshold",206); glutAddMenuEntry("[T] Increase threshold",207); glutAddMenuEntry("[n] Normalize length", 208); } if ( TRK_nTractsPlotted>0 ) { submenu_FIBERS_id = glutCreateMenu( GLUT__menu ); glutAddMenuEntry("[f] Show/hide", 301); glutAddMenuEntry("[c] Decrease crop size",302); glutAddMenuEntry("[C] Increase crop size",303); glutAddMenuEntry("[ ] Change crop mode", 304); } submenu_VIEW_id = glutCreateMenu( GLUT__menu ); glutAddMenuEntry("[1] Show/hide YZ plane", 401); glutAddMenuEntry("[2] Show/hide XZ plane", 402); glutAddMenuEntry("[3] Show/hide XY plane", 403); glutAddMenuEntry("[4] Reset to YZ plane", 404); glutAddMenuEntry("[5] Reset to XZ plane", 405); glutAddMenuEntry("[6] Reset to XY plane", 406); glutAddMenuEntry("[0] Show/hide axes", 407); glutAddMenuEntry("[-] Decrease zoom", 408); glutAddMenuEntry("[+] Increase zoom", 409); glutAddMenuEntry("[m] Decrease max value", 410); glutAddMenuEntry("[M] Increase max value", 411); glutAddMenuEntry("[o] Decrease opacity", 412); glutAddMenuEntry("[O] Increase opacity", 413); glutAddMenuEntry("[t] Decrease line width",414); glutAddMenuEntry("[T] Increase line width",415); glutAddMenuEntry("[r] Reset view", 416); glutAddMenuEntry("[l] Show/hide log", 417); int menu_id = glutCreateMenu( GLUT__menu ); glutAddSubMenu("Signal", submenu_SIGNAL_id); if ( PEAKS_n>0 ) glutAddSubMenu("Peaks", submenu_PEAKS_id); if ( TRK_nTractsPlotted>0 ) glutAddSubMenu("Fibers", submenu_FIBERS_id); glutAddSubMenu("View options", submenu_VIEW_id); glutAddMenuEntry("Quit", 0); glutAttachMenu(GLUT_RIGHT_BUTTON); } // RESHAPE callback // ---------------- void GLUT__reshape( GLint w, GLint h ) { ScreenX = w; ScreenY = h; glViewport( 0, 0, w, h ); glMatrixMode( GL_PROJECTION ); glLoadIdentity(); gluPerspective( 45.0f, ScreenX/ScreenY, 1.0f, 5000.0f ); glMatrixMode( GL_MODELVIEW ); glLoadIdentity(); gluLookAt( 0.0, 0.0, 2.0 * max(pixdim.x*dim.x,pixdim.y*dim.y) * ScreenY/ScreenX, // eye point 0.0, 0.0, 0.0, // reference point 0.0, 1.0, 0.0 // up vector ); } // SPECIALKEY callback // ------------------- void GLUT__specialkey( GLint key, GLint x, GLint y ) { bool doRedraw = true; GLint modif = glutGetModifiers(); GLint ALT = modif & GLUT_ACTIVE_ALT; GLint CTRL = modif & GLUT_ACTIVE_CTRL; switch( key ) { case GLUT_KEY_LEFT: if ( ALT ) TRK_offset.x -= 0.5; else if ( CTRL ) translation.x -= 2.0; else VOXEL.x--; break; case GLUT_KEY_RIGHT: if ( ALT ) TRK_offset.x += 0.5; else if ( CTRL ) translation.x += 2.0; else VOXEL.x++; break; case GLUT_KEY_DOWN: if ( ALT ) TRK_offset.y -= 0.5; else if ( CTRL ) translation.y -= 2.0; else VOXEL.y--; break; case GLUT_KEY_UP: if ( ALT ) TRK_offset.y += 0.5; else if ( CTRL ) translation.y += 2.0; else VOXEL.y++; break; case GLUT_KEY_PAGE_DOWN: if ( ALT ) TRK_offset.z -= 0.5; else VOXEL.z--; break; case GLUT_KEY_PAGE_UP: if ( ALT ) TRK_offset.z += 0.5; else VOXEL.z++; break; default: doRedraw = false; } // check the bounds VOXEL.x = max( VOXEL.x, 0 ); VOXEL.y = max( VOXEL.y, 0 ); VOXEL.z = max( VOXEL.z, 0 ); VOXEL.x = min( VOXEL.x, dim.x-1 ); VOXEL.y = min( VOXEL.y, dim.y-1 ); VOXEL.z = min( VOXEL.z, dim.z-1 ); if ( doRedraw ) glutPostRedisplay(); } // MOUSE callback // -------------- void GLUT__mouse( GLint button, GLint state, GLint x, GLint y ) { if (state == GLUT_DOWN) { if ( button == GLUT_LEFT_BUTTON && glutGetModifiers() != GLUT_ACTIVE_CTRL ) { moving = 1; start.x = x; start.y = y; } // NOTE: does not work, issue with glutGetModifiers not getting CTRL // else if ( button == GLUT_LEFT_BUTTON && glutGetModifiers() == GLUT_ACTIVE_CTRL ) // { // moving = 2; // start.x = x; // start.y = y; // } else if ( (button == GLUT_MIDDLE_BUTTON) || (button == GLUT_LEFT_BUTTON && glutGetModifiers() == GLUT_ACTIVE_ALT) ) { moving = 3; start.x = x; start.y = y; } } else if (state == GLUT_UP) { moving = 0; } } // MOTION callback // --------------- void GLUT__motion( GLint x, GLint y ) { if (moving==1) { OPENGL_utils::translate(id, 0,0,0, rot1); OPENGL_utils::rotateY(id,start.x-x,rot3); OPENGL_utils::matXMat(rot,rot1,rot2); OPENGL_utils::rotateX(id,start.y-y,rot1); OPENGL_utils::matXMat(rot2,rot1,rot); OPENGL_utils::matXMat(rot,rot3,rot2); OPENGL_utils::translate(id, 0,0,0, rot1); OPENGL_utils::matXMat(rot2,rot1,rot); start.x = x; start.y = y; } else if (moving==2) { zoom = zoom + (y-start.y)/2.0; start.y = y; } else if (moving==3) { translation.x = translation.x - (start.x-x)/3.0; translation.y = translation.y + (start.y-y)/3.0; start.x = x; start.y = y; } glutPostRedisplay(); } // DISPLAY callback // ---------------- void GLUT__display( void ) { glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); glPushMatrix(); glTranslatef(translation.x, translation.y, -zoom); // mouse translation + zoom glMultMatrixf(rot); // mouse rotation glTranslatef( -pixdim.x*dim.x/2.0, -pixdim.y*dim.y/2.0, -pixdim.z*dim.z/2.0 ); // center the FOV glScalef( pixdim.x, pixdim.y, pixdim.z ); // account for voxel size glEnable(GL_MULTISAMPLE_ARB); /* ============= */ /* Draw the AXES */ /* ============= */ if ( showAxes ) { glLineWidth(2); glBegin(GL_LINES); glColor4f( 1,0,0,1); glVertex3f( 0,0,0 ); glVertex3f( 10, 0, 0 ); glColor4f( 0,1,0,1); glVertex3f( 0,0,0 ); glVertex3f( 0, 10, 0 ); glColor4f( 0,0,1,1); glVertex3f( 0,0,0 ); glVertex3f( 0, 0, 10 ); glEnd(); } /* =============== */ /* Draw the TRACTS */ /* =============== */ if ( TRK_show ) { glPushMatrix(); glTranslatef(TRK_offset.x, TRK_offset.y, TRK_offset.z); glLineWidth(1.0f); float *ptr = TRK_coords, *ptrc = TRK_colors; VECTOR<float> Vc( VOXEL.x+0.5, VOXEL.y+0.5, VOXEL.z+0.5 ); // voxel center float thr = 0.5*TRK_crop; for(int f=0; f < TRK_nTractsPlotted; f++) { glBegin(GL_LINE_STRIP); for(int i=0; i < TRK_nPoints[f]; i++) { // plot segment only if it's close to center of VOXEL if ( ( TRK_crop_mode && ( ( showPlane[0] && abs( (ptr[0]+TRK_offset.x) - Vc.x ) <= thr ) || ( showPlane[1] && abs( (ptr[1]+TRK_offset.y) - Vc.y ) <= thr ) || ( showPlane[2] && abs( (ptr[2]+TRK_offset.z) - Vc.z ) <= thr ) ) ) || ( !TRK_crop_mode && ( ( abs( (ptr[0]+TRK_offset.x) - Vc.x ) <= thr ) && ( abs( (ptr[1]+TRK_offset.y) - Vc.y ) <= thr ) && ( abs( (ptr[2]+TRK_offset.z) - Vc.z ) <= thr ) ) ) ) { glColor3f( ptrc[0], ptrc[1], ptrc[2] ); glVertex3f( ptr[0], ptr[1], ptr[2] ); } else { glEnd(); glBegin(GL_LINE_STRIP); } ptr += 3; ptrc += 3; } glEnd(); } glPopMatrix(); } /* ============== */ /* Draw the PEAKS */ /* ============== */ if ( PEAKS_show || GLYPHS_show ) { glDisable( GL_BLEND ); glLineWidth( LINE_width ); glPointSize( LINE_width ); glPushMatrix(); glTranslatef(.5,.5,.5); Vec3Df dir, col; int x,y,z,d,idx; float norms[PEAKS_n], normMax, b0, w; // plane YZ if ( showPlane[0] ) { x = (int)VOXEL.x; for(y=0; y<dim.y ;y++) for(z=0; z<dim.z ;z++) { if ( PEAKS_show ) { normMax = 0; for(d=0; d<PEAKS_n; d++) { col.x = (*niiPEAKS->img)(x,y,z,3*d+0); // use "col" as tmp variable col.y = (*niiPEAKS->img)(x,y,z,3*d+1); col.z = (*niiPEAKS->img)(x,y,z,3*d+2); if ( PEAKS_use_affine ) { dir.x = col.x * ((float*)PEAKS_affine)[0] + col.y * ((float*)PEAKS_affine)[1] + col.z * ((float*)PEAKS_affine)[2]; dir.y = col.x * ((float*)PEAKS_affine)[3] + col.y * ((float*)PEAKS_affine)[4] + col.z * ((float*)PEAKS_affine)[5]; dir.z = col.x * ((float*)PEAKS_affine)[6] + col.y * ((float*)PEAKS_affine)[7] + col.z * ((float*)PEAKS_affine)[8]; } else { dir.x = col.x; dir.y = col.y; dir.z = col.z; } norms[d] = dir.norm(); if ( norms[d] > normMax ) normMax = norms[d]; } for(d=0; d<PEAKS_n; d++) { if ( norms[d] < PEAKS_thr*normMax ) continue; col.x = (*niiPEAKS->img)(x,y,z,3*d+0); // use "col" as tmp variable col.y = (*niiPEAKS->img)(x,y,z,3*d+1); col.z = (*niiPEAKS->img)(x,y,z,3*d+2); if ( PEAKS_use_affine ) { dir.x = col.x * ((float*)PEAKS_affine)[0] + col.y * ((float*)PEAKS_affine)[1] + col.z * ((float*)PEAKS_affine)[2]; dir.y = col.x * ((float*)PEAKS_affine)[3] + col.y * ((float*)PEAKS_affine)[4] + col.z * ((float*)PEAKS_affine)[5]; dir.z = col.x * ((float*)PEAKS_affine)[6] + col.y * ((float*)PEAKS_affine)[7] + col.z * ((float*)PEAKS_affine)[8]; } else { dir.x = col.x; dir.y = col.y; dir.z = col.z; } col.x = 0.5 * (PEAKS_flip[0]?-1:1) * dir.x / norms[d]; col.y = 0.5 * (PEAKS_flip[1]?-1:1) * dir.y / norms[d]; col.z = 0.5 * (PEAKS_flip[2]?-1:1) * dir.z / norms[d]; if ( PEAKS_doNormalize ) { dir.x = col.x; dir.y = col.y; dir.z = col.z; } else { dir.x = col.x * norms[d] / normMax; dir.y = col.y * norms[d] / normMax; dir.z = col.z * norms[d] / normMax; } glColor3f( fabs(2.0*col.x), fabs(2.0*col.y), fabs(2.0*col.z) ); glBegin(GL_LINES); glVertex3f( x-dir.x, y-dir.y, z-dir.z ); glVertex3f( x+dir.x, y+dir.y, z+dir.z ); glEnd(); } } if ( GLYPHS_show ) { b0 = (*niiDWI->img)(x,y,z,SCHEME_idxB0[0]); if ( b0 > GLYPHS_b0_thr ) { glBegin(GL_POINTS); for(d=0; d < SCHEME_shells_idx[GLYPHS_shell].size() ;d++) { idx = SCHEME_shells_idx[GLYPHS_shell][d]; w = 0.5 * (float)(*niiDWI->img)(x,y,z,idx) / b0; if ( GLYPHS_use_affine ) { dir.x = SCHEME_dirs[idx].x * ((float*)GLYPHS_affine)[0] + SCHEME_dirs[idx].y * ((float*)GLYPHS_affine)[1] + SCHEME_dirs[idx].z * ((float*)GLYPHS_affine)[2]; dir.y = SCHEME_dirs[idx].x * ((float*)GLYPHS_affine)[3] + SCHEME_dirs[idx].y * ((float*)GLYPHS_affine)[4] + SCHEME_dirs[idx].z * ((float*)GLYPHS_affine)[5]; dir.z = SCHEME_dirs[idx].x * ((float*)GLYPHS_affine)[6] + SCHEME_dirs[idx].y * ((float*)GLYPHS_affine)[7] + SCHEME_dirs[idx].z * ((float*)GLYPHS_affine)[8]; normMax = dir.norm(); dir.x *= w / normMax; dir.y *= w / normMax; dir.z *= w / normMax; } else { dir.x = w * SCHEME_dirs[idx].x; dir.y = w * SCHEME_dirs[idx].y; dir.z = w * SCHEME_dirs[idx].z; } normMax = dir.norm(); glColor3f( fabs(dir.x)/normMax, fabs(dir.y)/normMax, fabs(dir.z)/normMax ); glVertex3f( x+dir.x, y+dir.y, z+dir.z ); glVertex3f( x-dir.x, y-dir.y, z-dir.z ); } glEnd(); } } } } // plane XZ if ( showPlane[1] ) { y = (int)VOXEL.y; for(x=0; x<dim.x ;x++) for(z=0; z<dim.z ;z++) { if ( PEAKS_show ) { normMax = 0; for(d=0; d<PEAKS_n; d++) { col.x = (*niiPEAKS->img)(x,y,z,3*d+0); // use "col" as tmp variable col.y = (*niiPEAKS->img)(x,y,z,3*d+1); col.z = (*niiPEAKS->img)(x,y,z,3*d+2); if ( PEAKS_use_affine ) { dir.x = col.x * ((float*)PEAKS_affine)[0] + col.y * ((float*)PEAKS_affine)[1] + col.z * ((float*)PEAKS_affine)[2]; dir.y = col.x * ((float*)PEAKS_affine)[3] + col.y * ((float*)PEAKS_affine)[4] + col.z * ((float*)PEAKS_affine)[5]; dir.z = col.x * ((float*)PEAKS_affine)[6] + col.y * ((float*)PEAKS_affine)[7] + col.z * ((float*)PEAKS_affine)[8]; } else { dir.x = col.x; dir.y = col.y; dir.z = col.z; } norms[d] = dir.norm(); if ( norms[d] > normMax ) normMax = norms[d]; } for(d=0; d<PEAKS_n; d++) { if ( norms[d] < normMax*PEAKS_thr ) continue; col.x = (*niiPEAKS->img)(x,y,z,3*d+0); // use "col" as tmp variable col.y = (*niiPEAKS->img)(x,y,z,3*d+1); col.z = (*niiPEAKS->img)(x,y,z,3*d+2); if ( PEAKS_use_affine ) { dir.x = col.x * ((float*)PEAKS_affine)[0] + col.y * ((float*)PEAKS_affine)[1] + col.z * ((float*)PEAKS_affine)[2]; dir.y = col.x * ((float*)PEAKS_affine)[3] + col.y * ((float*)PEAKS_affine)[4] + col.z * ((float*)PEAKS_affine)[5]; dir.z = col.x * ((float*)PEAKS_affine)[6] + col.y * ((float*)PEAKS_affine)[7] + col.z * ((float*)PEAKS_affine)[8]; } else { dir.x = col.x; dir.y = col.y; dir.z = col.z; } col.x = 0.5 * (PEAKS_flip[0]?-1:1) * dir.x / norms[d]; col.y = 0.5 * (PEAKS_flip[1]?-1:1) * dir.y / norms[d]; col.z = 0.5 * (PEAKS_flip[2]?-1:1) * dir.z / norms[d]; if ( PEAKS_doNormalize ) { dir.x = col.x; dir.y = col.y; dir.z = col.z; } else { dir.x = col.x * norms[d] / normMax; dir.y = col.y * norms[d] / normMax; dir.z = col.z * norms[d] / normMax; } glColor3f( fabs(2.0*col.x), fabs(2.0*col.y), fabs(2.0*col.z) ); glBegin(GL_LINES); glVertex3f( x-dir.x, y-dir.y, z-dir.z ); glVertex3f( x+dir.x, y+dir.y, z+dir.z ); glEnd(); } } if ( GLYPHS_show ) { b0 = (*niiDWI->img)(x,y,z,SCHEME_idxB0[0]); if ( b0 > GLYPHS_b0_thr ) { glBegin(GL_POINTS); for(d=0; d < SCHEME_shells_idx[GLYPHS_shell].size() ;d++) { idx = SCHEME_shells_idx[GLYPHS_shell][d]; w = 0.5 * (float)(*niiDWI->img)(x,y,z,idx) / b0; if ( GLYPHS_use_affine ) { dir.x = SCHEME_dirs[idx].x * ((float*)GLYPHS_affine)[0] + SCHEME_dirs[idx].y * ((float*)GLYPHS_affine)[1] + SCHEME_dirs[idx].z * ((float*)GLYPHS_affine)[2]; dir.y = SCHEME_dirs[idx].x * ((float*)GLYPHS_affine)[3] + SCHEME_dirs[idx].y * ((float*)GLYPHS_affine)[4] + SCHEME_dirs[idx].z * ((float*)GLYPHS_affine)[5]; dir.z = SCHEME_dirs[idx].x * ((float*)GLYPHS_affine)[6] + SCHEME_dirs[idx].y * ((float*)GLYPHS_affine)[7] + SCHEME_dirs[idx].z * ((float*)GLYPHS_affine)[8]; normMax = dir.norm(); dir.x *= w / normMax; dir.y *= w / normMax; dir.z *= w / normMax; } else { dir.x = w * SCHEME_dirs[idx].x; dir.y = w * SCHEME_dirs[idx].y; dir.z = w * SCHEME_dirs[idx].z; } normMax = dir.norm(); glColor3f( fabs(dir.x)/normMax, fabs(dir.y)/normMax, fabs(dir.z)/normMax ); glVertex3f( x+dir.x, y+dir.y, z+dir.z ); glVertex3f( x-dir.x, y-dir.y, z-dir.z ); } glEnd(); } } } } // plane XY if ( showPlane[2] ) { z = (int)VOXEL.z; for(y=0; y<dim.y ;y++) for(x=0; x<dim.x ;x++) { if ( PEAKS_show ) { normMax = 0; for(d=0; d<PEAKS_n; d++) { col.x = (*niiPEAKS->img)(x,y,z,3*d+0); // use "col" as tmp variable col.y = (*niiPEAKS->img)(x,y,z,3*d+1); col.z = (*niiPEAKS->img)(x,y,z,3*d+2); if ( PEAKS_use_affine ) { dir.x = col.x * ((float*)PEAKS_affine)[0] + col.y * ((float*)PEAKS_affine)[1] + col.z * ((float*)PEAKS_affine)[2]; dir.y = col.x * ((float*)PEAKS_affine)[3] + col.y * ((float*)PEAKS_affine)[4] + col.z * ((float*)PEAKS_affine)[5]; dir.z = col.x * ((float*)PEAKS_affine)[6] + col.y * ((float*)PEAKS_affine)[7] + col.z * ((float*)PEAKS_affine)[8]; } else { dir.x = col.x; dir.y = col.y; dir.z = col.z; } norms[d] = dir.norm(); if ( norms[d] > normMax ) normMax = norms[d]; } for(d=0; d<PEAKS_n; d++) { if ( norms[d] < normMax*PEAKS_thr ) continue; col.x = (*niiPEAKS->img)(x,y,z,3*d+0); // use "col" as tmp variable col.y = (*niiPEAKS->img)(x,y,z,3*d+1); col.z = (*niiPEAKS->img)(x,y,z,3*d+2); if ( PEAKS_use_affine ) { dir.x = col.x * ((float*)PEAKS_affine)[0] + col.y * ((float*)PEAKS_affine)[1] + col.z * ((float*)PEAKS_affine)[2]; dir.y = col.x * ((float*)PEAKS_affine)[3] + col.y * ((float*)PEAKS_affine)[4] + col.z * ((float*)PEAKS_affine)[5]; dir.z = col.x * ((float*)PEAKS_affine)[6] + col.y * ((float*)PEAKS_affine)[7] + col.z * ((float*)PEAKS_affine)[8]; } else { dir.x = col.x; dir.y = col.y; dir.z = col.z; } col.x = 0.5 * (PEAKS_flip[0]?-1:1) * dir.x / norms[d]; col.y = 0.5 * (PEAKS_flip[1]?-1:1) * dir.y / norms[d]; col.z = 0.5 * (PEAKS_flip[2]?-1:1) * dir.z / norms[d]; if ( PEAKS_doNormalize ) { dir.x = col.x; dir.y = col.y; dir.z = col.z; } else { dir.x = col.x * norms[d] / normMax; dir.y = col.y * norms[d] / normMax; dir.z = col.z * norms[d] / normMax; } glColor3f( fabs(2.0*col.x), fabs(2.0*col.y), fabs(2.0*col.z) ); glBegin(GL_LINES); glVertex3f( x-dir.x, y-dir.y, z-dir.z ); glVertex3f( x+dir.x, y+dir.y, z+dir.z ); glEnd(); } } if( GLYPHS_show) { b0 = (*niiDWI->img)(x,y,z,SCHEME_idxB0[0]); if ( b0 > GLYPHS_b0_thr ) { glBegin(GL_POINTS); for(d=0; d < SCHEME_shells_idx[GLYPHS_shell].size() ;d++) { idx = SCHEME_shells_idx[GLYPHS_shell][d]; w = 0.5 * (float)(*niiDWI->img)(x,y,z,idx) / b0; if ( GLYPHS_use_affine ) { dir.x = SCHEME_dirs[idx].x * ((float*)GLYPHS_affine)[0] + SCHEME_dirs[idx].y * ((float*)GLYPHS_affine)[1] + SCHEME_dirs[idx].z * ((float*)GLYPHS_affine)[2]; dir.y = SCHEME_dirs[idx].x * ((float*)GLYPHS_affine)[3] + SCHEME_dirs[idx].y * ((float*)GLYPHS_affine)[4] + SCHEME_dirs[idx].z * ((float*)GLYPHS_affine)[5]; dir.z = SCHEME_dirs[idx].x * ((float*)GLYPHS_affine)[6] + SCHEME_dirs[idx].y * ((float*)GLYPHS_affine)[7] + SCHEME_dirs[idx].z * ((float*)GLYPHS_affine)[8]; normMax = dir.norm(); dir.x *= w / normMax; dir.y *= w / normMax; dir.z *= w / normMax; } else { dir.x = w * SCHEME_dirs[idx].x; dir.y = w * SCHEME_dirs[idx].y; dir.z = w * SCHEME_dirs[idx].z; } normMax = dir.norm(); glColor3f( fabs(dir.x)/normMax, fabs(dir.y)/normMax, fabs(dir.z)/normMax ); glVertex3f( x+dir.x, y+dir.y, z+dir.z ); glVertex3f( x-dir.x, y-dir.y, z-dir.z ); } glEnd(); } } } } glPopMatrix(); } /* =================== */ /* Draw the SCALAR MAP */ /* =================== */ if ( showPlane[0] || showPlane[1] || showPlane[2] ) { glDisable( GL_CULL_FACE ); glEnable( GL_BLEND ); glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); // to avoid z-fighting glPolygonOffset( 1.0, 1.0 ); glEnable(GL_POLYGON_OFFSET_FILL); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); glLineWidth( 3 ); int x, y, z; // voxel coordinates NB: (0,0,0) -> corner of voxel float color; // plane YZ if ( showPlane[0] ) { glPushMatrix(); glTranslatef(0.5,0,0); x = (int)VOXEL.x; for(y=0; y<dim.y ;y++) for(z=0; z<dim.z ;z++) { color = ( MAP(x,y,z) - MAP_min_view) / ( MAP_max_view - MAP_min_view ); glColor4f(color,color,color,MAP_opacity); glBegin(GL_QUADS); glVertex3f(x, y, z); glVertex3f(x, y, z+1); glVertex3f(x, y+1, z+1); glVertex3f(x, y+1, z); glEnd(); } // colored frame if ( showAxes ) { glColor3f(1,0,0); glBegin(GL_LINE_STRIP); glVertex3f(x,0,0); glVertex3f(x,dim.y,0); glVertex3f(x,dim.y,dim.z); glVertex3f(x,0,dim.z); glVertex3f(x,0,0); glEnd(); } glPopMatrix(); } // plane XZ if ( showPlane[1] ) { glPushMatrix(); glTranslatef(0,0.5,0); y = (int)VOXEL.y; for(x=0; x<dim.x ;x++) for(z=0; z<dim.z ;z++) { color = ( MAP(x,y,z) - MAP_min_view) / ( MAP_max_view - MAP_min_view ); glColor4f(color,color,color,MAP_opacity); glBegin(GL_QUADS); glVertex3f(x, y, z); glVertex3f(x, y, z+1); glVertex3f(x+1, y, z+1); glVertex3f(x+1, y, z); glEnd(); } // colored frame if ( showAxes ) { glColor3f(0,1,0); glBegin(GL_LINE_STRIP); glVertex3f(0,y,0); glVertex3f(dim.x,y,0); glVertex3f(dim.x,y,dim.z); glVertex3f(0,y,dim.z); glVertex3f(0,y,0); glEnd(); } glPopMatrix(); } // plane XY if ( showPlane[2] ) { glPushMatrix(); glTranslatef(0,0,0.5); z = (int)VOXEL.z; for(y=0; y<dim.y ;y++) for(x=0; x<dim.x ;x++) { color = ( MAP(x,y,z) - MAP_min_view) / ( MAP_max_view - MAP_min_view ); glColor4f(color,color,color,MAP_opacity); glBegin(GL_QUADS); glVertex3f(x, y, z); glVertex3f(x+1, y, z); glVertex3f(x+1, y+1, z); glVertex3f(x, y+1, z); glEnd(); } // colored frame if ( showAxes ) { glColor3f(0,0,1); glBegin(GL_LINE_STRIP); glVertex3f(0,0,z); glVertex3f(dim.x,0,z); glVertex3f(dim.x,dim.y,z); glVertex3f(0,dim.y,z); glVertex3f(0,0,z); glEnd(); } glPopMatrix(); } glEnable(GL_CULL_FACE); glDisable( GL_BLEND ); glDisable(GL_POLYGON_OFFSET_FILL); } /* ====================== */ /* Draw the CURRENT VOXEL */ /* ====================== */ if ( showAxes ) { glPushMatrix(); glTranslatef( VOXEL.x+0.5, VOXEL.y+0.5, VOXEL.z+0.5 ); glEnable( GL_BLEND ); glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); glLineWidth(1); glColor4f( 1,1,0,1 ); glutWireCube( 1 ); glColor4f( 1,1,0,0.25 ); glutSolidCube( 1 ); glDisable( GL_BLEND ); glPopMatrix(); } glPopMatrix(); PrintConfig(); glutSwapBuffers(); } // INITIALIZATION // -------------- void OpenGL_init( int argc, char** argv ) { glutInit( &argc, argv ); glutInitDisplayMode( GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA | GLUT_ALPHA | GLUT_MULTISAMPLE ); ScreenX = 0.7*glutGet(GLUT_SCREEN_WIDTH); if (ScreenX==0) ScreenX = 800; ScreenY = 0.7*glutGet(GLUT_SCREEN_HEIGHT); if (ScreenY==0) ScreenY = 600; glutInitWindowSize( ScreenX, ScreenY ); glutInitWindowPosition( 0.15*glutGet(GLUT_SCREEN_WIDTH), 0.15*glutGet(GLUT_SCREEN_HEIGHT) ); glutCreateWindow( "COMMIT debugger" ); // Projection and model matrix glMatrixMode(GL_PROJECTION); glLoadIdentity(); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); translation.x = translation.y = 0; zoom = 0; OPENGL_utils::identity( rot ); OPENGL_utils::identity( id ); glEnable( GL_DEPTH_TEST ); glClearColor( 0.1, 0.1, 0.1, 0.0 ); // lighting glShadeModel( GL_SMOOTH ); glEnable( GL_NORMALIZE ); GLfloat white[] = {.5f, .5f, .5f, 1.0f}; glMaterialfv(GL_FRONT, GL_SPECULAR, white); GLfloat shininess[] = {32}; glMaterialfv(GL_FRONT, GL_SHININESS, shininess); glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE); GLfloat global_ambient[] = { 0.2f, 0.2f, 0.2f, 1.0f }; glLightModelfv(GL_LIGHT_MODEL_AMBIENT, global_ambient); glEnable ( GL_COLOR_MATERIAL ); // register CALLBACKS and open window glutKeyboardFunc( GLUT__keyboard ); glutSpecialFunc( GLUT__specialkey ); glutDisplayFunc( GLUT__display ); glutReshapeFunc( GLUT__reshape ); glutMouseFunc( GLUT__mouse ); glutMotionFunc( GLUT__motion ); GLUT__createMenu(); glutMainLoop(); }
36.910856
188
0.437279
fb472ad16367fad95a64a4dd1d18491068181fe8
1,672
java
Java
maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/support/rememberme/InMemoryRemeberMeService.java
szj-coder/MaxKey
b56496a6df16de37f62db0064caf260e181365a1
[ "Apache-2.0" ]
1
2022-01-24T07:45:15.000Z
2022-01-24T07:45:15.000Z
maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/support/rememberme/InMemoryRemeberMeService.java
szj-coder/MaxKey
b56496a6df16de37f62db0064caf260e181365a1
[ "Apache-2.0" ]
null
null
null
maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/support/rememberme/InMemoryRemeberMeService.java
szj-coder/MaxKey
b56496a6df16de37f62db0064caf260e181365a1
[ "Apache-2.0" ]
null
null
null
/* * Copyright [2020] [MaxKey of copyright http://www.maxkey.top] * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.maxkey.authn.support.rememberme; import java.util.concurrent.TimeUnit; import org.maxkey.constants.ConstsTimeInterval; import com.github.benmanes.caffeine.cache.Cache; import com.github.benmanes.caffeine.cache.Caffeine; public class InMemoryRemeberMeService extends AbstractRemeberMeService { protected static final Cache<String, RemeberMe> remeberMeStore = Caffeine.newBuilder() .expireAfterWrite(ConstsTimeInterval.TWO_WEEK, TimeUnit.MINUTES) .build(); @Override public void save(RemeberMe remeberMe) { remeberMeStore.put(remeberMe.getUsername(), remeberMe); } @Override public void update(RemeberMe remeberMe) { remeberMeStore.put(remeberMe.getUsername(), remeberMe); } @Override public RemeberMe read(RemeberMe remeberMe) { return remeberMeStore.getIfPresent(remeberMe.getUsername()); } @Override public void remove(String username) { remeberMeStore.invalidate(username); } }
30.4
80
0.717703
f544083db56648fca3a9b160b4c0ed76adfa9776
2,521
cxx
C++
src/Cxx/Widgets/BoxWidget.cxx
cvandijck/VTKExamples
b6bb89414522afc1467be8a1f0089a37d0c16883
[ "Apache-2.0" ]
309
2017-05-21T09:07:19.000Z
2022-03-15T09:18:55.000Z
src/Cxx/Widgets/BoxWidget.cxx
yijianmingliu/VTKExamples
dc8aac47c4384f9a2de9facbdd1ab3249f62ec99
[ "Apache-2.0" ]
379
2017-05-21T09:06:43.000Z
2021-03-29T20:30:50.000Z
src/Cxx/Widgets/BoxWidget.cxx
yijianmingliu/VTKExamples
dc8aac47c4384f9a2de9facbdd1ab3249f62ec99
[ "Apache-2.0" ]
170
2017-05-17T14:47:41.000Z
2022-03-31T13:16:26.000Z
#include <vtkSmartPointer.h> // For the rendering pipeline setup: #include <vtkConeSource.h> #include <vtkPolyDataMapper.h> #include <vtkActor.h> #include <vtkRenderer.h> #include <vtkRenderWindow.h> #include <vtkRenderWindowInteractor.h> #include <vtkInteractorStyleTrackballCamera.h> // For vtkBoxWidget: #include <vtkBoxWidget.h> #include <vtkCommand.h> #include <vtkTransform.h> class vtkMyCallback : public vtkCommand { public: static vtkMyCallback *New() { return new vtkMyCallback; } virtual void Execute( vtkObject *caller, unsigned long, void* ) { // Here we use the vtkBoxWidget to transform the underlying coneActor // (by manipulating its transformation matrix). vtkSmartPointer<vtkTransform> t = vtkSmartPointer<vtkTransform>::New(); vtkBoxWidget *widget = reinterpret_cast<vtkBoxWidget*>(caller); widget->GetTransform( t ); widget->GetProp3D()->SetUserTransform( t ); } }; int main( int vtkNotUsed( argc ), char* vtkNotUsed( argv )[] ) { vtkSmartPointer<vtkConeSource> cone = vtkSmartPointer<vtkConeSource>::New(); vtkSmartPointer<vtkPolyDataMapper> coneMapper = vtkSmartPointer<vtkPolyDataMapper>::New(); coneMapper->SetInputConnection( cone->GetOutputPort() ); vtkSmartPointer<vtkActor> coneActor = vtkSmartPointer<vtkActor>::New(); coneActor->SetMapper( coneMapper ); vtkSmartPointer<vtkRenderer> renderer = vtkSmartPointer<vtkRenderer>::New(); renderer->AddActor( coneActor ); renderer->SetBackground( 0.1, 0.2, 0.4 ); vtkSmartPointer<vtkRenderWindow> window = vtkSmartPointer<vtkRenderWindow>::New(); window->AddRenderer( renderer ); window->SetSize( 300, 300 ); vtkSmartPointer<vtkRenderWindowInteractor> interactor = vtkSmartPointer<vtkRenderWindowInteractor>::New(); interactor->SetRenderWindow( window ); vtkSmartPointer<vtkInteractorStyleTrackballCamera> style = vtkSmartPointer<vtkInteractorStyleTrackballCamera>::New(); interactor->SetInteractorStyle( style ); vtkSmartPointer<vtkBoxWidget> boxWidget = vtkSmartPointer<vtkBoxWidget>::New(); boxWidget->SetInteractor( interactor ); boxWidget->SetProp3D( coneActor ); boxWidget->SetPlaceFactor( 1.25 ); // Make the box 1.25x larger than the actor boxWidget->PlaceWidget(); vtkSmartPointer<vtkMyCallback> callback = vtkSmartPointer<vtkMyCallback>::New(); boxWidget->AddObserver( vtkCommand::InteractionEvent, callback ); boxWidget->On(); window->Render(); interactor->Start(); return EXIT_SUCCESS; }
30.011905
80
0.742562
b454e22a7b72ef8fea543fa3189f3418d9217a67
3,107
sql
SQL
script/e6_migration/12_tags.sql
hahaluckyme/e621ng
7c667897ce3a9bfecea073222aa02000e5f9b933
[ "BSD-2-Clause-FreeBSD" ]
1
2020-04-05T20:13:02.000Z
2020-04-05T20:13:02.000Z
script/e6_migration/12_tags.sql
hahaluckyme/e621ng
7c667897ce3a9bfecea073222aa02000e5f9b933
[ "BSD-2-Clause-FreeBSD" ]
2
2020-09-03T17:08:14.000Z
2020-09-12T17:46:06.000Z
script/e6_migration/12_tags.sql
hahaluckyme/e621ng
7c667897ce3a9bfecea073222aa02000e5f9b933
[ "BSD-2-Clause-FreeBSD" ]
null
null
null
begin; alter table tags rename column tag_type to category; alter table tags rename column type_locked to is_locked; alter table tags rename column cached_related to related_tags; alter table tags rename column cached_related_expires_on to related_tags_updated_at; update tags set is_locked = false where is_locked is null; alter table tags alter column is_locked set not null; alter table tags add column created_at timestamp not null default now(), add column updated_at timestamp not null default now(); alter table tags alter column related_tags drop not null, alter column related_tags_updated_at drop not null; alter table tags add primary key (id); alter table tag_aliases rename column name to antecedent_name; alter table tag_aliases add column updated_at timestamp, add column forum_topic_id integer, add column creator_ip_addr inet not null default '127.0.0.1', add column consequent_name varchar, add column status varchar not null default 'pending', add column post_count int not null default 0, add column approver_id integer; update tag_aliases set status = 'active' where is_pending = false; alter table tag_aliases drop column is_pending; update tag_aliases set consequent_name = (select _.name from tags _ where _.id = tag_aliases.alias_id); alter table tag_aliases drop column alias_id; update tag_aliases set creator_id = 1 where creator_id is null; alter table tag_aliases alter column creator_id set not null, alter column consequent_name set not null; alter table forum_posts add primary key (id); update tag_aliases set forum_topic_id = (select _.topic_id from forum_posts _ where _.id = tag_aliases.forum_post_id); alter table tag_implications add column antecedent_name varchar, add column consequent_name varchar, add column status varchar not null default 'pending', add column creator_ip_addr inet not null default '127.0.0.1', add column forum_topic_id int, add column updated_at timestamp, add column descendant_names text[] default '{}'::text[], add column approver_id integer; update tag_implications set status = 'active' where is_pending = false; alter table tag_implications drop column is_pending; update tag_implications set antecedent_name = (select _.name from tags _ where _.id = tag_implications.predicate_id), consequent_name = (select _.name from tags _ where _.id = tag_implications.consequent_id); alter table tag_implications alter column antecedent_name set not null, alter column consequent_name set not null; update tag_implications set forum_topic_id = (select _.topic_id from forum_posts _ where _.id = tag_implications.forum_post_id); update tag_implications set creator_id = 1 where creator_id is null; alter table tag_implications alter column creator_id set not null; alter table tag_implications drop column consequent_id, drop column predicate_id; alter table forum_posts drop constraint forum_posts_pkey; alter table tags drop constraint tags_pkey; alter table tag_type_histories rename to tag_type_versions; alter table tag_type_versions rename column user_id to creator_id; commit;
53.568966
209
0.809784
4ea995bed2f2b93dc05fd1ad31a0014a71c10c25
7,917
dart
Dart
lib/src/bloc/bloc.dart
zaolab/flutter_rebloc
1afacb5554696f38aa3fed07b2961cb1f28b3f9a
[ "MIT" ]
1
2020-01-09T01:33:20.000Z
2020-01-09T01:33:20.000Z
lib/src/bloc/bloc.dart
zaolab/flutter_rebloc
1afacb5554696f38aa3fed07b2961cb1f28b3f9a
[ "MIT" ]
null
null
null
lib/src/bloc/bloc.dart
zaolab/flutter_rebloc
1afacb5554696f38aa3fed07b2961cb1f28b3f9a
[ "MIT" ]
null
null
null
import 'dart:async'; import 'dart:developer'; import 'package:flutter/widgets.dart'; import 'package:flutter_rebloc/src/event/event.dart'; import 'package:flutter_rebloc/src/state/state.dart'; import 'package:flutter_rebloc/src/state/state_provider.dart'; /// A layer that processes business logic by consuming action events and /// streaming output state. /// /// The BLOC consumes an incoming action event through the add method and /// streams the output through the [stream] property. /// The action event will be consumed by the runEvent method which all BLOCs /// must override. The yielded value of the runEvent can contain an event /// and/or state. The event will be passed to the event listeners and state /// to the output stream. The output event signifies the internal state of the /// BLOC and what it is currently doing. Event and/or state can be null. /// When the state is null, the previous state will be kept as if. /// /// e.g. /// ```dart /// enum CounterAction { /// increment, /// decrement, /// } /// /// CounterState extends ReBlocState { /// final int counter; /// CounterState(this.counter); /// } /// /// CounterBloc extends ReBloc<CounterState> { /// CounterState initState() => CounterState(0); /// /// Stream<StateEvent<CounterState>> runEvent(Object action, CounterState state) async* { /// yield(StateEvent(event: 'Working...')); /// /// switch (action) { /// case CounterAction.increment: /// yield(StateEvent(event: 'Incremented', state: CounterState(state.count+1))); /// break; /// case CounterAction.decrement: /// yield(StateEvent(event: 'Decremented', state: CounterState(state.count-1))); /// break; /// default: /// yield(StateEvent(event: ErrorEvent(message: 'Not implemented'))); /// } /// } /// } /// ``` abstract class ReBloc<S extends ReBlocState> { /// The last event that occured in the Bloc. /// /// This is not the action event that is sunk into the BlOC. /// It is the event that signals the situation the BLOC faced itself. Object get lastEvent => _lastEvent; /// The output stream containing the state. Stream get stream => _output.stream; /// The type of the state. Type get stateType => S; /// The last state output by the BLOC. S get state => _state; /// Creates a new BLOC with [context] that the BLOC can use to get /// access to state values provided by an ancestor StateProvider. ReBloc({BuildContext context}) { _state = initState(); if (context != null) { withContext(context); } _eventStream.stream.listen((event) { runEvent(event, state)?.listen((stateEvent) { _lastEvent = stateEvent.event ?? _lastEvent; if (stateEvent.state != null && _state != stateEvent.state) { state = stateEvent.state; _output.add(stateEvent.state); } if (stateEvent.event != null) { if (stateEvent.event is ErrorEvent) { for (var f in _errorListeners) { f(stateEvent.event); } } else { for (var f in _successListeners) { f(stateEvent.event); } } for (var f in _listeners) { f(stateEvent.event); } } }); }, onError: handleError); } /// Creates a default initial state. @protected S initState(); /// Consumes and run the [action] added to the sink and yield an output stream /// containing the BLOC event and output state. @protected Stream<StateEvent<S>> runEvent(Object action, S state); /// Closes and cleanup the BLOC. @mustCallSuper void close() { _stateSub?.cancel(); _stateSub = null; _context = null; _eventStream.close(); _output.close(); _listeners.clear(); _errorListeners.clear(); _successListeners.clear(); } /// Adds an action event to be run by the BLOC. void add(Object action) { _eventStream.add(action); } /// Subscribe callback function to the [eventType] events yielded by runEvent. /// /// There are three event types to subscribe to: /// 1. [ReBlocEvent.error] - Events that extend the ErrorEvent class. /// 2. [ReBlocEvent.success] - Events that _do not_ extend the ErrorEvent class. /// 3. [ReBlocEvent.all] - All events. void subscribe(ReBlocEvent eventType, dynamic f) { switch (eventType) { case ReBlocEvent.all: _listeners.add(f); break; case ReBlocEvent.success: _successListeners.add(f); break; case ReBlocEvent.error: _errorListeners.add(f); break; } } /// Unsubscribe callback function from the [eventType] events. void unsubscribe(ReBlocEvent eventType, dynamic f) { switch (eventType) { case ReBlocEvent.all: _listeners.remove(f); break; case ReBlocEvent.success: _successListeners.remove(f); break; case ReBlocEvent.error: _errorListeners.remove(f); break; } } /// Sets the BLOC with [context] to be used to get state values from the /// context tree. void withContext(BuildContext context) { if (context != null && _context != context) { _context = context; final p = StateProvider.of<S>(context); if (p != null) { _state = p.state; _sharedState = true; _stateSub?.cancel(); _stateSub = p.stream.listen(updateStateFromStream); } else if (_sharedState) { _sharedState = false; _stateSub?.cancel(); _stateSub = null; } } else if (_context != context) { _sharedState = false; _context = context; _stateSub?.cancel(); _stateSub = null; } } /// Gets a state value from an ancestor StateProvider. /// There must be a context set in the BLOC either from the constructor /// or the withContext method. T getSharedStateOfType<T extends ReBlocState>() { if (_context != null) { return StateProvider.of<T>(_context)?.state; } return null; } /// Handles any unhandled streaming error that happened in runEvent method. void handleError(dynamic err) { log(err.toString(), error: err); } final StreamController<Object> _eventStream = StreamController<Object>(); final StreamController<S> _output = StreamController<S>.broadcast(); S _state; final Set<ValueChanged<Object>> _listeners = {}; final Set<ValueChanged<ErrorEvent>> _errorListeners = {}; final Set<ValueChanged<Object>> _successListeners = {}; Object _lastEvent; BuildContext _context; bool _sharedState = false; // ignore: cancel_subscriptions StreamSubscription<S> _stateSub; @protected set state(S s) { if (_sharedState) { final ss = StateProvider.of<S>(_context); if (ss != null) { ss.add(s); } else { _sharedState = false; } } _state = s; } /// Updates the state coming from external events and pushing it to the stream. @protected void updateStateFromStream(S s) { if (_state != s) { _state = s; _output.add(s); } } } typedef ReBlocCreator<S extends ReBlocState> = ReBloc<S> Function(BuildContext); /// An object that contains the BLOC event and output state. class StateEvent<S extends ReBlocState> { /// The state value to push into the BLOC stream. final S state; /// The BLOC event to trigger to listeners. final Object event; /// Creates an immutable StateEvent to push to BLOC stream. StateEvent({this.state, this.event}); } /// The different types of events the BLOC can yield. enum ReBlocEvent { /// An events that extend the ErrorEvent class and indicating /// an error happening in the BLOC. error, /// An event that is not an error indicating the BLOC has /// successfully performed its job. success, /// Both error and non error events. all, }
28.789091
91
0.643931
eb4569c9c9df5764e8c54d7483b6d99a12dbd99a
6,823
swift
Swift
PQKit/Base/Services/PQSkip.swift
PQKit/PQKit
af1074a959328c4068c99487347f93084e796492
[ "Apache-2.0" ]
null
null
null
PQKit/Base/Services/PQSkip.swift
PQKit/PQKit
af1074a959328c4068c99487347f93084e796492
[ "Apache-2.0" ]
null
null
null
PQKit/Base/Services/PQSkip.swift
PQKit/PQKit
af1074a959328c4068c99487347f93084e796492
[ "Apache-2.0" ]
null
null
null
// // PQSkip.swift // PQKit // // Created by 盘国权 on 2019/6/10. // Copyright © 2019 pgq. All rights reserved. // import Foundation import PQTools public extension String { /// suport rgb rgba var spColor: UIColor? { var str = self if !str.contains("0x") && !str.contains("0X") { str = "0x" + str } let scanner = Scanner(string: self) var hex: UInt64 = 0 scanner.scanHexInt64(&hex) var alpha: CGFloat = 1 var red: CGFloat = 0 var green: CGFloat = 0 var blue: CGFloat = 0 if str.count == 8 { red = CGFloat(hex >> 16 & 0xff) / 255.0 green = CGFloat(hex >> 8 & 0xff) / 255.0 blue = CGFloat(hex & 0xff) / 255.0 }else if str.count == 10 { red = CGFloat(hex >> 32 & 0xff) / 255.0 green = CGFloat(hex >> 16 & 0xff) / 255.0 blue = CGFloat(hex >> 8 & 0xff) / 255.0 alpha = CGFloat(hex & 0xff) } else { PQPrint("读取颜色失败了,请检查输入是否正确: str - \(self)") return nil } return UIColor(red: red, green: green, blue: blue, alpha: alpha) } } public struct PQSkipFont: Codable { public var size: CGFloat public var color: String public var family: String? public var bold: Bool public var font: UIFont { if let family = family { if let font = UIFont(name: family, size: size) { return font } return UIFont.systemFont(ofSize: size) } if bold { return UIFont.boldSystemFont(ofSize: size) } return UIFont.systemFont(ofSize: size) } public static var largeTitle = PQSkipFont(size: 26, color: "0x000000ff", family: nil, bold: false) public static var midTitle = PQSkipFont(size: 23, color: "0x000000ff", family: nil, bold: false) public static var smallTitle = PQSkipFont(size: 20, color: "0x000000ff", family: nil, bold: false) public static var context = PQSkipFont(size: 17, color: "0x000000ff", family: nil, bold: false) public static var hint = PQSkipFont(size: 13, color: "0x000000ff", family: nil, bold: false) public static var selectedTitle = PQSkipFont(size: 15, color: "0x000000ff", family: nil, bold: false) public static var normalTitle = PQSkipFont(size: 15, color: "0x000000ff", family: nil, bold: false) public static var textField = PQSkipFont(size: 15, color: "0x000000ff", family: nil, bold: false) public static var textView = PQSkipFont(size: 15, color: "0x000000ff", family: nil, bold: false) } public struct PQSkipNavigationBar: Codable { public var isHidden: Bool public var barTintColor: String? public var isTranslucent: Bool public var tintColor: String? public var font: PQSkipFont public static let `default` = PQSkipNavigationBar(isHidden: false, barTintColor: "0xffffffff", isTranslucent: false, tintColor: "0xffffffff", font: PQSkipFont(size: 17, color: "0xffffffff", family: nil, bold: false)) } public struct PQSkipController: Codable { public var backgroundColor: String? public static let `default` = PQSkipController(backgroundColor: "0xffffffff") } public struct PQSkipTBCell: Codable { public var backgroundColor: String? public var lineColor: String? public var lineHeight: CGFloat public var lineMargin: [CGFloat] public static let `default` = PQSkipTBCell(backgroundColor: "0xffffffff", lineColor: "0xffffffff", lineHeight: 1, lineMargin: [0,0]) } public struct PQSkipCVCell: Codable { public var backgroundColor: String? public static let `default` = PQSkipCVCell(backgroundColor: "0xffffffff") } public struct PQSkipLabel: Codable { public var largeTitle: PQSkipFont public var midTitle: PQSkipFont public var smallTitle: PQSkipFont public var context: PQSkipFont public var hint: PQSkipFont public static var `default` = PQSkipLabel(largeTitle: .largeTitle, midTitle: .midTitle, smallTitle: .smallTitle, context: .context, hint: .hint) } public struct PQSkipButton: Codable { public var normalTitle: PQSkipFont public var selectedTitle: PQSkipFont public static var `default` = PQSkipButton(normalTitle: .normalTitle, selectedTitle: .selectedTitle) } public struct PQSkipTextField: Codable { public var placehodloerColor: String? public var cursorColor: String? public var textColor: String? public var font: PQSkipFont public static var `default` = PQSkipTextField(placehodloerColor: "0x000000ff", cursorColor: "0x000000ff", textColor: "0x000000ff", font: .textField) } public struct PQSkipTextView: Codable { public var placehodloerColor: String? public var cursorColor: String? public var textColor: String? public var font: PQSkipFont public static var `default` = PQSkipTextView(placehodloerColor: "0x000000ff", cursorColor: "0x000000ff", textColor: "0x000000ff", font: .textField) } open class PQSkip: NSObject, Codable { public static internal(set) var shared = PQSkip() open var navigationBar: PQSkipNavigationBar = .default open var controller: PQSkipController = .default open var tbCell: PQSkipTBCell = .default open var cvCell: PQSkipCVCell = .default open var label: PQSkipLabel = .default open var button: PQSkipButton = .default open var textField: PQSkipTextField = .default open var textView: PQSkipTextView = .default public func readSkip(for url: URL, completion: @escaping (Error?) -> ()) { DispatchQueue.global().async { do { let data = try Data(contentsOf: url) self.readSkip(for: data, completion: completion) } catch { completion(error) } } } public func readSkip(for data: Data, completion: @escaping (Error?) -> ()) { do { let skip = try JSONDecoder().decode(PQSkip.self, from: data) PQSkip.shared = skip completion(nil) } catch { completion(error) } } public func readSkip(for json: String, completion: @escaping (Error?) -> ()) { guard let data = json.data(using: .utf8) else { completion(NSError(domain: "Json str to data invalid", code: 0, userInfo: nil) as Error) return } readSkip(for: data, completion: completion) } open override var description: String { let encoder = JSONEncoder() encoder.outputFormatting = .prettyPrinted if let data = try? encoder.encode(self), let jsonStr = String(data: data, encoding: .utf8) { return jsonStr } return "\(self)" } }
35.170103
220
0.637403
2f3ebaf0c5329953b34039f2f3abe4a1277b7ac5
4,819
java
Java
modules/nf-ga4gh/src/main/nextflow/ga4gh/tes/client/model/TesServiceInfo.java
noobsauce101/tarema-nextflow-extension
cac8d2ad7127a9272d09e640c526ff231d4173d1
[ "Apache-2.0" ]
2
2021-11-14T19:17:50.000Z
2022-02-01T17:11:00.000Z
modules/nf-ga4gh/src/main/nextflow/ga4gh/tes/client/model/TesServiceInfo.java
noobsauce101/tarema-nextflow-extension
cac8d2ad7127a9272d09e640c526ff231d4173d1
[ "Apache-2.0" ]
null
null
null
modules/nf-ga4gh/src/main/nextflow/ga4gh/tes/client/model/TesServiceInfo.java
noobsauce101/tarema-nextflow-extension
cac8d2ad7127a9272d09e640c526ff231d4173d1
[ "Apache-2.0" ]
2
2021-03-17T15:50:06.000Z
2021-05-17T11:01:16.000Z
/* * Copyright 2020, Seqera Labs * Copyright 2013-2019, Centre for Genomic Regulation (CRG) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * task_execution.proto * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * * OpenAPI spec version: version not set * * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ package nextflow.ga4gh.tes.client.model; import java.util.Objects; import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; /** * ServiceInfo describes information about the service, such as storage details, resource availability, and other documentation. */ @ApiModel(description = "ServiceInfo describes information about the service, such as storage details, resource availability, and other documentation.") @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-02-01T15:43:49.638Z") public class TesServiceInfo { @SerializedName("name") private String name = null; @SerializedName("doc") private String doc = null; @SerializedName("storage") private List<String> storage = null; public TesServiceInfo name(String name) { this.name = name; return this; } /** * Returns the name of the service, e.g. \&quot;ohsu-compbio-funnel\&quot;. * @return name **/ @ApiModelProperty(value = "Returns the name of the service, e.g. \"ohsu-compbio-funnel\".") public String getName() { return name; } public void setName(String name) { this.name = name; } public TesServiceInfo doc(String doc) { this.doc = doc; return this; } /** * Returns a documentation string, e.g. \&quot;Hey, we&#39;re OHSU Comp. Bio!\&quot;. * @return doc **/ @ApiModelProperty(value = "Returns a documentation string, e.g. \"Hey, we're OHSU Comp. Bio!\".") public String getDoc() { return doc; } public void setDoc(String doc) { this.doc = doc; } public TesServiceInfo storage(List<String> storage) { this.storage = storage; return this; } public TesServiceInfo addStorageItem(String storageItem) { if (this.storage == null) { this.storage = new ArrayList<String>(); } this.storage.add(storageItem); return this; } /** * Lists some, but not necessarily all, storage locations supported by the service. Must be in a valid URL format. e.g. file:///path/to/local/funnel-storage s3://ohsu-compbio-funnel/storage etc. * @return storage **/ @ApiModelProperty(value = "Lists some, but not necessarily all, storage locations supported by the service. Must be in a valid URL format. e.g. file:///path/to/local/funnel-storage s3://ohsu-compbio-funnel/storage etc.") public List<String> getStorage() { return storage; } public void setStorage(List<String> storage) { this.storage = storage; } @Override public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } TesServiceInfo tesServiceInfo = (TesServiceInfo) o; return Objects.equals(this.name, tesServiceInfo.name) && Objects.equals(this.doc, tesServiceInfo.doc) && Objects.equals(this.storage, tesServiceInfo.storage); } @Override public int hashCode() { return Objects.hash(name, doc, storage); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TesServiceInfo {\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" doc: ").append(toIndentedString(doc)).append("\n"); sb.append(" storage: ").append(toIndentedString(storage)).append("\n"); sb.append("}"); return sb.toString(); } /** * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } }
29.206061
224
0.684374
e9ba539ed9b8215db6a8631f13ad5074f1e340a8
462
rb
Ruby
lib/migration_data/testing.rb
mpmenne/migration_data
e33293cfde2ed86977cf0dc15e890fe5c125bdd7
[ "MIT" ]
null
null
null
lib/migration_data/testing.rb
mpmenne/migration_data
e33293cfde2ed86977cf0dc15e890fe5c125bdd7
[ "MIT" ]
null
null
null
lib/migration_data/testing.rb
mpmenne/migration_data
e33293cfde2ed86977cf0dc15e890fe5c125bdd7
[ "MIT" ]
null
null
null
require 'rails' def require_migration(migration_name) path = MigrationData::ActiveRecord::Migration.migration_dir all_migrations = ActiveRecord::MigrationContext.new(path).migrations migration_name += '.rb' unless migration_name.end_with?('.rb') file = all_migrations.detect do |m| m.filename.end_with?(migration_name) end raise LoadError, "cannot load such file -- #{migration_name}" unless file require Rails.root.join(file.filename) end
28.875
75
0.766234
1690675883b0339101239d5dd399c1a8c5c2442e
86
sql
SQL
microservicio/infraestructura/src/main/resources/sql/videogame/list.sql
Santizgt5/prueba-adn
aa1404529efdb77c0b558f6d0ac851d37ba8668e
[ "Apache-2.0" ]
null
null
null
microservicio/infraestructura/src/main/resources/sql/videogame/list.sql
Santizgt5/prueba-adn
aa1404529efdb77c0b558f6d0ac851d37ba8668e
[ "Apache-2.0" ]
null
null
null
microservicio/infraestructura/src/main/resources/sql/videogame/list.sql
Santizgt5/prueba-adn
aa1404529efdb77c0b558f6d0ac851d37ba8668e
[ "Apache-2.0" ]
null
null
null
select * from videogame inner join company on videogame.companyId = company.company_id
86
86
0.837209
4574d6e087fa9d0f85aca5127b2f796b1d81011b
216
sql
SQL
database.sql
patchon/Pastebin
d961fd6952962aa2e3aea53c45afe4f1071994c8
[ "MIT" ]
null
null
null
database.sql
patchon/Pastebin
d961fd6952962aa2e3aea53c45afe4f1071994c8
[ "MIT" ]
null
null
null
database.sql
patchon/Pastebin
d961fd6952962aa2e3aea53c45afe4f1071994c8
[ "MIT" ]
null
null
null
CREATE TABLE `pastebin` ( `id` varchar(30) NOT NULL, `title` varchar(50) default NULL, `hash` char(40) default NULL, `data` longtext, `delkey` char(40) default NULL, `expiry` int, PRIMARY KEY (`id`) );
21.6
35
0.643519
64ee6bf1f30ce1a83c2705c9a87f13b73ac72bfe
4,367
java
Java
graphics/java/android/graphics/ComposeShader.java
rio-31/android_frameworks_base-1
091a068a3288d27d77636708679dde58b7b7fd25
[ "Apache-2.0" ]
164
2015-01-05T16:49:11.000Z
2022-03-29T20:40:27.000Z
graphics/java/android/graphics/ComposeShader.java
rio-31/android_frameworks_base-1
091a068a3288d27d77636708679dde58b7b7fd25
[ "Apache-2.0" ]
127
2015-01-12T12:02:32.000Z
2021-11-28T08:46:25.000Z
graphics/java/android/graphics/ComposeShader.java
rio-31/android_frameworks_base-1
091a068a3288d27d77636708679dde58b7b7fd25
[ "Apache-2.0" ]
1,141
2015-01-01T22:54:40.000Z
2022-02-09T22:08:26.000Z
/* * Copyright (C) 2007 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.graphics; import android.annotation.NonNull; /** A subclass of shader that returns the composition of two other shaders, combined by an {@link android.graphics.Xfermode} subclass. */ public class ComposeShader extends Shader { Shader mShaderA; private long mNativeInstanceShaderA; Shader mShaderB; private long mNativeInstanceShaderB; private int mPorterDuffMode; /** * Create a new compose shader, given shaders A, B, and a combining mode. * When the mode is applied, it will be given the result from shader A as its * "dst", and the result from shader B as its "src". * * @param shaderA The colors from this shader are seen as the "dst" by the mode * @param shaderB The colors from this shader are seen as the "src" by the mode * @param mode The mode that combines the colors from the two shaders. If mode * is null, then SRC_OVER is assumed. */ @Deprecated public ComposeShader(@NonNull Shader shaderA, @NonNull Shader shaderB, @NonNull Xfermode mode) { this(shaderA, shaderB, mode.porterDuffMode); } /** * Create a new compose shader, given shaders A, B, and a combining PorterDuff mode. * When the mode is applied, it will be given the result from shader A as its * "dst", and the result from shader B as its "src". * * @param shaderA The colors from this shader are seen as the "dst" by the mode * @param shaderB The colors from this shader are seen as the "src" by the mode * @param mode The PorterDuff mode that combines the colors from the two shaders. * */ public ComposeShader(@NonNull Shader shaderA, @NonNull Shader shaderB, @NonNull PorterDuff.Mode mode) { this(shaderA, shaderB, mode.nativeInt); } /** * Create a new compose shader, given shaders A, B, and a combining PorterDuff mode. * When the mode is applied, it will be given the result from shader A as its * "dst", and the result from shader B as its "src". * * @param shaderA The colors from this shader are seen as the "dst" by the mode * @param shaderB The colors from this shader are seen as the "src" by the mode * @param blendMode The blend mode that combines the colors from the two shaders. */ public ComposeShader(@NonNull Shader shaderA, @NonNull Shader shaderB, @NonNull BlendMode blendMode) { this(shaderA, shaderB, blendMode.getXfermode().porterDuffMode); } private ComposeShader(Shader shaderA, Shader shaderB, int nativeMode) { if (shaderA == null || shaderB == null) { throw new IllegalArgumentException("Shader parameters must not be null"); } mShaderA = shaderA; mShaderB = shaderB; mPorterDuffMode = nativeMode; } @Override long createNativeInstance(long nativeMatrix) { mNativeInstanceShaderA = mShaderA.getNativeInstance(); mNativeInstanceShaderB = mShaderB.getNativeInstance(); return nativeCreate(nativeMatrix, mShaderA.getNativeInstance(), mShaderB.getNativeInstance(), mPorterDuffMode); } /** @hide */ @Override protected void verifyNativeInstance() { if (mShaderA.getNativeInstance() != mNativeInstanceShaderA || mShaderB.getNativeInstance() != mNativeInstanceShaderB) { // Child shader native instance has been updated, // so our cached native instance is no longer valid - discard it discardNativeInstance(); } } private static native long nativeCreate(long nativeMatrix, long nativeShaderA, long nativeShaderB, int porterDuffMode); }
40.06422
100
0.67804
ca857228299cf7485c0fa3fccc4d6a032b20fe67
3,077
asm
Assembly
lib/target/cpc/classic/loader.asm
ahjelm/z88dk
c4de367f39a76b41f6390ceeab77737e148178fa
[ "ClArtistic" ]
4
2021-12-23T15:34:05.000Z
2021-12-23T15:36:16.000Z
lib/target/cpc/classic/loader.asm
ahjelm/z88dk
c4de367f39a76b41f6390ceeab77737e148178fa
[ "ClArtistic" ]
2
2022-03-20T22:17:35.000Z
2022-03-24T16:10:00.000Z
lib/target/cpc/classic/loader.asm
ahjelm/z88dk
c4de367f39a76b41f6390ceeab77737e148178fa
[ "ClArtistic" ]
null
null
null
; ; CPC bank loader, after @iratahack ; EXTERN __DATA_END_tail EXTERN __BANK_0_END_tail EXTERN __BANK_1_END_tail EXTERN __BANK_2_END_tail EXTERN __BANK_3_END_tail EXTERN __BANK_4_END_tail EXTERN __BANK_5_END_tail EXTERN __BANK_6_END_tail EXTERN __BANK_7_END_tail ; Turn off tape messages ld a,0 call cas_noisy ld hl,__crt_loader_filename find_ext: ld a,(hl) cp '.' inc hl jr nz,find_ext inc hl ld (extension),hl ; This may well contain the loading screen ld hl,CRT_ORG_BANK_3 ld de,__BANK_3_END_tail - CRT_ORG_BANK_3 ld bc, $33c0 ;bank port, extension call loadbank ; Probably part of the program as loaded, so not expected to be used ld hl,CRT_ORG_BANK_0 ld de,__BANK_0_END_tail - CRT_ORG_BANK_0 ld bc,$30c0 ;Bank 0 call loadbank ld hl,CRT_ORG_BANK_1 ld de,__BANK_1_END_tail - CRT_ORG_BANK_1 ld bc,$31c0 ;Bank 1 call loadbank ld hl,CRT_ORG_BANK_4 ld de,__BANK_4_END_tail - CRT_ORG_BANK_4 ld bc,$34c4 ;Bank 4 call loadbank ld hl,CRT_ORG_BANK_5 ld de,__BANK_5_END_tail - CRT_ORG_BANK_5 ld bc,$35c5 ;Bank 5 call loadbank ld hl,CRT_ORG_BANK_6 ld de,__BANK_6_END_tail - CRT_ORG_BANK_6 ld bc,$36c6 ;Bank 6 call loadbank ld hl,CRT_ORG_BANK_7 ld de,__BANK_7_END_tail - CRT_ORG_BANK_7 ld bc,$37c7 ;Bank 7 call loadbank ; Load bank2 into screen memory and copy across ; Loading into page2 will clobber ROM vectors ld hl,49152 ld de,__BANK_2_END_tail - CRT_ORG_BANK_2 ld a,d or e ret z ld bc,$32c0 ;Bank 2 call loadbank di ld hl,49152 ld de,$8000 ld bc,__BANK_2_END_tail - CRT_ORG_BANK_2 ldir ret ; hl = address ; de = length ; c = bank page, b = extension character loadbank: ld a,d or e ret z push hl ld hl,(extension) ld (hl),b ; Page in the bank ld b,$7F ;gate array address out (c),c ld hl,__crt_loader_filename call printit pop de ;de = address to load ld hl,__crt_loader_filename ;hl = filename push hl ld b,0 ; Figure out length of filename get_length: ld a,(hl) and a jr z,length_found inc hl inc b jr get_length length_found: pop hl call cas_in_open ; Load address returned in DE ex de, hl call cas_in_direct call cas_in_close ld bc,$7fc0 out (c),c ret printit: ld a, (hl) inc hl or a ret z call txt_output jr printit ; Populated by appmake PUBLIC __crt_loader_filename extension: defw 0 __crt_loader_filename: defs 16
23.135338
72
0.570361
268922c050a27cabce6e93632815711b2a9df577
1,358
java
Java
core/openapi/src/main/java/io/thorntail/openapi/impl/OpenApiConfigProducer.java
thumb-tack/
d8f350066bd724de4d2779dcef0676e624f7d412
[ "Apache-2.0" ]
1
2019-09-23T13:39:49.000Z
2019-09-23T13:39:49.000Z
core/openapi/src/main/java/io/thorntail/openapi/impl/OpenApiConfigProducer.java
thorntail/thorntail-poc
b123354fc85c4ed27838ff75227e3c1ef7cdc250
[ "Apache-2.0" ]
17
2019-03-24T05:50:42.000Z
2022-01-21T23:24:08.000Z
core/openapi/src/main/java/io/thorntail/openapi/impl/OpenApiConfigProducer.java
thumb-tack/tt
d8f350066bd724de4d2779dcef0676e624f7d412
[ "Apache-2.0" ]
1
2021-08-12T09:23:24.000Z
2021-08-12T09:23:24.000Z
/** * Copyright 2018 Red Hat, Inc, and individual contributors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package io.thorntail.openapi.impl; import javax.annotation.PostConstruct; import javax.enterprise.context.ApplicationScoped; import javax.enterprise.inject.Produces; import javax.inject.Inject; import org.eclipse.microprofile.config.Config; import io.smallrye.openapi.api.OpenApiConfig; import io.smallrye.openapi.api.OpenApiConfigImpl; /** * @author eric.wittmann@gmail.com */ @ApplicationScoped public class OpenApiConfigProducer { @Inject private Config config; private transient OpenApiConfig oaiConfig; @PostConstruct public void init() { oaiConfig = new OpenApiConfigImpl(config); } @Produces public OpenApiConfig openApiConfig() { return this.oaiConfig; } }
27.714286
75
0.743741